mappedPatchBase Class Reference

Engine which provides mapping between two patches. More...

Inheritance diagram for mappedPatchBase:
Collaboration diagram for mappedPatchBase:

Classes

struct  from
 Restrict use of the mapper to certain configurations. More...
 

Public Member Functions

 TypeName ("mappedPatchBase")
 Runtime type information. More...
 
 mappedPatchBase (const polyPatch &)
 Construct from patch. More...
 
 mappedPatchBase (const polyPatch &pp, const word &nbrRegionName, const word &nbrPatchName, const cyclicTransform &transform)
 Construct from components. More...
 
 mappedPatchBase (const polyPatch &pp, const dictionary &dict, const bool defaultTransformIsNone)
 Construct from dictionary. More...
 
 mappedPatchBase (const polyPatch &, const mappedPatchBase &)
 Construct as copy, resetting patch. More...
 
virtual ~mappedPatchBase ()
 Destructor. More...
 
const wordnbrRegionName () const
 Name of the region to map from. More...
 
bool sameRegion () const
 Is the neighbour region the same as for this patch? More...
 
bool samePatch () const
 Is the neighbour patch the same as this patch? More...
 
bool sameUntransformedPatch () const
 Is the neighbour patch the same as this patch with no transform? More...
 
const wordnbrPatchName () const
 Name of the patch to map from. More...
 
const polyMeshnbrMesh () const
 Get the mesh for the region to map from. More...
 
const polyPatchnbrPolyPatch () const
 Get the patch to map from. More...
 
template<class PatchFieldType , class FieldType >
void validateForField (const PatchFieldType &field, const FieldType &iF, const dictionary &context, const label froms=from::any) const
 Validate that the map is appropriate for the given. More...
 
virtual void clearOut ()
 Clear out data on mesh change. More...
 
template<class Type >
tmp< Field< Type > > fromNeighbour (const Field< Type > &nbrFld) const
 Map/interpolate the neighbour patch field to this patch. More...
 
template<class Type >
tmp< Field< Type > > fromNeighbour (const tmp< Field< Type >> &nbrFld) const
 Map/interpolate the neighbour patch field to this patch. More...
 
template<class Type >
tmp< Field< Type > > toNeighbour (const Field< Type > &fld) const
 Map/interpolate patch field to the neighbour patch. More...
 
template<class Type >
tmp< Field< Type > > toNeighbour (const tmp< Field< Type >> &fld) const
 Map/interpolate patch field to the neighbour patch. More...
 
