Go to the documentation of this file.
91 #ifndef mappedPatchBase_H
92 #define mappedPatchBase_H
158 if (!
x.first().hit())
162 else if (
y.second().first() <
x.second().first())
178 if (!
x.first().hit())
182 else if (
y.second().second() >
x.second().second())
204 if (yi.
first().hit())
206 if (
x.second() ==
y.second())
208 if (!xi.
first().hit())
318 const label mySampleWorld,
343 const label myWorldIndex,
424 const vector& uniformOffset
434 const scalar normalDistance
507 inline label
comm() const;
524 const
bool forceUpdate = false
528 inline
bool owner() const;
599 const word& fieldName,
621 template<
class Type,
class CombineOp>
629 template<
class Type,
class CombineOp>
Encapsulates using "patchGroups" to specify coupled patch.
label communicator_
Communicator.
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
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
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
const vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
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 sample 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
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.
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
label comm() const
Identical to getCommunicator()
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Class containing processor-to-processor mapping information.
sampleMode mode() const noexcept
What to sample.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
scalarField samples(nIntervals, Zero)
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
vectorField offsets_
Offset vector (nonuniform)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
static fileName receivePath(const fileName &root, const label proci)
scalar distance_
Offset distance (normal)
void calcAMI() const
Calculate AMI interpolator.
bool masterWorld() const
Is my world ordered before the sampleWorld?
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
const word & sampleRegion() const
Region to sample.
const word & sampleWorld() const noexcept
World to sample.
void operator()(nearInfo &x, const nearInfo &y) const
TypeName("mappedPatchBase")
Runtime type information.
void calcMapping() const
Calculate mapping.
bool addWorldConnection()
Add a world-world connection.
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.
virtual void write(Ostream &os) const
Write as a dictionary.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
tmp< pointField > facePoints(const polyPatch &) const
label getWorldCommunicator() const
Get the communicator for the world-world connection.
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
bool owner() const
Is it owner.
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
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.
const vector & offset() const noexcept
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.