A collection of tools for searching, sorting PrimitivePatch information. More...
#include <OpenFOAM/PatchTools.H>
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 56 of file PatchTools.H.
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.
| |
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.
| |
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.
| |
template<class BoolListType , class Face , template< class > class FaceList, class PointField , class PointType > | |
static void | subsetMap (const PrimitivePatch< Face, FaceList, PointField, PointType > &, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap) |
Determine the mapping for a sub-patch.
| |
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.
| |
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.
|
bool checkOrientation | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, |
const bool | report = false ,
|
||
labelHashSet * | marked = 0
|
||
) | [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 40 of file PatchToolsCheck.C.
References e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), edge::end(), Foam::endl(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), List< T >::size(), and edge::start().
void markZone | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, |
const BoolListType & | borderEdge, | ||
const label | faceI, | ||
const label | currentZone, | ||
labelList & | faceZone | ||
) | [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 46 of file PatchToolsSearch.C.
References Foam::abort(), List< T >::append(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), Foam::FatalError, FatalErrorIn, forAll, List< T >::size(), and List< T >::transfer().
Foam::label markZones | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, |
const BoolListType & | borderEdge, | ||
labelList & | faceZone | ||
) | [static]
|
Size and fills faceZone with zone of face.
Zone is area reachable by edge crossing without crossing borderEdge. Returns number of zones.
Definition at line 130 of file PatchToolsSearch.C.
References List< T >::setSize(), and List< T >::size().
void subsetMap | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p, |
const BoolListType & | includeFaces, | ||
labelList & | pointMap, | ||
labelList & | faceMap | ||
) | [static]
|
Determine the mapping for a sub-patch.
Only include faces for which bool-list entry is true.
[in] | includeFaces | faces to include |
[out] | pointMap | mapping new to old localPoints |
[out] | faceMap | mapping new to old faces |
Definition at line 173 of file PatchToolsSearch.C.
References f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), List< T >::setSize(), and List< T >::size().
Referenced by UnsortedMeshedSurface< Face >::subsetMesh(), and MeshedSurface< Face >::subsetMesh().
Foam::labelListList sortedEdgeFaces | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p ) | [static]
|
Return edge-face addressing sorted by angle around the edge.
Orientation is anticlockwise looking from edge.vec(localPoints())
Definition at line 42 of file PatchToolsSortEdges.C.
References e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), f(), FixedList< T, Size >::fcIndex(), Foam::findIndex(), forAll, SortableList< T >::indices(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), Foam::pseudoAngle(), List< T >::size(), SortableList< T >::sort(), edge::start(), and edge::vec().
Foam::labelList edgeOwner | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | p ) | [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.
Definition at line 40 of file PatchToolsEdgeOwner.C.
References Foam::abort(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), f(), Foam::FatalError, FatalErrorIn, forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), Foam::nl, and List< T >::size().