91 #ifndef mappedPatchBase_H 92 #define mappedPatchBase_H 159 if (!
x.first().hit())
163 else if (
y.second().first() <
x.second().first())
179 if (!
x.first().hit())
183 else if (
y.second().second() >
x.second().second())
196 class nearestWorldEqOp
207 if (
x.second() ==
y.second())
209 if (!xi.
first().hit())
329 const label mySampleWorld,
354 const label myWorldIndex,
435 const vector& uniformOffset
445 const scalar normalDistance
518 inline label
comm() const;
543 const
bool forceUpdate = false
547 inline
bool owner() const;
591 static fileName
sendPath(
const fileName& root,
const label proci);
593 virtual fileName
sendPath(
const label proci)
const;
599 const fileName& root,
603 virtual fileName
receivePath(
const label proci)
const;
609 const objectRegistry& obr,
618 const word& fieldName,
625 const objectRegistry& obr,
630 static void readDict(
const dictionary& d, objectRegistry& obr);
640 template<
class Type,
class CombineOp>
641 void distribute(List<Type>& lst,
const CombineOp& cop)
const;
648 template<
class Type,
class CombineOp>
655 virtual void write(Ostream&
os)
const;
label getWorldCommunicator() const
Get the communicator for the world-world connection.
bool sampleDatabase() const
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
use face normal + distance
nearest point on selected patch
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
const polyMesh & lookupMesh(const word ®ion) const
Lookup mesh.
nearest face on selected patch
vector offset_
Offset vector (uniform)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
A class for handling file names.
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
void operator()(nearInfo &x, const nearInfo &y) const
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
static const Enum< offsetMode > offsetModeNames_
word sampleRegion_
Region to sample.
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
autoPtr< mapDistribute > mapPtr_
Communication schedule:
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< pointField > samplePoints() const
Get the sample points.
const polyPatch & patch_
Patch to sample.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const polyMesh & sampleMesh() const
Get the region mesh.
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
bool sameRegion_
Same region.
autoPtr< searchableSurface > surfPtr_
Pointer to projection surface employed by AMI interpolator.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
virtual ~mappedPatchBase()
Destructor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds an item read from Istream.
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
autoPtr< uniformDimensionedScalarField > updateMeshTimePtr_
Local mesh update time.
uniformDimensionedScalarField & updateMeshTime() const
Sample mesh upate time.
scalarField samples(nIntervals, Zero)
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
Lookup (sub)objectRegistry by following names of sub registries. Creates non-existing intermediate on...
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
uniformDimensionedScalarField & updateSampleMeshTime() const
Local mesh update time.
const mapDistribute & map() const
Return reference to the parallel distribution map.
vectorField offsets_
Offset vector (nonuniform)
scalar distance_
Offset distance (normal)
nearest patch face + AMI interpolation
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
bool sameWorld() const
Is sample world the local world?
word sampleWorld_
World to sample.
static fileName receivePath(const fileName &root, const label proci)
Helper: return path to store data to be received from processor i.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
bool masterWorld() const
Is my world ordered before the sampleWorld?
A class for handling words, derived from Foam::string.
TypeName("mappedPatchBase")
Runtime type information.
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.
void calcMapping() const
Calculate mapping.
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
offsetMode offsetMode_
How to obtain samples.
Encapsulates using "patchGroups" to specify coupled patch.
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres and project them onto the face-diagonal-de...
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
static const Enum< sampleMode > sampleModeNames_
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const fileName & sampleDatabasePath() const
OBJstream os(runTime.globalPath()/outputName)
label sampleSize() const
Return size of mapped mesh/patch/boundary.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
virtual void write(Ostream &os) const
Write as a dictionary.
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
offsetMode
How to project face centres.
dictionary surfDict_
Dictionary storing projection surface description.
autoPtr< uniformDimensionedScalarField > updateSampleMeshTimePtr_
Sample mesh update time.
void operator()(nearInfo &x, const nearInfo &y) const
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
label comm() const
Identical to getCommunicator()
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
sampleMode mode() const noexcept
What to sample.
bool owner() const
Is it owner.
Class containing processor-to-processor mapping information.
void calcAMI() const
Calculate AMI interpolator.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
nearest cell containing sample
const T2 & second() const noexcept
Access the second element.
sampleMode
Mesh items to sample.
nearest cell (even if not containing cell)
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const word & sampleWorld() const noexcept
World to sample.
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
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 + wanted world.
A class for managing temporary objects.
Registry of regIOobjects.
A patch is a list of labels that address the faces in the global face list.
const T1 & first() const noexcept
Access the first element.
const word & sampleRegion() const
Region to sample.
label communicator_
Communicator.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
bool addWorldConnection()
Add a world-world connection.
mappedPatchBase(const polyPatch &)
Construct from patch.
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 vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
const sampleMode mode_
What to sample.