A collection of tools for searching, sorting PrimitivePatch information. More...
Public Member Functions | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::labelList | edgeOwner (const PrimitivePatch< Face, FaceList, PointField, PointType > &p) |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::tmp< Foam::pointField > | pointNormals (const polyMesh &mesh, const PrimitivePatch< Face, FaceList, PointField, PointType > &p) |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::tmp< Foam::pointField > | edgeNormals (const polyMesh &mesh, const PrimitivePatch< Face, FaceList, PointField, PointType > &p, const labelList &patchEdges, const labelList &coupledEdges) |
template<class BoolListType , class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::label | markZones (const PrimitivePatch< Face, FaceList, PointField, PointType > &p, const BoolListType &borderEdge, labelList &faceZone) |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::labelListList | sortedEdgeFaces (const PrimitivePatch< Face, FaceList, PointField, PointType > &p) |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
Foam::labelListList | sortedPointEdges (const PrimitivePatch< Face, FaceList, PointField, PointType > &p) |
Static Public Member Functions | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static bool | checkOrientation (const PrimitivePatch< Face, FaceList, PointField, PointType > &, const bool report=false, labelHashSet *marked=0) |
Check for orientation issues. More... | |
template<class BoolListType , class Face , template< class > class FaceList, class PointField , class PointType > | |
static void | markZone (const PrimitivePatch< Face, FaceList, PointField, PointType > &, const BoolListType &borderEdge, const label facei, const label currentZone, labelList &faceZone) |
Fill faceZone with currentZone for every face reachable. More... | |
template<class BoolListType , class Face , template< class > class FaceList, class PointField , class PointType > | |
static label | markZones (const PrimitivePatch< Face, FaceList, PointField, PointType > &, const BoolListType &borderEdge, labelList &faceZone) |
Size and fills faceZone with zone of face. More... | |
template<class BoolListType , class Face , template< class > class FaceList, class PointField , class PointType > | |
static void | subsetMap (const PrimitivePatch< Face, FaceList, PointField, PointType > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap) |
Determine the mapping for a sub-patch. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static void | calcBounds (const PrimitivePatch< Face, FaceList, PointField, PointType > &p, boundBox &bb, label &nPoints) |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static labelListList | sortedEdgeFaces (const PrimitivePatch< Face, FaceList, PointField, PointType > &) |
Return edge-face addressing sorted by angle around the edge. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static labelListList | sortedPointEdges (const PrimitivePatch< Face, FaceList, PointField, PointType > &) |
Return point-edge addressing sorted by order around the point. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static labelList | edgeOwner (const PrimitivePatch< Face, FaceList, PointField, PointType > &) |
If 2 face neighbours: label of face where ordering of edge. More... | |
template<class Face1 , template< class > class FaceList1, class PointField1 , class PointType1 , class Face2 , template< class > class FaceList2, class PointField2 , class PointType2 > | |
static void | matchPoints (const PrimitivePatch< Face1, FaceList1, PointField1, PointType1 > &p1, const PrimitivePatch< Face2, FaceList2, PointField2, PointType2 > &p2, labelList &p1PointLabels, labelList &p2PointLabels) |
Find corresponding points on patches sharing the same points. More... | |
template<class Face1 , template< class > class FaceList1, class PointField1 , class PointType1 , class Face2 , template< class > class FaceList2, class PointField2 , class PointType2 > | |
static void | matchEdges (const PrimitivePatch< Face1, FaceList1, PointField1, PointType1 > &p1, const PrimitivePatch< Face2, FaceList2, PointField2, PointType2 > &p2, labelList &p1EdgeLabels, labelList &p2EdgeLabels, bitSet &sameOrientation) |
Find corresponding edges on patches sharing the same points. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static tmp< pointField > | pointNormals (const polyMesh &, const PrimitivePatch< Face, FaceList, PointField, PointType > &) |
Return parallel consistent point normals for patches using mesh points. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static tmp< pointField > | edgeNormals (const polyMesh &, const PrimitivePatch< Face, FaceList, PointField, PointType > &, const labelList &patchEdges, const labelList &coupledEdges) |
Return parallel consistent edge normals for patches using mesh points. More... | |
template<class Face , template< class > class FaceList, class PointField , class PointType > | |
static void | gatherAndMerge (const scalar mergeDist, const PrimitivePatch< Face, FaceList, PointField, PointType > &p, Field< PointType > &mergedPoints, List< Face > &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 68 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 42 of file PatchToolsCheck.C.
References Foam::constant::electromagnetic::e, Foam::endl(), f(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::nl, p, and p0.
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 47 of file PatchToolsSearch.C.
References Foam::abort(), List< T >::append(), Foam::FatalError, FatalErrorInFunction, forAll, p, 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().
|
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 165 of file PatchToolsSearch.C.
References List< T >::clear(), Foam::faceMap(), forAll, and p.
Referenced by UnsortedMeshedSurface< Face >::subsetMesh().
|
static |
Definition at line 207 of file PatchToolsSearch.C.
References boundBox::add(), f(), nPoints, p, and points.
Referenced by triSurfaceMesh::edgeTree(), 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 45 of file PatchToolsMatch.C.
References forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::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 88 of file PatchToolsMatch.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, edge::insert(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), bitSet::set(), List< T >::setSize(), and PackedList< Width >::setSize().
Referenced by addPatchCellLayer::calcExtrudeInfo(), and createShellMesh::calcPointRegions().
|
static |
Return parallel consistent point normals for patches using mesh points.
|
static |
Return parallel consistent edge normals for patches using mesh points.
Supply with patch matching info from matchEdges.
|
static |
Gather points and faces onto master and merge into single patch.
Note: uses faces/points, not localFaces/localPoints.
Definition at line 44 of file PatchToolsGatherAndMerge.C.
References forAll, globalIndex::gather(), Foam::inplaceRenumber(), Foam::mergePoints(), p, and List< T >::transfer().
Referenced by mergedSurf::merge(), shortestPathSet::shortestPathSet(), and AMIWeights::writeWeightField().
|
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 120 of file PatchToolsGatherAndMerge.C.
References forAll, Foam::identity(), Foam::inplaceRenumber(), mesh, autoPtr< T >::reset(), and List< T >::setSize().
Foam::labelList edgeOwner | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p | ) |
Definition at line 42 of file PatchToolsEdgeOwner.C.
References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, and p.
Foam::tmp<Foam::pointField> pointNormals | ( | const polyMesh & | mesh, |
const PrimitivePatch< Face, FaceList, PointField, PointType > & | p | ||
) |
Definition at line 46 of file PatchToolsNormals.C.
References mapDistributeBase::constructSize(), globalMeshData::coupledPatch(), mapDistribute::distribute(), f(), faceNormals(), forAll, globalMeshData::globalPointSlaves(), globalMeshData::globalPointSlavesMap(), globalMeshData::globalPointTransformedSlaves(), globalMeshData::globalTransforms(), Foam::mag(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), n, p, pFaces, tmp< T >::ref(), mapDistribute::reverseDistribute(), List< T >::setSize(), Foam::sum(), Foam::transform(), and Foam::Zero.
Foam::tmp<Foam::pointField> edgeNormals | ( | const polyMesh & | mesh, |
const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, | ||
const labelList & | patchEdges, | ||
const labelList & | coupledEdges | ||
) |
Construct with all data in consistent orientation
Definition at line 209 of file PatchToolsNormals.C.
References mapDistributeBase::constructSize(), faceNormals(), forAll, globalMeshData::globalEdgeSlaves(), globalMeshData::globalEdgeSlavesMap(), globalMeshData::globalEdgeTransformedSlaves(), globalMeshData::globalTransforms(), Foam::mag(), mesh, p, tmp< T >::ref(), globalMeshData::syncData(), Foam::transform(), and Foam::Zero.
Foam::label markZones | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, |
const BoolListType & | borderEdge, | ||
labelList & | faceZone | ||
) |
Definition at line 125 of file PatchToolsSearch.C.
References p, and List< T >::setSize().
Foam::labelListList sortedEdgeFaces | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p | ) |
Definition at line 44 of file PatchToolsSortEdges.C.
References Foam::constant::electromagnetic::e, f(), forAll, SortableList< T >::indices(), Foam::mag(), Foam::max(), Foam::normalised(), p, Foam::pseudoAngle(), and SortableList< T >::sort().
Foam::labelListList sortedPointEdges | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p | ) |
Definition at line 42 of file PatchToolsSortPoints.C.
References DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), edge::end(), Foam::endl(), forAll, Foam::nl, p, DynamicList< T, SizeMin >::setCapacity(), edge::start(), and WarningInFunction.