Go to the documentation of this file.
65 { sampleMode::NEARESTCELL,
"nearestCell" },
66 { sampleMode::NEARESTPATCHFACE,
"nearestPatchFace" },
67 { sampleMode::NEARESTPATCHFACEAMI,
"nearestPatchFaceAMI" },
68 { sampleMode::NEARESTPATCHPOINT,
"nearestPatchPoint" },
69 { sampleMode::NEARESTFACE,
"nearestFace" },
70 { sampleMode::NEARESTONLYCELL,
"nearestOnlyCell" },
80 { offsetMode::UNIFORM,
"uniform" },
81 { offsetMode::NONUNIFORM,
"nonuniform" },
82 { offsetMode::NORMAL,
"normal" },
95 if (
dict.found(
"sampleDatabase"))
97 const bool useDb =
dict.get<
bool>(
"sampleDatabase");
106 "sampleDatabasePath",
113 else if (
dict.found(
"sampleDatabasePath"))
124 const word& sampleWorld
128 label comm = UPstream::worldComm;
130 if (!sampleWorld.empty() && Pstream::parRun())
132 if (!UPstream::allWorlds().found(sampleWorld))
135 <<
" in set of worlds " << UPstream::allWorlds()
139 const labelList& worldIDs = UPstream::worldIDs();
144 const label worldi = worldIDs[proci];
147 worldi == UPstream::myWorldID()
148 || UPstream::allWorlds()[worldi] == sampleWorld
156 comm = UPstream::allocateCommunicator(0, subRanks,
true);
160 Pout<<
"mappedPatchBase::communicator :"
161 <<
" myWorld:" << UPstream::myWorld()
162 <<
" sampleWorld:" << sampleWorld
163 <<
" using subRanks:" << subRanks
164 <<
" new comm:" << comm <<
endl;
180 (void)
mesh.tetBasePtIs();
192 polyMesh::FACE_DIAG_TRIS
202 const label mySampleWorld,
211 const label oldComm(Pstream::warnComm);
212 Pstream::warnComm = comm_;
214 const label myRank = Pstream::myProcNo(comm_);
215 const label nProcs = Pstream::nProcs(comm_);
220 globalFc[myRank] = facePoints;
221 Pstream::gatherList(globalFc, Pstream::msgType(), comm_);
222 Pstream::scatterList(globalFc, Pstream::msgType(), comm_);
224 patchFc = ListListOps::combine<pointField>
233 globalSamples[myRank] = samplePoints(facePoints);
234 Pstream::gatherList(globalSamples, Pstream::msgType(), comm_);
235 Pstream::scatterList(globalSamples, Pstream::msgType(), comm_);
237 samples = ListListOps::combine<pointField>
246 globalFaces[myRank] =
identity(patch_.size());
248 Pstream::gatherList(globalFaces, Pstream::msgType(), comm_);
249 Pstream::scatterList(globalFaces, Pstream::msgType(), comm_);
251 patchFaces = ListListOps::combine<labelList>
260 procToWorldIndex[myRank] = mySampleWorld;
261 Pstream::gatherList(procToWorldIndex, Pstream::msgType(), comm_);
262 Pstream::scatterList(procToWorldIndex, Pstream::msgType(), comm_);
265 nPerProc[myRank] = patch_.size();
266 Pstream::gatherList(nPerProc, Pstream::msgType(), comm_);
267 Pstream::scatterList(nPerProc, Pstream::msgType(), comm_);
269 patchFaceWorlds.
setSize(patchFaces.size());
270 patchFaceProcs.
setSize(patchFaces.size());
275 for (label i = 0; i < nPerProc[proci]; i++)
277 patchFaceWorlds[sampleI] = procToWorldIndex[proci];
278 patchFaceProcs[sampleI] = proci;
283 Pstream::warnComm = oldComm;
291 const label mySampleWorld,
292 const word& sampleRegion,
293 const word& samplePatch,
301 const label myRank = Pstream::myProcNo(comm_);
319 if (samplePatch.size() && samplePatch !=
"none")
322 <<
"No need to supply a patch name when in "
339 near.
first().second().second() = myRank;
340 near.
second() = mySampleWorld;
344 const point& cc =
mesh.cellCentres()[celli];
353 near.
first().second().second() = myRank;
354 near.
second() = mySampleWorld;
360 case NEARESTONLYCELL:
362 if (samplePatch.size() && samplePatch !=
"none")
365 <<
"No need to supply a patch name when in "
377 near.
first().first() = tree.findNearest(sample,
sqr(GREAT));
380 near.
first().first().hitPoint()
383 near.
first().second().second() = myRank;
384 near.
second() = mySampleWorld;
389 case NEARESTPATCHFACE:
393 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
401 near.
first().second().second() = myRank;
402 near.
second() = mySampleWorld;
415 patchBb.
min() -= point::uniform(ROOTVSMALL);
416 patchBb.max() += point::uniform(ROOTVSMALL);
447 near.
first().second().second() = myRank;
448 near.
second() = mySampleWorld;
455 near.
first().second().second() = myRank;
456 near.
second() = mySampleWorld;
463 case NEARESTPATCHPOINT:
467 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
475 near.
first().second().second() = myRank;
476 near.
second() = mySampleWorld;
490 patchBb.
min() -= point::uniform(ROOTVSMALL);
491 patchBb.max() += point::uniform(ROOTVSMALL);
521 near.
first().second().second() = myRank;
522 near.
second() = mySampleWorld;
529 near.
first().second().second() = myRank;
530 near.
second() = mySampleWorld;
539 if (samplePatch.size() && samplePatch !=
"none")
542 <<
"No need to supply a patch name when in "
560 near.
first().second().second() = myRank;
561 near.
second() = mySampleWorld;
565 const point& fc =
mesh.faceCentres()[facei];
569 near.
first().second().second() = myRank;
570 near.
second() = mySampleWorld;
576 case NEARESTPATCHFACEAMI:
608 const label myRank = Pstream::myProcNo(comm_);
609 const label nProcs = Pstream::nProcs(comm_);
613 const label oldComm(Pstream::warnComm);
614 Pstream::warnComm = comm_;
615 samplePatches[myRank] = samplePatch_;
616 Pstream::gatherList(samplePatches, Pstream::msgType(), comm_);
617 Pstream::scatterList(samplePatches, Pstream::msgType(), comm_);
618 Pstream::warnComm = oldComm;
622 const label oldComm(Pstream::warnComm);
623 Pstream::warnComm = comm_;
624 sampleRegions[myRank] = sampleRegion_;
625 Pstream::gatherList(sampleRegions, Pstream::msgType(), comm_);
626 Pstream::scatterList(sampleRegions, Pstream::msgType(), comm_);
627 Pstream::warnComm = oldComm;
639 nearest[samplei].second() = wantedWorlds[samplei];
646 forAll(wantedWorlds, samplei)
648 if (wantedWorlds[samplei] == myWorld)
650 localMap.append(samplei);
657 labelList localOrigProcs(origProcs, localMap);
660 const word localOrigPatch(samplePatches[localOrigProcs[0]]);
661 const word localOrigRegion(sampleRegions[localOrigProcs[0]]);
666 Pout<<
"Searching locally for " << localSamples.size()
667 <<
" samples on region:" << localOrigRegion
668 <<
" on patch:" << localOrigPatch <<
endl;
683 const label oldComm(Pstream::warnComm);
684 Pstream::warnComm = comm_;
687 Pstream::listCombineGather
694 Pstream::listCombineScatter(nearest, Pstream::msgType(), comm_);
718 sampleLocations.setSize(
samples.size());
722 const nearInfo& ni = nearest[sampleI].first();
724 if (!ni.
first().hit())
726 sampleProcs[sampleI] = -1;
727 sampleIndices[sampleI] = -1;
732 sampleProcs[sampleI] = ni.
second().second();
733 sampleIndices[sampleI] = ni.
first().index();
734 sampleLocations[sampleI] = ni.
first().hitPoint();
738 Pstream::warnComm = oldComm;
744 static bool hasWarned =
false;
797 bool coincident = (
gAverage(
mag(d)) <= ROOTVSMALL);
799 if (sampleMyself && coincident)
802 <<
"Invalid offset " << d <<
endl
803 <<
"Offset is the vector added to the patch face centres to"
804 <<
" find the patch face supplying the data." <<
endl
805 <<
"Setting it to " << d
806 <<
" on the same patch, on the same region"
807 <<
" will find the faces themselves which does not make sense"
808 <<
" for anything but testing." <<
endl
873 forAll(sampleProcs, sampleI)
875 if (sampleProcs[sampleI] == -1)
887 <<
"Did not find " << nNotFound
888 <<
" out of " << sampleProcs.size() <<
" total samples."
889 <<
" Sampling these on owner cell centre instead." <<
endl
894 <<
". Suppressing further warnings from " <<
type() <<
endl;
901 forAll(sampleProcs, sampleI)
903 if (sampleProcs[sampleI] == -1)
944 if (sampleProcs[i] == -1)
947 << patchFc[i] <<
" on patch " <<
patch_.
name()
950 <<
" on processor " << patchFaceProcs[i]
979 Pout<<
"Dumping mapping as lines from patch faceCentres to"
980 <<
" sampled cell/faceCentres/points to file " << str.
name()
991 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
1006 subMap[proci] =
labelUIndList(sampleIndices, subMap[proci]);
1007 constructMap[proci] =
labelUIndList(patchFaces, constructMap[proci]);
1011 Pout<<
"To proc:" << proci <<
" sending values of cells/faces:"
1012 << subMap[proci] <<
endl;
1013 Pout<<
"From proc:" << proci
1014 <<
" receiving values of patch faces:"
1015 << constructMap[proci] <<
endl;
1027 forAll(constructMap, proci)
1033 label facei =
map[i];
1039 <<
" patchface " << facei
1040 <<
" is assigned to more than once."
1055 <<
" patchface " << facei
1056 <<
" is never assigned to."
1067 const word surfType(surfDict_.getOrDefault<
word>(
"type",
"none"));
1069 if (!surfPtr_ && surfType !=
"none")
1071 word surfName(surfDict_.getOrDefault(
"name", patch_.name()));
1098 if (AMIPtr_->upToDate())
1101 <<
"AMI already up-to-date"
1108 if (sampleWorld_.empty())
1110 const polyPatch& nbr = samplePolyPatch();
1128 OFstream os(patch_.name() +
"_neighbourPatch-org.obj");
1131 OFstream osN(patch_.name() +
"_neighbourPatch-trans.obj");
1134 OFstream osO(patch_.name() +
"_ownerPatch.obj");
1139 AMIPtr_->calculate(patch_, nbrPatch0, surfPtr());
1147 const polyPatch& nbr = samplePolyPatch();
1174 AMIPtr_->calculate(patch_, nbrPatch0, surfPtr());
1190 if (index == names.size()-1)
1196 return subRegistry(sub, names, index+1);
1206 sampleWorld_(
word::null),
1208 mode_(NEARESTPATCHFACE),
1209 samplePatch_(
word::null),
1211 sampleDatabasePtr_(),
1212 offsetMode_(UNIFORM),
1214 offsets_(pp.size(), offset_),
1216 comm_(communicator(sampleWorld_)),
1219 sampleWorld_.empty()
1233 const word& sampleRegion,
1235 const word& samplePatch,
1241 sampleRegion_(sampleRegion),
1243 samplePatch_(samplePatch),
1245 sampleDatabasePtr_(),
1246 offsetMode_(NONUNIFORM),
1250 comm_(communicator(sampleWorld_)),
1253 sampleWorld_.empty()
1254 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1267 const word& sampleRegion,
1269 const word& samplePatch,
1275 sampleRegion_(sampleRegion),
1277 samplePatch_(samplePatch),
1279 sampleDatabasePtr_(),
1280 offsetMode_(UNIFORM),
1284 comm_(communicator(sampleWorld_)),
1287 sampleWorld_.empty()
1288 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1301 const word& sampleRegion,
1303 const word& samplePatch,
1309 sampleRegion_(sampleRegion),
1311 samplePatch_(samplePatch),
1313 sampleDatabasePtr_(),
1314 offsetMode_(NORMAL),
1318 comm_(communicator(sampleWorld_)),
1321 sampleWorld_.empty()
1322 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1341 mode_(sampleModeNames_.get(
"sampleMode",
dict)),
1344 sampleDatabasePtr_(readDatabase(
dict)),
1345 offsetMode_(UNIFORM),
1349 comm_(communicator(sampleWorld_)),
1352 sampleWorld_.empty()
1353 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1369 if (!coupleGroup_.valid())
1371 if (sampleWorld_.empty() && sampleRegion_.empty())
1374 sampleRegion_ = patch_.boundaryMesh().mesh().name();
1379 if (offsetModeNames_.readIfPresent(
"offsetMode",
dict, offsetMode_))
1381 switch (offsetMode_)
1404 offsetMode_ = UNIFORM;
1408 offsetMode_ = NONUNIFORM;
1411 else if (mode_ != NEARESTPATCHFACE && mode_ != NEARESTPATCHFACEAMI)
1414 <<
"Please supply the offsetMode as one of "
1434 sampleDatabasePtr_(readDatabase(
dict)),
1435 offsetMode_(UNIFORM),
1439 comm_(communicator(sampleWorld_)),
1442 sampleWorld_.empty()
1443 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1459 if (
mode != NEARESTPATCHFACE &&
mode != NEARESTPATCHFACEAMI)
1462 <<
"Construct from sampleMode and dictionary only applicable for "
1463 <<
" collocated patches in modes "
1464 << sampleModeNames_[NEARESTPATCHFACE] <<
','
1465 << sampleModeNames_[NEARESTPATCHFACEAMI]
1470 if (!coupleGroup_.valid())
1472 if (sampleWorld_.empty() && sampleRegion_.empty())
1475 sampleRegion_ = patch_.boundaryMesh().mesh().name();
1508 AMIPtr_(mpb.
AMIPtr_->clone()),
1537 offsetMode_ == NONUNIFORM
1546 AMIPtr_(mpb.
AMIPtr_->clone()),
1564 AMIPtr_->upToDate() =
false;
1572 const word& sampleRegion
1578 sampleRegion.empty() || sampleRegion == thisMesh.
name()
1587 const word& sampleRegion,
1588 const word& samplePatch
1591 const polyMesh& nbrMesh = lookupMesh(sampleRegion);
1598 <<
"Cannot find patch " << samplePatch
1599 <<
" in region " << sampleRegion_ <<
endl
1611 <<
"sampleWorld : " << sampleWorld_
1615 return lookupMesh(sampleRegion());
1621 const polyMesh& nbrMesh = sampleMesh();
1628 <<
"Cannot find patch " << samplePatch()
1629 <<
" in region " << sampleRegion_ <<
endl
1646 switch (offsetMode_)
1675 return samplePoints(facePoints(patch_));
1720 const point& basePoint =
p[
f[fp0]];
1722 label fp =
f.fcIndex(fp0);
1723 for (label i = 2; i <
f.size(); i++)
1725 const point& thisPoint =
p[
f[fp]];
1726 label nextFp =
f.fcIndex(fp);
1727 const point& nextPoint =
p[
f[nextFp]];
1729 const triPointRef tri(basePoint, thisPoint, nextPoint);
1770 const wordList names(fName.components());
1778 return subRegistry(obr, names, 0);
1790 return root/
"send"/processorName;
1796 return sendPath(sampleDatabasePath(), proci);
1807 return root/
"receive"/processorName;
1813 return receivePath(sampleDatabasePath(), proci);
1828 if (isA<objectRegistry>(obj))
1835 writeIOField<scalar>(obj,
dict)
1836 || writeIOField<vector>(obj,
dict)
1837 || writeIOField<sphericalTensor>(obj,
dict)
1838 || writeIOField<symmTensor>(obj,
dict)
1839 || writeIOField<tensor>(obj,
dict)
1870 readDict(
e.dict(), sub);
1879 constructIOField<scalar>(
e.keyword(), tok, is, obr)
1880 || constructIOField<vector>(
e.keyword(), tok, is, obr)
1881 || constructIOField<sphericalTensor>(
e.keyword(), tok, is, obr)
1882 || constructIOField<symmTensor>(
e.keyword(), tok, is, obr)
1883 || constructIOField<tensor>(
e.keyword(), tok, is, obr)
1900 os.
writeEntry(
"sampleMode", sampleModeNames_[mode_]);
1905 if (sampleDatabasePtr_)
1907 os.
writeEntry(
"sampleDatabase", sampleDatabasePtr_.valid());
1911 "sampleDatabasePath",
1913 sampleDatabasePtr_()
1916 coupleGroup_.write(os);
1920 offsetMode_ == UNIFORM
1922 && (mode_ == NEARESTPATCHFACE || mode_ == NEARESTPATCHFACEAMI)
1929 os.
writeEntry(
"offsetMode", offsetModeNames_[offsetMode_]);
1931 switch (offsetMode_)
1950 if (mode_ == NEARESTPATCHFACEAMI)
1957 if (!surfDict_.empty())
1959 surfDict_.
writeEntry(surfDict_.dictName(), os);
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual void write(Ostream &) const
Write as a dictionary.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
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
cellDecomposition
Enumeration defining the decomposition of the cell for.
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
const word & name() const
Return name.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
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.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A class for managing temporary objects.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
static constexpr const zero Zero
Global zero (0)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
const mapDistribute & map() const
Return reference to the parallel distribution map.
Type gAverage(const FieldField< Field, Type > &f)
virtual bool writeData(Ostream &) const =0
Pure virtual writeData function.
A List obtained as a section of another List.
word sampleWorld_
World to sample.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
Standard boundBox with extra functionality for use in octree.
const Time & time() const
Return time.
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.
scalar distance() const noexcept
Return distance to hit.
static bool master(const label communicator=worldComm)
Am I the master process.
const sampleMode mode_
What to sample.
bool test(const Key &key) const noexcept
Same as found() - return true if key exists in the set.
void append(const T &val)
Append an element at the end of the list.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
static const Enum< offsetMode > offsetModeNames_
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
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.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
static autoPtr< AMIInterpolation > New(const word &modelName, const dictionary &dict, const bool reverseTarget=false)
Selector for dictionary.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
nearest cell (even if not containing cell)
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
Mesh consisting of general polyhedral cells.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
wordList names() const
Return a list of patch names.
const point & min() const
Minimum describing the bounding box.
virtual ~mappedPatchBase()
Destructor.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
static const Enum< sampleMode > sampleModeNames_
#define forAll(list, i)
Loop across all elements in list.
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
Face area weighted Arbitrary Mesh Interface (AMI) method.
Field< vector > vectorField
Specialisation of Field<T> for vector.
MeshObject wrapper around meshSearch(mesh).
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
label facePoint(const int facei, const block &block, const label i, const label j)
Registry of regIOobjects.
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
autoPtr< mapDistribute > mapPtr_
Communication schedule:
word sampleRegion_
Region to sample.
tmp< pointField > samplePoints() const
Get the sample points.
A triangle primitive used to calculate face normals and swept volumes.
const polyMesh & sampleMesh() const
Get the region mesh.
label findNearestFace(const point &location, const label seedFacei=-1, const bool useTreeSearch=true) const
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
void set(T *p) noexcept
Deprecated(2018-02) Identical to reset().
static label myWorldID()
My worldID.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
An input stream of tokens.
#define DebugInFunction
Report an information message using Foam::Info.
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
virtual const fileName & name() const
Return the name of the stream.
labelRange range() const
Return start/size range of this patch.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Class containing processor-to-processor mapping information.
virtual const labelList & faceOwner() const
Return face owner.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
scalarField samples(nIntervals, Zero)
const polyMesh & mesh() const
Return the mesh reference.
const Type & lookupObject(const word &name, const bool recursive=false) const
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
static const word & myWorld()
My world.
const word & sampleWorld() const
World to sample.
vectorField offsets_
Offset vector (nonuniform)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Field< point_type > & points() const
Return reference to global points.
static fileName receivePath(const fileName &root, const label proci)
Macros for easy insertion into run-time selection tables.
scalar distance_
Offset distance (normal)
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
void calcAMI() const
Calculate AMI interpolator.
static const wordList & allWorlds()
All worlds.
errorManip< error > abort(error &err)
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 +.
static autoPtr< searchableSurface > New(const word &surfaceType, const IOobject &io, const dictionary &dict)
Return a reference to the selected searchableSurface.
label start() const
Return start label of this patch in the polyMesh face list.
const word & sampleRegion() const
Region to sample.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
scalar distance(const vector &p1, const vector &p2)
static const fileName null
An empty fileName.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Output to file stream, using an OSstream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
void calcMapping() const
Calculate mapping.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const vectorField & cellCentres() const
static int & msgType()
Message tag of standard messages.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
fileName path() const
Return path.
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
nearest face on selected patch
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
static label worldComm
Default communicator (all processors)
labelHashSet used(const bitSet &select)
Convert a bitset to a labelHashSet of the indices used.
const DynamicList< token > & tokens() const
The tokens.
Encapsulation of data needed to search for faces.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vectorField & faceCentres() const
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
static const word null
An empty word.
offsetMode offsetMode_
How to obtain samples.
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
nearest cell containing sample
const T2 & second() const noexcept
Return second.
offsetMode
How to project face centres.
static bool clean(std::string &str)
Cleanup filename.
const Time & time() const
Return the top-level database.
static const Vector< Cmpt > zero
A List with indirect addressing.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres.
dictionary surfDict_
Dictionary storing projection surface description.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
A face is a list of labels corresponding to mesh vertices.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const polyPatch & patch_
Patch to sample.
bool sameRegion_
Same region.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
void setSize(const label newSize)
Alias for resize(const label)
const word & constant() const
Return constant name.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
defineTypeNameAndDebug(combustionModel, 0)
const word & name() const
The patch name.
const T1 & first() const noexcept
Return first.
bool hit() const noexcept
Is there a hit.
#define WarningInFunction
Report a warning using Foam::Warning.
sampleMode
Mesh items to sample.
static label communicator(const word &sampleWorld)
Optionally allocate a world-local communicator.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool set(const Key &key)
Same as insert (no value to overwrite)
A list of faces which address into the list of points.
UIndirectList< label > labelUIndList
UIndirectList of labels.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)