virtual void write (Ostream &) const
 Write as a dictionary. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > fromNeighbour (const Field< Type > &nbrFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > fromNeighbour (const tmp< Field< Type >> &nbrFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > toNeighbour (const Field< Type > &fld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > toNeighbour (const tmp< Field< Type >> &fld) const
 

Static Public Member Functions

static const mappedPatchBasegetMap (const polyPatch &patch)
 Cast the given polyPatch to a mappedPatchBase. Handle errors. More...
 
template<class PatchFieldType , class FieldType >
static void validateMapForField (const PatchFieldType &field, const FieldType &iF, const dictionary &context, const label froms=from::any)
 Validate that the map exists and is appropriate for the given. More...
 
static bool specified (const dictionary &dict)
 Return whether or not the given dictionary contains a. More...
 

Protected Member Functions

virtual tmp< vectorFieldpatchFaceAreas () const
 Get the face-areas for this patch. More...
 
virtual tmp< pointFieldpatchFaceCentres () const
 Get the face-centres for this patch. More...
 
virtual tmp< pointFieldpatchLocalPoints () const
 Get the local points for this patch. More...
 
tmp< vectorFieldnbrPatchFaceAreas () const
 Get the face-areas for the neighbour patch. More...
 
tmp< pointFieldnbrPatchFaceCentres () const
 Get the face-centres for the neighbour patch. More...
 
tmp< pointFieldnbrPatchLocalPoints () const
 Get the local points for the neighbour patch. More...
 
void calcMapping () const
 Calculate mapping. More...
 
bool nbrPatchIsMapped () const
 Return whether or not the neighbour patch is of mapped type. More...
 
const mappedPatchBasenbrMappedPatch () const
 Get the mapped neighbouring patch. More...
 
bool symmetric () const
 Determine whether the neighbouring patch maps from this patch in. More...
 

Protected Attributes

const polyPatchpatch_
 Patch to map to. More...
 
const coupleGroupIdentifier coupleGroup_
 Couple group for the region/patch to map from. More...
 
word nbrRegionName_
 Name of the region to map from. More...
 
word nbrPatchName_
 Name of the patch to map from. More...
 
cyclicTransform transform_
 The transformation between the patches. More...
 
const bool usingTree_
 Are we using the tree mapping method, or a patch-to-patch. More...
 
autoPtr< distributionMaptreeMapPtr_
 Distributor (if using tree) More...
 
labelList treeNbrPatchFaceIndices_
 Indices of the neighbouring patch faces who's values. More...
 
bool patchToPatchIsValid_
 Is the patch-to-patch intersection engine up to date? (if using. More...
 
autoPtr< patchToPatchpatchToPatchPtr_
 Patch-to-patch intersection engine (if using patch-to-patch) More...
 
const scalar matchTol_
 Matching tolerance. More...
 
const bool reMapAfterMove_
 Do we need to re-calculate the mapping if mesh motion takes place? More...
 
bool reMapNbr_
 Do we need to re-map the neighbour because this patch moved? More...
 

Static Protected Attributes

static const scalar defaultMatchTol_ = 1e-4
 Default Matching tolerance. More...
 

Detailed Description

Engine which provides mapping between two patches.

Example:

    // The name of the region to map from. Optional. Defaults to the same
    // region as the patch.
    neighbourRegion region0;

    // The name of the patch to map from
    neighbourPatch movingWall;

    // Couple group to specify the region and patch to map from. This is an
    // alternative to specifying neighbourRegion and neighbourPatch
    // directly, as shown above.
    coupleGroup baffleGroup;
Source files

Definition at line 70 of file mappedPatchBase.H.

Constructor & Destructor Documentation

◆ mappedPatchBase() [1/4]

mappedPatchBase ( const polyPatch pp)

Construct from patch.

Definition at line 323 of file mappedPatchBase.C.

◆ mappedPatchBase() [2/4]

mappedPatchBase ( const polyPatch pp,
const word nbrRegionName,
const word nbrPatchName,
const cyclicTransform transform 
)

Construct from components.

Definition at line 341 of file mappedPatchBase.C.

◆ mappedPatchBase() [3/4]

mappedPatchBase ( const polyPatch pp,
const dictionary dict,
const bool  defaultTransformIsNone 
)

Construct from dictionary.

Definition at line 365 of file mappedPatchBase.C.

◆ mappedPatchBase() [4/4]

mappedPatchBase ( const polyPatch pp,
const mappedPatchBase mpb 
)

Construct as copy, resetting patch.

Definition at line 433 of file mappedPatchBase.C.

◆ ~mappedPatchBase()

~mappedPatchBase ( )
virtual

Destructor.

Definition at line 462 of file mappedPatchBase.C.

Member Function Documentation

◆ patchFaceAreas()

Foam::tmp< Foam::vectorField > patchFaceAreas ( ) const
protectedvirtual

Get the face-areas for this patch.

Reimplemented in mappedExtrudedPatchBase.

Definition at line 47 of file mappedPatchBase.C.

References mappedPatchBase::patch_.

Referenced by mappedExtrudedPatchBase::patchFaceAreas().

Here is the caller graph for this function:

◆ patchFaceCentres()

Foam::tmp< Foam::pointField > patchFaceCentres ( ) const
protectedvirtual

Get the face-centres for this patch.

Reimplemented in mappedExtrudedPatchBase.

Definition at line 53 of file mappedPatchBase.C.

Referenced by mappedExtrudedPatchBase::patchFaceCentres().

Here is the caller graph for this function:

◆ patchLocalPoints()

Foam::tmp< Foam::pointField > patchLocalPoints ( ) const
protectedvirtual

Get the local points for this patch.

Reimplemented in mappedExtrudedPatchBase.

Definition at line 59 of file mappedPatchBase.C.

Referenced by mappedExtrudedPatchBase::patchLocalPoints().

Here is the caller graph for this function:

◆ nbrPatchFaceAreas()

Foam::tmp< Foam::vectorField > nbrPatchFaceAreas ( ) const
protected

Get the face-areas for the neighbour patch.

Definition at line 65 of file mappedPatchBase.C.

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

Here is the call graph for this function:

◆ nbrPatchFaceCentres()

Foam::tmp< Foam::pointField > nbrPatchFaceCentres ( ) const
protected

Get the face-centres for the neighbour patch.

Definition at line 74 of file mappedPatchBase.C.

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

Here is the call graph for this function:

◆ nbrPatchLocalPoints()

Foam::tmp< Foam::pointField > nbrPatchLocalPoints ( ) const
protected

Get the local points for the neighbour patch.

Definition at line 83 of file mappedPatchBase.C.

◆ calcMapping()

◆ nbrPatchIsMapped()

bool nbrPatchIsMapped ( ) const
inlineprotected

Return whether or not the neighbour patch is of mapped type.

Definition at line 30 of file mappedPatchBaseI.H.

References mappedPatchBase::nbrPolyPatch().

Here is the call graph for this function:

◆ nbrMappedPatch()

const Foam::mappedPatchBase & nbrMappedPatch ( ) const
inlineprotected

Get the mapped neighbouring patch.

Definition at line 37 of file mappedPatchBaseI.H.

◆ symmetric()

bool symmetric ( ) const
inlineprotected

Determine whether the neighbouring patch maps from this patch in.

the same way as this patch maps from its neighbour

Definition at line 43 of file mappedPatchBaseI.H.

◆ TypeName()

TypeName ( "mappedPatchBase"  )

Runtime type information.

◆ nbrRegionName()

const Foam::word & nbrRegionName ( ) const
inline

Name of the region to map from.

Definition at line 57 of file mappedPatchBaseI.H.

◆ sameRegion()

bool sameRegion ( ) const
inline

Is the neighbour region the same as for this patch?

Definition at line 84 of file mappedPatchBaseI.H.

◆ samePatch()

bool samePatch ( ) const
inline

Is the neighbour patch the same as this patch?

Definition at line 90 of file mappedPatchBaseI.H.

◆ sameUntransformedPatch()

bool sameUntransformedPatch ( ) const
inline

Is the neighbour patch the same as this patch with no transform?

Definition at line 96 of file mappedPatchBaseI.H.

◆ nbrPatchName()

const Foam::word & nbrPatchName ( ) const
inline

Name of the patch to map from.

Definition at line 73 of file mappedPatchBaseI.H.

◆ nbrMesh()

◆ nbrPolyPatch()

◆ getMap()

◆ validateMapForField()

◆ validateForField()

void validateForField ( const PatchFieldType &  field,
const FieldType &  iF,
const dictionary context,
const label  froms = from::any 
) const

Validate that the map is appropriate for the given.

set of permitted configurations

Definition at line 64 of file mappedPatchBaseTemplates.C.

References Foam::stringOps::breakIntoIndentedLines(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, OSstream::name(), OStringStream::str(), and fileName::type().

Here is the call graph for this function:

◆ clearOut()

◆ fromNeighbour() [1/4]

◆ fromNeighbour() [2/4]

tmp<Field<Type> > fromNeighbour ( const tmp< Field< Type >> &  nbrFld) const

Map/interpolate the neighbour patch field to this patch.

◆ toNeighbour() [1/4]

tmp<Field<Type> > toNeighbour ( const Field< Type > &  fld) const

Map/interpolate patch field to the neighbour patch.

◆ toNeighbour() [2/4]

tmp<Field<Type> > toNeighbour ( const tmp< Field< Type >> &  fld) const

Map/interpolate patch field to the neighbour patch.

◆ specified()

bool specified ( const dictionary dict)
static

Return whether or not the given dictionary contains a.

mappedPatchBase specification

Definition at line 524 of file mappedPatchBase.C.

References dict, and dictionary::found().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write as a dictionary.

Reimplemented in mappedWallPolyPatch, mappedPolyPatch, mappedExtrudedWallPolyPatch, mappedExtrudedPatchBase, mappedFilmWallPolyPatch, and mappedFilmSurfacePolyPatch.

Definition at line 536 of file mappedPatchBase.C.

References word::null, Foam::writeEntry(), and Foam::writeEntryIfDifferent().

Referenced by mappedFilmWallPolyPatch::write(), mappedExtrudedPatchBase::write(), mappedPolyPatch::write(), and mappedWallPolyPatch::write().

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

◆ fromNeighbour() [3/4]

Foam::tmp<Foam::Field<Type> > fromNeighbour ( const Field< Type > &  nbrFld) const

Definition at line 109 of file mappedPatchBaseTemplates.C.

References List< T >::clear(), and tmp< T >::ref().

Here is the call graph for this function:

◆ fromNeighbour() [4/4]

Foam::tmp<Foam::Field<Type> > fromNeighbour ( const tmp< Field< Type >> &  nbrFld) const

Definition at line 162 of file mappedPatchBaseTemplates.C.

◆ toNeighbour() [3/4]

Foam::tmp<Foam::Field<Type> > toNeighbour ( const Field< Type > &  fld) const

Definition at line 172 of file mappedPatchBaseTemplates.C.

References fld(), and tmp< T >::ref().

Here is the call graph for this function:

◆ toNeighbour() [4/4]

Foam::tmp<Foam::Field<Type> > toNeighbour ( const tmp< Field< Type >> &  fld) const

Definition at line 224 of file mappedPatchBaseTemplates.C.

References fld().

Here is the call graph for this function:

Member Data Documentation

◆ patch_

const polyPatch& patch_
protected

Patch to map to.

Definition at line 77 of file mappedPatchBase.H.

Referenced by mappedExtrudedPatchBase::patchFaceAreas(), and mappedPatchBase::patchFaceAreas().

◆ coupleGroup_

const coupleGroupIdentifier coupleGroup_
protected

Couple group for the region/patch to map from.

Definition at line 80 of file mappedPatchBase.H.

◆ nbrRegionName_

word nbrRegionName_
mutableprotected

Name of the region to map from.

Definition at line 83 of file mappedPatchBase.H.

◆ nbrPatchName_

word nbrPatchName_
mutableprotected

Name of the patch to map from.

Definition at line 86 of file mappedPatchBase.H.

◆ transform_

cyclicTransform transform_
mutableprotected

The transformation between the patches.

Definition at line 89 of file mappedPatchBase.H.

◆ usingTree_

const bool usingTree_
protected

Are we using the tree mapping method, or a patch-to-patch.

intersection engine? The former is typically faster on small, pairs of patches with identical meshes. The latter is better parallelised and provides options for connecting patches with differing surface meshes.

Definition at line 96 of file mappedPatchBase.H.

◆ treeMapPtr_

autoPtr<distributionMap> treeMapPtr_
mutableprotected

Distributor (if using tree)

Definition at line 99 of file mappedPatchBase.H.

◆ treeNbrPatchFaceIndices_

labelList treeNbrPatchFaceIndices_
mutableprotected

Indices of the neighbouring patch faces who's values.

have to be supplied to the distribution map (if using tree)

Definition at line 103 of file mappedPatchBase.H.

◆ patchToPatchIsValid_

bool patchToPatchIsValid_
mutableprotected

Is the patch-to-patch intersection engine up to date? (if using.

patch-to-patch)

Definition at line 107 of file mappedPatchBase.H.

◆ patchToPatchPtr_

autoPtr<patchToPatch> patchToPatchPtr_
mutableprotected

Patch-to-patch intersection engine (if using patch-to-patch)

Definition at line 110 of file mappedPatchBase.H.

◆ defaultMatchTol_

const scalar defaultMatchTol_ = 1e-4
staticprotected

Default Matching tolerance.

Definition at line 113 of file mappedPatchBase.H.

◆ matchTol_

const scalar matchTol_
protected

Matching tolerance.

Definition at line 116 of file mappedPatchBase.H.

◆ reMapAfterMove_

const bool reMapAfterMove_
protected

Do we need to re-calculate the mapping if mesh motion takes place?

Defaults to true.

Definition at line 120 of file mappedPatchBase.H.

◆ reMapNbr_

bool reMapNbr_
mutableprotected

Do we need to re-map the neighbour because this patch moved?

Definition at line 123 of file mappedPatchBase.H.


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