Data Structures | Functions
Foam::help Namespace Reference

Helper functions useful for mesh generation. More...

Data Structures

class  graphNeiOp
 
class  graphSelectorOp
 

Functions

template<class labelListType , class neiOp , class filterOp >
void frontalMarking (labelListType &result, const label startingIndex, const neiOp &neighbourCalculator, const filterOp &selector)
 
template<class labelListType , class neiOp , class filterOp >
label groupMarking (labelListType &elementInGroup, const neiOp &neighbourCalculator, const filterOp &selector)
 
template<class ListType >
bool isnan (const ListType &)
 check if a list has nan entries More...
 
template<class ListType >
bool isinf (const ListType &)
 check if a list has inf entries More...
 
template<class Face1 , class Face2 >
bool isSharedEdgeConvex (const pointField &points, const Face1 &f1, const Face2 &f2)
 check if the faces share a convex edge More...
 
template<class Face1 , class Face2 >
scalar angleBetweenFaces (const pointField &points, const Face1 &f1, const Face2 &f2)
 angle between the two faces in radians More...
 
faceList mergePatchFaces (const List< DynList< label > > &pfcs, const pointField &polyPoints)
 
bool vertexOnLine (const point &p, const edge &e, const pointField &ep)
 check if the point p belongs to the edge e More...
 
bool vertexInPlane (const point &p, const plane &pl)
 check if the point p belongs to the plane More...
 
point nearestPointOnTheEdge (const point &edgePoint0, const point &edgePoint1, const point &p)
 find the vertex on the line of the edge nearest to the point p More...
 
point nearestPointOnTheEdgeExact (const point &edgePoint0, const point &edgePoint1, const point &p)
 find the vertex on the edge nearest to the point p More...
 
scalar distanceOfPointFromTheEdge (const point &edgePoint0, const point &edgePoint1, const point &p)
 find and return the distance between the edge and the point p More...
 
bool nearestEdgePointToTheLine (const point &edgePoint0, const point &edgePoint1, const point &lp0, const point &lp1, point &nearestOnEdge, point &nearestOnLine)
 find the nearest points on the edge and the line More...
 
bool planeIntersectsEdge (const point &start, const point &end, const plane &pl, point &intersection)
 check if the edge intersects the plane More...
 
bool pointInTetrahedron (const point &p, const tetrahedron< point, point > &tet)
 check if a vertex lies inside the tetrahedron More...
 
bool triLineIntersection (const triangle< point, point > &tria, const point &lineStart, const point &lineEnd, point &intersection)
 check if a line intersects the triangle, and return the intersection More...
 
bool triLineIntersection (const triSurf &, const label, const point &, const point &, point &)
 check if a line intersects the triangle and return the intersection More...
 
bool boundBoxLineIntersection (const point &, const point &, const boundBox &)
 check if the line intersects the bounding box More...
 
bool lineFaceIntersection (const point &, const point &, const face &, const pointField &fp, point &intersection)
 check if the line and the face intersect More...
 
bool doFaceAndTriangleIntersect (const triSurf &surface, const label triI, const face &f, const pointField &facePoints)
 check if the surface triangle and the face intersect More...
 
point nearestPointOnTheTriangle (const triangle< point, point > &tri, const point &)
 find the nearest point on the triangle to the given point More...
 
point nearestPointOnTheTriangle (const label, const triSurf &, const point &)
 find the nearest vertex on the surface triangle to the given point More...
 
bool findMinimizerPoint (const DynList< point > &origins, const DynList< vector > &normals, point &pMin)
 
bool doEdgesOverlap (const point &e0p0, const point &e0p1, const point &e1p0, const point &e1p1, FixedList< point, 2 > &overlappingPart, const scalar distTol=-1.0, const scalar cosTol=Foam::cos(5.0 *(M_PI/180.0)))
 check the existence of overlap between the two edges More...
 
bool doTrianglesOverlap (const triangle< point, point > &tri0, const triangle< point, point > &tri1, DynList< point > &overlappingPolygon, const scalar distTol=-1.0, const scalar cosTol=Foam::cos(5.0 *(M_PI/180.0)))
 check the existence of overlap between the two triangles More...
 
bool doTrianglesIntersect (const triangle< point, point > &tri0, const triangle< point, point > &tri1, const scalar distTol=-1.0)
 check the existence of intersection between the two triangles More...
 
bool doTrianglesIntersect (const triangle< point, point > &tri0, const triangle< point, point > &tri1, DynList< point > &intersectionPoints, const scalar distTol=-1.0)
 
bool pointInsideFace (const point &p, const face &f, const vector &n, const pointField &fp, const scalar distTol=SMALL)
 check if the point is inside or outside the face More...
 
bool pointInsideFace (const point &p, const face &f, const pointField &fp, const scalar distTol=SMALL)
 check if the point is inside or outside the face More...
 
bool isFaceConvexAndOk (const face &f, const pointField &fp, DynList< bool > &OkPoints)
 check if the face is convex. Concave points are flagged false More...
 
bool isVertexVisible (const point &p, const plane &pl)
 check if the vertex is on the positive side of the face plane More...
 
label numberOfFaceGroups (const labelHashSet &containedElements, const point &centre, const scalar range, const triSurf &surface)
 find number of face groups within a given range More...
 
