A list of faces which address into the list of points. More...
#include <OpenFOAM/PrimitivePatch_.H>
A list of faces which address into the list of points.
The class is templated on the face type (e.g. triangle, polygon etc.) and on the list type of faces and points so that it can refer to existing lists using UList and const pointField& or hold the storage using List and pointField.
Definition at line 88 of file PrimitivePatch_.H.
Public Types | |
enum | surfaceTopo { MANIFOLD, OPEN, ILLEGAL } |
Enumeration defining the surface type. Used in check routines. More... | |
typedef Face | FaceType |
typedef FaceList< Face > | FaceListType |
typedef PointField | PointFieldType |
Public Member Functions | |
PrimitivePatch (const FaceList< Face > &faces, const Field< PointType > &points) | |
Construct from components.
| |
PrimitivePatch (FaceList< Face > &faces, Field< PointType > &points, const bool reUse) | |
Construct from components, reuse storage.
| |
PrimitivePatch (const PrimitivePatch< Face, FaceList, PointField, PointType > &) | |
Construct as copy.
| |
virtual | ~PrimitivePatch () |
void | clearOut () |
void | clearGeom () |
void | clearTopology () |
void | clearPatchMeshAddr () |
const Field< PointType > & | points () const |
Return reference to global points.
| |
label | nPoints () const |
Return number of points supporting patch faces.
| |
label | nEdges () const |
Return number of edges in patch.
| |
const edgeList & | edges () const |
Return list of edges, address into LOCAL point list.
| |
label | nInternalEdges () const |
Number of internal edges.
| |
bool | isInternalEdge (const label edgeI) const |
Is internal edge?
| |
const labelList & | boundaryPoints () const |
Return list of boundary points,.
| |
const labelListList & | faceFaces () const |
Return face-face addressing.
| |
const labelListList & | edgeFaces () const |
Return edge-face addressing.
| |
const labelListList & | faceEdges () const |
Return face-edge addressing.
| |
const labelListList & | pointEdges () const |
Return point-edge addressing.
| |
const labelListList & | pointFaces () const |
Return point-face addressing.
| |
const List< Face > & | localFaces () const |
Return patch faces addressing into local point list.
| |
const labelList & | meshPoints () const |
Return labelList of mesh points in patch. They are constructed.
| |
const Map< label > & | meshPointMap () const |
Mesh point map. Given the global point index find its.
| |
const Field< PointType > & | localPoints () const |
Return pointField of points in patch.
| |
const labelList & | localPointOrder () const |
Return orders the local points for most efficient search.
| |
label | whichPoint (const label gp) const |
Given a global point index, return the local point index.
| |
label | whichEdge (const edge &) const |
Given an edge in local point labels, return its.
| |
labelList | meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const |
Return labels of patch edges in the global edge list using.
| |
labelList | meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const |
Return labels of patch edges in the global edge list using.
| |
const Field< PointType > & | faceCentres () const |
Return face centres for patch.
| |
const Field< PointType > & | faceNormals () const |
Return face normals for patch.
| |
const Field< PointType > & | pointNormals () const |
Return point normals for patch.
| |
template<class ToPatch > | |
List< objectHit > | projectPoints (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const |
Project vertices of patch onto another patch.
| |
template<class ToPatch > | |
List< objectHit > | projectFaceCentres (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const |
Project vertices of patch onto another patch.
| |
const labelListList & | edgeLoops () const |
Return list of closed loops of boundary vertices.
| |
surfaceTopo | surfaceType () const |
Calculate surface type formed by patch.
| |
bool | checkTopology (const bool report=false, labelHashSet *setPtr=NULL) const |
Check surface formed by patch for manifoldness (see above).
| |
bool | checkPointManifold (const bool report=false, labelHashSet *setPtr=NULL) const |
Checks primitivePatch for faces sharing point but not edge.
| |
virtual void | movePoints (const Field< PointType > &) |
Correct patch after moving points.
| |
void | operator= (const PrimitivePatch< Face, FaceList, PointField, PointType > &) |
Assignment.
|
typedef Face FaceType |
Definition at line 98 of file PrimitivePatch_.H.
typedef FaceList<Face> FaceListType |
Definition at line 99 of file PrimitivePatch_.H.
typedef PointField PointFieldType |
Definition at line 100 of file PrimitivePatch_.H.
enum surfaceTopo |
Enumeration defining the surface type. Used in check routines.
Definition at line 106 of file PrimitivePatch_.H.
PrimitivePatch | ( | const FaceList< Face > & | faces, |
const Field< PointType > & | points | ||
) |
Construct from components.
Definition at line 39 of file PrimitivePatch_.C.
PrimitivePatch | ( | FaceList< Face > & | faces, |
Field< PointType > & | points, | ||
const bool | reUse | ||
) |
Construct from components, reuse storage.
Definition at line 75 of file PrimitivePatch_.C.
PrimitivePatch | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | pp ) |
Construct as copy.
Definition at line 112 of file PrimitivePatch_.C.
~PrimitivePatch | ( | ) | [virtual]
|
Definition at line 149 of file PrimitivePatch_.C.
void clearOut | ( | ) |
Reimplemented in distributedTriSurfaceMesh, triSurfaceMesh, surfMesh, and triSurface.
Definition at line 132 of file PrimitivePatchClear.C.
Referenced by processorPolyPatch::updateMesh().
void clearGeom | ( | ) |
Reimplemented in surfMesh.
Definition at line 41 of file PrimitivePatchClear.C.
References Foam::deleteDemandDrivenData(), Foam::endl(), and Foam::Info.
void clearTopology | ( | ) |
Reimplemented in triSurface.
Definition at line 66 of file PrimitivePatchClear.C.
References Foam::deleteDemandDrivenData(), Foam::endl(), and Foam::Info.
void clearPatchMeshAddr | ( | ) |
Reimplemented in triSurface.
Definition at line 107 of file PrimitivePatchClear.C.
References Foam::deleteDemandDrivenData(), Foam::endl(), and Foam::Info.
const Field<PointType>& points | ( | ) | const [inline]
|
Return reference to global points.
Reimplemented in sampledIsoSurfaceCell, sampledPatch, sampledPlane, sampledTriSurfaceMesh, sampledThresholdCellFaces, and surfMesh.
Definition at line 279 of file PrimitivePatch_.H.
Referenced by booleanSurface::booleanSurface(), Foam::meshTools::calcBoxPointNormals(), triSurfaceTools::calcInterpolationWeights(), PatchTools::checkOrientation(), triSurfaceTools::classify(), distributedTriSurfaceMesh::distribute(), edgeIntersections::edgeIntersections(), distributedTriSurfaceMesh::getNormal(), processorPolyPatch::initOrder(), facePointPatch::localPoints(), octreeDataTriSurface::octreeDataTriSurface(), triSurface::operator=(), processorPolyPatch::order(), cyclicPolyPatch::order(), orientedSurface::orient(), orientedSurface::orientedSurface(), distributedTriSurfaceMesh::overlappingSurface(), sampledCuttingPlane::points(), sampledIsoSurface::points(), distanceSurface::points(), boundaryMesh::read(), addPatchCellLayer::setRefinement(), cellDistFuncs::smallestDist(), triSurfaceTools::surfaceNormal(), triSurfaceTools::surfaceSide(), triSurfaceTools::triangulate(), triSurfaceSearch::triSurfaceSearch(), sampledTriSurfaceMesh::update(), and surfaceLocation::write().
label nPoints | ( | ) | const [inline]
|
Return number of points supporting patch faces.
Reimplemented in surfMesh.
Definition at line 290 of file PrimitivePatch_.H.
Referenced by booleanSurface::booleanSurface(), Foam::meshTools::calcBoxPointNormals(), boundaryMesh::getNPoints(), autoSnapDriver::getZoneSurfacePoints(), triSurfaceTools::greenRefine(), triSurfaceTools::mergePoints(), addPatchCellLayer::setRefinement(), PatchTools::subsetMap(), surfaceIntersection::surfaceIntersection(), syncTools::syncPointList(), globalMeshData::updateMesh(), and AC3DsurfaceFormat< Face >::write().
label nEdges | ( | ) | const [inline]
|
Return number of edges in patch.
Definition at line 296 of file PrimitivePatch_.H.
Referenced by booleanSurface::booleanSurface(), addPatchCellLayer::calcMeshEdges(), PatchTools::checkOrientation(), triSurfaceTools::collapseEdges(), edgeIntersections::edgeIntersections(), edgeSurface::edgeSurface(), triSurfaceTools::greenRefine(), polyBoundaryMesh::neighbourEdges(), edgeIntersections::removeDegenerates(), addPatchCellLayer::setRefinement(), surfaceIntersection::surfaceIntersection(), and syncTools::syncEdgeList().
const Foam::edgeList & edges | ( | ) | const |
Return list of edges, address into LOCAL point list.
Definition at line 192 of file PrimitivePatch_.C.
Referenced by booleanSurface::booleanSurface(), addPatchCellLayer::calcMeshEdges(), autoSnapDriver::calcSnapDistance(), PatchTools::checkOrientation(), triSurfaceTools::collapseEdges(), PatchTools::edgeOwner(), edgeSurface::edgeSurface(), triSurfaceTools::getEdge(), combineFaces::getOutsideFace(), triSurfaceTools::getVertexTriangles(), triSurfaceTools::getVertexVertices(), triSurfaceTools::greenRefine(), triSurfaceTools::maxEdge(), triSurfaceTools::minEdge(), edgeIntersections::minEdgeLength(), slidingInterface::modifyMotionPoints(), PrimitivePatch< face,::Foam::List, pointField, point >::nEdges(), polyBoundaryMesh::neighbourEdges(), triSurfaceTools::oppositeEdge(), triSurfaceTools::oppositeVertex(), triSurfaceTools::otherEdges(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), PatchTools::sortedEdgeFaces(), surfaceIntersection::surfaceIntersection(), triSurfaceTools::surfaceSide(), syncTools::syncEdgeMap(), and surfaceLocation::write().
Foam::label nInternalEdges | ( | ) | const |
Number of internal edges.
Definition at line 212 of file PrimitivePatch_.C.
Referenced by combineFaces::getOutsideFace(), PrimitivePatch< face,::Foam::List, pointField, point >::isInternalEdge(), polyBoundaryMesh::neighbourEdges(), and addPatchCellLayer::setRefinement().
bool isInternalEdge | ( | const label | edgeI ) | const [inline]
|
Is internal edge?
Definition at line 308 of file PrimitivePatch_.H.
const Foam::labelList & boundaryPoints | ( | ) | const |
Return list of boundary points,.
address into LOCAL point list
Definition at line 232 of file PrimitivePatch_.C.
const Foam::labelListList & faceFaces | ( | ) | const |
Return face-face addressing.
Definition at line 252 of file PrimitivePatch_.C.
Referenced by cellDistFuncs::getPointNeighbours().
const Foam::labelListList & edgeFaces | ( | ) | const |
Return edge-face addressing.
Definition at line 272 of file PrimitivePatch_.C.
Referenced by booleanSurface::booleanSurface(), PatchTools::checkOrientation(), triSurfaceTools::collapseEdges(), PatchTools::edgeOwner(), triSurfaceTools::edgeSide(), edgeSurface::edgeSurface(), combineFaces::getOutsideFace(), triSurfaceTools::getTriangle(), triSurfaceTools::getVertexTriangles(), triSurfaceTools::greenRefine(), PatchTools::markZone(), surfaceLocation::normal(), triSurfaceTools::otherFace(), addPatchCellLayer::setRefinement(), PatchTools::sortedEdgeFaces(), surfaceIntersection::surfaceIntersection(), triSurfaceTools::surfaceNormal(), and triSurfaceTools::trackToEdge().
const Foam::labelListList & faceEdges | ( | ) | const |
Return face-edge addressing.
Definition at line 292 of file PrimitivePatch_.C.
Referenced by PatchTools::checkOrientation(), triSurfaceTools::classify(), combineFaces::getOutsideFace(), triSurfaceTools::getTriangle(), intersectedSurface::intersectedSurface(), PatchTools::markZone(), triSurfaceTools::oppositeEdge(), triSurfaceTools::otherEdges(), addPatchCellLayer::setRefinement(), triSurfaceTools::surfaceNormal(), and triSurfaceTools::surfaceSide().
const Foam::labelListList & pointEdges | ( | ) | const |
Return point-edge addressing.
Definition at line 312 of file PrimitivePatch_.C.
Referenced by autoSnapDriver::calcSnapDistance(), triSurfaceTools::getEdge(), triSurfaceTools::getVertexVertices(), edgeIntersections::minEdgeLength(), and triSurfaceTools::surfaceSide().
const Foam::labelListList & pointFaces | ( | ) | const |
Return point-face addressing.
Definition at line 332 of file PrimitivePatch_.C.
Referenced by Foam::meshTools::calcBoxPointNormals(), cellDistFuncs::correctBoundaryPointCells(), cellDistFuncs::getPointNeighbours(), triSurfaceTools::getVertexTriangles(), cyclicPolyPatch::order(), processorPointPatchField< Type >::swapAdd(), and triSurfaceTools::trackToEdge().
const Foam::List< Face > & localFaces | ( | ) | const |
Return patch faces addressing into local point list.
Definition at line 352 of file PrimitivePatch_.C.
Referenced by PatchTools::checkOrientation(), triSurfaceTools::classify(), triSurfaceTools::collapseEdges(), PatchTools::edgeOwner(), combineFaces::getOutsideFace(), cellDistFuncs::getPointNeighbours(), triSurfaceTools::greenRefine(), intersectedSurface::intersectedSurface(), triSurfaceTools::mergePoints(), meshTriangulation::meshTriangulation(), triSurfaceTools::oppositeVertex(), cyclicPolyPatch::order(), triSurfaceTools::otherEdges(), triSurfaceTools::otherVertices(), boundaryMesh::readTriSurface(), autoSnapDriver::repatchToSurface(), addPatchCellLayer::setRefinement(), PatchTools::sortedEdgeFaces(), PatchTools::subsetMap(), triSurfaceTools::surfaceNormal(), triSurfaceTools::surfaceSide(), triSurfaceTools::triangulateFaceCentre(), boundaryMesh::triangulateLocal(), sampledPatch::update(), and AC3DsurfaceFormat< Face >::write().
const Foam::labelList & meshPoints | ( | ) | const |
Return labelList of mesh points in patch. They are constructed.
walking through the faces in incremental order and not sorted anymore.
Definition at line 372 of file PrimitivePatch_.C.
Referenced by Foam::meshTools::calcBoxPointNormals(), addPatchCellLayer::calcMeshEdges(), autoSnapDriver::calcNearestSurface(), autoSnapDriver::calcSnapDistance(), inversePointDistanceDiffusivity::correct(), cellDistFuncs::correctBoundaryPointCells(), syncTools::getMasterPoints(), combineFaces::getOutsideFace(), localPointRegion::localPointRegion(), facePointPatch::meshPoints(), polyBoundaryMesh::neighbourEdges(), PrimitivePatch< face,::Foam::List, pointField, point >::nPoints(), orientedSurface::orientedSurface(), motionSmoother::setDisplacement(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), autoSnapDriver::smoothDisplacement(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), boundaryMesh::triangulateLocal(), triSurfaceSearch::triSurfaceSearch(), and globalMeshData::updateMesh().
const Foam::Map< Foam::label > & meshPointMap | ( | ) | const |
Mesh point map. Given the global point index find its.
location in the patch
Definition at line 392 of file PrimitivePatch_.C.
Referenced by autoSnapDriver::getZoneSurfacePoints().
const Foam::Field< PointType > & localPoints | ( | ) | const |
Return pointField of points in patch.
Definition at line 412 of file PrimitivePatch_.C.
Referenced by booleanSurface::booleanSurface(), autoSnapDriver::calcNearestSurface(), autoSnapDriver::calcSnapDistance(), PatchTools::checkOrientation(), triSurfaceTools::collapseEdges(), edgeSurface::edgeSurface(), triSurfaceTools::greenRefine(), facePointPatch::localPoints(), triSurfaceTools::maxEdge(), triSurfaceTools::mergePoints(), meshTriangulation::meshTriangulation(), triSurfaceTools::minEdge(), edgeIntersections::minEdgeLength(), slidingInterface::modifyMotionPoints(), polyBoundaryMesh::neighbourEdges(), boundaryMesh::readTriSurface(), perfectInterface::setRefinement(), autoSnapDriver::smoothDisplacement(), PatchTools::sortedEdgeFaces(), surfaceIntersection::surfaceIntersection(), triSurfaceTools::surfaceSide(), triSurfaceTools::triangulateFaceCentre(), boundaryMesh::triangulateLocal(), sampledPatch::update(), globalMeshData::updateMesh(), AC3DsurfaceFormat< Face >::write(), surfaceLocation::write(), and triSurfaceTools::writeOBJ().
const Foam::labelList & localPointOrder | ( | ) | const |
Return orders the local points for most efficient search.
Definition at line 432 of file PrimitivePatch_.C.
Foam::label whichPoint | ( | const label | gp ) | const |
Given a global point index, return the local point index.
If the point is not found, return -1
Definition at line 453 of file PrimitivePatch_.C.
References HashTable< T, Key, Hash >::find().
Referenced by slidingInterface::modifyMotionPoints().
Foam::label whichEdge | ( | const edge & | e ) | const |
Given an edge in local point labels, return its.
index in the edge list. If the edge is not found, return -1
Definition at line 175 of file PrimitivePatchMeshEdges.C.
References forAll, nPoints, and edge::start().
Referenced by slidingInterface::modifyMotionPoints().
Foam::labelList meshEdges | ( | const edgeList & | allEdges, |
const labelListList & | cellEdges, | ||
const labelList & | faceCells | ||
) | const |
Return labels of patch edges in the global edge list using.
cell addressing
Definition at line 41 of file PrimitivePatchMeshEdges.C.
References Foam::endl(), forAll, Foam::Info, and List< T >::size().
Referenced by polyPatch::meshEdges().
Foam::labelList meshEdges | ( | const edgeList & | allEdges, |
const labelListList & | pointEdges | ||
) | const |
Return labels of patch edges in the global edge list using.
basic edge addressing.
Definition at line 118 of file PrimitivePatchMeshEdges.C.
References Foam::endl(), forAll, Foam::Info, and List< T >::size().
const Foam::Field< PointType > & faceCentres | ( | ) | const |
Return face centres for patch.
Reimplemented in polyPatch.
Definition at line 480 of file PrimitivePatch_.C.
const Foam::Field< PointType > & faceNormals | ( | ) | const |
Return face normals for patch.
Definition at line 500 of file PrimitivePatch_.C.
Referenced by Foam::meshTools::calcBoxPointNormals(), PatchTools::checkOrientation(), directions::directions(), triSurfaceTools::edgeSide(), intersectedSurface::intersectedSurface(), surfaceLocation::normal(), removeFaces::setRefinement(), triSurfaceTools::surfaceNormal(), triSurfaceTools::surfaceSide(), and wallLayerCells::wallLayerCells().
const Foam::Field< PointType > & pointNormals | ( | ) | const |
Return point normals for patch.
Definition at line 520 of file PrimitivePatch_.C.
Referenced by Foam::meshTools::calcBoxPointNormals(), slidingInterface::modifyMotionPoints(), surfaceLocation::normal(), facePointPatch::pointNormals(), and triSurfaceTools::surfaceNormal().
Foam::List< Foam::objectHit > projectPoints | ( | const ToPatch & | targetPatch, |
const Field< PointType > & | projectionDirection, | ||
const intersection::algorithm | alg = intersection::FULL_RAY ,
|
||
const intersection::direction | dir = intersection::VECTOR
|
||
) | const |
Project vertices of patch onto another patch.
Definition at line 48 of file PrimitivePatchProjectPoints.C.
References Foam::abort(), Foam::fvc::average(), PointHit< Point >::distance(), PointHit< Point >::eligibleMiss(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, PointHit< Point >::hit(), Foam::Info, Foam::mag(), magSqr(), PointHit< Point >::missPoint(), Foam::nl, nPoints, points, and List< T >::size().
Foam::List< Foam::objectHit > projectFaceCentres | ( | const ToPatch & | targetPatch, |
const Field< PointType > & | projectionDirection, | ||
const intersection::algorithm | alg = intersection::FULL_RAY ,
|
||
const intersection::direction | dir = intersection::VECTOR
|
||
) | const |
Project vertices of patch onto another patch.
Definition at line 295 of file PrimitivePatchProjectPoints.C.
References Foam::abort(), Foam::bandCompression(), PointHit< Point >::distance(), PointHit< Point >::eligibleMiss(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, PointHit< Point >::hit(), Foam::Info, Foam::mag(), magSqr(), PointHit< Point >::missPoint(), Foam::nl, points, and List< T >::size().
const Foam::labelListList & edgeLoops | ( | ) | const |
Return list of closed loops of boundary vertices.
Edge loops are given as ordered lists of vertices in local addressing
Definition at line 176 of file PrimitivePatchEdgeLoops.C.
Referenced by combineFaces::getOutsideFace().
Foam::PrimitivePatch< Face, FaceList, PointField, PointType >::surfaceTopo surfaceType | ( | ) | const |
Calculate surface type formed by patch.
some edges have more than two neighbours (illegal)
Definition at line 123 of file PrimitivePatchCheck.C.
References Foam::endl(), forAll, Foam::Info, and List< T >::size().
bool checkTopology | ( | const bool | report = false ,
|
labelHashSet * | setPtr = NULL
|
||
) | const |
Check surface formed by patch for manifoldness (see above).
Return true if any incorrect edges are found. Insert vertices of incorrect edges into set.
Definition at line 177 of file PrimitivePatchCheck.C.
References edge::end(), Foam::endl(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), List< T >::size(), and edge::start().
bool checkPointManifold | ( | const bool | report = false ,
|
labelHashSet * | setPtr = NULL
|
||
) | const |
Checks primitivePatch for faces sharing point but not edge.
This denotes a surface that is pinched at a single point (test for pinched at single edge is already in PrimitivePatch) Returns true if this situation found and puts conflicting (mesh)point in set. Based on all the checking routines in primitiveMesh.
Definition at line 247 of file PrimitivePatchCheck.C.
References Foam::endl(), Foam::findIndex(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::nl, and List< T >::size().
void movePoints | ( | const Field< PointType > & | ) | [virtual]
|
Correct patch after moving points.
Definition at line 167 of file PrimitivePatch_.C.
References Foam::endl(), and Foam::Pout.
void operator= | ( | const PrimitivePatch< Face, FaceList, PointField, PointType > & | pp ) |