44 if (sampleRegion_.empty())
46 if (!coupleGroup_.valid())
49 <<
"Supply either a regionName or a coupleGroup"
50 <<
" for patch " << patch_.name()
51 <<
" in region " << patch_.boundaryMesh().mesh().name()
56 label samplePatchID = coupleGroup_.findOtherPatchID
62 samplePatch_ = sampleMesh().boundaryMesh()[samplePatchID].name();
70 if (samplePatch_.empty())
72 if (!coupleGroup_.valid())
75 <<
"Supply either a patchName or a coupleGroup"
76 <<
" for patch " << patch_.name()
77 <<
" in region " << patch_.boundaryMesh().mesh().name() <<
nl
82 label samplePatchID = coupleGroup_.findOtherPatchID
88 samplePatch_ = sampleMesh().boundaryMesh()[samplePatchID].name();
96 return coupleGroup_.name();
104 case NEARESTPATCHFACEAMI:
106 return samplePolyPatch().size();
110 return sampleMesh().nCells();
112 case NEARESTPATCHFACE:
114 return samplePolyPatch().size();
116 case NEARESTPATCHPOINT:
118 return samplePolyPatch().nPoints();
150 if (communicator_ == -1)
152 const_cast<label&
>(communicator_) = getWorldCommunicator();
154 return communicator_;
161 if (communicator_ == -1)
163 const_cast<label&
>(communicator_) = getWorldCommunicator();
165 return communicator_;
174 || sampleWorld_.
empty()
203 (sameWorld() && sampleMesh().topoChanging())
208 mapPtr_.reset(
nullptr);
227 (sameWorld() && sampleMesh().topoChanging())
230 if (topoChange || forceUpdate)
232 AMIPtr_->upToDate() =
false;
243 return (patch_.boundaryMesh().mesh().name() < sampleRegion());
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
static label myWorldID()
My worldID.
static const wordList & allWorlds() noexcept
All worlds.
static const word & myWorld()
My world.
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Class containing processor-to-processor mapping information.
const mapDistribute & map() const
Return reference to the parallel distribution map.
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
bool owner() const
Is it owner.
const vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
sampleMode
Mesh items to sample.
const sampleMode mode_
What to sample.
label sampleSize() const
Return size of mapped mesh/patch/boundary.
label comm() const
Identical to getCommunicator()
bool masterWorld() const
Is my world ordered before the sampleWorld?
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
const word & sampleWorld() const noexcept
World to sample.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
sampleMode mode() const noexcept
What to sample.
const word & sampleRegion() const
Region to sample.
bool sameWorld() const
Is sample world the local world?
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
const polyMesh & mesh() const noexcept
Return the mesh reference.
Mesh consisting of general polyhedral cells.
bool topoChanging() const noexcept
Is mesh topology changing.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)