waLBerla 7.2
Loading...
Searching...
No Matches
walberla::geometry Namespace Reference

Namespaces

namespace  containment_octree
 
namespace  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.
 
Cylinder cylinderFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns a Cylinder.
 
Torus torusFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns a Torus.
 
Ellipsoid ellipsoidFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns an Ellipsoid.
 
AABB AABBFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns a box.
 
BodyLogicalAND< Sphere, AABB > sphereSliceFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns a difference/union/... of bodies.
 
BodyLogicalAND< Sphere, BodyLogicalNOT< Sphere > > hollowSphereFromConfig (const Config::BlockHandle &block)
 
shared_ptr< AbstractBodybodyFromConfig (const Config::BlockHandle &block)
 Parses a configuration block and returns a body via dynamic polymorphism.
 
shared_ptr< AbstractBodybodyANDFromConfig (const Config::BlockHandle &block)
 
shared_ptr< AbstractBodybodyORFromConfig (const Config::BlockHandle &block)
 
shared_ptr< AbstractBodybodyXORFromConfig (const Config::BlockHandle &block)
 
shared_ptr< AbstractBodybodyNOTFromConfig (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.
 
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.
 
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.
 
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.
 
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<>
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 Ellipsoid &e, const AABB &box)
 
template<>
FastOverlapResult fastOverlapCheck (const Ellipsoid &e, 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 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<>
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.
 
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.
 
template<typename T >
mpi::GenericRecvBuffer< T > & operator>> (mpi::GenericRecvBuffer< T > &buf, TriangleMesh &mesh)
 Unpacks a TriangleMesh from a RecvBuffer.
 
void readMesh (const std::string &meshFilename, TriangleMesh &mesh)
 Reads mesh from file.
 
void writeMesh (const std::string &meshFilename, const TriangleMesh &mesh)
 writes a mesh to file
 
void readAndBroadcastMesh (const std::string &meshFilename, TriangleMesh &mesh)
 Reads mesh from file on root process and broadcasts it to all other processes.
 
void writeMeshOnRoot (const std::string &meshFilename, const TriangleMesh &mesh)
 writes a mesh to file on root process
 
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.
 
void writeMeshObj (std::ostream &os, const TriangleMesh &mesh)
 Writes mesh to output stream in obj format.
 
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.
 
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.
 
static void skipComments (std::istream &is)
 
void readMeshOff (std::istream &is, TriangleMesh &mesh)
 Reads mesh from input stream in Geomview Object File Format.
 
void writeMeshOff (std::ostream &os, const TriangleMesh &mesh)
 Writes a mesh to an output stream in Geomview Object File Format.
 
void writeMeshVtp (std::ostream &os, const TriangleMesh &mesh)
 Writes a mesh to an output stream in VTK Poly Data format.
 
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.
 
void validateCellInterval (const CellInterval &cellInterval)
 Validate if the given CellInterval can be converted to a CellAABB.
 
Geometry functions
void 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.
 
void 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.
 
void 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.
 
bool originInTetrahedron (const Vector3< real_t > &A, const Vector3< real_t > &B, const Vector3< real_t > &C, const Vector3< real_t > &D)
 Estimates whether or not the origin lies within the given tetrahedron.
 
bool pointInTetrahedron (const Vector3< real_t > &A, const Vector3< real_t > &B, const Vector3< real_t > &C, const Vector3< real_t > &D, const Vector3< real_t > &point)
 Estimates whether or not a given point lies within the given tetrahedron.
 
bool pointInFrontOfPlane (const Vector3< real_t > &normal, const Vector3< real_t > &pointOnPlane, const Vector3< real_t > &point)
 Estimates whether a given point is in front of a plane.
 

Enumeration Type Documentation

◆ FastOverlapResult

Enumerator
CONTAINED_INSIDE_BODY 
COMPLETELY_OUTSIDE 
PARTIAL_OVERLAP 
DONT_KNOW 

◆ State

Enumerator
VERTEX 
NORMAL 
FACE 

Function Documentation

◆ AABBFromConfig()

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>; }

◆ bodyANDFromConfig()

shared_ptr< AbstractBody > walberla::geometry::bodyANDFromConfig ( const Config::BlockHandle & block)

◆ bodyFromConfig()

shared_ptr< AbstractBody > walberla::geometry::bodyFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns a body via dynamic polymorphism.

◆ bodyNOTFromConfig()

shared_ptr< AbstractBody > walberla::geometry::bodyNOTFromConfig ( const Config::BlockHandle & block)

◆ bodyORFromConfig()

shared_ptr< AbstractBody > walberla::geometry::bodyORFromConfig ( const Config::BlockHandle & block)

◆ bodyXORFromConfig()

shared_ptr< AbstractBody > walberla::geometry::bodyXORFromConfig ( const Config::BlockHandle & block)

◆ cellSupersampling()

template<typename Body >
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) )

◆ contains() [1/15]

template<>
bool walberla::geometry::contains ( const AABB & aabb,
const Vector3< real_t > & point )
inline

◆ contains() [2/15]

template<>
bool walberla::geometry::contains ( const AbstractBody & body,
const Vector3< real_t > & point )
inline

◆ contains() [3/15]

template<typename Body >
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.

◆ contains() [4/15]

template<typename A , typename B >
bool walberla::geometry::contains ( const BodyLogicalAND< A, B > & body,
const Vector3< real_t > & point )

◆ contains() [5/15]

template<typename A >
bool walberla::geometry::contains ( const BodyLogicalNOT< A > & body,
const Vector3< real_t > & point )

◆ contains() [6/15]

template<typename A , typename B >
bool walberla::geometry::contains ( const BodyLogicalOR< A, B > & body,
const Vector3< real_t > & point )

◆ contains() [7/15]

template<typename A , typename B >
bool walberla::geometry::contains ( const BodyLogicalXOR< A, B > & body,
const Vector3< real_t > & point )

◆ contains() [8/15]

template<>
bool walberla::geometry::contains ( const Cylinder & cyl,
const Vector3< real_t > & point )

◆ contains() [9/15]

template<>
bool walberla::geometry::contains ( const Cylinder & cyl,
const Vector3< real_t > & point )

◆ contains() [10/15]

template<>
bool walberla::geometry::contains ( const Ellipsoid & ellipsoid,
const Vector3< real_t > & point )

◆ contains() [11/15]

template<>
bool walberla::geometry::contains ( const Ellipsoid & ellipsoid,
const Vector3< real_t > & point )

◆ contains() [12/15]

template<>
bool walberla::geometry::contains ( const Sphere & sphere,
const Vector3< real_t > & point )

◆ contains() [13/15]

template<>
bool walberla::geometry::contains ( const Sphere & sphere,
const Vector3< real_t > & point )

◆ contains() [14/15]

template<>
bool walberla::geometry::contains ( const Torus & torus,
const Vector3< real_t > & point )

◆ contains() [15/15]

template<>
bool walberla::geometry::contains ( const Torus & torus,
const Vector3< real_t > & point )

◆ cylinderFromConfig()

Cylinder walberla::geometry::cylinderFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns a Cylinder.

Example block: Cylinder{ min <1,2,3>; max <5,4,3>; radius 3; }

◆ ellipsoidFromConfig()

Ellipsoid walberla::geometry::ellipsoidFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns an Ellipsoid.

Example block: Ellipsoid{ midpoint <1,2,3>; radii <5,4,3>; axis1 <1,0,0>; axis2 <0,1,0> }

For the semantic of the parameters see constructor of Ellipsoid

◆ fastOverlapCheck() [1/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const AABB & body,
const AABB & cell )
inline

◆ fastOverlapCheck() [2/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const AbstractBody & body,
const AABB & box )
inline

◆ fastOverlapCheck() [3/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const AbstractBody & body,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx )
inline

◆ fastOverlapCheck() [4/17]

template<typename Body >
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.

◆ fastOverlapCheck() [5/17]

template<typename Body >
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.

◆ fastOverlapCheck() [6/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Cylinder & cyl,
const AABB & box )

◆ fastOverlapCheck() [7/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Cylinder & cyl,
const AABB & box )

◆ fastOverlapCheck() [8/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Ellipsoid & e,
const AABB & box )

◆ fastOverlapCheck() [9/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Ellipsoid & e,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx )

◆ fastOverlapCheck() [10/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Ellipsoid & ellipsoid,
const AABB & box )

