PrimitivePatch< FaceList, PointField > Class Template Reference

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

Inheritance diagram for PrimitivePatch< FaceList, PointField >:
Collaboration diagram for PrimitivePatch< FaceList, PointField >:

Public Types

enum  surfaceTopo { MANIFOLD , OPEN , ILLEGAL }
 Enumeration defining the surface type. Used in check routines. More...
 
typedef FaceList FaceListType
 
typedef std::remove_reference< FaceList >::type::value_type FaceType
 
typedef PointField PointFieldType
 
typedef std::remove_reference< PointField >::type::value_type PointType
 

Public Member Functions

 PrimitivePatch (const FaceList &faces, const Field< PointType > &points)
 Construct from components. More...
 
 PrimitivePatch (FaceList &&faces, Field< PointType > &&points)
 Move constructor from components. More...
 
 PrimitivePatch (FaceList &faces, Field< PointType > &points, const bool reuse)
 Construct from components, reuse storage. More...
 
 PrimitivePatch (const PrimitivePatch< FaceList, PointField > &)
 Copy constructor. More...
 
 PrimitivePatch (PrimitivePatch< FaceList, PointField > &&)
 Move constructor. More...
 
autoPtr< PrimitivePatch< FaceList, PointField > > clone () const
 Construct and return a clone. More...
 
 ~PrimitivePatch ()
 Destructor. More...
 
const Field< PointType > & 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,. 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< FaceType > & localFaces () const
 Return patch faces addressing into local point list. More...
 
const labelListmeshPoints () const
 Return labelList of mesh points in patch. They are constructed. More...
 
const Map< label > & meshPointMap () const
 Mesh point map. Given the global point index find its. More...
 
const Field< PointType > & 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
 Given an edge in local point labels, return its. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
 Return labels of patch edges in the global edge list using. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const
 Return labels of patch edges in the global edge list using. More...
 
const Field< PointType > & faceCentres () const
 Return face centres for patch. More...
 
const Field< PointType > & faceAreas () const
 Return face areas for patch. More...
 
const Field< PointType > & faceNormals () const
 Return face normals for patch. More...
 
const Field< PointType > & pointNormals () const
 Return point normals for patch. More...
 
template<class ToPatch >
List< objectHitprojectPoints (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::vector) const
 Project vertices of patch onto another patch. More...
 
template<class ToPatch >
List< objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::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...
 
void clearOut ()
 
void clearGeom ()
 
void clearTopology ()
 
void clearPatchMeshAddr ()
 
void operator= (const PrimitivePatch< FaceList, PointField > &)
 Assignment operator. More...
 
void operator= (PrimitivePatch< FaceList, PointField > &&)
 Move assignment operator. More...
 
