Engine which provides mapping from cells to patch faces. More...
Public Types | |
enum | offsetMode { NORMAL , DIRECTION } |
How to project face centres. More... | |
Public Member Functions | |
TypeName ("mappedInternalPatchBase") | |
Runtime type information. More... | |
mappedInternalPatchBase (const polyPatch &) | |
Construct from patch. More... | |
mappedInternalPatchBase (const polyPatch &pp, const word &nbrRegion) | |
Construct with no offset. More... | |
mappedInternalPatchBase (const polyPatch &, const dictionary &) | |
Construct from dictionary. More... | |
mappedInternalPatchBase (const polyPatch &, const mappedInternalPatchBase &) | |
Construct as copy, resetting patch. More... | |
virtual | ~mappedInternalPatchBase () |
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... | |
const distributionMap & | map () const |
Return reference to the parallel distribution map. More... | |
const labelList & | cellIndices () const |
Return the indices of the cells who's values have to be. More... | |
const polyMesh & | nbrMesh () const |
Get the region mesh. More... | |
tmp< pointField > | samplePoints () const |
Get the sample points. More... | |
void | clearOut () |
Clear out data on mesh change. More... | |
template<class Type > | |
tmp< Field< Type > > | distribute (const Field< Type > &fld) const |
Wrapper around map/interpolate data distribution. More... | |
template<class Type > | |
tmp< Field< Type > > | distribute (const tmp< Field< Type >> &fld) const |
Wrapper around map/interpolate data distribution. More... | |
virtual void | write (Ostream &) const |
Write as a dictionary. More... | |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | distribute (const Field< Type > &fld) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | distribute (const tmp< Field< Type >> &fld) const |
Static Public Member Functions | |
static bool | specified (const dictionary &dict) |
Return whether or not the given dictionary contains a. More... | |
Static Public Attributes | |
static const NamedEnum< offsetMode, 2 > | offsetModeNames_ |
Protected Member Functions | |
offsetMode | readOffsetMode (const dictionary &dict) const |
Read the offset mode from a dictionary. More... | |
void | calcMapping () const |
Calculate mapping. More... | |
Protected Attributes | |
const polyPatch & | patch_ |
Patch to map to. More... | |
word | nbrRegionName_ |
Name of the region to map from. More... | |
offsetMode | offsetMode_ |
How to offset the patch face centres to the sampling locations. More... | |
scalar | distance_ |
Offset distance. More... | |
vector | offset_ |
Offset vector. More... | |
autoPtr< distributionMap > | mapPtr_ |
Distributor. More... | |
labelList | cellIndices_ |
Indices of the cells who's values have to be supplied to the. More... | |
Engine which provides mapping from cells to patch faces.
Example:
// The name of the region to map from. Optional. Defaults to the same // region as the patch. neighbourRegion region0; // How to offset the patch face centres to the sampling locations. // Optional. This will be inferred if there is a single entry of either // "distance" or "offset". // - normal : distance along the patch face normals // - direction : specified offset vector offsetMode direction; // If offsetMode is normal : The normal distance to offset distance 1; // If offsetMode is direction : The offset vector offset (1 0 0);
Note that patch normals point outward, so if offsetMode is normal
then a negative distance will be required in order to map values from inside the region.
Definition at line 73 of file mappedInternalPatchBase.H.
enum offsetMode |
How to project face centres.
Enumerator | |
---|---|
NORMAL | |
DIRECTION |
Definition at line 80 of file mappedInternalPatchBase.H.
mappedInternalPatchBase | ( | const polyPatch & | pp | ) |
Construct from patch.
Definition at line 289 of file mappedInternalPatchBase.C.
mappedInternalPatchBase | ( | const polyPatch & | pp, |
const word & | nbrRegion | ||
) |
Construct with no offset.
Definition at line 304 of file mappedInternalPatchBase.C.
mappedInternalPatchBase | ( | const polyPatch & | pp, |
const dictionary & | dict | ||
) |
Construct from dictionary.
Definition at line 320 of file mappedInternalPatchBase.C.
mappedInternalPatchBase | ( | const polyPatch & | pp, |
const mappedInternalPatchBase & | mpb | ||
) |
Construct as copy, resetting patch.
Definition at line 353 of file mappedInternalPatchBase.C.
|
virtual |
Destructor.
Definition at line 371 of file mappedInternalPatchBase.C.
|
protected |
Read the offset mode from a dictionary.
Definition at line 63 of file mappedInternalPatchBase.C.
References dict, mappedInternalPatchBase::DIRECTION, mappedInternalPatchBase::NORMAL, mappedInternalPatchBase::offsetModeNames_, and NamedEnum< Enum, nEnum >::read().
|
protected |
Calculate mapping.
Definition at line 94 of file mappedInternalPatchBase.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), primitiveMesh::cellCentres(), polyMesh::cellTree(), UList< T >::data(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, indexedOctree< Type >::findInside(), forAll, Pstream::gatherList(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::magSqr(), UPstream::myProcNo(), IOstream::name(), Foam::name(), UPstream::nProcs(), p, Foam::returnReduce(), Pstream::scatterList(), globalIndex::size(), Foam::sqr(), globalIndex::toGlobal(), List< T >::transfer(), WarningInFunction, and OBJstream::write().
Referenced by mappedInternalPatchBase::distribute().
TypeName | ( | "mappedInternalPatchBase" | ) |
Runtime type information.
|
inline |
Name of the region to map from.
Definition at line 30 of file mappedInternalPatchBaseI.H.
References mappedInternalPatchBase::nbrRegionName_.
|
inline |
Is the neighbour region the same as for this patch?
Definition at line 36 of file mappedInternalPatchBaseI.H.
|
inline |
Return reference to the parallel distribution map.
Definition at line 42 of file mappedInternalPatchBaseI.H.
|
inline |
Return the indices of the cells who's values have to be.
supplied to the distribution map
Definition at line 53 of file mappedInternalPatchBaseI.H.
const Foam::polyMesh & nbrMesh | ( | ) | const |
Get the region mesh.
Definition at line 377 of file mappedInternalPatchBase.C.
References polyMesh::boundaryMesh(), objectRegistry::lookupObject(), polyBoundaryMesh::mesh(), and objectRegistry::time().
Foam::tmp< Foam::pointField > samplePoints | ( | ) | const |
Get the sample points.
Definition at line 386 of file mappedInternalPatchBase.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), PointHit< Point >::distance(), f(), UList< T >::fcIndex(), forAll, intersection::halfRay, PointHit< Point >::hit(), PointHit< Point >::hitPoint(), triangle< Point, PointRef >::intersection(), polyBoundaryMesh::mesh(), polyMesh::points(), tmp< T >::ref(), List< T >::size(), and polyMesh::tetBasePtIs().
void clearOut | ( | ) |
Clear out data on mesh change.
Definition at line 460 of file mappedInternalPatchBase.C.
Referenced by mappedInternalPolyPatch::calcGeometry(), mappedInternalPolyPatch::movePoints(), and mappedInternalPolyPatch::topoChange().
Wrapper around map/interpolate data distribution.
Wrapper around map/interpolate data distribution.
|
static |
Return whether or not the given dictionary contains a.
mappedInternalPatchBase specification
Definition at line 467 of file mappedInternalPatchBase.C.
References dict, and dictionary::found().
|
virtual |
Write as a dictionary.
Reimplemented in mappedInternalPolyPatch.
Definition at line 477 of file mappedInternalPatchBase.C.
References IOstream::name(), Foam::writeEntry(), and Foam::writeEntryIfDifferent().
Referenced by mappedInternalPolyPatch::write().
Foam::tmp<Foam::Field<Type> > distribute | ( | const Field< Type > & | fld | ) | const |
Definition at line 32 of file mappedInternalPatchBaseTemplates.C.
References mappedInternalPatchBase::calcMapping(), mappedInternalPatchBase::cellIndices_, fld(), mappedInternalPatchBase::mapPtr_, and tmp< T >::ref().
Foam::tmp<Foam::Field<Type> > distribute | ( | const tmp< Field< Type >> & | fld | ) | const |
Definition at line 46 of file mappedInternalPatchBaseTemplates.C.
References fld().
|
static |
Definition at line 86 of file mappedInternalPatchBase.H.
Referenced by mappedInternalPatchBase::readOffsetMode().
|
protected |
Patch to map to.
Definition at line 94 of file mappedInternalPatchBase.H.
|
protected |
Name of the region to map from.
Definition at line 97 of file mappedInternalPatchBase.H.
Referenced by mappedInternalPatchBase::nbrRegionName().
|
protected |
How to offset the patch face centres to the sampling locations.
Definition at line 100 of file mappedInternalPatchBase.H.
|
protected |
Offset distance.
Definition at line 103 of file mappedInternalPatchBase.H.
|
protected |
Offset vector.
Definition at line 106 of file mappedInternalPatchBase.H.
|
mutableprotected |
Distributor.
Definition at line 109 of file mappedInternalPatchBase.H.
Referenced by mappedInternalPatchBase::distribute().
|
mutableprotected |
Indices of the cells who's values have to be supplied to the.
distribution map
Definition at line 113 of file mappedInternalPatchBase.H.
Referenced by mappedInternalPatchBase::distribute().