label numberOfEdgeGroups (const labelHashSet &containedEdges, const point &centre, const scalar range, const triSurf &surface)
 find the number of edge groups within the given range More...
 
template<class sendOp , class combineOp , class T , class ListType >
void combineData (const sendOp &sop, combineOp &cop)
 
template<class T , class ListType , class scatterOp , class gatherOp >
void whisperReduce (const ListType &neis, const scatterOp &sop, gatherOp &gop)
 
template<class T , class ListType >
void exchangeMap (const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
 
template<class T , class ListType >
void exchangeMap (const std::map< label, ListType > &m, std::map< label, List< T > > &mOut)
 
template<class RowType , template< class ListTypeArg > class GraphType>
void reverseAddressingSMP (const GraphType< RowType > &, GraphType< RowType > &)
 calculates the reverse addressing of the graph by transposing the graph More...
 
scalar textToScalar (const word &w)
 convert the text to scalar More...
 
label textToLabel (const word &w)
 convert the text to label More...
 
word scalarToText (const scalar s)
 convert the scalar value into text More...
 
word labelToText (const label l)
 convert the integer value into text More...
 
template<class faceType1 , class faceType2 >
bool areFacesEqual (const faceType1 &f1, const faceType2 &f2)
 check if the faces are equal More...
 
template<class T , class ListType >
label positionInList (const T &elmt, const ListType &l)
 local position of element in a list More...
 
template<class faceType >
faceType reverseFace (const faceType &f)
 reverse the face More...
 
template<class faceType1 , class faceType2 >
face mergeTwoFaces (const faceType1 &f1, const faceType2 &f2)
 returns a merged face More...
 
edgeList modifyFacesToShareOneEdge (face &f1, face &f2)
 remove edges until faces share only one edge More...
 
face createFaceFromRemovedPart (const face &fOrig, const face &fCut)
 create a face from the removed part More...
 
face removeEdgesFromFace (const face &fOrig, const DynList< edge > &removeEdges)
 remove edges from face More...
 
void findOpenEdges (const faceList &cellFaces, DynList< edge > &openEdges)
 find open edges for a set of faces forming a cell More...
 
template<class faceType1 , class faceType2 >
bool shareAnEdge (const faceType1 &f1, const faceType2 &f2)
 check if two faces share an edge More...
 
template<class faceType1 , class faceType2 >
edge sharedEdge (const faceType1 &f1, const faceType2 &f2)
 return the edge shared by the faces More...
 
template<class faceType >
label positionOfEdgeInFace (const edge &e, const faceType &f)
 return the position of edge in the face, -1 otherwise More...
 
template<class faceType1 , class faceType2 >
bool shareAVertex (const faceType1 &f1, const faceType2 &f2)
 check if two faces share a vertex More...
 
template<class faceType1 , class faceType2 >
label sharedVertex (const faceType1 &f1, const faceType2 &f2)
 shared vertex of two faces More...
 
template<class faceListType >
label sharedVertex (const faceListType &fcs)
 find a vertex label common to all faces in the list More...
 
template<class boolListType >
bool areElementsInChain (const boolListType &sel)
 check if selected elements are in one singly-connected chain More...
 
labelList sortEdgeChain (const DynList< edge > &bEdges)
 
void zipOpenChain (DynList< edge > &bEdges)
 creates closed edge chains from the open chain More...
 

Detailed Description

Helper functions useful for mesh generation.

Source files

Function Documentation

◆ frontalMarking()

void frontalMarking ( labelListType &  result,
const label  startingIndex,
const neiOp &  neighbourCalculator,
const filterOp &  selector 
)

template implementation of the fron-marking algorithm labelListType contains indices of elements satisfying the filtering criteria startingIndex is the first element from where the search is started neiOp determines which neighbouring elements are available. It requires an operator neiOp(const label, DynList<label>&) to be defined filterOp determines which neighbouring elements shall be stored in the result and used in the front. It requires an operator bool filterOp(const label) which return true if the element shall be part of the front

add the starting element

add the starting element to the front

store information which element were already visited

start with frontal marking

find neighbours of the current element

Definition at line 50 of file helperFunctionsFrontalMarking.C.

References LongList< T, Offset >::append(), forAll, LongList< T, Offset >::removeLastElement(), and LongList< T, Offset >::size().

Referenced by groupMarking(), and meshOctreeInsideOutside::meshOctreeInsideOutside().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ groupMarking()

label groupMarking ( labelListType &  elementInGroup,
const neiOp &  neighbourCalculator,
const filterOp &  selector 
)

templated implementation of functionality for finding discrete groups of elements depending on the user-defined criteria the first argument is the result of the operation. Each element is assigned to a group amd the ones failing the critearia are set to -1 neiOp is the functionality for determining neighbours of the currently processed front element. This class requires an operator neiOp(const label, DynList<label>&) filterOp represents the user-defined criteria and shall have an operator bool filterOp(const label)

this is a communication interface between two threads

this element is part of the same group

find group to neighbouring groups addressing

start processing connections between the group and merge the connected ones into a new group

reduce the information about the groups

reduce the groups over processors of an MPI run count the total number of groups over all processors

translate group labels

find the neighbouring groups collect groups on other processors this operator implements the algorithm for exchanging data over processors and collects information which groups are connected over inter-processor boundaries

create a graph of connections

copy the connections into the global neighbour list

communicate partial graphs to the master processor

collect the graph of connections for the whole system

assign a global label to each group

broadcast group labels from the master to other processors

assign correct group labels

set the global group label

Definition at line 155 of file helperFunctionsFrontalMarking.C.

References Foam::abort(), LongList< T, Offset >::append(), DynList< T, staticSize >::append(), VRWGraph::append(), VRWGraph::appendIfNotIn(), Foam::FatalError, Pair::first(), forAll, forAllRow, frontalMarking(), Pstream::gatherList(), UPstream::master(), Foam::max(), UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), LongList< T, Offset >::removeLastElement(), Pstream::scatter(), Pstream::scatterList(), Pair::second(), DynList< T, staticSize >::setSize(), List::setSize(), VRWGraph::setSize(), LongList< T, Offset >::size(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), and Foam::sort().

