PrimitivePatch< FaceList, PointField > Class Template Reference

A list of faces which address into the list of points. More...

Inheritance diagram for PrimitivePatch< FaceList, PointField >:
[legend]
Collaboration diagram for PrimitivePatch< FaceList, PointField >:
[legend]

Public Types

enum  surfaceTopo { MANIFOLD, OPEN, ILLEGAL }
 Enumeration defining the surface type. Used in check routines. More...
 
typedef std::remove_reference< FaceList >::type::value_type face_type
 The face type. More...
 
typedef std::remove_reference< PointField >::type::value_type point_type
 The point type. More...
 
typedef FaceList FaceListType
 The face list type. More...
 
typedef PointField PointFieldType
 The point field type. More...
 
typedef face_type FaceType
 Deprecated(2020-03) prefer face_type typedef. More...
 

Public Member Functions

 PrimitivePatch (const FaceList &faces, const PointField &points)
 Construct from components. More...
 
 PrimitivePatch (FaceList &&faces, const PointField &points)
 Construct from components, transferring faces. More...
 
 PrimitivePatch (FaceList &faces, PointField &points, const bool reuse)
 Construct from components, reuse storage. More...
 
 PrimitivePatch (const PrimitivePatch< FaceList, PointField > &pp)
 Copy construct. More...
 
virtual ~PrimitivePatch ()
 Destructor. More...
 
void clearOut ()
 
void clearGeom ()
 
void clearTopology ()
 
void clearPatchMeshAddr ()
 
void swap (PrimitivePatch &)=delete
 Suppress direct swapping, since storage containers may be const. More...
 
const Field< point_type > & points () const
 Return reference to global points. More...
 
label nPoints () const
 Return number of points supporting patch faces. More...
 
label nEdges () const
 Return number of edges in patch. More...
 
const edgeListedges () const
 Return list of edges, address into LOCAL point list. More...
 
label nInternalEdges () const
 Number of internal edges. More...
 
bool isInternalEdge (const label edgei) const
 Is internal edge? More...
 
const labelListboundaryPoints () const
 Return list of boundary points, address into LOCAL point list. More...
 
const labelListListfaceFaces () const
 Return face-face addressing. More...
 
const labelListListedgeFaces () const
 Return edge-face addressing. More...
 
const labelListListfaceEdges () const
 Return face-edge addressing. More...
 
const labelListListpointEdges () const
 Return point-edge addressing. More...
 
const labelListListpointFaces () const
 Return point-face addressing. More...
 
const List< face_type > & localFaces () const
 Return patch faces addressing into local point list. More...
 
const labelListmeshPoints () const
 Return labelList of mesh points in patch. More...
 
const Map< label > & meshPointMap () const
 Mesh point map. More...
 
const Field< point_type > & localPoints () const
 Return pointField of points in patch. More...
 
const labelListlocalPointOrder () const
 Return orders the local points for most efficient search. More...
 
label whichPoint (const label gp) const
 Given a global point index, return the local point index. More...
 
label whichEdge (const edge &) const
 
labelList meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
 
labelList meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const
 
const Field< point_type > & faceCentres () const
 Return face centres for patch. More...
 
const Field< point_type > & faceAreas () const
 Return face area vectors for patch. More...
 
const Field< scalar > & magFaceAreas () const
 Return face area magnitudes for patch. More...
 
const Field< point_type > & faceNormals () const
 Return face unit normals for patch. More...
 
const Field< point_type > & pointNormals () const
 Return point normals for patch. More...
 
bool hasFaceAreas () const
 
bool hasFaceCentres () const
 
bool hasFaceNormals () const
 
bool hasPointNormals () const
 