template<class ToPatch >
Foam::List< Foam::objectHitprojectPoints (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
 
template<class ToPatch >
Foam::List< Foam::objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< PointType > &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 81 of file PrimitivePatch.H.

Member Typedef Documentation

◆ FaceListType

typedef FaceList FaceListType

Definition at line 91 of file PrimitivePatch.H.

◆ FaceType

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

Definition at line 94 of file PrimitivePatch.H.

◆ PointFieldType

Definition at line 96 of file PrimitivePatch.H.

◆ PointType

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

Definition at line 99 of file PrimitivePatch.H.

Member Enumeration Documentation

◆ surfaceTopo

Enumeration defining the surface type. Used in check routines.

Enumerator
MANIFOLD 
OPEN 
ILLEGAL 

Definition at line 105 of file PrimitivePatch.H.

Constructor & Destructor Documentation

◆ PrimitivePatch() [1/5]

PrimitivePatch ( const FaceList &  faces,
const Field< PointType > &  points 
)

Construct from components.

Definition at line 32 of file PrimitivePatch.C.

◆ PrimitivePatch() [2/5]

PrimitivePatch ( FaceList &&  faces,
Field< PointType > &&  points 
)

Move constructor from components.

Definition at line 62 of file PrimitivePatch.C.

◆ PrimitivePatch() [3/5]

PrimitivePatch ( FaceList &  faces,
Field< PointType > &  points,
const bool  reuse 
)

Construct from components, reuse storage.

Definition at line 92 of file PrimitivePatch.C.

◆ PrimitivePatch() [4/5]

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

Copy constructor.

Definition at line 123 of file PrimitivePatch.C.

◆ PrimitivePatch() [5/5]

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

Move constructor.

Definition at line 153 of file PrimitivePatch.C.

◆ ~PrimitivePatch()

Destructor.

Definition at line 185 of file PrimitivePatch.C.

Member Function Documentation

◆ clone()

autoPtr<PrimitivePatch<FaceList, PointField> > clone ( ) const
inline

Construct and return a clone.

Definition at line 279 of file PrimitivePatch.H.

◆ points()

◆ nPoints()

◆ nEdges()

◆ edges()

const Foam::edgeList & edges

Return list of edges, address into LOCAL point list.

Definition at line 194 of file PrimitivePatch.C.

Referenced by booleanSurface::booleanSurface(), createShellMesh::calcPointRegions(), addPatchCellLayer::calcSidePatch(), snappySnapDriver::calcSnapDistance(), searchableSurfaces::checkIntersection(), Foam::checkNonManifoldEdge(), triSurfaceTools::collapseEdges(), patchPatchDist::correct(), cyclicPolyPatch::coupledEdges(), edgeSurface::edgeSurface(), triSurfaceTools::getEdge(), combineFaces::getOutsideFace(), triSurfaceTools::getVertexTriangles(), triSurfaceTools::getVertexVertices(), triSurfaceTools::greenRefine(), PatchTools::matchEdges(), triSurfaceTools::maxEdge(), triSurfaceTools::minEdge(), edgeIntersections::minEdgeLength(), slidingInterface::modifyMotionPoints(), polyBoundaryMesh::nbrEdges(), PrimitivePatch< FaceList, PointField >::nEdges(), triSurfaceTools::oppositeEdge(), triSurfaceTools::oppositeVertex(), triSurfaceTools::otherEdges(), nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge(), nonConformalBoundary::patchPointOwnerOrigBoundaryPoints(), Foam::selectBox(), Foam::selectCutEdges(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), surfaceFeatures::surfaceFeatures(), surfaceIntersection::surfaceIntersection(), triSurfaceTools::surfaceSide(), syncTools::syncEdgeMap(), patchToPatchStabilisation::update(), patchFaceOrientation::updateEdge(), patchEdgeFacePoint::updateEdge(), patchFaceOrientation::updateFace(), OBJstream::write(), and GTSsurfaceFormat< Face >::write().

Here is the caller graph for this function:

◆ nInternalEdges()

◆ isInternalEdge()

bool isInternalEdge ( const label  edgeI) const
inline

Is internal edge?

Definition at line 324 of file PrimitivePatch.H.

References PrimitivePatch< FaceList, PointField >::nInternalEdges().

Here is the call graph for this function:

◆ boundaryPoints()

const Foam::labelList & boundaryPoints

Return list of boundary points,.

address into LOCAL point list

Definition at line 219 of file PrimitivePatch.C.

◆ faceFaces()

const Foam::labelListList & faceFaces

Return face-face addressing.

Definition at line 232 of file PrimitivePatch.C.

◆ edgeFaces()

◆ faceEdges()

◆ pointEdges()

◆ pointFaces()

◆ localFaces()

const Foam::List< typename Foam::PrimitivePatch< FaceList, PointField >::FaceType > & localFaces

◆ meshPoints()

const Foam::labelList & meshPoints

Return labelList of mesh points in patch. They are constructed.

walking through the faces in incremental order and not sorted anymore.

Definition at line 314 of file PrimitivePatch.C.

Referenced by snappySnapDriver::avgCellCentres(), Foam::meshTools::calcBoxPointNormals(), snappySnapDriver::calcNearestSurface(), addPatchCellLayer::calcSidePatch(), snappySnapDriver::calcSnapDistance(), patchPatchDist::correct(), cyclicPolyPatch::coupledEdges(), snappySnapDriver::detectNearSurfaces(), syncTools::getMasterPoints(), combineFaces::getOutsideFace(), globalIndexAndTransform::globalIndexAndTransform(), globalPoints::globalPoints(), localPointRegion::localPointRegion(), PatchTools::matchEdges(), PatchTools::matchPoints(), globalMeshData::mergePoints(), facePointPatch::meshPoints(), medialAxisMeshMover::move(), polyBoundaryMesh::nbrEdges(), PrimitivePatch< FaceList, PointField >::nPoints(), inversePointDistanceDiffusivity::operator()(), orientedSurface::orientedSurface(), mappedExtrudedPatchBase::patchLocalPoints(), nonConformalBoundary::patchPointOwnerOrigBoundaryPoints(), Foam::selectCutEdges(), motionSmootherAlgo::setDisplacement(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), snappySnapDriver::smoothDisplacement(), syncTools::syncEdgeMap(), globalMeshData::syncPointData(), syncTools::syncPointList(), syncTools::syncPointMap(), pointConstraints::syncUntransformedData(), patchEdgeFacePoint::updateEdge(), and GTSsurfaceFormat< Face >::write().

Here is the caller graph for this function:

◆ meshPointMap()

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

Mesh point map. Given the global point index find its.

location in the patch

Definition at line 327 of file PrimitivePatch.C.

Referenced by cellClassification::fillRegionPoints(), snappySnapDriver::getZoneSurfacePoints(), globalPoints::globalPoints(), PatchTools::matchPoints(), globalMeshData::mergePoints(), PatchTools::pointNormals(), and syncTools::syncPointList().

Here is the caller graph for this function:

◆ localPoints()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::PointType > & localPoints

Return pointField of points in patch.

Definition at line 343 of file PrimitivePatch.C.

Referenced by snappySnapDriver::avgCellCentres(), booleanSurface::booleanSurface(), enrichedPatch::calcEnrichedFaces(), snappySnapDriver::calcNearestSurface(), snappySnapDriver::calcSnapDistance(), searchableSurfaces::checkIntersection(), triSurfaceTools::collapseEdges(), cyclicPolyPatch::coupledEdges(), snappySnapDriver::detectNearSurfaces(), patchToPatch::distributePatch(), snappySnapDriver::doSnap(), edgeSurface::edgeSurface(), nearest::finalise(), triSurfaceTools::greenRefine(), patchToPatch::intersectPatches(), Foam::levelSetFraction(), facePointPatch::localPoints(), triSurfaceTools::maxEdge(), triSurfaceTools::mergePoints(), meshTriangulation::meshTriangulation(), triSurfaceTools::minEdge(), edgeIntersections::minEdgeLength(), slidingInterface::modifyMotionPoints(), polyBoundaryMesh::nbrEdges(), nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge(), pairPatchAgglomeration::pairPatchAgglomeration(), mappedExtrudedPatchBase::patchLocalPoints(), repatchMesh::read(), repatchMesh::readTriSurface(), Foam::selectBox(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), snappySnapDriver::smoothDisplacement(), patchToPatch::srcBox(), surfaceIntersection::surfaceIntersection(), triSurfaceTools::surfaceSide(), patchToPatch::tgtBox(), triSurfaceTools::triangulate(), triSurfaceTools::triangulateFaceCentre(), patch::update(), patchToPatchStabilisation::update(), patchToPatch::update(), OBJstream::write(), AC3DsurfaceFormat< Face >::write(), coupledPolyPatch::writeOBJ(), triSurfaceTools::writeOBJ(), and meshRefinement::zonify().

Here is the caller graph for this function:

◆ localPointOrder()

const Foam::labelList & localPointOrder

Return orders the local points for most efficient search.

Definition at line 356 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 368 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 146 of file PrimitivePatchMeshEdges.C.

References Foam::constant::electromagnetic::e, forAll, and nPoints.

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

References Foam::endl(), forAll, found, InfoInFunction, and List< T >::size().

Referenced by addPatchCellLayer::calcSidePatch(), addPatchCellLayer::globalEdgeFaces(), polyPatch::meshEdges(), nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge(), nonConformalBoundary::patchPointOwnerOrigBoundaryPoints(), and addPatchCellLayer::setRefinement().

Here is the call graph for this function:
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 99 of file PrimitivePatchMeshEdges.C.

References Foam::endl(), forAll, InfoInFunction, and List< T >::size().

Here is the call graph for this function:

◆ faceCentres()

◆ faceAreas()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::PointType > & faceAreas

Return face areas for patch.

Definition at line 408 of file PrimitivePatch.C.

Referenced by cyclicPolyPatch::initOrder(), mappedPatchBase::nbrPatchFaceAreas(), and cyclicPolyPatch::order().

Here is the caller graph for this function:

◆ faceNormals()

◆ pointNormals()

const Foam::Field< typename Foam::PrimitivePatch< FaceList, PointField >::PointType > & pointNormals

Return point normals for patch.

Definition at line 440 of file PrimitivePatch.C.

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

Here is the caller graph for this function:

◆ projectPoints() [1/2]

List<objectHit> projectPoints ( const ToPatch &  targetPatch,
const Field< PointType > &  projectionDirection,
const intersection::algorithm  = intersection::algorithm::fullRay,
const intersection::direction  = intersection::direction::vector 
) const

Project vertices of patch onto another patch.

◆ projectFaceCentres() [1/2]

List<objectHit> projectFaceCentres ( const ToPatch &  targetPatch,
const Field< PointType > &  projectionDirection,
const intersection::algorithm  = intersection::algorithm::fullRay,
const intersection::direction  = intersection::direction::vector 
) const

Project vertices of patch onto another patch.

◆ edgeLoops()

const Foam::labelListList & edgeLoops

Return list of closed loops of boundary vertices.

Edge loops are given as ordered lists of vertices in local addressing

Definition at line 152 of file PrimitivePatchEdgeLoops.C.

Referenced by combineFaces::getOutsideFace(), and combineFaces::setRefinement().

Here is the caller graph for this function:

◆ surfaceType()

Foam::PrimitivePatch< FaceList, PointField >::surfaceTopo surfaceType

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 105 of file PrimitivePatchCheck.C.

References Foam::endl(), forAll, Foam::Info, InfoInFunction, and List< T >::size().

Here is the call graph for this function:

◆ 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 146 of file PrimitivePatchCheck.C.

References Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::Info, InfoInFunction, HashSet< Key, Hash >::insert(), and List< T >::size().

Here is the call graph for this function:

◆ 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 200 of file PrimitivePatchCheck.C.

References Foam::endl(), Foam::findIndex(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), Foam::constant::atomic::mp, Foam::nl, and pFaces.

Referenced by cellClassification::fillRegionPoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearOut()

void clearOut

Definition at line 95 of file PrimitivePatchClear.C.

Referenced by PrimitiveOldTimePatch< FaceList, PointField >::clearOut(), and processorPolyPatch::topoChange().

Here is the caller graph for this function:

◆ clearGeom()

void clearGeom

Definition at line 33 of file PrimitivePatchClear.C.

References Foam::deleteDemandDrivenData(), Foam::endl(), and InfoInFunction.

Referenced by PrimitiveOldTimePatch< FaceList, PointField >::clearGeom(), polyPatch::clearGeom(), polyPatch::movePoints(), and polyPatch::topoChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearTopology()

void clearTopology

Definition at line 49 of file PrimitivePatchClear.C.

References Foam::deleteDemandDrivenData(), Foam::endl(), and InfoInFunction.

Referenced by polyPatch::clearAddressing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearPatchMeshAddr()

void clearPatchMeshAddr

Definition at line 81 of file PrimitivePatchClear.C.

References Foam::deleteDemandDrivenData(), Foam::endl(), and InfoInFunction.

Referenced by polyPatch::clearAddressing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 454 of file PrimitivePatch.C.

Referenced by polyPatch::operator=().

Here is the caller graph for this function:

◆ operator=() [2/2]

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

Move assignment operator.

Definition at line 466 of file PrimitivePatch.C.

◆ projectPoints() [2/2]

◆ projectFaceCentres() [2/2]


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