◆ fastOverlapCheck() [11/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Ellipsoid & ellipsoid,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx )

◆ fastOverlapCheck() [12/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Sphere & sphere,
const AABB & box )

◆ fastOverlapCheck() [13/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Sphere & sphere,
const AABB & box )

◆ fastOverlapCheck() [14/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Sphere & sphere,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx )

◆ fastOverlapCheck() [15/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Sphere & sphere,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx )

◆ fastOverlapCheck() [16/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Torus & torus,
const AABB & box )

◆ fastOverlapCheck() [17/17]

template<>
FastOverlapResult walberla::geometry::fastOverlapCheck ( const Torus & torus,
const AABB & box )

◆ getClosestLineBoxPoints()

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.

Parameters
p1The first end point of the line segment.
p2The second end point of the line segment.
cThe center position of the box.
RThe rotation of the box.
sideThe box's sides lengths.
[out]lretThe closest point on the line.
[out]bretThe closest point on the box.
Returns
void

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.

◆ getClosestLineSegmentPoints()

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.

Parameters
a1The first end point of the first line segment.
a2The second end point of the first line segment.
b1The first end point of the second line segment.
b2The second end point of the second line segment.
[out]cp1The closest point on line one.
[out]cp2The closest point on line two.
Returns
void

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.

◆ hollowSphereFromConfig()

BodyLogicalAND< Sphere, BodyLogicalNOT< Sphere > > walberla::geometry::hollowSphereFromConfig ( const Config::BlockHandle & block)

◆ initBoundaryHandling() [1/2]

template<typename BoundaryHandling >
void walberla::geometry::initBoundaryHandling ( StructuredBlockStorage & blocks,
BlockDataID boundaryHandlingId,
const Config & config )

◆ initBoundaryHandling() [2/2]

template<typename BoundaryHandling >
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 Initializes a boundary handler using a CellInterval (works for both boundary handlings and boundary handling collections). CellInterval
initializer::BoundaryFromDomainBorder Sets a boundary condition at a certain border of the domain (borders are specified by directions). Border
initializer::BoundaryFromImage<GrayScaleImage> GrayScaleImage
initializer::BoundaryFromImage<RGBAImage> RGBAImage
initializer::BoundaryFromVoxelFile Sets boundary conditions using information obtained from a voxel file. VoxelFile
initializer::BoundaryFromBody Initializes a boundary handler using a Body (works for both boundary handlings and boundary handling collections). Body

Example for a configuration block:

Boundaries
{
Border { direction W; walldistance -1; Velocity0 {} }
Border { direction E; walldistance -1; Pressure1 {} }
Border { direction S,N; walldistance -1; NoSlip {} }
Body { shape Sphere; radius 2; midpoint <10,10,10>; NoSlip {} }
Image
{
file obstacle.png;
extrusionCoordinate 2;
rescaleToDomain true;
BoundaryValueMapping {
NoSlip {}
value 0;
}
}
}
@ N
North.
Definition Directions.h:39
@ S
South.
Definition Directions.h:40

◆ intersectLines()

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 \).

Parameters
o1A point on line \( l_1 \).
d1The direction of line \( l_1 \).
o2A point on line \( l_2 \).
d2The direction of line \( l_2 \).
[out]sThe resolved parameter for line \( l_1 \).
[out]tThe resolved parameter for line \( l_2 \).
Returns
void

\[ 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 } \]

◆ loadFile()

template<typename T >
static BinaryRawFile walberla::geometry::loadFile ( const std::string & filename,
const Vector3< uint_t > & size )
static

◆ make_DynamicBody()

template<typename Body >
shared_ptr< DynamicBody< Body > > walberla::geometry::make_DynamicBody ( Body body)

◆ operator<<() [1/2]

template<typename T , typename G >
mpi::GenericSendBuffer< T, G > & walberla::geometry::operator<< ( mpi::GenericSendBuffer< T, G > & buf,
const TriangleMesh & mesh )

Packs a TriangleMesh into a SendBuffer.

Parameters
bufThe SendBuffer object mesh is packed into.
meshThe TriangleMesh object to be packed into buf.
Returns
A reference to buf.

◆ operator<<() [2/2]

std::ostream & walberla::geometry::operator<< ( std::ostream & os,
const RGBAImage::pixel_t & pixel )

