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 ¢re, const scalar range, const triSurf &surface) |
find number of face groups within a given range More... | |
label | numberOfEdgeGroups (const labelHashSet &containedEdges, const point ¢re, 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... | |
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().
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().
|
inline |
check if a list has nan entries
Definition at line 53 of file helperFunctionsGeometryQueriesI.H.
References forAll.
Referenced by boundaryLayers::createNewEdgeVerticesParallel(), boundaryLayers::createNewPartitionVerticesParallel(), boundaryLayers::createNewVertex(), boundaryLayers::createNewVertices(), ensightPart::isFieldDefined(), meshSurfaceOptimizer::newPositionSurfaceOptimizer(), triSurf::topologyCheck(), and ensightPart::writeFieldList().
bool isinf | ( | const ListType & | l | ) |
check if a list has inf entries
Definition at line 63 of file helperFunctionsGeometryQueriesI.H.
References forAll.
Referenced by boundaryLayers::createNewEdgeVerticesParallel(), boundaryLayers::createNewPartitionVerticesParallel(), boundaryLayers::createNewVertex(), boundaryLayers::createNewVertices(), meshSurfaceOptimizer::newPositionSurfaceOptimizer(), and triSurf::topologyCheck().
|
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().
|
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().
|
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().
|
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.
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
inline |
check if a line intersects the triangle, and return the intersection
Definition at line 653 of file helperFunctionsGeometryQueriesI.H.
References triangle::a(), triangle::b(), triangle::c(), Foam::det(), matrix3D::determinant(), Foam::mag(), matrix3D::solveFirst(), matrix3D::solveSecond(), matrix3D::solveThird(), and u0.
Referenced by Foam::triSurfaceChecks::checkSelfIntersections(), doFaceAndTriangleIntersect(), doTrianglesIntersect(), meshOctreeAddressing::edgeIntersections(), meshOctreeCubeCoordinates::intersectsTriangleExact(), meshOctreeAddressing::isIntersectedEdge(), lineFaceIntersection(), and triLineIntersection().
|
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().
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().
|
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().
|
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().
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().
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.
|
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.
|
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.
|
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().
|
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().
|
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.
|
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.
|
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().
|
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().
check if the vertex is on the positive side of the face plane
|
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().
|
inline |
find the number of edge groups within the given range
Definition at line 1758 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(), nearestPointOnTheEdgeExact(), p, points, range, DynList< T, staticSize >::removeLastElement(), DynList< T, staticSize >::size(), and HashTable::size().
Referenced by meshOctreeAutomaticRefinement::refineBasedOnProximityTests().
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().
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().
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().
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.
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().
scalar textToScalar | ( | const word & | w | ) |
convert the text to scalar
Definition at line 45 of file helperFunctionsStringConversion.C.
Referenced by main(), and textToLabel().
convert the text to label
Definition at line 56 of file helperFunctionsStringConversion.C.
References textToScalar(), and w().
word scalarToText | ( | const scalar | s | ) |
convert the scalar value into text
Definition at line 61 of file helperFunctionsStringConversion.C.
References s().
Referenced by polyMeshGenModifier::addBufferCells(), detectBoundaryLayers::analyseLayers(), triSurfaceCurvatureEstimator::calculateSurfaceCurvatures(), meshSurfaceOptimizer::calculateTrianglesAndAddressing(), edgeExtractor::checkCorners(), Foam::triSurfaceChecks::checkDisconnectedParts(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), Foam::triSurfaceChecks::checkOrientation(), Foam::triSurfaceChecks::checkOverlaps(), Foam::triSurfaceChecks::checkSelfIntersections(), Foam::triSurfaceChecks::checkSurfaceManifolds(), Foam::createFIRESelections(), partTetMesh::createPolyMesh(), edgeExtractor::extractEdges(), boundaryLayers::findPatchesToBeTreatedTogether(), boundaryLayerOptimisation::optimiseHairNormalsAtTheBoundary(), boundaryLayerOptimisation::optimiseHairNormalsInside(), triSurfacePatchManipulator::surfaceWithPatches(), and meshSurfaceOptimizer::transformIntoPlane().
convert the integer value into text
Definition at line 69 of file helperFunctionsStringConversion.C.
Referenced by createFundamentalSheetsJFS::createSheetsAtFeatureEdges(), and meshOctreeModifier::markAdditionalLayers().
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().
local position of element in a list
Definition at line 103 of file helperFunctionsTopologyManipulationI.H.
Referenced by refineBoundaryLayers::generateNewCells().
faceType reverseFace | ( | const faceType & | f | ) |
reverse the face
Definition at line 113 of file helperFunctionsTopologyManipulationI.H.
References f().
Referenced by layerAdditionRemoval::addCellLayer(), attachDetach::attachInterface(), polyDualMesh::collectPatchInternalFace(), polyDualMesh::collectPatchSideFace(), attachDetach::detachInterface(), refineBoundaryLayers::refineEdgeHexCell::generateMissingFaces(), refineBoundaryLayers::refineCornerHexCell::generateMissingFaces(), refineBoundaryLayers::generateNewCells(), refineBoundaryLayers::generateNewCellsPrism(), and refineBoundaryLayers::generateNewFaces().
|
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().
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().
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().
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().
find open edges for a set of faces forming a cell
Definition at line 279 of file helperFunctionsTopologyManipulationI.H.
References Foam::abort(), DynList< T, staticSize >::append(), DynList< T, staticSize >::clear(), DynList< T, staticSize >::containsAtPosition(), Foam::FatalError, FatalErrorIn, forAll, Foam::pos(), and DynList< T, staticSize >::setSize().
|
inline |
check if two faces share an edge
Definition at line 324 of file helperFunctionsTopologyManipulationI.H.
Referenced by boundaryLayerOptimisation::calculateThicknessOverCell(), refineBoundaryLayers::refineEdgeHexCell::determineFacesInDirections(), refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections(), checkNonMappableCellConnections::findCellTypes(), mergePatchFaces(), and meshBndLayerSelectorOperator::operator()().
|
inline |
return the edge shared by the faces
Definition at line 343 of file helperFunctionsTopologyManipulationI.H.
Referenced by edgeExtractor::faceEvaluator::bestPatchTopological(), globalMeshData::calcSharedEdges(), edgeExtractor::checkFacePatchesTopology(), refineBoundaryLayers::refineEdgeHexCell::determineFacesInDirections(), and syncTools::syncEdgeMap().
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().
|
inline |
check if two faces share a vertex
Definition at line 387 of file helperFunctionsTopologyManipulationI.H.
|
inline |
shared vertex of two faces
Definition at line 376 of file helperFunctionsTopologyManipulationI.H.
Referenced by refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections().
|
inline |
find a vertex label common to all faces in the list
Definition at line 398 of file helperFunctionsTopologyManipulationI.H.
|
inline |
check if selected elements are in one singly-connected chain
Definition at line 426 of file helperFunctionsTopologyManipulationI.H.
Referenced by edgeExtractor::faceEvaluator::bestPatchTopological(), edgeExtractor::checkFacePatchesTopology(), and correctEdgesBetweenPatches::decomposeProblematicFaces().
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().
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().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.