91#ifndef Foam_mappedPatchBase_H
92#define Foam_mappedPatchBase_H
160 if (!
x.first().hit())
164 else if (
y.second().first() <
x.second().first())
180 if (!
x.first().hit())
184 else if (
y.second().second() >
x.second().second())
197 class nearestWorldEqOp
208 if (
x.second() ==
y.second())
356 const label mySampleWorld,
381 const label myWorldIndex,
463 const vector& uniformOffset
473 const scalar normalDistance
546 inline label
comm() const;
571 const
bool forceUpdate = false
575 inline
bool owner() const;
619 static fileName
sendPath(
const fileName& root,
const label proci);
621 virtual fileName
sendPath(
const label proci)
const;
627 const fileName& root,
631 virtual fileName
receivePath(
const label proci)
const;
638 const objectRegistry& obr,
647 const word& fieldName,
648 const Field<Type>& values
654 const objectRegistry& obr,
669 template<
class Type,
class CombineOp>
670 void distribute(List<Type>& lst,
const CombineOp& cop)
const;
677 template<
class Type,
class CombineOp>
684 virtual void write(Ostream&
os)
const;
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool hit() const noexcept
Is there a hit?
Buffers for inter-processor communications streams (UOPstream, UIPstream).
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Access the first element.
const T2 & second() const noexcept
Access the second element.
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
const fileName & sampleDatabasePath() const
label communicator_
Communicator.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres and project them onto the face-diagonal-de...
label getWorldCommunicator() const
Get the communicator for the world-world connection.
tmp< pointField > samplePoints(const pointField &) const
Get the sample points given the face points.
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.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
uniformDimensionedScalarField & updateSampleMeshTime() const
Local mesh update time.
TypeName("mappedPatchBase")
Runtime type information.
static FOAM_NO_DANGLING_REFERENCE 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...
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.
uniformDimensionedScalarField & updateMeshTime() const
Sample mesh upate time.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
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.
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.
mappedPatchBase(const polyPatch &)
Construct from patch.
autoPtr< uniformDimensionedScalarField > updateSampleMeshTimePtr_
Sample mesh update time.
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.
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
bool sampleDatabase() const noexcept
bool masterWorld() const
Is my world ordered before the sampleWorld?
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
static fileName receivePath(const fileName &root, const label proci)
Helper: return path to store data to be received from processor i.
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.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
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.
autoPtr< uniformDimensionedScalarField > updateMeshTimePtr_
Local mesh update time.
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.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
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)
List< word > wordList
List of word.
List< label > labelList
A List of labels.
UniformDimensionedField< scalar > uniformDimensionedScalarField
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
UList< label > labelUList
A UList of labels.
#define FOAM_NO_DANGLING_REFERENCE
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
scalarField samples(nIntervals, Zero)