◆ operator>>() [1/2]

template<typename T >
mpi::GenericRecvBuffer< T > & walberla::geometry::operator>> ( mpi::GenericRecvBuffer< T > & buf,
TriangleMesh & mesh )

Unpacks a TriangleMesh from a RecvBuffer.

Parameters
bufThe RecvBuffer object mesh is unpacked from.
meshThe TriangleMesh object buf is unpacked into.
Returns
A reference to buf.

◆ operator>>() [2/2]

std::istream & walberla::geometry::operator>> ( std::istream & is,
RGBAImage::pixel_t & pixel )

◆ originInTetrahedron()

bool walberla::geometry::originInTetrahedron ( const Vector3< real_t > & A,
const Vector3< real_t > & B,
const Vector3< real_t > & C,
const Vector3< real_t > & D )
inline

Estimates whether or not the origin lies within the given tetrahedron.

Parameters
AVertex that sees the triangle BCD in counterclockwise order.
BVertex that sees the triangle ADC in counterclockwise order.
CVertex that sees the triangle ABD in counterclockwise order.
DVertex that sees the triangle ACB in counterclockwise order.
Returns
true if the origin lies within the tetrahedron, otherwise false.
Note
Points on the surface of the tetrahedron are considered inside.
Todo
Review documentation

◆ overlapFraction() [1/4]

template<>
real_t walberla::geometry::overlapFraction ( const AABB & body,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx,
uint_t  )
inline

◆ overlapFraction() [2/4]

template<typename Body >
real_t walberla::geometry::overlapFraction ( const Body & body,
const Vector3< real_t > & cellMidpoint,
const Vector3< real_t > & dx,
uint_t maxDepth = 4 )

◆ overlapFraction() [3/4]

template<typename Body >
real_t walberla::geometry::overlapFraction ( const Body & body,
const Vector3< real_t > & cellMidpoint,
real_t dx,
int maxDepth )

◆ overlapFraction() [4/4]

template<typename Body >
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.

Parameters
bodythe body object
cellMidpointmidpoint of the cell in global coordinates
dxthe edge length(s) of the cell, dx or (dx, dy, dz)
maxDepthsub 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().

◆ pointInFrontOfPlane()

bool walberla::geometry::pointInFrontOfPlane ( const Vector3< real_t > & normal,
const Vector3< real_t > & pointOnPlane,
const Vector3< real_t > & point )
inline

Estimates whether a given point is in front of a plane.

Parameters
normalThe normal of the plane, does not have to be normalised.
pointOnPlaneAny point on the Plane.
pointThe point whose position is check for being in front of the plane.
Returns
true if the origin lies in front of the plane, otherwise false.
Note
Points on the surface of the plane are considered not in front of the plane.
Todo
Review documentation

◆ pointInTetrahedron()

bool walberla::geometry::pointInTetrahedron ( const Vector3< real_t > & A,
const Vector3< real_t > & B,
const Vector3< real_t > & C,
const Vector3< real_t > & D,
const Vector3< real_t > & point )
inline

Estimates whether or not a given point lies within the given tetrahedron.

Parameters
AVertex that sees the triangle BCD in counterclockwise order.
BVertex that sees the triangle ADC in counterclockwise order.
CVertex that sees the triangle ABD in counterclockwise order.
DVertex that sees the triangle ACB in counterclockwise order.
pointThe point whose position is check for being inside the tetrahedron.
Returns
true if the origin lies within the tetrahedron, otherwise false.
Note
Points on the surface of the tetrahedron are considered inside.
Todo
Review documentation

◆ readAndBroadcastMesh()

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.

Parameters
meshFilenameFilename of mesh. Supported formats are obj, pov and off. Format is detected by file ending
meshobject where the mesh is stored, if the given mesh is not empty, all contents are cleared

◆ readFaceVertex()

void walberla::geometry::readFaceVertex ( std::istream & is,
TriangleMesh::index_t & vertexIdx,
TriangleMesh::index_t & textureIdx,
TriangleMesh::index_t & normalIdx )

◆ readMesh()

void walberla::geometry::readMesh ( const std::string & meshFilename,
TriangleMesh & mesh )

Reads mesh from file.

Mesh format is detected by file ending.