Referenced by detectBoundaryLayers::analyseLayers(), Foam::triSurfaceChecks::checkDisconnectedParts(), Foam::triSurfaceChecks::checkOrientation(), Foam::triSurfaceChecks::checkSurfaceManifolds(), and checkCellConnectionsOverFaces::findCellGroups().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isnan()

bool isnan ( const ListType &  l)
inline

◆ isinf()

bool isinf ( const ListType &  l)

◆ isSharedEdgeConvex()

bool isSharedEdgeConvex ( const pointField points,
const Face1 &  f1,
const Face2 &  f2 
)
inline

check if the faces share a convex edge

Definition at line 74 of file helperFunctionsGeometryQueriesI.H.

References DynList< T, staticSize >::contains(), f1, forAll, tetrahedron::mag(), points, and Foam::pos().

Referenced by boundaryLayers::findPatchesToBeTreatedTogether().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ angleBetweenFaces()

scalar angleBetweenFaces ( const pointField points,
const Face1 &  f1,
const Face2 &  f2 
)
inline

angle between the two faces in radians

the angle is in the interval [Pi, 2Pi>

the angle is in the interval [0, Pi>

the angle is in the interval [Pi, 2Pi>

the angle is in the interval [0, Pi>

Definition at line 132 of file helperFunctionsGeometryQueriesI.H.

References Foam::abort(), Foam::acos(), DynList< T, staticSize >::contains(), Foam::dot(), f1, Foam::FatalError, FatalErrorIn, forAll, tetrahedron::mag(), Foam::mag(), Foam::max(), Foam::min(), points, and Foam::pos().

Referenced by boundaryLayers::findPatchesToBeTreatedTogether().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergePatchFaces()

faceList mergePatchFaces ( const List< DynList< label > > &  pfcs,
const pointField polyPoints 
)
inline

merge faces which share a common edge

merge faces which share a common edge

Definition at line 232 of file helperFunctionsGeometryQueriesI.H.

References f(), forAll, k, Foam::mag(), mergeTwoFaces(), List::newElmt(), patchFaces(), and shareAnEdge().

Referenced by autoLayerDriver::doLayers(), autoRefineDriver::doRefine(), autoSnapDriver::doSnap(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertexOnLine()

bool vertexOnLine ( const point p,
const edge e,
const pointField ep 
)
inline

check if the point p belongs to the edge e

Definition at line 308 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, Foam::mag(), and p.

Here is the call graph for this function:

◆ vertexInPlane()

bool vertexInPlane ( const point p,
const plane pl 
)
inline

check if the point p belongs to the plane

Definition at line 322 of file helperFunctionsGeometryQueriesI.H.

References Foam::mag(), n, plane::normal(), p, and plane::refPoint().

Here is the call graph for this function:

◆ nearestPointOnTheEdge()

point nearestPointOnTheEdge ( const point edgePoint0,
const point edgePoint1,
const point p 
)
inline

find the vertex on the line of the edge nearest to the point p

Definition at line 1616 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, k, Foam::mag(), and p.

Referenced by boundaryLayerOptimisation::calculateThickness(), distanceOfPointFromTheEdge(), nearestEdgePointToTheLine(), nearestPointOnTheTriangle(), and numberOfFaceGroups().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPointOnTheEdgeExact()

point nearestPointOnTheEdgeExact ( const point edgePoint0,
const point edgePoint1,
const point p 
)
inline

find the vertex on the edge nearest to the point p

Definition at line 1633 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, k, Foam::magSqr(), and p.

Referenced by edgeExtractor::findEdgeCandidates(), meshOctree::findEdgesInBox(), meshOctree::findNearestEdgePoint(), and numberOfEdgeGroups().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distanceOfPointFromTheEdge()

scalar distanceOfPointFromTheEdge ( const point edgePoint0,
const point edgePoint1,
const point p 
)
inline

find and return the distance between the edge and the point p

Definition at line 1660 of file helperFunctionsGeometryQueriesI.H.

References Foam::mag(), nearestPointOnTheEdge(), and p.

Referenced by boundaryLayers::createNewEdgeVerticesParallel(), and boundaryLayers::createNewVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestEdgePointToTheLine()

bool nearestEdgePointToTheLine ( const point edgePoint0,
const point edgePoint1,
const point lp0,
const point lp1,
point nearestOnEdge,
point nearestOnLine 
)
inline

find the nearest points on the edge and the line

Definition at line 417 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, Foam::inv(), Foam::mag(), nearestPointOnTheEdge(), Tensor::xx(), Tensor::xy(), Tensor::yx(), Tensor::yy(), Tensor::zero, Vector< scalar >::zero, and Tensor::zz().

Referenced by meshOctree::findNearestPointToEdge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planeIntersectsEdge()

bool planeIntersectsEdge ( const point start,
const point end,
const plane pl,
point intersection 
)
inline

check if the edge intersects the plane

Definition at line 338 of file helperFunctionsGeometryQueriesI.H.

References Foam::mag(), n, plane::normal(), and plane::refPoint().

Here is the call graph for this function:

◆ pointInTetrahedron()

bool pointInTetrahedron ( const point p,
const tetrahedron< point, point > &  tet 
)
inline

check if a vertex lies inside the tetrahedron

check the determinant of the transformation

get the coordinates of the point in the barycentric corrdinate system

check the determinant of the transformation

get the coordinates of the point in the barycentric corrdinate system

Definition at line 365 of file helperFunctionsGeometryQueriesI.H.

References tetrahedron::a(), tetrahedron::b(), tetrahedron::c(), tetrahedron::d(), Foam::det(), matrix3D::determinant(), Foam::mag(), p, matrix3D::solveFirst(), matrix3D::solveSecond(), matrix3D::solveThird(), and u0.

Referenced by findCellsIntersectingSurface::findIntersectedCells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ triLineIntersection() [1/2]

bool triLineIntersection ( const triangle< point, point > &  tria,
const point lineStart,
const point lineEnd,
point intersection 
)
inline

◆ triLineIntersection() [2/2]

bool triLineIntersection ( const triSurf surface,
const label  tI,
const point s,
const point e,
point intersection 
)
inline

check if a line intersects the triangle and return the intersection

Definition at line 701 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, s(), and triLineIntersection().

Here is the call graph for this function:

◆ boundBoxLineIntersection()

bool boundBoxLineIntersection ( const point s,
const point e,
const boundBox bb 
)
inline

check if the line intersects the bounding box

check if the vector has length

check coordinates

check if the vector has length

check coordinates

Definition at line 723 of file helperFunctionsGeometryQueriesI.H.

References boundBox::contains(), Foam::e, Foam::mag(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), pMin(), and s().

Referenced by triSurfaceClassifyEdges::checkOrientation(), and meshOctreeCubeCoordinates::intersectsTriangleExact().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lineFaceIntersection()

bool lineFaceIntersection ( const point sp,
const point ep,
const face f,
const pointField fp,
point intersection 
)
inline

check if the line and the face intersect

Definition at line 778 of file helperFunctionsGeometryQueriesI.H.

References Foam::constant::universal::c, f(), forAll, and triLineIntersection().

Referenced by boundaryLayerOptimisation::calculateThicknessOverCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doFaceAndTriangleIntersect()

bool doFaceAndTriangleIntersect ( const triSurf surface,
const label  triI,
const face f,
const pointField facePoints 
)
inline

check if the surface triangle and the face intersect

check if any triangle edge intersects the face

check if any face edges intersect the triangle

check if any triangle edge intersects the face

check if any face edges intersect the triangle

Definition at line 805 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, f(), forAll, s(), and triLineIntersection().

Referenced by findCellsIntersectingSurface::findIntersectedCells(), and meshOctreeAddressing::isIntersectedFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPointOnTheTriangle() [1/2]

point nearestPointOnTheTriangle ( const triangle< point, point > &  tri,
const point p 
)
inline

find the nearest point on the triangle to the given point

Check if point is in triangle

Check if point is in triangle

Definition at line 475 of file helperFunctionsGeometryQueriesI.H.

References triangle::a(), triangle::b(), triangle::c(), Foam::det(), Foam::e, forAll, Foam::mag(), Foam::magSqr(), nearestPointOnTheEdge(), and p.

Referenced by triSurfaceImportSurfaceAsSubset::addSurfaceAsSubset(), doTrianglesIntersect(), meshOctree::findNearestSurfacePoint(), meshOctree::findNearestSurfacePointInRegion(), meshOctree::findTrianglesInBox(), nearestPointOnTheTriangle(), numberOfFaceGroups(), and pointInsideFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPointOnTheTriangle() [2/2]

point nearestPointOnTheTriangle ( const label  tI,
const triSurf surface,
const point p 
)
inline

find the nearest vertex on the surface triangle to the given point

Definition at line 594 of file helperFunctionsGeometryQueriesI.H.

References nearestPointOnTheTriangle(), p, and points.

Here is the call graph for this function:

◆ findMinimizerPoint()

bool findMinimizerPoint ( const DynList< point > &  origins,
const DynList< vector > &  normals,
point pMin 
)
inline

find the minimiser point from a point and the given planes returns true if the minimizer exists

use the normalized vector

use the normalized vector

Definition at line 614 of file helperFunctionsGeometryQueriesI.H.

References Foam::abort(), Foam::det(), Foam::FatalError, FatalErrorIn, forAll, Foam::inv(), Foam::mag(), n, pMin(), DynList< T, staticSize >::size(), Tensor::zero, and Vector< scalar >::zero.

Here is the call graph for this function:

◆ doEdgesOverlap()

bool doEdgesOverlap ( const point e0p0,
const point e0p1,
const point e1p0,
const point e1p1,
FixedList< point, 2 > &  overlappingPart,
const scalar  distTol = -1.0,
const scalar  cosTol = Foam::cos(5.0*(M_PI/180.0)) 
)
inline

check the existence of overlap between the two edges

check the angle deviation between the two vectors

check if points are colinear within the tolerance

calculate parameters on the regression line

check interval overlapping over the line

check the angle deviation between the two vectors

check if points are colinear within the tolerance

calculate parameters on the regression line

check interval overlapping over the line

Definition at line 872 of file helperFunctionsGeometryQueriesI.H.

References Foam::endl(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::min(), and WarningIn.

Here is the call graph for this function:

◆ doTrianglesOverlap()

bool doTrianglesOverlap ( const triangle< point, point > &  tri0,
const triangle< point, point > &  tri1,
DynList< point > &  overlappingPolygon,
const scalar  distTol = -1.0,
const scalar  cosTol = Foam::cos(5.0*(M_PI/180.0)) 
)
inline

check the existence of overlap between the two triangles

check the angle deviation between the two vectors

check if the two nearest points are within tolerance

calculate max distance point from the origin

transform into planar coordinates

this is very sensitive to floaing point tolerances

this is very sensitive to floaing point tolerances

check if the overlapping polygon exists

fill the overlapping polygon

check the angle deviation between the two vectors

check if the two nearest points are within tolerance

calculate max distance point from the origin

transform into planar coordinates

this is very sensitive to floaing point tolerances

this is very sensitive to floaing point tolerances

check if the overlapping polygon exists

fill the overlapping polygon

Definition at line 957 of file helperFunctionsGeometryQueriesI.H.

References triangle::a(), DynList< T, staticSize >::append(), triangle::b(), triangle::c(), triangle::centre(), DynList< T, staticSize >::clear(), Foam::distance(), Foam::endl(), DynList< T, staticSize >::fcElement(), forAll, Foam::mag(), Foam::magSqr(), triangle::normal(), DynList< T, staticSize >::setSize(), DynList< T, staticSize >::size(), WarningIn, x, Vector2D< Cmpt >::x(), y, and Vector2D< Cmpt >::y().

Referenced by Foam::triSurfaceChecks::checkOverlaps(), and doTrianglesIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doTrianglesIntersect() [1/2]

bool doTrianglesIntersect ( const triangle< point, point > &  tri0,
const triangle< point, point > &  tri1,
const scalar  distTol = -1.0 
)
inline

check the existence of intersection between the two triangles

find distances of points from the second triangle

find distances of points from the first triangle

find edge intersections

find distances of points from the second triangle

find distances of points from the first triangle

find edge intersections

Definition at line 1149 of file helperFunctionsGeometryQueriesI.H.

References triangle::a(), triangle::b(), triangle::c(), Foam::endl(), Foam::magSqr(), nearestPointOnTheTriangle(), triLineIntersection(), and WarningIn.

Referenced by Foam::triSurfaceChecks::checkSelfIntersections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doTrianglesIntersect() [2/2]

bool doTrianglesIntersect ( const triangle< point, point > &  tri0,
const triangle< point, point > &  tri1,
DynList< point > &  intersectionPoints,
const scalar  distTol = -1.0 
)
inline

distance of the points of the first triangle from the plane of the second triangle

find points on the intersection line

there can be no intersection

find points on the intersection line

these triangles are in the same plane check if they overlap

distance of the points of the second triangle from the plane of the first triangle

there can be no intersection

find points on the intersection line

these triangles are in the same plane check if they overlap

calculate the direction of the intersection line

n0 and n1 are nearly coplanar, try overlap intersection

these triangles are in the same plane

calculate intervals on the intersection line

distance of the points of the first triangle from the plane of the second triangle

find points on the intersection line

there can be no intersection

find points on the intersection line

these triangles are in the same plane check if they overlap

distance of the points of the second triangle from the plane of the first triangle

there can be no intersection

find points on the intersection line

these triangles are in the same plane check if they overlap

calculate the direction of the intersection line

n0 and n1 are nearly coplanar, try overlap intersection

these triangles are in the same plane

calculate intervals on the intersection line

Definition at line 1209 of file helperFunctionsGeometryQueriesI.H.

References triangle::a(), DynList< T, staticSize >::append(), triangle::b(), triangle::c(), DynList< T, staticSize >::clear(), doTrianglesOverlap(), Foam::endl(), forAll, Foam::mag(), Foam::magSqr(), triangle::normal(), DynList< T, staticSize >::setSize(), WarningIn, and Vector< scalar >::zero.

Here is the call graph for this function:

◆ pointInsideFace() [1/2]

bool pointInsideFace ( const point p,
const face f,
const vector n,
const pointField fp,
const scalar  distTol = SMALL 
)
inline

check if the point is inside or outside the face

Definition at line 1491 of file helperFunctionsGeometryQueriesI.H.

References f(), forAll, Foam::mag(), n, and p.

Here is the call graph for this function:

◆ pointInsideFace() [2/2]

bool pointInsideFace ( const point p,
const face f,
const pointField fp,
const scalar  distTol = SMALL 
)
inline

check if the point is inside or outside the face

Definition at line 1522 of file helperFunctionsGeometryQueriesI.H.

References Foam::constant::universal::c, f(), forAll, Foam::magSqr(), nearestPointOnTheTriangle(), p, and Foam::sqr().

Here is the call graph for this function:

◆ isFaceConvexAndOk()

bool isFaceConvexAndOk ( const face f,
const pointField fp,
DynList< bool > &  OkPoints 
)
inline

check if the face is convex. Concave points are flagged false

face has zero area. All points are inverted

project points into the plane formed by the face centre and the face normal

calculate normalised edge vectors

check if the face is convex

face has zero area. All points are inverted

project points into the plane formed by the face centre and the face normal

calculate normalised edge vectors

check if the face is convex

Definition at line 1553 of file helperFunctionsGeometryQueriesI.H.

References Foam::e, f(), forAll, Foam::mag(), plane::nearestPoint(), and DynList< T, staticSize >::setSize().

Referenced by meshSurfaceCheckInvertedVertices::checkVertices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isVertexVisible()

bool Foam::help::isVertexVisible ( const point p,
const plane pl 
)
inline

check if the vertex is on the positive side of the face plane

◆ numberOfFaceGroups()

label numberOfFaceGroups ( const labelHashSet containedElements,
const point centre,
const scalar  range,
const triSurf surface 
)
inline

find number of face groups within a given range

check if the edge intersects the bounding box

check if the edge intersects the bounding box

Definition at line 1670 of file helperFunctionsGeometryQueriesI.H.

References DynList< T, staticSize >::append(), DynList< T, staticSize >::clear(), Foam::e, forAllConstIter(), forAllRow, HashTable::found(), HashSet< Key, Hash >::insert(), Foam::magSqr(), nearestPointOnTheEdge(), nearestPointOnTheTriangle(), p, points, range, DynList< T, staticSize >::removeLastElement(), s(), DynList< T, staticSize >::size(), and HashTable::size().

Referenced by meshOctreeAutomaticRefinement::refineBasedOnProximityTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ numberOfEdgeGroups()

label numberOfEdgeGroups ( const labelHashSet containedEdges,
const point centre,
const scalar  range,
const triSurf surface 
)
inline

◆ combineData()

void combineData ( const sendOp &  ,
combineOp &   
)

exchanges the data between processors such that in the end thwy all have the necessary information to proceed with the local work

Definition at line 49 of file helperFunctionsPar.C.

References exchangeMap().

Here is the call graph for this function:

◆ whisperReduce()

void whisperReduce ( const ListType &  ,
const scatterOp &  ,
gatherOp &   
)

each processor exchanges the data with all of its neighbours processors with lower labels first send the data to processors with higher labels first and and then to the processors with lower labels

receive the data from the processors above

receive the data

send the data to the processors below

send the data

gather the data from the processors below to the processors above receive the data from the processors below

receive the data

send the data to the processors below

send the data

Definition at line 62 of file helperFunctionsPar.C.

References DynList< T, staticSize >::append(), UPstream::blocking, LongList< T, Offset >::byteSize(), forAll, forAllReverse, and UPstream::myProcNo().

Here is the call graph for this function:

◆ exchangeMap() [1/2]

void Foam::help::exchangeMap ( const std::map< label, ListType > &  ,
LongList< T > &  ,
const Pstream::commsTypes  commsType = Pstream::blocking 
)

send the data stored in the map to other processors and collects the data sent from other processors into the list

check which processors shall exchange the data and which ones shall not

start with blocking type of send and received operation

send data to other processors

receive data from other processors

start with scheduled data transfer this type of transfer is intended for long messages because it does not require any buffer

receive data from processors with lower ids

send data to processors with greater ids

receive data from processors with greater ids

send data to processors with lower ids

Definition at line 129 of file helperFunctionsPar.C.

References Foam::abort(), UPstream::blocking, dictionary::clear(), Foam::exit(), Foam::FatalError, FatalErrorIn, HashTable::found(), HashSet< Key, Hash >::insert(), UPstream::myProcNo(), UPstream::nProcs(), Foam::reduce(), s(), UPstream::scheduled, and List::size().

Referenced by meshOctreeModifier::addLayerFromNeighbouringProcessors(), meshSurfaceEngine::calcAddressingForProcEdges(), meshOctreeAddressing::calcGlobalLeafLabels(), meshSurfacePartitioner::calculateCornersEdgesAndAddressing(), boundaryLayerOptimisation::calculateHairVectorsAtTheBoundary(), edgeExtractor::faceEvaluator::calculateNeiPatchesParallel(), edgeExtractor::faceEvaluator::calculateNeiPatchesParallelNewPatches(), boundaryLayerOptimisation::calculateNormalVectors(), featureEdgesNeiOp::calculateNumberOfEdgesAtPoint(), meshSurfaceEngine::calculatePointPatches(), meshSurfaceEngine::calculatePointPoints(), edgeExtractor::calculateValence(), checkIrregularSurfaceConnections::checkAndFixCellGroupsAtBndVertices(), checkIrregularSurfaceConnections::checkEdgeFaceConnections(), checkIrregularSurfaceConnections::checkFaceGroupsAtBndVertices(), meshSurfaceCheckInvertedVertices::checkVertices(), meshSurfaceCheckEdgeTypes::classifyEdges(), meshBndLayerNeighbourOperator::collectGroups(), featureEdgesNeiOp::collectGroups(), combineData(), partTriMesh::createBufferLayers(), partTetMesh::createBufferLayers(), boundaryLayers::createLayerCells(), boundaryLayers::createNewEdgeVerticesParallel(), boundaryLayers::createNewFacesFromPointsParallel(), boundaryLayers::createNewPartitionVerticesParallel(), extrudeLayer::createNewVertices(), partTriMesh::createParallelAddressing(), partTetMesh::createParallelAddressing(), edgeExtractor::cornerEvaluator::createParallelAddressing(), correctEdgesBetweenPatches::decomposeConcaveFaces(), correctEdgesBetweenPatches::decomposeProblematicFaces(), meshSurfaceOptimizer::edgeNodeDisplacementParallel(), tetMeshOptimisation::exchangeData(), meshSurfaceMapper2D::findActiveBoundaryEdges(), checkBoundaryFacesSharingTwoEdges::findBndFacesAtBndVertex(), edgeExtractor::findCornerCandidates(), checkBoundaryFacesSharingTwoEdges::findFacesAtBndEdge(), meshSurfaceOptimizer::findInvertedVertices(), meshSurfaceMapper::findMappingDistance(), meshSurfaceMapper2D::findMappingDistance(), edgeExtractor::findOtherFacePatchesParallel(), boundaryLayers::findPatchesToBeTreatedTogether(), meshOctreeAddressing::findUsedBoxes(), refineBoundaryLayers::generateNewVertices(), meshOptimizer::laplaceSmoother::laplacianParallel(), meshOptimizer::laplaceSmoother::laplacianPCParallel(), meshOptimizer::laplaceSmoother::laplacianWPCParallel(), meshSurfaceOptimizer::lockBoundaryFaces(), meshSurfaceOptimizer::lockBoundaryPoints(), meshSurfaceMapper::mapToSmallestDistance(), meshSurfaceMapper2D::mapToSmallestDistance(), edgeExtractor::markPatchPoints(), extrudeLayer::movePoints(), edgeExtractor::moveVerticesTowardsDiscontinuities(), meshSurfaceOptimizer::nodeDisplacementLaplacianFCParallel(), meshSurfaceOptimizer::nodeDisplacementLaplacianParallel(), boundaryLayerOptimisation::optimiseHairNormalsAtTheBoundary(), boundaryLayerOptimisation::optimiseHairNormalsInside(), boundaryLayerOptimisation::optimiseThicknessVariation(), partTetMesh::partTetMesh(), partTriMesh::partTriMesh(), symmetryPlaneOptimisation::pointInPlanes(), meshSurfaceMapper::preMapVertices(), meshSurfaceMapper2D::preMapVertices(), edgeExtractor::projectDeterminedFeatureVertices(), meshSurfaceMapper::selectNodesAtParallelBnd(), meshSurfaceEngineModifier::syncVerticesAtParallelBoundaries(), tetMeshOptimisation::unifyCoordinatesParallel(), tetMeshOptimisation::unifyNegativePoints(), meshSurfaceOptimizer::untangleSurface2D(), tetMeshOptimisation::updateBufferLayerPoints(), partTriMesh::updateBufferLayers(), meshSurfaceEngineModifier::updateGeometry(), meshSurfaceEngine::updatePointNormalsAtProcBoundaries(), partTriMesh::updateVertices(), and partTriMesh::updateVerticesSMP().

Here is the call graph for this function:

◆ exchangeMap() [2/2]

void exchangeMap ( const std::map< label, ListType > &  ,
std::map< label, List< T > > &   
)

sends the data stored in a map to other processors and receives the data received from other processors into another map

send data to other processors

receive data from other processors

Definition at line 301 of file helperFunctionsPar.C.

References UPstream::blocking, Foam::exit(), and Foam::FatalError.

Here is the call graph for this function:

◆ reverseAddressingSMP()

void reverseAddressingSMP ( const GraphType< RowType > &  addr,
GraphType< RowType > &  reverseAddr 
)

calculates the reverse addressing of the graph by transposing the graph

find min and max entry in the graph they are used for assigning ranges of values local for each process

find the number of appearances of each element in the original graph

count the appearances which are not local to the processor

allocate reverse matrix

start filling reverse addressing graph update data from processors with smaller labels

update data local to the processor

update data from the processors with higher labels

Definition at line 340 of file helperFunctionsPar.C.

References DynList< T, staticSize >::append(), forAll, Foam::max(), Foam::min(), range, DynList< T, staticSize >::setSize(), and List::setSize().

Here is the call graph for this function:

◆ textToScalar()

scalar textToScalar ( const word w)

convert the text to scalar

Definition at line 45 of file helperFunctionsStringConversion.C.

References s(), and w().

Referenced by main(), and textToLabel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textToLabel()

label textToLabel ( const word w)

convert the text to label

Definition at line 56 of file helperFunctionsStringConversion.C.

References textToScalar(), and w().

Here is the call graph for this function:

◆ scalarToText()

word scalarToText ( const scalar  s)

◆ labelToText()

word labelToText ( const label  l)

convert the integer value into text

Definition at line 69 of file helperFunctionsStringConversion.C.

Referenced by createFundamentalSheetsJFS::createSheetsAtFeatureEdges(), and meshOctreeModifier::markAdditionalLayers().

Here is the caller graph for this function:

◆ areFacesEqual()

bool areFacesEqual ( const faceType1 &  f1,
const faceType2 &  f2 
)

check if the faces are equal

their size mut be equal

find the starting point the the second face

faces have the same orientation

faces shall have opposite orientation, but do not match

same orientation, check if all points match

faces with opposite orientation, check if all points match

faces are equal

their size mut be equal

find the starting point the the second face

faces have the same orientation

faces shall have opposite orientation, but do not match

same orientation, check if all points match

faces with opposite orientation, check if all points match

faces are equal

Definition at line 46 of file helperFunctionsTopologyManipulationI.H.

References f1, forAll, and s().

Referenced by refineBoundaryLayers::generateNewCells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ positionInList()

label positionInList ( const T elmt,
const ListType &  l 
)

local position of element in a list

Definition at line 103 of file helperFunctionsTopologyManipulationI.H.

Referenced by refineBoundaryLayers::generateNewCells().

Here is the caller graph for this function:

◆ reverseFace()

faceType reverseFace ( const faceType &  f)

◆ mergeTwoFaces()

face mergeTwoFaces ( const faceType1 &  f1,
const faceType2 &  f2 
)
inline

returns a merged face

Definition at line 128 of file helperFunctionsTopologyManipulationI.H.

References DynList< T, staticSize >::append(), f1, forAll, DynList< T, staticSize >::setSize(), and sortEdgeChain().

Referenced by faceDecomposition::decomposeFace(), mergePatchFaces(), and surfaceMorpherCells::morphBoundaryFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modifyFacesToShareOneEdge()

edgeList modifyFacesToShareOneEdge ( face f1,
face f2 
)
inline

remove edges until faces share only one edge

Definition at line 175 of file helperFunctionsTopologyManipulationI.H.

References face::edges(), f1, forAll, List::newElmt(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ createFaceFromRemovedPart()

face createFaceFromRemovedPart ( const face fOrig,
const face fCut 
)
inline

create a face from the removed part

Definition at line 219 of file helperFunctionsTopologyManipulationI.H.

References face::edges(), f(), forAll, and List::size().

Referenced by boundaryLayers::checkTopologyOfBoundaryFaces(), and surfaceMorpherCells::morphInternalFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeEdgesFromFace()

face removeEdgesFromFace ( const face fOrig,
const DynList< edge > &  removeEdges 
)
inline

remove edges from face

Definition at line 252 of file helperFunctionsTopologyManipulationI.H.

References face::faceEdge(), forAll, List::setSize(), and List::size().

Referenced by boundaryLayers::checkTopologyOfBoundaryFaces(), and surfaceMorpherCells::morphInternalFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findOpenEdges()

void findOpenEdges ( const faceList cellFaces,
DynList< edge > &  openEdges 
)
inline

◆ shareAnEdge()

bool shareAnEdge ( const faceType1 &  f1,
const faceType2 &  f2 
)
inline

◆ sharedEdge()

edge sharedEdge ( const faceType1 &  f1,
const faceType2 &  f2 
)
inline

◆ positionOfEdgeInFace()

label positionOfEdgeInFace ( const edge e,
const faceType &  f 
)
inline

return the position of edge in the face, -1 otherwise

Definition at line 362 of file helperFunctionsTopologyManipulationI.H.

References Foam::e, f(), and forAll.

Referenced by refineBoundaryLayers::refineEdgeHexCell::determineFacesInDirections(), refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections(), and refineBoundaryLayers::generateNewVertices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shareAVertex()

bool shareAVertex ( const faceType1 &  f1,
const faceType2 &  f2 
)
inline

check if two faces share a vertex

Definition at line 387 of file helperFunctionsTopologyManipulationI.H.

References f1, and forAll.

◆ sharedVertex() [1/2]

label sharedVertex ( const faceType1 &  f1,
const faceType2 &  f2 
)
inline

shared vertex of two faces

Definition at line 376 of file helperFunctionsTopologyManipulationI.H.

References f1, and forAll.

Referenced by refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections().

Here is the caller graph for this function:

◆ sharedVertex() [2/2]

label sharedVertex ( const faceListType &  fcs)
inline

find a vertex label common to all faces in the list

Definition at line 398 of file helperFunctionsTopologyManipulationI.H.

References forAll, and found.

◆ areElementsInChain()

bool areElementsInChain ( const boolListType &  sel)
inline

check if selected elements are in one singly-connected chain

Definition at line 426 of file helperFunctionsTopologyManipulationI.H.

References forAll, and found.

Referenced by edgeExtractor::faceEvaluator::bestPatchTopological(), edgeExtractor::checkFacePatchesTopology(), and correctEdgesBetweenPatches::decomposeProblematicFaces().

Here is the caller graph for this function:

◆ sortEdgeChain()

labelList sortEdgeChain ( const DynList< edge > &  bEdges)
inline

sort the edge chain such that the end of one edge is the beginning of the next one (valid for singly-connected chains, only)

Definition at line 524 of file helperFunctionsTopologyManipulationI.H.

References Foam::abort(), DynList< T, staticSize >::append(), Foam::FatalError, FatalErrorIn, forAll, and DynList< T, staticSize >::size().

Referenced by mergeTwoFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zipOpenChain()

void zipOpenChain ( DynList< edge > &  bEdges)
inline

creates closed edge chains from the open chain

close the chain if open

close the chain if open

Definition at line 466 of file helperFunctionsTopologyManipulationI.H.

References Foam::abort(), DynList< T, staticSize >::append(), DynList< T, staticSize >::containsAtPosition(), Foam::e, Foam::FatalError, FatalErrorIn, forAll, Foam::pos(), and DynList< T, staticSize >::size().

Here is the call graph for this function: