FreeFOAM The Cross-Platform CFD Toolkit
coupledPolyPatch Class Reference

The coupledPolyPatch is an abstract base class for patches that couple regions of the computational domain e.g. cyclic and processor-processor links. More...

#include <OpenFOAM/coupledPolyPatch.H>


Detailed Description

The coupledPolyPatch is an abstract base class for patches that couple regions of the computational domain e.g. cyclic and processor-processor links.

Source files

Definition at line 51 of file coupledPolyPatch.H.

+ Inheritance diagram for coupledPolyPatch:
+ Collaboration diagram for coupledPolyPatch:

List of all members.

Public Types

enum  transformType { UNKNOWN, ROTATIONAL, TRANSLATIONAL }

Public Member Functions

 TypeName ("coupled")
 Runtime type information.
 coupledPolyPatch (const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
 Construct from components.
 coupledPolyPatch (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)
 Construct from dictionary.
 coupledPolyPatch (const coupledPolyPatch &, const polyBoundaryMesh &)
 Construct as copy, resetting the boundary mesh.
 coupledPolyPatch (const coupledPolyPatch &pp, const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart)
 Construct given the original patch and resetting the.
virtual ~coupledPolyPatch ()
virtual bool coupled () const
 Return true because this patch is coupled.
bool separated () const
 Are the coupled planes separated.
const vectorFieldseparation () const
 Return the offset (distance) vector from one side of the couple.
bool parallel () const
 Are the cyclic planes parallel.
const tensorFieldforwardT () const
 Return face transformation tensor.
const tensorFieldreverseT () const
 Return neighbour-cell transformation tensor.
virtual void initOrder (const primitivePatch &) const =0
 Initialize ordering for primitivePatch. Does not.
virtual bool order (const primitivePatch &, labelList &faceMap, labelList &rotation) const =0
 Return new ordering for primitivePatch.
- Public Member Functions inherited from polyPatch
 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.
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.
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 Attributes

static const NamedEnum
< transformType, 3 > 
transformTypeNames
static scalar matchTol = 1E-3
 Relative tolerance (for geometric matching).
- Static Public Attributes inherited from polyPatch
static int disallowGenericPolyPatch
 Debug switch to disallow the use of genericPolyPatch.

Protected Member Functions

void calcTransformTensors (const vectorField &Cf, const vectorField &Cr, const vectorField &nf, const vectorField &nr, const scalarField &smallDist, const scalar absTol=matchTol, const transformType=UNKNOWN) const
 Calculate the transformation tensors.
virtual void initGeometry ()=0
 Initialise the calculation of the patch geometry.
virtual void calcGeometry ()=0
 Calculate the patch geometry.
virtual void initMovePoints (const pointField &)=0
 Initialise the patches for moving points.
virtual void movePoints (const pointField &)=0
 Correct patches after moving points.
virtual void initUpdateMesh ()=0
 Initialise the update of the patch topology.
virtual void updateMesh ()=0
 Update of the patch topology.
bool inPatch (const labelList &oldToNew, const label oldFaceI) const
 Is face (in old face labels) in current patch?

Static Protected Member Functions

static void writeOBJ (Ostream &os, const point &pt)
 Write point in OBJ format.
static void writeOBJ (Ostream &, const pointField &, const labelList &)
 Write selected points in OBJ format.
static void writeOBJ (const fileName &, const UList< face > &, const pointField &)
 Write patch.
static void writeOBJ (Ostream &os, const point &p0, const point &p1, label &vertI)
 Write edge in OBJ format.
static pointField calcFaceCentres (const UList< face > &, const pointField &)
 Calculate face centres.
static pointField getAnchorPoints (const UList< face > &, const pointField &)
 Get f[0] for all faces.
static label whichPatch (const labelList &patchStarts, const label faceI)
 Given list of starts of patches and a face label determine.
static scalarField calcFaceTol (const UList< face > &faces, const pointField &points, const pointField &faceCentres)
 Calculate typical tolerance per face. Is currently max distance.
static label getRotation (const pointField &points, const face &f, const point &anchor, const scalar tol)
 Get the number of vertices face f needs to be rotated such that.

Additional Inherited Members

- Static Public Member Functions inherited from polyPatch
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.

Member Enumeration Documentation

Enumerator:
UNKNOWN 
ROTATIONAL 
TRANSLATIONAL 

Definition at line 57 of file coupledPolyPatch.H.


Constructor & Destructor Documentation

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

Construct from components.

Definition at line 429 of file coupledPolyPatch.C.

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

Construct from dictionary.

Definition at line 442 of file coupledPolyPatch.C.

coupledPolyPatch ( const coupledPolyPatch pp,
const polyBoundaryMesh bm 
)

Construct as copy, resetting the boundary mesh.

Definition at line 454 of file coupledPolyPatch.C.

coupledPolyPatch ( const coupledPolyPatch 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 464 of file coupledPolyPatch.C.

~coupledPolyPatch ( )
virtual

Definition at line 478 of file coupledPolyPatch.C.


Member Function Documentation

void calcTransformTensors ( const vectorField Cf,
const vectorField Cr,
const vectorField nf,
const vectorField nr,
const scalarField smallDist,
const scalar  absTol = matchTol,
const transformType  transform = UNKNOWN 
) const
protected

Calculate the transformation tensors.

smallDist : matching distance per face absTol : absolute error in normal if transformType = unknown it first tries rotational, then translational transform

Definition at line 266 of file coupledPolyPatch.C.

References Foam::endl(), forAll, Foam::I, Foam::mag(), Foam::magSqr(), Foam::name(), Foam::nl, Foam::Pout, Foam::rotationTensor(), List< T >::size(), Foam::sqr(), Foam::sqrt(), Foam::sum(), and Foam::transform().

virtual void initGeometry ( )
protectedpure virtual

Initialise the calculation of the patch geometry.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual void calcGeometry ( )
protectedpure virtual

Calculate the patch geometry.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual void initMovePoints ( const pointField )
protectedpure virtual

Initialise the patches for moving points.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual void movePoints ( const pointField )
protectedpure virtual

Correct patches after moving points.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual void initUpdateMesh ( )
protectedpure virtual

Initialise the update of the patch topology.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual void updateMesh ( )
protectedpure virtual

Update of the patch topology.

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

void writeOBJ ( Ostream os,
const point pt 
)
staticprotected

Write point in OBJ format.

Definition at line 51 of file coupledPolyPatch.C.

References Foam::endl(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

void writeOBJ ( Ostream os,
const pointField points,
const labelList pointLabels 
)
staticprotected

Write selected points in OBJ format.

Definition at line 58 of file coupledPolyPatch.C.

References forAll, and Foam::meshTools::writeOBJ().

void writeOBJ ( const fileName fName,
const UList< face > &  faces,
const pointField points 
)
staticprotected

Write patch.

Definition at line 90 of file coupledPolyPatch.C.

References f(), forAll, Foam::nl, UList< T >::size(), and Foam::meshTools::writeOBJ().

void writeOBJ ( Ostream os,
const point p0,
const point p1,
label &  vertI 
)
staticprotected

Write edge in OBJ format.

Definition at line 72 of file coupledPolyPatch.C.

References Foam::nl, and Foam::meshTools::writeOBJ().

Foam::pointField calcFaceCentres ( const UList< face > &  faces,
const pointField points 
)
staticprotected

Calculate face centres.

Definition at line 126 of file coupledPolyPatch.C.

References forAll, and UList< T >::size().

Foam::pointField getAnchorPoints ( const UList< face > &  faces,
const pointField points 
)
staticprotected

Get f[0] for all faces.

Definition at line 143 of file coupledPolyPatch.C.

References forAll, and UList< T >::size().

bool inPatch ( const labelList oldToNew,
const label  oldFaceI 
) const
protected

Is face (in old face labels) in current patch?

Definition at line 160 of file coupledPolyPatch.C.

Foam::label whichPatch ( const labelList patchStarts,
const label  faceI 
)
staticprotected

Given list of starts of patches and a face label determine.

the patch.

Definition at line 172 of file coupledPolyPatch.C.

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

Foam::scalarField calcFaceTol ( const UList< face > &  faces,
const pointField points,
const pointField faceCentres 
)
staticprotected

Calculate typical tolerance per face. Is currently max distance.

from face centre to any of the face vertices.

Definition at line 197 of file coupledPolyPatch.C.

References Foam::cmptMag(), Foam::cmptMax(), f(), forAll, Foam::magSqr(), Foam::max(), UList< T >::size(), and Foam::sqrt().

Foam::label getRotation ( const pointField points,
const face f,
const point anchor,
const scalar  tol 
)
staticprotected

Get the number of vertices face f needs to be rotated such that.

its f[0] point aligns with given anchor (within tol).

Definition at line 232 of file coupledPolyPatch.C.

References forAll, Foam::mag(), Foam::magSqr(), and List< T >::size().

TypeName ( "coupled"  )

Runtime type information.

virtual bool coupled ( ) const
inlinevirtual

Return true because this patch is coupled.

Reimplemented from polyPatch.

Definition at line 250 of file coupledPolyPatch.H.

Referenced by coupledFvPatch::coupled().

virtual void initOrder ( const primitivePatch ) const
pure virtual

Initialize ordering for primitivePatch. Does not.

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

Reimplemented from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.

virtual bool order ( const primitivePatch ,
labelList faceMap,
labelList rotation 
) const
pure 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 from polyPatch.

Implemented in cyclicPolyPatch, and processorPolyPatch.


Member Data Documentation

const Foam::NamedEnum< Foam::coupledPolyPatch::transformType, 3 > transformTypeNames
static

Definition at line 63 of file coupledPolyPatch.H.

Foam::scalar matchTol = 1E-3
static

Relative tolerance (for geometric matching).

Definition at line 84 of file coupledPolyPatch.H.

Referenced by processorPolyPatch::calcGeometry().


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