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>
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational domain e.g. cyclic and processor-processor links.
Definition at line 51 of file coupledPolyPatch.H.
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 vectorField & | separation () const |
Return the offset (distance) vector from one side of the couple.
| |
bool | parallel () const |
Are the cyclic planes parallel.
| |
const tensorField & | forwardT () const |
Return face transformation tensor.
| |
const tensorField & | reverseT () 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.
| |
Static Public Attributes | |
static const NamedEnum < transformType, 3 > | transformTypeNames |
static scalar | matchTol = 1E-3 |
Relative tolerance (for geometric matching).
| |
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.
|
enum transformType |
Definition at line 57 of file coupledPolyPatch.H.
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.
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 | ( | ) | [protected, pure virtual]
|
Initialise the calculation of the patch geometry.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
virtual void calcGeometry | ( | ) | [protected, pure virtual]
|
Calculate the patch geometry.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
virtual void initMovePoints | ( | const pointField & | ) | [protected, pure virtual]
|
Initialise the patches for moving points.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
virtual void movePoints | ( | const pointField & | ) | [protected, pure virtual]
|
Correct patches after moving points.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
virtual void initUpdateMesh | ( | ) | [protected, pure virtual]
|
Initialise the update of the patch topology.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
virtual void updateMesh | ( | ) | [protected, pure virtual]
|
Update of the patch topology.
Reimplemented from polyPatch.
Implemented in cyclicPolyPatch, and processorPolyPatch.
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 | ||
) | [static, protected]
|
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 [inline, virtual]
|
Return true because this patch is coupled.
Reimplemented from polyPatch.
Definition at line 250 of file coupledPolyPatch.H.
Referenced by coupledFvPatch::coupled().
bool separated | ( | ) | const [inline]
|
Are the coupled planes separated.
Definition at line 257 of file coupledPolyPatch.H.
References List< T >::size().
Referenced by Particle< ParticleType >::correctAfterParallelTransfer(), extendedCellToFaceStencil::extendedCellToFaceStencil(), extendedFaceToCellStencil::extendedFaceToCellStencil(), Particle< ParticleType >::hitCyclicPatch(), motionSmoother::scaleMesh(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), and globalMeshData::updateMesh().
const vectorField& separation | ( | ) | const [inline]
|
Return the offset (distance) vector from one side of the couple.
to the other
Definition at line 264 of file coupledPolyPatch.H.
Referenced by Particle< ParticleType >::correctAfterParallelTransfer(), cyclicPolyPatch::separation(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), and globalMeshData::updateMesh().
bool parallel | ( | ) | const [inline]
|
Are the cyclic planes parallel.
Definition at line 271 of file coupledPolyPatch.H.
References UList< T >::empty().
Referenced by Particle< ParticleType >::correctAfterParallelTransfer(), processorPointPatchField< Type >::doTransform(), extendedCellToFaceStencil::extendedCellToFaceStencil(), extendedFaceToCellStencil::extendedFaceToCellStencil(), Particle< ParticleType >::hitCyclicPatch(), cyclicPointPatch::parallel(), coupledFvPatch::parallel(), motionSmoother::scaleMesh(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), and cyclicPolyPatch::transform().
const tensorField& forwardT | ( | ) | const [inline]
|
Return face transformation tensor.
Definition at line 277 of file coupledPolyPatch.H.
Referenced by Particle< ParticleType >::correctAfterParallelTransfer(), cyclicPointPatch::forwardT(), processorFvPatch::forwardT(), coupledFvPatch::forwardT(), motionSmoother::scaleMesh(), processorPointPatchField< Type >::swapAdd(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), and cyclicPolyPatch::transformT().
const tensorField& reverseT | ( | ) | const [inline]
|
Return neighbour-cell transformation tensor.
Definition at line 283 of file coupledPolyPatch.H.
Referenced by cyclicPointPatch::reverseT(), coupledFvPatch::reverseT(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncEdgeMap(), syncTools::syncPointList(), syncTools::syncPointMap(), and cyclicPolyPatch::transformT().
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.
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().