Go to the documentation of this file.
91 #ifndef mappedPatchBase_H
92 #define mappedPatchBase_H
160 if (!
x.first().hit())
164 else if (
y.second().first() <
x.second().first())
181 if (!
x.first().hit())
185 else if (
y.second().second() >
x.second().second())
208 if (yi.
first().hit())
210 if (
x.second() ==
y.second())
212 if (!xi.
first().hit())
319 const label mySampleWorld,
344 const label myWorldIndex,
493 inline label
comm()
const;
507 const bool forceUpdate =
false
578 const word& fieldName,
600 template<
class Type,
class CombineOp>
608 template<
class Type,
class CombineOp>
Encapsulates using "patchGroups" to specify coupled patch.
virtual void write(Ostream &) const
Write as a dictionary.
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
cellDecomposition
Enumeration defining the decomposition of the cell for.
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
A class for handling words, derived from Foam::string.
A class for handling file names.
nearest patch face + AMI interpolation
A class for managing temporary objects.
const mapDistribute & map() const
Return reference to the parallel distribution map.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
word sampleWorld_
World to sample.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
nearest point on selected patch
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
mappedPatchBase(const polyPatch &)
Construct from patch.
const polyMesh & lookupMesh(const word ®ion) const
Lookup mesh.
vector offset_
Offset vector (uniform)
void findLocalSamples(const sampleMode mode, const label sampleWorld, const word &sampleRegion, const word &samplePatch, const pointField &samplePoints, List< nearInfoWorld > &nearest) const
Find (local) cells/faces containing samples.
const sampleMode mode_
What to sample.
static const Enum< offsetMode > offsetModeNames_
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
A token holds an item read from Istream.
bool sameWorld() const
Is world the local world.
void findSamples(const sampleMode mode, const label myWorldIndex, const pointField &, const labelList &wantedWorlds, const labelList &origProcs, labelList &sampleProcs, labelList &sampleIndices, pointField &sampleLocations) const
Find (global) cells/faces containing samples.
bool sampleDatabase() const
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
nearest cell (even if not containing cell)
Mesh consisting of general polyhedral cells.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
virtual ~mappedPatchBase()
Destructor.
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
const vector & offset() const
Offset vector (from patch faces to destination mesh objects)
static const Enum< sampleMode > sampleModeNames_
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
Registry of regIOobjects.
autoPtr< mapDistribute > mapPtr_
Communication schedule:
word sampleRegion_
Region to sample.
tmp< pointField > samplePoints() const
Get the sample points.
void operator()(nearInfo &x, const nearInfo &y) const
label sampleSize() const
Return size of mapped mesh/patch/boundary.
const polyMesh & sampleMesh() const
Get the region mesh.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
autoPtr< searchableSurface > surfPtr_
Pointer to projection surface employed by AMI interpolator.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
label comm() const
Communicator.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Class containing processor-to-processor mapping information.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
scalarField samples(nIntervals, Zero)
const word & sampleWorld() const
World to sample.
const sampleMode & mode() const
What to sample.
vectorField offsets_
Offset vector (nonuniform)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static fileName receivePath(const fileName &root, const label proci)
scalar distance_
Offset distance (normal)
void calcAMI() const
Calculate AMI interpolator.
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
Collect single list of samples and originating processor+face +.
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
const word & sampleRegion() const
Region to sample.
void operator()(nearInfo &x, const nearInfo &y) const
scalar distance(const vector &p1, const vector &p2)
TypeName("mappedPatchBase")
Runtime type information.
void calcMapping() const
Calculate mapping.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
nearest face on selected patch
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
offsetMode offsetMode_
How to obtain samples.
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
nearest cell containing sample
const T2 & second() const noexcept
Return second.
offsetMode
How to project face centres.
bool sameRegion() const
Cached sampleRegion != mesh.name()
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres.
dictionary surfDict_
Dictionary storing projection surface description.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const polyPatch & patch_
Patch to sample.
const fileName & sampleDatabasePath() const
bool sameRegion_
Same region.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
use face normal + distance
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
const T1 & first() const noexcept
Return first.
sampleMode
Mesh items to sample.
static label communicator(const word &sampleWorld)
Optionally allocate a world-local communicator.
const vectorField & offsets() const
Offset vector (from patch faces to destination mesh objects)
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.