FreeFOAM The Cross-Platform CFD Toolkit
polyPatch Class Reference

A patch is a list of labels that address the faces in the global face list. More...

#include <OpenFOAM/polyPatch.H>


Detailed Description

A patch is a list of labels that address the faces in the global face list.

The patch can calculate its own edges based on the global faces. Patch also contains all addressing between the faces.

Source files

Definition at line 66 of file polyPatch.H.

+ Inheritance diagram for polyPatch:
+ Collaboration diagram for polyPatch:

List of all members.

Public Member Functions

 TypeName ("patch")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, polyPatch, word,(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm),(name, size, start, index, bm))
 declareRunTimeSelectionTable (autoPtr, polyPatch, dictionary,(const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm),(name, dict, index, bm))
 polyPatch (const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
 Construct from components.
 polyPatch (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)
 Construct from dictionary.
 polyPatch (const polyPatch &, const polyBoundaryMesh &)
 Construct as copy, resetting the boundary mesh.
 polyPatch (const polyPatch &pp, const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart)
 Construct given the original patch and resetting the.
 polyPatch (const polyPatch &)
 Construct as copy.
virtual autoPtr< polyPatchclone (const polyBoundaryMesh &bm) const
 Construct and return a clone, resetting the boundary mesh.
virtual autoPtr< polyPatchclone (const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart) const
 Construct and return a clone, resetting the face list.
virtual ~polyPatch ()
label start () const
 Return start label of this patch in the polyMesh face list.
const polyBoundaryMeshboundaryMesh () const
 Return boundaryMesh reference.
virtual bool coupled () const
 Return true if this patch field is coupled.
template<class T >
const List< T >::subList patchSlice (const List< T > &l) const
 Slice list to patch.
template<class T >
const Field< T >::subField patchSlice (const Field< T > &l) const
 Slice Field to patch.
virtual void write (Ostream &) const
 Write the polyPatch data as a dictionary.
const vectorField::subField faceCentres () const
 Return face centres.
const vectorField::subField faceAreas () const
 Return face normals.
tmp< vectorFieldfaceCellCentres () const
 Return face neighbour cell centres.
const unallocLabelListfaceCells () const
 Return face-cell addressing.
const labelListmeshEdges () const
 Return global edge index for local edges.
void clearAddressing ()
 Clear addressing.
label whichFace (const label l) const
 Return label of face in patch from global face label.
virtual void initOrder (const primitivePatch &) const
 Initialize ordering for primitivePatch. Does not.
virtual bool order (const primitivePatch &, labelList &faceMap, labelList &rotation) const
 Return new ordering for primitivePatch.
void operator= (const polyPatch &)
 Assignment.
- Public Member Functions inherited from patchIdentifier
 patchIdentifier (const word &name, const label index, const word &physicalType=word::null)
 Construct from components.
 patchIdentifier (const word &name, const dictionary &, const label index)
 Construct from dictionary.
 patchIdentifier (const patchIdentifier &, const label index)
 Construct from geometric patch, resetting the index.
virtual ~patchIdentifier ()
const wordname () const
 Return name.
wordname ()
 Return name for modification.
const wordphysicalType () const
 Return the optional physical type of the patch.
wordphysicalType ()
 Return the optional physical type of the patch for modification.
label index () const
 Return the index of this patch in the boundaryMesh.
label & index ()
 Return the index of this patch in the boundaryMesh for modification.
- Public Member Functions inherited from PrimitivePatch< Face, FaceList, PointField, PointType >
 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 edgeListedges () 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 labelListboundaryPoints () const
 Return list of boundary points,.
const labelListListfaceFaces () const
 Return face-face addressing.
const labelListListedgeFaces () const
 Return edge-face addressing.
const labelListListfaceEdges () const
 Return face-edge addressing.
const labelListListpointEdges () const
 Return point-edge addressing.
const labelListListpointFaces () const
 Return point-face addressing.
const List< Face > & localFaces () const
 Return patch faces addressing into local point list.
const labelListmeshPoints () 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 labelListlocalPointOrder () 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 > & faceNormals () const
 Return face normals for patch.
const Field< PointType > & pointNormals () const
 Return point normals for patch.
template<class ToPatch >
List< objectHitprojectPoints (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< objectHitprojectFaceCentres (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 labelListListedgeLoops () 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.

Static Public Member Functions

static autoPtr< polyPatchNew (const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
 Return a pointer to a new patch created on freestore from.
static autoPtr< polyPatchNew (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)
 Return a pointer to a new patch created on freestore from.
static bool constraintType (const word &pt)
 Return true if the given type is a constraint type.
static wordList constraintTypes ()
 Return a list of all the constraint patch types.

Static Public Attributes

static int disallowGenericPolyPatch
 Debug switch to disallow the use of genericPolyPatch.

Protected Member Functions

virtual void initGeometry ()
 Initialise the calculation of the patch geometry.
virtual void calcGeometry ()
 Calculate the patch geometry.
virtual void initMovePoints (const pointField &)
 Initialise the patches for moving points.
virtual void movePoints (const pointField &p)
 Correct patches after moving points.
virtual void initUpdateMesh ()
 Initialise the update of the patch topology.
virtual void updateMesh ()
 Update of the patch topology.

Friends

class polyBoundaryMesh
Ostreamoperator<< (Ostream &, const polyPatch &)

Additional Inherited Members

- Public Types inherited from PrimitivePatch< Face, FaceList, PointField, PointType >
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

Constructor & Destructor Documentation

polyPatch ( const word name,
const label  size,
const label  start,
const label  index,
const polyBoundaryMesh bm 
)

Construct from components.

Definition at line 71 of file polyPatch.C.

Referenced by polyPatch::clone().

polyPatch ( const word name,
const dictionary dict,
const label  index,
const polyBoundaryMesh bm 
)

Construct from dictionary.

Definition at line 93 of file polyPatch.C.

polyPatch ( const polyPatch pp,
const polyBoundaryMesh bm 
)

Construct as copy, resetting the boundary mesh.

Definition at line 119 of file polyPatch.C.

polyPatch ( const polyPatch pp,
const polyBoundaryMesh bm,
const label  index,
const label  newSize,
const label  newStart 
)

Construct given the original patch and resetting the.

face list and boundary mesh information

Definition at line 143 of file polyPatch.C.

polyPatch ( const polyPatch p)

Construct as copy.

Definition at line 169 of file polyPatch.C.

~polyPatch ( )
virtual

Definition at line 182 of file polyPatch.C.


Member Function Documentation

virtual void initGeometry ( )
inlineprotectedvirtual
virtual void calcGeometry ( )
inlineprotectedvirtual
virtual void initMovePoints ( const pointField )
inlineprotectedvirtual
void movePoints ( const pointField p)
protectedvirtual
virtual void initUpdateMesh ( )
inlineprotectedvirtual
TypeName ( "patch"  )

Runtime type information.

declareRunTimeSelectionTable ( autoPtr  ,
polyPatch  ,
word  ,
(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)  ,
(name, size, start, index, bm)   
)
declareRunTimeSelectionTable ( autoPtr  ,
polyPatch  ,
dictionary  ,
(const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)  ,
(name, dict, index, bm)   
)
virtual autoPtr<polyPatch> clone ( const polyBoundaryMesh bm) const
inlinevirtual

Construct and return a clone, resetting the boundary mesh.

Reimplemented in cyclicPolyPatch, processorPolyPatch, directMappedPolyPatch, directMappedWallPolyPatch, wedgePolyPatch, genericPolyPatch, emptyPolyPatch, symmetryPolyPatch, and wallPolyPatch.

Definition at line 205 of file polyPatch.H.

References polyPatch::polyPatch().

Referenced by boundaryMesh::patchify().

virtual autoPtr<polyPatch> clone ( const polyBoundaryMesh bm,
const label  index,
const label  newSize,
const label  newStart 
) const
inlinevirtual

Construct and return a clone, resetting the face list.

and boundary mesh

Reimplemented in cyclicPolyPatch, processorPolyPatch, directMappedPolyPatch, directMappedWallPolyPatch, wedgePolyPatch, genericPolyPatch, emptyPolyPatch, symmetryPolyPatch, and wallPolyPatch.

Definition at line 213 of file polyPatch.H.

References polyPatch::polyPatch().

Foam::autoPtr< Foam::polyPatch > New ( const word patchType,
const word name,
const label  size,
const label  start,
const label  index,
const polyBoundaryMesh bm 
)
static

Return a pointer to a new patch created on freestore from.

components

Definition at line 32 of file newPolyPatch.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, and name().

Referenced by meshRefinement::addPatch(), boundaryMesh::patchify(), polyBoundaryMesh::polyBoundaryMesh(), and polyMesh::polyMesh().

Foam::autoPtr< Foam::polyPatch > New ( const word name,
const dictionary dict,
const label  index,
const polyBoundaryMesh bm 
)
static

Return a pointer to a new patch created on freestore from.

dictionary

Definition at line 70 of file newPolyPatch.C.

References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, Foam::Info, dictionary::lookup(), name(), and dictionary::readIfPresent().

label start ( ) const
inline

Return start label of this patch in the polyMesh face list.

Definition at line 260 of file polyPatch.H.

Referenced by polyTopoChange::addMesh(), meshRefinement::addPatch(), cellToCellStencil::allCoupledFacesPatch(), cellToFaceStencil::allCoupledFacesPatch(), cellToFaceStencil::calcFaceStencil(), polyDualMesh::calcFeatures(), hexRef8::checkMesh(), inverseFaceDistanceDiffusivity::correct(), inversePointDistanceDiffusivity::correct(), Particle< ParticleType >::correctAfterParallelTransfer(), cellDistFuncs::correctBoundaryFaceCells(), ensightPartFaces::ensightPartFaces(), faceCoupleInfo::faceLabels(), removeCells::getExposedFaces(), syncTools::getMasterFaces(), combineFaces::getMergeSets(), FreeStream< CloudType >::inflow(), fvMeshSubset::interpolate(), isoSurface::isoSurface(), isoSurfaceCell::isoSurfaceCell(), meshRefinement::makePatch(), meshRefinement::mergePatchFaces(), octreeDataFace::octreeDataFace(), boundaryMesh::patchify(), fvPatch::patchSlice(), fvMeshDistribute::printMeshInfo(), boundaryMesh::read(), dynamicRefineFvMesh::refine(), autoSnapDriver::repatchToSurface(), fvMeshSubset::setLargeCellSubset(), removeCells::setRefinement(), perfectInterface::setRefinement(), removeFaces::setRefinement(), cellDistFuncs::smallestDist(), faceSet::sync(), syncTools::syncBoundaryFaceList(), syncTools::syncFaceList(), meshRefinement::testSyncBoundaryFaceList(), cyclicPolyPatch::transformGlobalFace(), triSurfaceTools::triangulateFaceCentre(), directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs(), directMappedFixedValueFvPatchField< Type >::updateCoeffs(), cellToCellStencil::validBoundaryFaces(), cellToFaceStencil::validBoundaryFaces(), wallLayerCells::wallLayerCells(), polyBoundaryMesh::whichPatch(), and meshRefinement::zonify().

Return boundaryMesh reference.

Definition at line 222 of file polyPatch.C.

Referenced by outletMappedUniformInletFvPatchField< Type >::updateCoeffs().

bool constraintType ( const word pt)
static

Return true if the given type is a constraint type.

Definition at line 190 of file polyPatch.C.

Foam::wordList constraintTypes ( )
static

Return a list of all the constraint patch types.

Definition at line 196 of file polyPatch.C.

References List< T >::setSize().

const List<T>::subList patchSlice ( const List< T > &  l) const
inline

Slice list to patch.

Definition at line 282 of file polyPatch.H.

Referenced by isoSurface::isoSurface().

const Field<T>::subField patchSlice ( const Field< T > &  l) const
inline

Slice Field to patch.

Definition at line 289 of file polyPatch.H.

Foam::tmp< Foam::vectorField > faceCellCentres ( ) const

Return face neighbour cell centres.

Definition at line 241 of file polyPatch.C.

References forAll.

const Foam::unallocLabelList & faceCells ( ) const
const Foam::labelList & meshEdges ( ) const

Return global edge index for local edges.

Definition at line 274 of file polyPatch.C.

References mesh, and PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges().

Referenced by syncTools::getMasterEdges(), and syncTools::syncEdgeList().

void clearAddressing ( )

Clear addressing.

Definition at line 293 of file polyPatch.C.

References Foam::deleteDemandDrivenData().

void initOrder ( const primitivePatch ) const
virtual

Initialize ordering for primitivePatch. Does not.

refer to *this (except for name() and type() etc.)

Reimplemented in cyclicPolyPatch, coupledPolyPatch, and processorPolyPatch.

Definition at line 309 of file polyPatch.C.

bool order ( const primitivePatch ,
labelList faceMap,
labelList rotation 
) const
virtual

Return new ordering for primitivePatch.

Ordering is -faceMap: for every face index of the new face -rotation:for every new face the clockwise shift of the original face. Return false if nothing changes (faceMap is identity, rotation is 0), true otherwise.

Reimplemented in cyclicPolyPatch, coupledPolyPatch, and processorPolyPatch.

Definition at line 314 of file polyPatch.C.

void operator= ( const polyPatch p)

Assignment.

Definition at line 327 of file polyPatch.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::operator=().


Friends And Related Function Documentation

friend class polyBoundaryMesh
friend

Definition at line 100 of file polyPatch.H.

Ostream& operator<< ( Ostream ,
const polyPatch  
)
friend

Member Data Documentation

int disallowGenericPolyPatch
static

Debug switch to disallow the use of genericPolyPatch.

Definition at line 131 of file polyPatch.H.


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