Parameters
meshFilenameFilename of mesh. Supported formats are obj, pov and off. Format is detected by file ending
meshobject where the mesh is stored, if the given mesh is not empty, all contents are cleared

◆ readMeshObj()

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.

Parameters
isinput stream, to read from file use std::fstream
meshobject where the mesh is stored, if the given mesh is not empty, all contents are cleared

◆ readMeshOff()

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

Parameters
isinput stream, to read from file use std::fstream
meshobject where the mesh is stored, if the given mesh is not empty, all contents are cleared

◆ readMeshPov()

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.

Parameters
isinput stream, to read from file use std::fstream
meshobject where the mesh is stored, if the given mesh is not empty, all contents are cleared

◆ removeComments()

void walberla::geometry::removeComments ( std::istream & is,
std::ostream & os )

◆ setNonBoundaryCellsToDomain() [1/3]

template<typename BoundaryHandling >
void walberla::geometry::setNonBoundaryCellsToDomain ( StructuredBlockStorage & blocks,
BlockDataID boundaryHandlingId )

◆ setNonBoundaryCellsToDomain() [2/3]

template<typename FlagField_T >
void walberla::geometry::setNonBoundaryCellsToDomain ( StructuredBlockStorage & blocks,
BlockDataID flagFieldID,
field::FlagUID fluidFlagID )

◆ setNonBoundaryCellsToDomain() [3/3]

template<typename FlagField_T >
void walberla::geometry::setNonBoundaryCellsToDomain ( StructuredBlockStorage & blocks,
BlockDataID flagFieldID,
field::FlagUID fluidFlagID,
cell_idx_t numGhostLayers )

◆ skipComments()

static void walberla::geometry::skipComments ( std::istream & is)
static

◆ sphereFromConfig()

Sphere walberla::geometry::sphereFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns a Sphere.

Example block: Sphere{ midpoint <1,2,3>; radius 5; }

◆ sphereSliceFromConfig()

BodyLogicalAND< Sphere, AABB > walberla::geometry::sphereSliceFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns a difference/union/... of bodies.

◆ toCellAABB()

CellAABB walberla::geometry::toCellAABB ( const CellInterval & cellInterval)
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!

Parameters
cellIntervalThe CellInterval to be converted.
Precondition
!cellInterval.empty()
cellInterval.positiveIndicesOnly()
Returns
The CellAABB.

◆ torusFromConfig()

Torus walberla::geometry::torusFromConfig ( const Config::BlockHandle & block)

Parses a configuration block and returns a Torus.

Example block: Torus{ midpoint <1,2,3>; normal <1,0,0>; radius 5; distance 1; }

◆ validateCellInterval()

void walberla::geometry::validateCellInterval ( const CellInterval & cellInterval)
inline

Validate if the given CellInterval can be converted to a CellAABB.

Logs an Error and aborts if either cellInterval.empty() or !cellInterval.positiveIndicesOnly() since a CellAABB can neither be empty nor contain negative bounds.

Parameters
cellIntervalThe validated CellInterval.

◆ writeMesh()

void walberla::geometry::writeMesh ( const std::string & meshFilename,
const TriangleMesh & mesh )

writes a mesh to file

Mesh format is detected by file ending.

Parameters
meshFilenameFilename of mesh. Supported formats are obj, pov and off. Format is detected by file ending
meshobject where the mesh is read from

◆ writeMeshObj()

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

Parameters
osthe output stream. To write to file call with ofstream("filename.obj"))
meshthe mesh to write

◆ writeMeshOff()

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

Parameters
osthe output stream. To write to file call with ofstream("filename.off")
meshthe mesh to write

◆ writeMeshOnRoot()

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.

Parameters
meshFilenameFilename of mesh. Supported formats are obj, pov and off. Format is detected by file ending
meshobject where the mesh is read from

◆ writeMeshPov()

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.

Parameters
osthe output stream. To write to file call with ofstream("filename.dat")
meshthe mesh to write

◆ writeMeshPov0()

void walberla::geometry::writeMeshPov0 ( std::ostream & os,
const TriangleMesh & mesh,
const size_t itemsPerLine )

◆ writeMeshVtp()

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

Parameters
osthe output stream. To write to file call with ofstream("filename.vtp")
meshthe mesh to write