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>
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Return first.
const T2 & second() const noexcept
Return second.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Encapsulates using "patchGroups" to specify coupled patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Class containing processor-to-processor mapping information.
void operator()(nearInfo &x, const nearInfo &y) const
void operator()(nearInfo &x, const nearInfo &y) const
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
const fileName & sampleDatabasePath() const
label communicator_
Communicator.
tmp< pointField > facePoints(const polyPatch &) const
label getWorldCommunicator() const
Get the communicator for the world-world connection.
const mapDistribute & map() const
Return reference to the parallel distribution map.
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
scalar distance_
Offset distance (normal)
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
TypeName("mappedPatchBase")
Runtime type information.
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
bool owner() const
Is it owner.
const polyPatch & patch_
Patch to sample.
autoPtr< searchableSurface > surfPtr_
Pointer to projection surface employed by AMI interpolator.
vectorField offsets_
Offset vector (nonuniform)
const vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
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.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
sampleMode
Mesh items to sample.
@ NEARESTPATCHPOINT
nearest point on selected patch
@ NEARESTONLYCELL
nearest cell (even if not containing cell)
@ NEARESTCELL
nearest cell containing sample
@ NEARESTPATCHFACE
nearest face on selected patch
@ NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
@ NEARESTFACE
nearest face
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 bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
void calcAMI() const
Calculate AMI interpolator.
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
static const Enum< sampleMode > sampleModeNames_
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
bool sampleDatabase() const
const sampleMode mode_
What to sample.
const polyMesh & sampleMesh() const
Get the region mesh.
bool sameRegion_
Same region.
word sampleRegion_
Region to sample.
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
label sampleSize() const
Return size of mapped mesh/patch/boundary.
label comm() const
Identical to getCommunicator()
tmp< pointField > samplePoints() const
Get the sample points.
bool addWorldConnection()
Add a world-world connection.
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
autoPtr< mapDistribute > mapPtr_
Communication schedule:
const polyPatch & samplePolyPatch() const
Get the patch on the region.
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
bool masterWorld() const
Is my world ordered before the sampleWorld?
static fileName receivePath(const fileName &root, const label proci)
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
offsetMode
How to project face centres.
@ NORMAL
use face normal + distance
@ UNIFORM
single offset vector
@ NONUNIFORM
per-face offset vector
const word & sampleWorld() const noexcept
World to sample.
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
dictionary surfDict_
Dictionary storing projection surface description.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
static const Enum< offsetMode > offsetModeNames_
virtual ~mappedPatchBase()
Destructor.
void calcMapping() const
Calculate mapping.
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
sampleMode mode() const noexcept
What to sample.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
const word & sampleRegion() const
Region to sample.
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
const polyMesh & lookupMesh(const word ®ion) const
Lookup mesh.
vector offset_
Offset vector (uniform)
offsetMode offsetMode_
How to obtain samples.
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
bool sameWorld() const
Is sample world the local world?
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
word sampleWorld_
World to sample.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
A class for managing temporary objects.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
OBJstream os(runTime.globalPath()/outputName)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
scalarField samples(nIntervals, Zero)