A collection of tools for searching, sorting PrimitivePatch information. More...
Public Member Functions | |
template<class FaceList , class PointField > | |
Foam::labelList | edgeOwner (const PrimitivePatch< FaceList, PointField > &p) |
template<class FaceList , class PointField > | |
Foam::tmp< Foam::pointField > | pointNormals (const polyMesh &mesh, const PrimitivePatch< FaceList, PointField > &p) |
template<class FaceList , class PointField > | |
Foam::tmp< Foam::pointField > | edgeNormals (const polyMesh &mesh, const PrimitivePatch< FaceList, PointField > &p, const labelList &patchEdges, const labelList &coupledEdges) |
template<class BoolListType , class FaceList , class PointField > | |
Foam::label | markZones (const PrimitivePatch< FaceList, PointField > &p, const BoolListType &borderEdge, labelList &faceZone) |
template<class FaceList , class PointField > | |
Foam::labelListList | sortedEdgeFaces (const PrimitivePatch< FaceList, PointField > &p) |
template<class FaceList , class PointField > | |
Foam::labelListList | sortedPointEdges (const PrimitivePatch< FaceList, PointField > &p) |
Static Public Member Functions | |
template<class FaceList , class PointField > | |
static bool | checkOrientation (const PrimitivePatch< FaceList, PointField > &, const bool report=false, labelHashSet *marked=0) |
Check for orientation issues. More... | |
template<class BoolListType , class FaceList , class PointField > | |
static void | markZone (const PrimitivePatch< FaceList, PointField > &, const BoolListType &borderEdge, const label facei, const label currentZone, labelList &faceZone) |
Fill faceZone with currentZone for every face reachable. More... | |
template<class BoolListType , class FaceList , class PointField > | |
static label | markZones (const PrimitivePatch< FaceList, PointField > &, const BoolListType &borderEdge, labelList &faceZone) |
Size and fills faceZone with zone of face. More... | |
template<class BoolListType , class FaceList , class PointField > | |
static void | subsetMap (const PrimitivePatch< FaceList, PointField > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap) |
Determine the mapping for a sub-patch. More... | |
template<class FaceList , class PointField > | |
static void | calcBounds (const PrimitivePatch< FaceList, PointField > &p, boundBox &bb, label &nPoints) |
template<class FaceList , class PointField > | |
static labelListList | sortedEdgeFaces (const PrimitivePatch< FaceList, PointField > &) |
Return edge-face addressing sorted by angle around the edge. More... | |
template<class FaceList , class PointField > | |
static labelListList | sortedPointEdges (const PrimitivePatch< FaceList, PointField > &) |
Return point-edge addressing sorted by order around the point. More... | |
template<class FaceList , class PointField > | |
static labelList | edgeOwner (const PrimitivePatch< FaceList, PointField > &) |
If 2 face neighbours: label of face where ordering of edge. More... | |
template<class FaceList1 , class PointField1 , class FaceList2 , class PointField2 > | |
static void | matchPoints (const PrimitivePatch< FaceList1, PointField1 > &p1, const PrimitivePatch< FaceList2, PointField2 > &p2, labelList &p1PointLabels, labelList &p2PointLabels) |
Find corresponding points on patches sharing the same points. More... | |
template<class FaceList1 , class PointField1 , class FaceList2 , class PointField2 > | |
static void | matchEdges (const PrimitivePatch< FaceList1, PointField1 > &p1, const PrimitivePatch< FaceList2, PointField2 > &p2, labelList &p1EdgeLabels, labelList &p2EdgeLabels, PackedBoolList &sameOrientation) |
Find corresponding edges on patches sharing the same points. More... | |
template<class FaceList , class PointField > | |
static tmp< pointField > | pointNormals (const polyMesh &, const PrimitivePatch< FaceList, PointField > &) |
Return parallel consistent point normals for patches using mesh points. More... | |
template<class FaceList , class PointField > | |
static tmp< pointField > | edgeNormals (const polyMesh &, const PrimitivePatch< FaceList, PointField > &, const labelList &patchEdges, const labelList &coupledEdges) |
Return parallel consistent edge normals for patches using mesh points. More... | |
template<class FaceList , class PointField > | |
static void | gatherAndMerge (const scalar mergeDist, const PrimitivePatch< FaceList, PointField > &p, Field< typename PrimitivePatch< FaceList, PointField >::PointType > &mergedPoints, List< typename PrimitivePatch< FaceList, PointField >::FaceType > &mergedFaces, labelList &pointMergeMap) |
Gather points and faces onto master and merge into single patch. More... | |
template<class FaceList > | |
static void | gatherAndMerge (const polyMesh &mesh, const FaceList &faces, const labelList &meshPoints, const Map< label > &meshPointMap, labelList &pointToGlobal, labelList &uniqueMeshPointLabels, autoPtr< globalIndex > &globalPoints, autoPtr< globalIndex > &globalFaces, List< typename FaceList::value_type > &mergedFaces, pointField &mergedPoints) |
Gather (mesh!) points and faces onto master and merge collocated. More... | |
A collection of tools for searching, sorting PrimitivePatch information.
The class could also be extended to include more that just static methods.
Definition at line 65 of file PatchTools.H.
|
static |
Check for orientation issues.
Returns true if problems were found. If a normal flips across an edge, places it in the HashSet
Compute normal from 3 points, use the first as the origin
minor warpage should not be a problem
Definition at line 32 of file PatchToolsCheck.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), edge::end(), Foam::endl(), f(), PrimitivePatch< FaceList, PointField >::faceEdges(), PrimitivePatch< FaceList, PointField >::faceNormals(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), PrimitivePatch< FaceList, PointField >::nEdges(), Foam::nl, PrimitivePatch< FaceList, PointField >::points(), List< T >::size(), and edge::start().
Referenced by searchableSurfaces::checkNormalOrientation().
|
static |
Fill faceZone with currentZone for every face reachable.
from facei without crossing edge marked in borderEdge. Note: faceZone has to be sized nFaces before calling.
Definition at line 37 of file PatchToolsSearch.C.
References Foam::abort(), List< T >::append(), PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::FatalError, FatalErrorInFunction, forAll, PatchTools::markZones(), List< T >::size(), and List< T >::transfer().
|
static |
Size and fills faceZone with zone of face.
Zone is area reachable by edge crossing without crossing borderEdge. Returns number of zones.
Referenced by searchableSurfaces::checkNormalOrientation(), PatchTools::markZone(), and NamedEnum< compressibleField, 8 >::names().
|
static |
Determine the mapping for a sub-patch.
Only include faces for which bool-list entry is true.
[in] | p | patch to be searched on |
[in] | includeFaces | faces to include |
[out] | pointMap | mapping new to old localPoints |
[out] | faceMap | mapping new to old faces |
Definition at line 137 of file PatchToolsSearch.C.
References PatchTools::calcBounds(), f(), forAll, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::nPoints(), List< T >::setSize(), and List< T >::size().
Referenced by PatchTools::markZones(), and UnsortedMeshedSurface< Face >::subsetMesh().
|
static |
Definition at line 186 of file PatchToolsSearch.C.
References f(), forAll, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), points, PrimitivePatch< FaceList, PointField >::points(), and List< T >::size().
Referenced by triSurfaceMesh::edgeTree(), PatchTools::subsetMap(), triSurfaceSearch::tree(), triSurfaceRegionSearch::treeByRegion(), and distributedTriSurfaceMesh::writeStats().
|
static |
Return edge-face addressing sorted by angle around the edge.
Orientation is anticlockwise looking from edge.vec(localPoints())
|
static |
Return point-edge addressing sorted by order around the point.
|
static |
If 2 face neighbours: label of face where ordering of edge.
is consistent with righthand walk. If 1 neighbour: label of only face. If >2 neighbours: undetermined.
|
static |
Find corresponding points on patches sharing the same points.
p1PointLabels : points on p1 that were matched p2PointLabels : corresponding points on p2
Definition at line 32 of file PatchToolsMatch.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::find(), forAll, PatchTools::matchEdges(), PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nPoints(), and List< T >::setSize().
|
static |
Find corresponding edges on patches sharing the same points.
p1EdgeLabels : edges on p1 that were matched p2EdgeLabels : corresponding edges on p2 sameOrientation : same orientation?
Definition at line 68 of file PatchToolsMatch.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), HashTable< T, Key, Hash >::find(), forAll, PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nEdges(), List< T >::setSize(), and PackedList< nBits >::setSize().
Referenced by createShellMesh::calcPointRegions(), and PatchTools::matchPoints().
|
static |
Return parallel consistent point normals for patches using mesh points.
Referenced by listPlusEqOp< T >::operator()(), and snappySnapDriver::repatchToSurface().
|
static |
Return parallel consistent edge normals for patches using mesh points.
Supply with patch matching info from matchEdges.
Referenced by PatchTools::pointNormals().
|
static |
Gather points and faces onto master and merge into single patch.
Note: uses faces/points, not localFaces/localPoints.
Definition at line 35 of file PatchToolsGatherAndMerge.C.
References forAll, Foam::inplaceRenumber(), Foam::mergePoints(), p, PrimitivePatch< FaceList, PointField >::points(), Foam::ListListOps::subSizes(), and List< T >::transfer().
Referenced by NamedEnum< compressibleField, 8 >::names(), and sampledSurfaces::update().
|
static |
Gather (mesh!) points and faces onto master and merge collocated.
points into a single patch. Uses coupled point mesh structure so does not need tolerances. On master and slave returns:
Definition at line 129 of file PatchToolsGatherAndMerge.C.
References forAll, polyMesh::globalData(), Foam::identity(), Foam::inplaceRenumber(), globalMeshData::mergePoints(), polyMesh::points(), autoPtr< T >::reset(), List< T >::setSize(), and List< T >::size().
Foam::labelList edgeOwner | ( | const PrimitivePatch< FaceList, PointField > & | p | ) |
Definition at line 32 of file PatchToolsEdgeOwner.C.
References Foam::abort(), PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), f(), Foam::FatalError, FatalErrorInFunction, forAll, PrimitivePatch< FaceList, PointField >::localFaces(), Foam::nl, and List< T >::size().
Foam::tmp<Foam::pointField> pointNormals | ( | const polyMesh & | mesh, |
const PrimitivePatch< FaceList, PointField > & | p | ||
) |
Definition at line 35 of file PatchToolsNormals.C.
References mapDistributeBase::constructSize(), globalMeshData::coupledPatch(), mapDistribute::distribute(), PatchTools::edgeNormals(), HashTableCore::end(), f(), PrimitivePatch< FaceList, PointField >::faceNormals(), HashTable< T, Key, Hash >::find(), forAll, polyMesh::globalData(), globalMeshData::globalPointSlaves(), globalMeshData::globalPointSlavesMap(), globalMeshData::globalPointTransformedSlaves(), globalMeshData::globalTransforms(), PrimitivePatch< FaceList, PointField >::localFaces(), Foam::mag(), PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), n, PrimitivePatch< FaceList, PointField >::nPoints(), pFaces, PrimitivePatch< FaceList, PointField >::pointFaces(), tmp< T >::ref(), mapDistribute::reverseDistribute(), List< T >::setSize(), List< T >::size(), Foam::sum(), Foam::transform(), transforms, and Foam::Zero.
Foam::tmp<Foam::pointField> edgeNormals | ( | const polyMesh & | mesh, |
const PrimitivePatch< FaceList, PointField > & | p, | ||
const labelList & | patchEdges, | ||
const labelList & | coupledEdges | ||
) |
Construct with all data in consistent orientation
Definition at line 190 of file PatchToolsNormals.C.
References mapDistributeBase::constructSize(), PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::faceNormals(), forAll, polyMesh::globalData(), globalMeshData::globalEdgeSlaves(), globalMeshData::globalEdgeSlavesMap(), globalMeshData::globalEdgeTransformedSlaves(), globalMeshData::globalTransforms(), Foam::mag(), PrimitivePatch< FaceList, PointField >::nEdges(), tmp< T >::ref(), globalMeshData::syncData(), and Foam::Zero.
Foam::label markZones | ( | const PrimitivePatch< FaceList, PointField > & | p, |
const BoolListType & | borderEdge, | ||
labelList & | faceZone | ||
) |
Definition at line 106 of file PatchToolsSearch.C.
References List< T >::setSize(), List< T >::size(), and PatchTools::subsetMap().
Foam::labelListList sortedEdgeFaces | ( | const PrimitivePatch< FaceList, PointField > & | p | ) |
Definition at line 34 of file PatchToolsSortEdges.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), f(), forAll, SortableList< T >::indices(), PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), Foam::max(), Foam::pseudoAngle(), List< T >::size(), SortableList< T >::sort(), edge::start(), and edge::vec().
Foam::labelListList sortedPointEdges | ( | const PrimitivePatch< FaceList, PointField > & | p | ) |
Definition at line 32 of file PatchToolsSortPoints.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), edge::end(), Foam::endl(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::findIndex(), forAll, Foam::nl, PrimitivePatch< FaceList, PointField >::pointEdges(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::setCapacity(), List< T >::size(), edge::start(), and WarningInFunction.