Namespaces | |
containment_octree | |
initializer | |
Classes | |
class | AbstractBody |
class | BasicVoxelFileReader |
Provides a low level reader for waLBerla geometry files. More... | |
class | BinaryRawFile |
class | BinaryRawFileInterpolator |
class | BodyLogicalAND |
class | BodyLogicalNOT |
class | BodyLogicalOperationBinary |
Class representing a union, difference, etc. More... | |
class | BodyLogicalOR |
class | BodyLogicalXOR |
struct | CellAABB |
Helper class to provide a cell based axis-aligned bounding box. More... | |
class | ContainmentOctree |
class | Cylinder |
Class representing a Cylinder. More... | |
class | DynamicBody |
class | Ellipsoid |
Class representing an Ellipsoid in 3D. More... | |
class | GrayScaleImage |
A gray scale image. More... | |
class | LessThan |
Helper class, used in TriangleMesh::removeDuplicateVertices. More... | |
class | RGBAImage |
A gray scale image. More... | |
class | Sphere |
Class representing a Sphere. More... | |
class | Torus |
Class representing a Torus. More... | |
class | TriangleMesh |
Class for storing a triangle mesh. More... | |
struct | TriangleMeshNode |
Used only internally in function "TriangleMesh::split( vector<TriangleMesh>& meshes )". More... | |
class | VoxelFileReader |
Provides a reader for waLBerla geometry files. More... | |
Enumerations | |
enum | FastOverlapResult { CONTAINED_INSIDE_BODY, COMPLETELY_OUTSIDE, PARTIAL_OVERLAP, DONT_KNOW } |
enum | State { VERTEX, NORMAL, FACE } |
Functions | |
template<> | |
real_t | overlapFraction (const AABB &body, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx, uint_t) |
template<> | |
FastOverlapResult | fastOverlapCheck (const AABB &body, const AABB &cell) |
template<> | |
bool | contains (const AABB &aabb, const Vector3< real_t > &point) |
Sphere | sphereFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a Sphere. More... | |
Cylinder | cylinderFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a Cylinder. More... | |
Torus | torusFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a Torus. More... | |
Ellipsoid | ellipsoidFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns an Ellipsoid. More... | |
AABB | AABBFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a box. More... | |
BodyLogicalAND< Sphere, AABB > | sphereSliceFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a difference/union/... More... | |
BodyLogicalAND< Sphere, BodyLogicalNOT< Sphere > > | hollowSphereFromConfig (const Config::BlockHandle &block) |
shared_ptr< AbstractBody > | bodyFromConfig (const Config::BlockHandle &block) |
Parses a configuration block and returns a body via dynamic polymorphism. More... | |
shared_ptr< AbstractBody > | bodyANDFromConfig (const Config::BlockHandle &block) |
shared_ptr< AbstractBody > | bodyORFromConfig (const Config::BlockHandle &block) |
shared_ptr< AbstractBody > | bodyXORFromConfig (const Config::BlockHandle &block) |
shared_ptr< AbstractBody > | bodyNOTFromConfig (const Config::BlockHandle &block) |
template<typename A > | |
bool | contains (const BodyLogicalNOT< A > &body, const Vector3< real_t > &point) |
template<typename A , typename B > | |
bool | contains (const BodyLogicalAND< A, B > &body, const Vector3< real_t > &point) |
template<typename A , typename B > | |
bool | contains (const BodyLogicalOR< A, B > &body, const Vector3< real_t > &point) |
template<typename A , typename B > | |
bool | contains (const BodyLogicalXOR< A, B > &body, const Vector3< real_t > &point) |
template<typename Body > | |
real_t | overlapFraction (const Body &body, const Vector3< real_t > &cellMidpoint, real_t dx, uint_t maxDepth=4) |
Returns the overlap fraction between a body and a cell. More... | |
template<typename Body > | |
real_t | overlapFraction (const Body &body, const Vector3< real_t > &cellMidpoint, real_t dx, int maxDepth) |
template<typename Body > | |
real_t | overlapFraction (const Body &body, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx, uint_t maxDepth=4) |
template<typename Body > | |
bool | contains (const Body &body, const Vector3< real_t > &point) |
Test if a point in space lies inside a body. More... | |
template<typename Body > | |
FastOverlapResult | fastOverlapCheck (const Body &body, const AABB &block) |
Determines in a fast way ( for example using a bounding box) if a body and a block overlap when no fast computation is possible return DONT_KNOW. More... | |
template<typename Body > | |
FastOverlapResult | fastOverlapCheck (const Body &body, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
Determines in a fast way (bounding box etc) if a body and a block overlap when no fast computation is possible return DONT_KNOW. More... | |
template<typename Body > | |
real_t | cellSupersampling (const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx, const Body &body, uint_t maxDepth=4, uint_t depth=uint_t(0u)) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Cylinder &cyl, const AABB &box) |
template<> | |
bool | contains (const Cylinder &cyl, const Vector3< real_t > &point) |
template<typename Body > | |
shared_ptr< DynamicBody< Body > > | make_DynamicBody (Body body) |
template<> | |
FastOverlapResult | fastOverlapCheck (const AbstractBody &body, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const AbstractBody &body, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const AbstractBody &body, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Ellipsoid &ellipsoid, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Ellipsoid &ellipsoid, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const Ellipsoid &ellipsoid, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Sphere &sphere, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Sphere &sphere, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const Sphere &sphere, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const Torus &torus, const AABB &box) |
template<> | |
bool | contains (const Torus &torus, const Vector3< real_t > &point) |
template<typename BoundaryHandling > | |
void | initBoundaryHandling (StructuredBlockStorage &blocks, BlockDataID boundaryHandlingId, const Config::BlockHandle &geometryBlock) |
Convenience function for setting up boundary handling via a block in the configuration file. More... | |
template<typename BoundaryHandling > | |
void | initBoundaryHandling (StructuredBlockStorage &blocks, BlockDataID boundaryHandlingId, const Config &config) |
template<typename BoundaryHandling > | |
void | setNonBoundaryCellsToDomain (StructuredBlockStorage &blocks, BlockDataID boundaryHandlingId) |
template<typename FlagField_T > | |
void | setNonBoundaryCellsToDomain (StructuredBlockStorage &blocks, BlockDataID flagFieldID, field::FlagUID fluidFlagID) |
template<typename FlagField_T > | |
void | setNonBoundaryCellsToDomain (StructuredBlockStorage &blocks, BlockDataID flagFieldID, field::FlagUID fluidFlagID, cell_idx_t numGhostLayers) |
template<typename T , typename G > | |
mpi::GenericSendBuffer< T, G > & | operator<< (mpi::GenericSendBuffer< T, G > &buf, const TriangleMesh &mesh) |
Packs a TriangleMesh into a SendBuffer. More... | |
template<typename T > | |
mpi::GenericRecvBuffer< T > & | operator>> (mpi::GenericRecvBuffer< T > &buf, TriangleMesh &mesh) |
Unpacks a TriangleMesh from a RecvBuffer. More... | |
void | readMesh (const std::string &meshFilename, TriangleMesh &mesh) |
Reads mesh from file. More... | |
void | writeMesh (const std::string &meshFilename, const TriangleMesh &mesh) |
writes a mesh to file More... | |
void | readAndBroadcastMesh (const std::string &meshFilename, TriangleMesh &mesh) |
Reads mesh from file on root process and broadcasts it to all other processes. More... | |
void | writeMeshOnRoot (const std::string &meshFilename, const TriangleMesh &mesh) |
writes a mesh to file on root process More... | |
void | readFaceVertex (std::istream &is, TriangleMesh::index_t &vertexIdx, TriangleMesh::index_t &textureIdx, TriangleMesh::index_t &normalIdx) |
void | readMeshObj (std::istream &is, TriangleMesh &mesh) |
Reads mesh from input stream in obj file format. More... | |
void | writeMeshObj (std::ostream &os, const TriangleMesh &mesh) |
Writes mesh to output stream in obj format. More... | |
void | removeComments (std::istream &is, std::ostream &os) |
void | readMeshPov (std::istream &is, TriangleMesh &mesh, bool clear=true) |
Reads mesh from input stream in povray's mesh2 format. More... | |
void | writeMeshPov0 (std::ostream &os, const TriangleMesh &mesh, const size_t itemsPerLine) |
void | writeMeshPov (std::ostream &os, const TriangleMesh &mesh, size_t itemsPerLine=5u, size_t itemsPerMesh=0u) |
Writes mesh in povray's mesh2 format. More... | |
static void | skipComments (std::istream &is) |
void | readMeshOff (std::istream &is, TriangleMesh &mesh) |
Reads mesh from input stream in Geomview Object File Format. More... | |
void | writeMeshOff (std::ostream &os, const TriangleMesh &mesh) |
Writes a mesh to an output stream in Geomview Object File Format. More... | |
void | writeMeshVtp (std::ostream &os, const TriangleMesh &mesh) |
Writes a mesh to an output stream in VTK Poly Data format. More... | |
template<typename T > | |
static BinaryRawFile | loadFile (const std::string &filename, const Vector3< uint_t > &size) |
std::ostream & | operator<< (std::ostream &os, const RGBAImage::pixel_t &pixel) |
std::istream & | operator>> (std::istream &is, RGBAImage::pixel_t &pixel) |
CellAABB | toCellAABB (const CellInterval &cellInterval) |
Converts a CellInterval to a CellAABB. More... | |
void | validateCellInterval (const CellInterval &cellInterval) |
Validate if the given CellInterval can be converted to a CellAABB. More... | |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Sphere &peSphere, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Sphere &peSphere, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const pe::Sphere &peSphere, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Squirmer &peSquirmer, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Squirmer &peSquirmer, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const pe::Squirmer &peSquirmer, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Plane &pePlane, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::Plane &pePlane, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const pe::Plane &pePlane, const Vector3< real_t > &point) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::RigidBody &peBody, const AABB &box) |
template<> | |
FastOverlapResult | fastOverlapCheck (const pe::RigidBody &peBody, const Vector3< real_t > &cellMidpoint, const Vector3< real_t > &dx) |
template<> | |
bool | contains (const pe::RigidBody &peBody, const Vector3< real_t > &point) |
AABB walberla::geometry::AABBFromConfig | ( | const Config::BlockHandle & | block | ) |
Parses a configuration block and returns a box.
Example block: box{ min <1,2,3>; max <5,4,3>; }
shared_ptr< AbstractBody > walberla::geometry::bodyANDFromConfig | ( | const Config::BlockHandle & | block | ) |
shared_ptr< AbstractBody > walberla::geometry::bodyFromConfig | ( | const Config::BlockHandle & | block | ) |
Parses a configuration block and returns a body via dynamic polymorphism.
shared_ptr< AbstractBody > walberla::geometry::bodyNOTFromConfig | ( | const Config::BlockHandle & | block | ) |
shared_ptr< AbstractBody > walberla::geometry::bodyORFromConfig | ( | const Config::BlockHandle & | block | ) |
shared_ptr< AbstractBody > walberla::geometry::bodyXORFromConfig | ( | const Config::BlockHandle & | block | ) |
real_t walberla::geometry::cellSupersampling | ( | const Vector3< real_t > & | cellMidpoint, |
const Vector3< real_t > & | dx, | ||
const Body & | body, | ||
uint_t | maxDepth = 4 , |
||
uint_t | depth = uint_t(0u) |
||
) |
|
inline |
|
inline |
bool walberla::geometry::contains | ( | const Body & | body, |
const Vector3< real_t > & | point | ||
) |
Test if a point in space lies inside a body.
This function has to be specialized for every body. There is no default implementation.
bool walberla::geometry::contains | ( | const BodyLogicalAND< A, B > & | body, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const BodyLogicalNOT< A > & | body, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const BodyLogicalOR< A, B > & | body, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const BodyLogicalXOR< A, B > & | body, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const Cylinder & | cyl, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const Ellipsoid & | ellipsoid, |
const Vector3< real_t > & | point | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
bool walberla::geometry::contains | ( | const Sphere & | sphere, |
const Vector3< real_t > & | point | ||
) |
bool walberla::geometry::contains | ( | const Torus & | torus, |
const Vector3< real_t > & | point | ||
) |
Cylinder walberla::geometry::cylinderFromConfig | ( | const Config::BlockHandle & | block | ) |
Ellipsoid walberla::geometry::ellipsoidFromConfig | ( | const Config::BlockHandle & | block | ) |
|
inline |
|
inline |
|
inline |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Body & | body, |
const AABB & | block | ||
) |
Determines in a fast way ( for example using a bounding box) if a body and a block overlap when no fast computation is possible return DONT_KNOW.
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Body & | body, |
const Vector3< real_t > & | cellMidpoint, | ||
const Vector3< real_t > & | dx | ||
) |
Determines in a fast way (bounding box etc) if a body and a block overlap when no fast computation is possible return DONT_KNOW.
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Cylinder & | cyl, |
const AABB & | box | ||
) |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Ellipsoid & | ellipsoid, |
const AABB & | box | ||
) |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Ellipsoid & | ellipsoid, |
const Vector3< real_t > & | cellMidpoint, | ||
const Vector3< real_t > & | dx | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Sphere & | sphere, |
const AABB & | box | ||
) |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Sphere & | sphere, |
const Vector3< real_t > & | cellMidpoint, | ||
const Vector3< real_t > & | dx | ||
) |
FastOverlapResult walberla::geometry::fastOverlapCheck | ( | const Torus & | torus, |
const AABB & | box | ||
) |
void walberla::geometry::getClosestLineBoxPoints | ( | const Vector3< real_t > & | p1, |
const Vector3< real_t > & | p2, | ||
const Vector3< real_t > & | c, | ||
const Matrix3< real_t > & | R, | ||
const Vector3< real_t > & | side, | ||
Vector3< real_t > & | lret, | ||
Vector3< real_t > & | bret | ||
) |
Find the closest points on a box and a line segment.
p1 | The first end point of the line segment. | |
p2 | The second end point of the line segment. | |
c | The center position of the box. | |
R | The rotation of the box. | |
side | The box's sides lengths. | |
[out] | lret | The closest point on the line. |
[out] | bret | The closest point on the box. |
This function calculates the closest points between a box and a line segment. The variable lret will be set to the closest point on the line, the variable bret to the closest point on the box. In case p1 lies outside the box and the line intersects the box, the intersection point is returned (in both variables). In case p1 lies inside the box, both lret and bret will refer to p1.
void walberla::geometry::getClosestLineSegmentPoints | ( | const Vector3< real_t > & | a1, |
const Vector3< real_t > & | a2, | ||
const Vector3< real_t > & | b1, | ||
const Vector3< real_t > & | b2, | ||
Vector3< real_t > & | cp1, | ||
Vector3< real_t > & | cp2 | ||
) |
Find the closest points on two line segments.
a1 | The first end point of the first line segment. | |
a2 | The second end point of the first line segment. | |
b1 | The first end point of the second line segment. | |
b2 | The second end point of the second line segment. | |
[out] | cp1 | The closest point on line one. |
[out] | cp2 | The closest point on line two. |
Given the two line segments A and B, this function returns the points that are closest to each other. In the case of parallel lines, where multiple solutions are possible, a solution involving the endpoint of at least one line will be returned. This will also work correctly for zero length lines, e.g. if a1 = a2 and/or b1 = b2.
BodyLogicalAND< Sphere, BodyLogicalNOT< Sphere > > walberla::geometry::hollowSphereFromConfig | ( | const Config::BlockHandle & | block | ) |
void walberla::geometry::initBoundaryHandling | ( | StructuredBlockStorage & | blocks, |
BlockDataID | boundaryHandlingId, | ||
const Config & | config | ||
) |
void walberla::geometry::initBoundaryHandling | ( | StructuredBlockStorage & | blocks, |
BlockDataID | boundaryHandlingId, | ||
const Config::BlockHandle & | geometryBlock | ||
) |
Convenience function for setting up boundary handling via a block in the configuration file.
This function groups together the most common initializers for a boundary handling. For a detailed documentation on the format of the configuration block look at the initializer documentation:
Initializer | Functionality | Subblock name |
---|---|---|
initializer::BoundaryFromCellInterval | CellInterval | |
initializer::BoundaryFromDomainBorder | Border | |
initializer::BoundaryFromImage<GrayScaleImage> | GrayScaleImage | |
initializer::BoundaryFromImage<RGBAImage> | RGBAImage | |
initializer::BoundaryFromVoxelFile | VoxelFile | |
initializer::BoundaryFromBody | Body |
Example for a configuration block:
void walberla::geometry::intersectLines | ( | const Vector3< real_t > & | o1, |
const Vector3< real_t > & | d1, | ||
const Vector3< real_t > & | o2, | ||
const Vector3< real_t > & | d2, | ||
real_t & | s, | ||
real_t & | t | ||
) |
Find the intersection point or the point of the closest approach between two straight.
lines \( l_1(s) = o_1+sd_1 \) and \( l_2(t) = o_2+td_2 \).
o1 | A point on line \( l_1 \). | |
d1 | The direction of line \( l_1 \). | |
o2 | A point on line \( l_2 \). | |
d2 | The direction of line \( l_2 \). | |
[out] | s | The resolved parameter for line \( l_1 \). |
[out] | t | The resolved parameter for line \( l_2 \). |
\[ o_1+sd_1 = o_2+td_2 \]
\[ \Longleftrightarrow \]
\[ s = \frac{\det(o_2-o_1,d_2,d_1 \times d_2)}{\left \Vert d_1 \times d_2 \right \| ^2 } \]
\[ t = \frac{\det(o_2-o_1,d_1,d_1 \times d_2)}{\left \Vert d_1 \times d_2 \right \| ^2 } \]
|
static |
shared_ptr<DynamicBody<Body> > walberla::geometry::make_DynamicBody | ( | Body | body | ) |
mpi::GenericSendBuffer<T,G>& walberla::geometry::operator<< | ( | mpi::GenericSendBuffer< T, G > & | buf, |
const TriangleMesh & | mesh | ||
) |
Packs a TriangleMesh into a SendBuffer.
buf | The SendBuffer object mesh is packed into. |
mesh | The TriangleMesh object to be packed into buf. |
std::ostream & walberla::geometry::operator<< | ( | std::ostream & | os, |
const RGBAImage::pixel_t & | pixel | ||
) |
mpi::GenericRecvBuffer<T>& walberla::geometry::operator>> | ( | mpi::GenericRecvBuffer< T > & | buf, |
TriangleMesh & | mesh | ||
) |
Unpacks a TriangleMesh from a RecvBuffer.
buf | The RecvBuffer object mesh is unpacked from. |
mesh | The TriangleMesh object buf is unpacked into. |
std::istream & walberla::geometry::operator>> | ( | std::istream & | is, |
RGBAImage::pixel_t & | pixel | ||
) |
|
inline |
Estimates whether or not the origin lies within the given tetrahedron.
A | Vertex that sees the triangle BCD in counterclockwise order. |
B | Vertex that sees the triangle ADC in counterclockwise order. |
C | Vertex that sees the triangle ABD in counterclockwise order. |
D | Vertex that sees the triangle ACB in counterclockwise order. |
|
inline |
real_t walberla::geometry::overlapFraction | ( | const Body & | body, |
const Vector3< real_t > & | cellMidpoint, | ||
const Vector3< real_t > & | dx, | ||
uint_t | maxDepth = 4 |
||
) |
real_t walberla::geometry::overlapFraction | ( | const Body & | body, |
const Vector3< real_t > & | cellMidpoint, | ||
real_t | dx, | ||
int | maxDepth | ||
) |
real_t walberla::geometry::overlapFraction | ( | const Body & | body, |
const Vector3< real_t > & | cellMidpoint, | ||
real_t | dx, | ||
uint_t | maxDepth = 4 |
||
) |
Returns the overlap fraction between a body and a cell.
Specialize this function directly for bodies where the overlap can be computed analytically. The default implementation does a cell super-sampling, using the contains() method multiple times.
body | the body object |
cellMidpoint | midpoint of the cell in global coordinates |
dx | the edge length(s) of the cell, dx or (dx, dy, dz) |
maxDepth | sub sampling depth: the cell edge is divided in half maxDepth+1 times. Values less than zero result in no subdivisions, making this function behave like contains(). |
|
inline |
Estimates whether a given point is in front of a plane.
normal | The normal of the plane, does not have to be normalised. |
pointOnPlane | Any point on the Plane. |
point | The point whose position is check for being in front of the plane. |
|
inline |
Estimates whether or not a given point lies within the given tetrahedron.
A | Vertex that sees the triangle BCD in counterclockwise order. |
B | Vertex that sees the triangle ADC in counterclockwise order. |
C | Vertex that sees the triangle ABD in counterclockwise order. |
D | Vertex that sees the triangle ACB in counterclockwise order. |
point | The point whose position is check for being inside the tetrahedron. |
void walberla::geometry::readAndBroadcastMesh | ( | const std::string & | meshFilename, |
TriangleMesh & | mesh | ||
) |
Reads mesh from file on root process and broadcasts it to all other processes.
Mesh format is detected by file ending.
meshFilename | Filename of mesh. Supported formats are obj, pov and off. Format is detected by file ending |
mesh | object where the mesh is stored, if the given mesh is not empty, all contents are cleared |
void walberla::geometry::readFaceVertex | ( | std::istream & | is, |
TriangleMesh::index_t & | vertexIdx, | ||
TriangleMesh::index_t & | textureIdx, | ||
TriangleMesh::index_t & | normalIdx | ||
) |
void walberla::geometry::readMesh | ( | const std::string & | meshFilename, |
TriangleMesh & | mesh | ||
) |
Reads mesh from file.
Mesh format is detected by file ending.
meshFilename | Filename of mesh. Supported formats are obj, pov and off. Format is detected by file ending |
mesh | object where the mesh is stored, if the given mesh is not empty, all contents are cleared |
void walberla::geometry::readMeshObj | ( | std::istream & | is, |
TriangleMesh & | mesh | ||
) |
Reads mesh from input stream in obj file format.
Reads "v" (vertex) and "f" (face) entries only.
is | input stream, to read from file use std::fstream |
mesh | object where the mesh is stored, if the given mesh is not empty, all contents are cleared |
void walberla::geometry::readMeshOff | ( | std::istream & | is, |
TriangleMesh & | mesh | ||
) |
Reads mesh from input stream in Geomview Object File Format.
Reads "v" (vertex) and "f" (face) entries only. Only triangular faces are supported. Colors are currently also not supported. Format details: http://people.sc.fsu.edu/~jburkardt/data/off/off.html
is | input stream, to read from file use std::fstream |
mesh | object where the mesh is stored, if the given mesh is not empty, all contents are cleared |
void walberla::geometry::readMeshPov | ( | std::istream & | is, |
TriangleMesh & | mesh, | ||
bool | clear = true |
||
) |
Reads mesh from input stream in povray's mesh2 format.
Vertices, normals and faces are read.
is | input stream, to read from file use std::fstream |
mesh | object where the mesh is stored, if the given mesh is not empty, all contents are cleared |
void walberla::geometry::removeComments | ( | std::istream & | is, |
std::ostream & | os | ||
) |
void walberla::geometry::setNonBoundaryCellsToDomain | ( | StructuredBlockStorage & | blocks, |
BlockDataID | boundaryHandlingId | ||
) |
void walberla::geometry::setNonBoundaryCellsToDomain | ( | StructuredBlockStorage & | blocks, |
BlockDataID | flagFieldID, | ||
field::FlagUID | fluidFlagID | ||
) |
void walberla::geometry::setNonBoundaryCellsToDomain | ( | StructuredBlockStorage & | blocks, |
BlockDataID | flagFieldID, | ||
field::FlagUID | fluidFlagID, | ||
cell_idx_t | numGhostLayers | ||
) |
|
static |
Sphere walberla::geometry::sphereFromConfig | ( | const Config::BlockHandle & | block | ) |
BodyLogicalAND< Sphere, AABB > walberla::geometry::sphereSliceFromConfig | ( | const Config::BlockHandle & | block | ) |
Parses a configuration block and returns a difference/union/...
of bodies.
|
inline |
Converts a CellInterval to a CellAABB.
A CellAABB can not hold negative bounds and therefore not be empty. You have to check yourself if this is the case!
cellInterval | The CellInterval to be converted. |
Torus walberla::geometry::torusFromConfig | ( | const Config::BlockHandle & | block | ) |
|
inline |
void walberla::geometry::writeMesh | ( | const std::string & | meshFilename, |
const TriangleMesh & | mesh | ||
) |
writes a mesh to file
Mesh format is detected by file ending.
meshFilename | Filename of mesh. Supported formats are obj, pov and off. Format is detected by file ending |
mesh | object where the mesh is read from |
void walberla::geometry::writeMeshObj | ( | std::ostream & | os, |
const TriangleMesh & | mesh | ||
) |
Writes mesh to output stream in obj format.
Writes obj file with vertex, normal and face information
os | the output stream. To write to file call with ofstream("filename.obj")) |
mesh | the mesh to write |
void walberla::geometry::writeMeshOff | ( | std::ostream & | os, |
const TriangleMesh & | mesh | ||
) |
Writes a mesh to an output stream in Geomview Object File Format.
Writes vertices and faces only. Colors are not (yet) supported. Format details: http://people.sc.fsu.edu/~jburkardt/data/off/off.html
os | the output stream. To write to file call with ofstream("filename.off") |
mesh | the mesh to write |
void walberla::geometry::writeMeshOnRoot | ( | const std::string & | meshFilename, |
const TriangleMesh & | mesh | ||
) |
writes a mesh to file on root process
Mesh format is detected by file ending.
meshFilename | Filename of mesh. Supported formats are obj, pov and off. Format is detected by file ending |
mesh | object where the mesh is read from |
void walberla::geometry::writeMeshPov | ( | std::ostream & | os, |
const TriangleMesh & | mesh, | ||
size_t | itemsPerLine = 5u , |
||
size_t | itemsPerMesh = 0u |
||
) |
Writes mesh in povray's mesh2 format.
Vertices, normals and faces are written.
os | the output stream. To write to file call with ofstream("filename.dat") |
mesh | the mesh to write |
void walberla::geometry::writeMeshPov0 | ( | std::ostream & | os, |
const TriangleMesh & | mesh, | ||
const size_t | itemsPerLine | ||
) |
void walberla::geometry::writeMeshVtp | ( | std::ostream & | os, |
const TriangleMesh & | mesh | ||
) |
Writes a mesh to an output stream in VTK Poly Data format.
Writes colors and vertex normals if available Format details: http://www.vtk.org/VTK/img/file-formats.pdf
os | the output stream. To write to file call with ofstream("filename.vtp") |
mesh | the mesh to write |