template<class ToPatch >
List< objectHitprojectPoints (const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
template<class ToPatch >
List< objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
const labelListListedgeLoops () const
 Return list of closed loops of boundary vertices. More...
 
surfaceTopo surfaceType () const
 Calculate surface type formed by patch. More...
 
bool checkTopology (const bool report=false, labelHashSet *setPtr=nullptr) const
 Check surface formed by patch for manifoldness (see above). More...
 
bool checkPointManifold (const bool report=false, labelHashSet *setPtr=nullptr) const
 Checks primitivePatch for faces sharing point but not edge. More...
 
virtual void movePoints (const Field< point_type > &)
 Correct patch after moving points. More...
 
void operator= (const PrimitivePatch< FaceList, PointField > &rhs)
 Copy assign faces. Leave points alone (could be a reference). More...
 
void operator= (PrimitivePatch< FaceList, PointField > &&rhs)
 Move assign faces. Leave points alone (could be a reference). More...
 
template<class ToPatch >
Foam::List< Foam::objectHitprojectPoints (const ToPatch &targetPatch, const Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
 
template<class ToPatch >
Foam::List< Foam::objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
 

Detailed Description

template<class FaceList, class PointField>
class Foam::PrimitivePatch< FaceList, PointField >

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.

Source files

Definition at line 85 of file PrimitivePatch.H.

Member Typedef Documentation

◆ face_type

typedef std::remove_reference<FaceList>::type::value_type face_type

The face type.

Definition at line 96 of file PrimitivePatch.H.

◆ point_type

typedef std::remove_reference<PointField>::type::value_type point_type

The point type.

Definition at line 100 of file PrimitivePatch.H.

◆ FaceListType

typedef FaceList FaceListType

The face list type.

Definition at line 103 of file PrimitivePatch.H.

◆ PointFieldType

typedef PointField PointFieldType

The point field type.

Definition at line 106 of file PrimitivePatch.H.

◆ FaceType

Deprecated(2020-03) prefer face_type typedef.

Deprecated:
(2020-03) prefer face_type typedef

Definition at line 110 of file PrimitivePatch.H.

Member Enumeration Documentation

◆ surfaceTopo

Enumeration defining the surface type. Used in check routines.

Enumerator
MANIFOLD 
OPEN 
ILLEGAL 

Definition at line 116 of file PrimitivePatch.H.

Constructor & Destructor Documentation

◆ PrimitivePatch() [1/4]

PrimitivePatch ( const FaceList &  faces,
const PointField &  points 
)

Construct from components.

Definition at line 35 of file PrimitivePatch.C.

◆ PrimitivePatch() [2/4]

PrimitivePatch ( FaceList &&  faces,
const PointField &  points 
)

Construct from components, transferring faces.

Definition at line 66 of file PrimitivePatch.C.

◆ PrimitivePatch() [3/4]

PrimitivePatch ( FaceList &  faces,
PointField &  points,
const bool  reuse 
)

Construct from components, reuse storage.

Definition at line 97 of file PrimitivePatch.C.

◆ PrimitivePatch() [4/4]

PrimitivePatch ( const PrimitivePatch< FaceList, PointField > &  pp)

Copy construct.

Definition at line 129 of file PrimitivePatch.C.

◆ ~PrimitivePatch()

virtual ~PrimitivePatch ( )
virtual

Destructor.

Member Function Documentation

◆ clearOut()

void clearOut ( )

Definition at line 85 of file PrimitivePatchClear.C.

Referenced by processorPolyPatch::updateMesh().

Here is the caller graph for this function:

◆ clearGeom()

void clearGeom ( )

Definition at line 35 of file PrimitivePatchClear.C.

Referenced by polyPatch::clearGeom(), and polyPatch::updateMesh().

Here is the caller graph for this function:

◆ clearTopology()

void clearTopology ( )

Definition at line 50 of file PrimitivePatchClear.C.

Referenced by polyPatch::clearAddressing().

Here is the caller graph for this function:

◆ clearPatchMeshAddr()

void clearPatchMeshAddr ( )

Definition at line 73 of file PrimitivePatchClear.C.

Referenced by polyPatch::clearAddressing().

Here is the caller graph for this function:

◆ swap()

void swap ( PrimitivePatch< FaceList, PointField > &  )
delete

Suppress direct swapping, since storage containers may be const.

◆ points()

const Field<point_type>& points ( ) const
inline

Return reference to global points.

Definition at line 305 of file PrimitivePatch.H.

Referenced by booleanSurface::booleanSurface(), Foam::meshTools::calcBoxPointNormals(), addPatchCellLayer::calcExtrudeInfo(), cyclicPolyPatch::calcTransforms(), cyclicAMIPolyPatch::calcTransforms(), AMIInterpolation::calculate(), triSurfaceTools::curvatures(), distributedTriSurfaceMesh::distribute(), Foam::drawHitProblem(), edgeIntersections::edgeIntersections(), Foam::edgeMeshTools::featureProximity(), patchProbes::findElements(), mappedPatchBase::findLocalSamples(), processorPolyPatch::initOrder(), cyclicPolyPatch::initOrder(), trackingInverseDistance::markBoundaries(), inverseDistance::markBoundaries(), momentOfInertia::massPropertiesPatch(), momentOfInertia::massPropertiesShell(), momentOfInertia::massPropertiesSolid(), offsetSurface::operator()(), triSurface::operator=(), oldCyclicPolyPatch::order(), processorPolyPatch::order(), cyclicPolyPatch::order(), orientedSurface::orientedSurface(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), boundaryMesh::read(), refinementSurfaces::setMinLevelFields(), addPatchCellLayer::setRefinement(), AMIInterpolation::srcPointFace(), MeshedSurface< Foam::face >::storedPoints(), triSurfaceTools::surfaceNormal(), triSurfaceTools::surfaceSide(), AMIInterpolation::tgtPointFace(), triSurfaceSearch::tree(), triSurfaceMeshPointSet::triSurfaceMeshPointSet(), triSurfaceTools::validTri(), triSurfaceTools::vertexNormals(), triSurfaceTools::vertexTriads(), and interfaceTrackingFvMesh::writeVTK().

Here is the caller graph for this function:

◆ nPoints()

◆ nEdges()

◆ edges()

◆ nInternalEdges()

Foam::label nInternalEdges ( ) const

Number of internal edges.

Definition at line 203 of file PrimitivePatch.C.

Referenced by patchPatchDist::correct(), faMesh::faMesh(), combineFaces::getOutsideFace(), PrimitivePatch<::Foam::List< labelledTri >, pointField >::isInternalEdge(), polyBoundaryMesh::neighbourEdges(), addPatchCellLayer::setRefinement(), and faMesh::updateMesh().

Here is the caller graph for this function:

◆ isInternalEdge()

bool isInternalEdge ( const label  edgei) const
inline

Is internal edge?

Definition at line 334 of file PrimitivePatch.H.

◆ boundaryPoints()

const Foam::labelList & boundaryPoints ( ) const

Return list of boundary points, address into LOCAL point list.

Definition at line 216 of file PrimitivePatch.C.

◆ faceFaces()

const Foam::labelListList & faceFaces ( ) const

Return face-face addressing.

Definition at line 229 of file PrimitivePatch.C.

Referenced by triSurfaceTools::validTri().

Here is the caller graph for this function:

◆ edgeFaces()

◆ faceEdges()

const Foam::labelListList & faceEdges ( ) const

Return face-edge addressing.

Definition at line 255 of file PrimitivePatch.C.

Referenced by cyclicPolyPatch::coupledEdges(), combineFaces::getOutsideFace(), triSurfaceTools::getTriangle(), intersectedSurface::intersectedSurface(), triSurfaceTools::oppositeEdge(), triSurfaceTools::otherEdges(), addPatchCellLayer::setRefinement(), triSurfaceTools::surfaceNormal(), and triSurfaceTools::surfaceSide().

Here is the caller graph for this function:

◆ pointEdges()

const Foam::labelListList & pointEdges ( ) const

Return point-edge addressing.

Definition at line 268 of file PrimitivePatch.C.

Referenced by snappySnapDriver::calcSnapDistance(), triSurfaceTools::getEdge(), triSurfaceTools::getVertexVertices(), edgeIntersections::minEdgeLength(), and triSurfaceTools::surfaceSide().

Here is the caller graph for this function:

◆ pointFaces()

const Foam::labelListList & pointFaces ( ) const

Return point-face addressing.

Definition at line 281 of file PrimitivePatch.C.

Referenced by snappySnapDriver::avgCellCentres(), Foam::meshTools::calcBoxPointNormals(), triSurfaceTools::getVertexTriangles(), oldCyclicPolyPatch::order(), and triSurfaceTools::vertexNormals().

Here is the caller graph for this function:

◆ localFaces()

◆ meshPoints()

const Foam::labelList & meshPoints ( ) const

Return labelList of mesh points in patch.

They are constructed by walking through the faces in incremental order and not sorted anymore.

Definition at line 310 of file PrimitivePatch.C.

Referenced by snappySnapDriver::avgCellCentres(), Foam::meshTools::calcBoxPointNormals(), addPatchCellLayer::calcExtrudeInfo(), snappySnapDriver::calcNearestSurface(), snappySnapDriver::calcSnapDistance(), patchPatchDist::correct(), cyclicPolyPatch::coupledEdges(), triSurfaceTools::curvatures(), snappySnapDriver::detectNearSurfaces(), mappedPatchBase::findLocalSamples(), combineFaces::getOutsideFace(), globalIndexAndTransform::globalIndexAndTransform(), globalPoints::globalPoints(), localPointRegion::localPointRegion(), processorFaPatch::makeNonGlobalPatchPoints(), PatchTools::matchEdges(), PatchTools::matchPoints(), globalMeshData::mergePoints(), facePointPatch::meshPoints(), fieldSmoother::minSmoothField(), polyBoundaryMesh::neighbourEdges(), PrimitivePatch<::Foam::List< labelledTri >, pointField >::nPoints(), orientedSurface::orientedSurface(), motionSmootherAlgo::setDisplacement(), perfectInterface::setRefinement(), addPatchCellLayer::setRefinement(), snappySnapDriver::smoothDisplacement(), fieldSmoother::smoothPatchNormals(), syncTools::syncEdgeMap(), globalMeshData::syncPointData(), syncTools::syncPointList(), syncTools::syncPointMap(), pointConstraints::syncUntransformedData(), ensightFaces::uniqueMeshPoints(), triSurfaceTools::vertexNormals(), ensightFaces::write(), and AMIWeights::writeWeightField().

Here is the caller graph for this function:

◆ meshPointMap()

const Foam::Map< Foam::label > & meshPointMap ( ) const

Mesh point map.

Given the global point index find its location in the patch

Definition at line 323 of file PrimitivePatch.C.

Referenced by triSurfaceTools::curvatures(), snappySnapDriver::getFacePoints(), globalPoints::globalPoints(), PatchTools::matchPoints(), globalMeshData::mergePoints(), PatchTools::pointNormals(), syncTools::syncPointList(), ensightFaces::uniqueMeshPoints(), triSurfaceTools::vertexTriads(), ensightFaces::write(), and AMIWeights::writeWeightField().

Here is the caller graph for this function:

◆ localPoints()

◆ localPointOrder()

const Foam::labelList & localPointOrder ( ) const

Return orders the local points for most efficient search.

Definition at line 352 of file PrimitivePatch.C.

◆ whichPoint()

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 366 of file PrimitivePatch.C.

Referenced by slidingInterface::modifyMotionPoints().

Here is the caller graph for this function:

◆ whichEdge()

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 147 of file PrimitivePatchMeshEdges.C.

Referenced by slidingInterface::modifyMotionPoints().

Here is the caller graph for this function:

◆ meshEdges() [1/2]

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 37 of file PrimitivePatchMeshEdges.C.

Referenced by addPatchCellLayer::calcExtrudeInfo(), addPatchCellLayer::globalEdgeFaces(), polyPatch::meshEdges(), and addPatchCellLayer::setRefinement().

Here is the caller graph for this function:

◆ meshEdges() [2/2]

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 102 of file PrimitivePatchMeshEdges.C.

◆ faceCentres()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > & faceCentres ( ) const

Return face centres for patch.

Definition at line 380 of file PrimitivePatch.C.

Referenced by symmetryPlanePolyPatch::calcGeometry(), wedgePolyPatch::calcGeometry(), MeshedSurface< Foam::face >::Cf(), triSurfaceMesh::coordinates(), processorPolyPatch::initOrder(), processorPolyPatch::order(), triSurfaceTools::writeCloseness(), AMIInterpolation::writeFaceConnectivity(), and boundaryDataWriter::writeTemplate().

Here is the caller graph for this function:

◆ faceAreas()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > & faceAreas ( ) const

Return face area vectors for patch.

Definition at line 396 of file PrimitivePatch.C.

Referenced by MeshedSurface< Foam::face >::Sf().

Here is the caller graph for this function:

◆ magFaceAreas()

const Foam::Field< Foam::scalar > & magFaceAreas ( ) const

Return face area magnitudes for patch.

Definition at line 409 of file PrimitivePatch.C.

Referenced by MeshedSurface< Foam::face >::magSf().

Here is the caller graph for this function:

◆ faceNormals()

◆ pointNormals()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > & pointNormals ( ) const

Return point normals for patch.

Definition at line 441 of file PrimitivePatch.C.

Referenced by Foam::meshTools::calcBoxPointNormals(), slidingInterface::modifyMotionPoints(), facePointPatch::pointNormals(), and triSurfaceTools::surfaceNormal().

Here is the caller graph for this function:

◆ hasFaceAreas()

bool hasFaceAreas ( ) const
inline

Definition at line 421 of file PrimitivePatch.H.

◆ hasFaceCentres()

bool hasFaceCentres ( ) const
inline

Definition at line 422 of file PrimitivePatch.H.

◆ hasFaceNormals()

bool hasFaceNormals ( ) const
inline

Definition at line 423 of file PrimitivePatch.H.

◆ hasPointNormals()

bool hasPointNormals ( ) const
inline

Definition at line 424 of file PrimitivePatch.H.

◆ projectPoints() [1/2]

List<objectHit> projectPoints ( const ToPatch &  targetPatch,
const Field< point_type > &  projectionDirection,
const intersection::algorithm  = intersection::FULL_RAY,
const intersection::direction  = intersection::VECTOR 
) const

Project vertices of patch onto another patch.

◆ projectFaceCentres() [1/2]

List<objectHit> projectFaceCentres ( const ToPatch &  targetPatch,
const Field< point_type > &  projectionDirection,
const intersection::algorithm  = intersection::FULL_RAY,
const intersection::direction  = intersection::VECTOR 
) const

Project vertices of patch onto another patch.

◆ edgeLoops()

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 148 of file PrimitivePatchEdgeLoops.C.

Referenced by combineFaces::getOutsideFace().

Here is the caller graph for this function:

◆ surfaceType()

Foam::PrimitivePatch< FaceList, PointField >::surfaceTopo surfaceType ( ) const

Calculate surface type formed by patch.

Types:

  • all edges have two neighbours (manifold)
  • some edges have more than two neighbours (illegal)
  • other (open)

Definition at line 108 of file PrimitivePatchCheck.C.

◆ checkTopology()

bool checkTopology ( const bool  report = false,
labelHashSet setPtr = nullptr 
) 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 143 of file PrimitivePatchCheck.C.

◆ checkPointManifold()

bool checkPointManifold ( const bool  report = false,
labelHashSet setPtr = nullptr 
) 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 190 of file PrimitivePatchCheck.C.

◆ movePoints()

void movePoints ( const Field< point_type > &  )
virtual

Correct patch after moving points.

Definition at line 172 of file PrimitivePatch.C.

Referenced by cyclicAMIPolyPatch::initMovePoints(), and polyPatch::movePoints().

Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const PrimitivePatch< FaceList, PointField > &  rhs)

Copy assign faces. Leave points alone (could be a reference).

Definition at line 457 of file PrimitivePatch.C.

Referenced by polyPatch::operator=().

Here is the caller graph for this function:

◆ operator=() [2/2]

void operator= ( PrimitivePatch< FaceList, PointField > &&  rhs)

Move assign faces. Leave points alone (could be a reference).

Definition at line 477 of file PrimitivePatch.C.

◆ projectPoints() [2/2]

Foam::List<Foam::objectHit> projectPoints ( const ToPatch &  targetPatch,
const Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > &  projectionDirection,
const intersection::algorithm  alg,
const intersection::direction  dir 
) const

Definition at line 44 of file PrimitivePatchProjectPoints.C.

◆ projectFaceCentres() [2/2]

Foam::List<Foam::objectHit> projectFaceCentres ( const ToPatch &  targetPatch,
const Field< typename Foam::PrimitivePatch< FaceList, PointField >::point_type > &  projectionDirection,
const intersection::algorithm  alg,
const intersection::direction  dir 
) const

Definition at line 283 of file PrimitivePatchProjectPoints.C.


The documentation for this class was generated from the following files: