Engine which provides mapping between two patches. More...
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 word & | nbrRegionName () 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 word & | nbrPatchName () const |
Name of the patch to map from. More... | |
const polyMesh & | nbrMesh () const |
Get the mesh for the region to map from. More... | |
const polyPatch & | nbrPolyPatch () 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 mappedPatchBase & | getMap (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< vectorField > | patchFaceAreas () const |
Get the face-areas for this patch. More... | |
virtual tmp< pointField > | patchFaceCentres () const |
Get the face-centres for this patch. More... | |
virtual tmp< pointField > | patchLocalPoints () const |
Get the local points for this patch. More... | |
tmp< vectorField > | nbrPatchFaceAreas () const |
Get the face-areas for the neighbour patch. More... | |
tmp< pointField > | nbrPatchFaceCentres () const |
Get the face-centres for the neighbour patch. More... | |
tmp< pointField > | nbrPatchLocalPoints () 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 mappedPatchBase & | nbrMappedPatch () const |
Get the mapped neighbouring patch. More... | |
bool | symmetric () const |
Determine whether the neighbouring patch maps from this patch in. More... | |
Protected Attributes | |
const polyPatch & | patch_ |
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< distributionMap > | treeMapPtr_ |
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< patchToPatch > | patchToPatchPtr_ |
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... | |
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;
Definition at line 70 of file mappedPatchBase.H.
mappedPatchBase | ( | const polyPatch & | pp | ) |
Construct from patch.
Definition at line 323 of file mappedPatchBase.C.
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 | ( | const polyPatch & | pp, |
const dictionary & | dict, | ||
const bool | defaultTransformIsNone | ||
) |
Construct from dictionary.
Definition at line 365 of file mappedPatchBase.C.
mappedPatchBase | ( | const polyPatch & | pp, |
const mappedPatchBase & | mpb | ||
) |
Construct as copy, resetting patch.
Definition at line 433 of file mappedPatchBase.C.
|
virtual |
Destructor.
Definition at line 462 of file mappedPatchBase.C.
|
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().
|
protectedvirtual |
Get the face-centres for this patch.
Reimplemented in mappedExtrudedPatchBase.
Definition at line 53 of file mappedPatchBase.C.
Referenced by mappedExtrudedPatchBase::patchFaceCentres().
|
protectedvirtual |
Get the local points for this patch.
Reimplemented in mappedExtrudedPatchBase.
Definition at line 59 of file mappedPatchBase.C.
Referenced by mappedExtrudedPatchBase::patchLocalPoints().
|
protected |
Get the face-areas for the neighbour patch.
Definition at line 65 of file mappedPatchBase.C.
References PrimitivePatch< FaceList, PointField >::faceAreas().
|
protected |
Get the face-centres for the neighbour patch.
Definition at line 74 of file mappedPatchBase.C.
References PrimitivePatch< FaceList, PointField >::faceCentres().
|
protected |
Get the local points for the neighbour patch.
Definition at line 83 of file mappedPatchBase.C.
|
protected |
Calculate mapping.
Definition at line 92 of file mappedPatchBase.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), UList< T >::data(), Foam::e, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Pstream::gatherList(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::magSqr(), UPstream::myProcNo(), Foam::name(), Foam::nl, UPstream::nProcs(), p, PrimitivePatch< FaceList, PointField >::pointNormals(), Pstream::scatterList(), globalIndex::size(), boundBox::span(), Foam::sqr(), globalIndex::toGlobal(), and List< T >::transfer().
|
inlineprotected |
Return whether or not the neighbour patch is of mapped type.
Definition at line 30 of file mappedPatchBaseI.H.
References mappedPatchBase::nbrPolyPatch().
|
inlineprotected |
Get the mapped neighbouring patch.
Definition at line 37 of file mappedPatchBaseI.H.
|
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 | ( | "mappedPatchBase" | ) |
Runtime type information.
|
inline |
Name of the region to map from.
Definition at line 57 of file mappedPatchBaseI.H.
|
inline |
Is the neighbour region the same as for this patch?
Definition at line 84 of file mappedPatchBaseI.H.
|
inline |
Is the neighbour patch the same as this patch?
Definition at line 90 of file mappedPatchBaseI.H.
|
inline |
Is the neighbour patch the same as this patch with no transform?
Definition at line 96 of file mappedPatchBaseI.H.
|
inline |
Name of the patch to map from.
Definition at line 73 of file mappedPatchBaseI.H.
const Foam::polyMesh & nbrMesh | ( | ) | const |
Get the mesh for the region to map from.
Definition at line 468 of file mappedPatchBase.C.
References polyMesh::boundaryMesh(), objectRegistry::lookupObject(), polyBoundaryMesh::mesh(), and objectRegistry::time().
Referenced by semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp(), VoFFilmTransfer::correct(), radiationCoupledBase::emissivity(), VoFFilmTransfer::filmVoFTransferRate(), filmSurfaceVelocityFvPatchVectorField::updateCoeffs(), mappedFlowRateVelocityFvPatchVectorField::updateCoeffs(), mappedVelocityFluxFvPatchField::updateCoeffs(), and coupledTemperatureFvPatchScalarField::updateCoeffs().
const Foam::polyPatch & nbrPolyPatch | ( | ) | const |
Get the patch to map from.
Definition at line 477 of file mappedPatchBase.C.
References polyMesh::boundaryMesh(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::findPatchID(), polyBoundaryMesh::names(), and patchi.
Referenced by semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp(), VoFFilmTransfer::correct(), radiationCoupledBase::emissivity(), mappedPatchBase::nbrPatchIsMapped(), filmSurfaceVelocityFvPatchVectorField::updateCoeffs(), mappedFlowRateVelocityFvPatchVectorField::updateCoeffs(), mappedVelocityFluxFvPatchField::updateCoeffs(), and coupledTemperatureFvPatchScalarField::updateCoeffs().
|
static |
Cast the given polyPatch to a mappedPatchBase. Handle errors.
Definition at line 496 of file mappedPatchBase.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and patchIdentifier::name().
Referenced by semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp(), radiationCoupledBase::emissivity(), filmSurfaceVelocityFvPatchVectorField::updateCoeffs(), mappedFlowRateVelocityFvPatchVectorField::updateCoeffs(), mappedVelocityFluxFvPatchField::updateCoeffs(), coupledTemperatureFvPatchScalarField::updateCoeffs(), and thermalBaffle1DFvPatchScalarField< solidType >::updateCoeffs().
|
static |
Validate that the map exists and is appropriate for the given.
set of permitted configurations
Definition at line 32 of file mappedPatchBaseTemplates.C.
References Foam::stringOps::breakIntoIndentedLines(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, OSstream::name(), patchIdentifier::name(), OStringStream::str(), and fileName::type().
Referenced by coupledTemperatureFvPatchScalarField::coupledTemperatureFvPatchScalarField(), mappedFlowRateVelocityFvPatchVectorField::mappedFlowRateVelocityFvPatchVectorField(), mappedVelocityFluxFvPatchField::mappedVelocityFluxFvPatchField(), semiPermeableBaffleMassFractionFvPatchScalarField::semiPermeableBaffleMassFractionFvPatchScalarField(), and thermalBaffle1DFvPatchScalarField< solidType >::thermalBaffle1DFvPatchScalarField().
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().
|
virtual |
Clear out data on mesh change.
Reimplemented in mappedExtrudedPatchBase.
Definition at line 512 of file mappedPatchBase.C.
Referenced by mappedFilmWallPolyPatch::calcGeometry(), mappedPolyPatch::calcGeometry(), mappedWallPolyPatch::calcGeometry(), mappedExtrudedPatchBase::clearOut(), mappedFilmWallPolyPatch::movePoints(), mappedPolyPatch::movePoints(), mappedWallPolyPatch::movePoints(), mappedFilmWallPolyPatch::topoChange(), mappedPolyPatch::topoChange(), and mappedWallPolyPatch::topoChange().
Map/interpolate the neighbour patch field to this patch.
Referenced by semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp(), VoFFilmTransfer::correct(), radiationCoupledBase::emissivity(), VoFFilmTransfer::filmVoFTransferRate(), filmSurfaceVelocityFvPatchVectorField::updateCoeffs(), mappedFlowRateVelocityFvPatchVectorField::updateCoeffs(), mappedVelocityFluxFvPatchField::updateCoeffs(), coupledTemperatureFvPatchScalarField::updateCoeffs(), and thermalBaffle1DFvPatchScalarField< solidType >::updateCoeffs().
Map/interpolate the neighbour patch field to this patch.
Map/interpolate patch field to the neighbour patch.
Map/interpolate patch field to the neighbour patch.
|
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().
|
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().
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().
Foam::tmp<Foam::Field<Type> > fromNeighbour | ( | const tmp< Field< Type >> & | nbrFld | ) | const |
Definition at line 162 of file mappedPatchBaseTemplates.C.
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().
Foam::tmp<Foam::Field<Type> > toNeighbour | ( | const tmp< Field< Type >> & | fld | ) | const |
Definition at line 224 of file mappedPatchBaseTemplates.C.
References fld().
|
protected |
Patch to map to.
Definition at line 77 of file mappedPatchBase.H.
Referenced by mappedExtrudedPatchBase::patchFaceAreas(), and mappedPatchBase::patchFaceAreas().
|
protected |
Couple group for the region/patch to map from.
Definition at line 80 of file mappedPatchBase.H.
|
mutableprotected |
Name of the region to map from.
Definition at line 83 of file mappedPatchBase.H.
|
mutableprotected |
Name of the patch to map from.
Definition at line 86 of file mappedPatchBase.H.
|
mutableprotected |
The transformation between the patches.
Definition at line 89 of file mappedPatchBase.H.
|
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.
|
mutableprotected |
Distributor (if using tree)
Definition at line 99 of file mappedPatchBase.H.
|
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.
|
mutableprotected |
Is the patch-to-patch intersection engine up to date? (if using.
patch-to-patch)
Definition at line 107 of file mappedPatchBase.H.
|
mutableprotected |
Patch-to-patch intersection engine (if using patch-to-patch)
Definition at line 110 of file mappedPatchBase.H.
|
staticprotected |
Default Matching tolerance.
Definition at line 113 of file mappedPatchBase.H.
|
protected |
Matching tolerance.
Definition at line 116 of file mappedPatchBase.H.
|
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.
|
mutableprotected |
Do we need to re-map the neighbour because this patch moved?
Definition at line 123 of file mappedPatchBase.H.