Go to the documentation of this file.
66 { sampleMode::NEARESTCELL,
"nearestCell" },
67 { sampleMode::NEARESTPATCHFACE,
"nearestPatchFace" },
68 { sampleMode::NEARESTPATCHFACEAMI,
"nearestPatchFaceAMI" },
69 { sampleMode::NEARESTPATCHPOINT,
"nearestPatchPoint" },
70 { sampleMode::NEARESTFACE,
"nearestFace" },
71 { sampleMode::NEARESTONLYCELL,
"nearestOnlyCell" },
81 { offsetMode::UNIFORM,
"uniform" },
82 { offsetMode::NONUNIFORM,
"nonuniform" },
83 { offsetMode::NORMAL,
"normal" },
96 if (
dict.found(
"sampleDatabase"))
98 const bool useDb =
dict.get<
bool>(
"sampleDatabase");
107 "sampleDatabasePath",
114 else if (
dict.found(
"sampleDatabasePath"))
163 auto& facePoints = tfacePoints.ref();
181 const label mySampleWorld,
192 const label myComm = getCommunicator();
202 <<
"[rank=" << myRank <<
" procs=" << nProcs
203 <<
" comm=" << myComm <<
"] collect samples" <<
endl;
209 globalFc[myRank] = facePoints;
215 patchFc = ListListOps::combine<pointField>
224 globalSamples[myRank] = samplePoints(facePoints);
228 samples = ListListOps::combine<pointField>
237 globalFaces[myRank] =
identity(patch_.size());
242 patchFaces = ListListOps::combine<labelList>
251 procToWorldIndex[myRank] = mySampleWorld;
256 nPerProc[myRank] = patch_.size();
260 patchFaceWorlds.
setSize(patchFaces.size());
261 patchFaceProcs.
setSize(patchFaces.size());
266 for (label i = 0; i < nPerProc[proci]; i++)
268 patchFaceWorlds[sampleI] = procToWorldIndex[proci];
269 patchFaceProcs[sampleI] = proci;
283 const label mySampleWorld,
284 const word& sampleRegion,
285 const word& samplePatch,
293 const label myComm = getCommunicator();
314 if (samplePatch.size() && samplePatch !=
"none")
317 <<
"No need to supply a patch name when in "
334 near.
first().second().second() = myRank;
335 near.
second() = mySampleWorld;
348 near.
first().second().second() = myRank;
349 near.
second() = mySampleWorld;
355 case NEARESTONLYCELL:
357 if (samplePatch.size() && samplePatch !=
"none")
360 <<
"No need to supply a patch name when in "
375 near.
first().first().hitPoint()
378 near.
first().second().second() = myRank;
379 near.
second() = mySampleWorld;
384 case NEARESTPATCHFACE:
388 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
396 near.
first().second().second() = myRank;
397 near.
second() = mySampleWorld;
442 near.
first().second().second() = myRank;
443 near.
second() = mySampleWorld;
450 near.
first().second().second() = myRank;
451 near.
second() = mySampleWorld;
458 case NEARESTPATCHPOINT:
462 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
470 near.
first().second().second() = myRank;
471 near.
second() = mySampleWorld;
516 near.
first().second().second() = myRank;
517 near.
second() = mySampleWorld;
524 near.
first().second().second() = myRank;
525 near.
second() = mySampleWorld;
534 if (samplePatch.size() && samplePatch !=
"none")
537 <<
"No need to supply a patch name when in "
555 near.
first().second().second() = myRank;
556 near.
second() = mySampleWorld;
564 near.
first().second().second() = myRank;
565 near.
second() = mySampleWorld;
571 case NEARESTPATCHFACEAMI:
604 const label myComm = getCommunicator();
613 samplePatches[myRank] = samplePatch_;
619 sampleRegions[myRank] = sampleRegion_;
634 nearest[samplei].second() = wantedWorlds[samplei];
641 forAll(wantedWorlds, samplei)
643 if (wantedWorlds[samplei] == myWorld)
645 localMap.append(samplei);
652 labelList localOrigProcs(origProcs, localMap);
655 const word localOrigPatch(samplePatches[localOrigProcs[0]]);
656 const word localOrigRegion(sampleRegions[localOrigProcs[0]]);
661 Pout<<
"Searching locally for " << localSamples.size()
662 <<
" samples on region:" << localOrigRegion
663 <<
" on patch:" << localOrigPatch <<
endl;
711 sampleLocations.setSize(
samples.size());
715 const nearInfo& ni = nearest[sampleI].first();
717 if (!ni.
first().hit())
719 sampleProcs[sampleI] = -1;
720 sampleIndices[sampleI] = -1;
725 sampleProcs[sampleI] = ni.
second().second();
726 sampleIndices[sampleI] = ni.
first().index();
727 sampleLocations[sampleI] = ni.
first().hitPoint();
737 static bool hasWarned =
false;
746 const label myComm = getCommunicator();
778 const pointField offsettedPoints(samplePoints(patchPoints()));
784 mode_ == NEARESTPATCHFACE
786 && sampleRegion() == patch_.boundaryMesh().mesh().name()
787 && samplePatch() == patch_.name()
794 bool coincident = (
gAverage(
mag(d)) <= ROOTVSMALL);
796 if (sampleMyself && coincident)
799 <<
"Invalid offset " << d <<
endl
800 <<
"Offset is the vector added to the patch face centres to"
801 <<
" find the patch face supplying the data." <<
endl
802 <<
"Setting it to " << d
803 <<
" on the same patch, on the same region"
804 <<
" will find the faces themselves which does not make sense"
805 <<
" for anything but testing." <<
endl
806 <<
"patch:" << patch_.
name() <<
endl
807 <<
"sampleRegion:" << sampleRegion() <<
endl
808 <<
"mode:" << sampleModeNames_[mode_] <<
endl
809 <<
"samplePatch:" << samplePatch() <<
endl
810 <<
"offsetMode:" << offsetModeNames_[offsetMode_] <<
endl;
867 if (mode_ == NEARESTCELL)
870 forAll(sampleProcs, sampleI)
872 if (sampleProcs[sampleI] == -1)
884 <<
"Did not find " << nNotFound
885 <<
" out of " << sampleProcs.size() <<
" total samples."
886 <<
" Sampling these on owner cell centre instead." <<
endl
887 <<
"On patch " << patch_.
name()
888 <<
" on region " << sampleRegion()
889 <<
" in mode " << sampleModeNames_[mode_] <<
endl
890 <<
"with offset mode " << offsetModeNames_[offsetMode_]
891 <<
". Suppressing further warnings from " <<
type() <<
endl;
898 forAll(sampleProcs, sampleI)
900 if (sampleProcs[sampleI] == -1)
941 if (sampleProcs[i] == -1)
944 << patchFc[i] <<
" on patch " << patch_.name()
946 << patch_.boundaryMesh().mesh().name()
947 <<
" on processor " << patchFaceProcs[i]
972 patch_.boundaryMesh().mesh().time().path()
976 Pout<<
"Dumping mapping as lines from patch faceCentres to"
977 <<
" sampled cell/faceCentres/points to file " << str.
name()
988 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
993 mapPtr_.reset(
new mapDistribute(sampleProcs, patchFaceProcs, myComm));
1003 subMap[proci] =
labelUIndList(sampleIndices, subMap[proci]);
1004 constructMap[proci] =
labelUIndList(patchFaces, constructMap[proci]);
1008 Pout<<
"To proc:" << proci <<
" sending values of cells/faces:"
1009 << subMap[proci] <<
endl;
1010 Pout<<
"From proc:" << proci
1011 <<
" receiving values of patch faces:"
1012 << constructMap[proci] <<
endl;
1018 mapPtr_().constructSize() = patch_.size();
1024 forAll(constructMap, proci)
1026 const labelList& map = constructMap[proci];
1030 label facei = map[i];
1035 <<
"On patch " << patch_.name()
1036 <<
" patchface " << facei
1037 <<
" is assigned to more than once."
1051 <<
"On patch " << patch_.name()
1052 <<
" patchface " << facei
1053 <<
" is never assigned to."
1064 const word surfType(surfDict_.getOrDefault<
word>(
"type",
"none"));
1066 if (!surfPtr_ && surfType !=
"none")
1068 word surfName(surfDict_.getOrDefault(
"name", patch_.name()));
1095 if (AMIPtr_->upToDate())
1098 <<
"AMI already up-to-date"
1106 const label myComm = getCommunicator();
1112 if (sampleWorld_.empty() || sameWorld())
1114 const polyPatch& nbr = samplePolyPatch();
1132 OFstream os(patch_.name() +
"_neighbourPatch-org.obj");
1135 OFstream osN(patch_.name() +
"_neighbourPatch-trans.obj");
1138 OFstream osO(patch_.name() +
"_ownerPatch.obj");
1149 AMIPtr_->calculate(patch_, nbrPatch0, surfPtr());
1176 AMIPtr_->calculate(patch_, dummyPatch, surfPtr());
1183 AMIPtr_->calculate(dummyPatch, patch_, surfPtr());
1202 if (index ==
names.size()-1)
1208 return subRegistry(sub,
names, index+1);
1220 mode_(NEARESTPATCHFACE),
1223 sampleDatabasePtr_(),
1224 offsetMode_(UNIFORM),
1226 offsets_(pp.size(), offset_),
1243 const word& sampleRegion,
1245 const word& samplePatch,
1265 const word& sampleRegion,
1267 const word& samplePatch,
1268 const vector& uniformOffset
1287 const word& sampleRegion,
1289 const word& samplePatch,
1290 const scalar normalDistance
1295 sampleRegion_(sampleRegion),
1297 samplePatch_(samplePatch),
1299 sampleDatabasePtr_(),
1300 offsetMode_(NORMAL),
1303 distance_(normalDistance),
1307 sampleWorld_.empty()
1308 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1316 addWorldConnection();
1329 mode_(sampleModeNames_.get(
"sampleMode",
dict)),
1332 sampleDatabasePtr_(readDatabase(
dict)),
1333 offsetMode_(UNIFORM),
1340 sampleWorld_.empty()
1341 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1368 addWorldConnection();
1370 if (!coupleGroup_.valid())
1372 if (sampleWorld_.empty() && sampleRegion_.empty())
1375 sampleRegion_ = patch_.boundaryMesh().mesh().name();
1380 if (offsetModeNames_.readIfPresent(
"offsetMode",
dict, offsetMode_))
1382 switch (offsetMode_)
1405 offsetMode_ = UNIFORM;
1409 offsetMode_ = NONUNIFORM;
1412 else if (mode_ != NEARESTPATCHFACE && mode_ != NEARESTPATCHFACEAMI)
1415 <<
"Please supply the offsetMode as one of "
1435 sampleDatabasePtr_(readDatabase(
dict)),
1436 offsetMode_(UNIFORM),
1443 sampleWorld_.empty()
1444 && sampleRegion_ == patch_.boundaryMesh().mesh().name()
1471 addWorldConnection();
1473 if (
mode != NEARESTPATCHFACE &&
mode != NEARESTPATCHFACEAMI)
1476 <<
"Construct from sampleMode and dictionary only applicable for "
1477 <<
" collocated patches in modes "
1478 << sampleModeNames_[NEARESTPATCHFACE] <<
','
1479 << sampleModeNames_[NEARESTPATCHFACEAMI]
1483 if (!coupleGroup_.valid())
1485 if (sampleWorld_.empty() && sampleRegion_.empty())
1488 sampleRegion_ = patch_.boundaryMesh().mesh().name();
1521 AMIPtr_(mpb.
AMIPtr_->clone()),
1550 offsetMode_ == NONUNIFORM
1559 AMIPtr_(mpb.
AMIPtr_->clone()),
1575 mapPtr_.reset(
nullptr);
1576 surfPtr_.reset(
nullptr);
1577 AMIPtr_->upToDate() =
false;
1586 offsetMode_ = offsetMode::NORMAL;
1589 distance_ = normalDist;
1596 offsetMode_ = offsetMode::UNIFORM;
1597 offset_ = uniformOffset;
1606 offsetMode_ = offsetMode::NONUNIFORM;
1615 const word& sampleRegion
1621 sampleRegion.empty() || sampleRegion == thisMesh.
name()
1630 const word& sampleRegion,
1631 const word& samplePatch
1634 const polyMesh& nbrMesh = lookupMesh(sampleRegion);
1641 <<
"Cannot find patch " << samplePatch
1642 <<
" in region " << sampleRegion_ <<
endl
1654 <<
"sampleWorld : " << sampleWorld_
1658 return lookupMesh(sampleRegion());
1664 const polyMesh& nbrMesh = sampleMesh();
1671 <<
"Cannot find patch " << samplePatch()
1672 <<
" in region " << sampleRegion_ <<
endl
1687 auto&
fld = tfld.ref();
1689 switch (offsetMode_)
1718 return samplePoints(facePoints(patch_));
1763 const point& basePoint =
p[
f[fp0]];
1765 label fp =
f.fcIndex(fp0);
1766 for (label i = 2; i <
f.size(); i++)
1768 const point& thisPoint =
p[
f[fp]];
1769 label nextFp =
f.fcIndex(fp);
1770 const point& nextPoint =
p[
f[nextFp]];
1772 const triPointRef tri(basePoint, thisPoint, nextPoint);
1813 cleanedPath.
clean();
1822 return subRegistry(obr,
names, 0);
1834 return root/
"send"/processorName;
1840 return sendPath(sampleDatabasePath(), proci);
1851 return root/
"receive"/processorName;
1857 return receivePath(sampleDatabasePath(), proci);
1872 if (isA<objectRegistry>(obj))
1879 writeIOField<scalar>(obj,
dict)
1880 || writeIOField<vector>(obj,
dict)
1881 || writeIOField<sphericalTensor>(obj,
dict)
1882 || writeIOField<symmTensor>(obj,
dict)
1883 || writeIOField<tensor>(obj,
dict)
1914 readDict(
e.dict(), sub);
1923 constructIOField<scalar>(
e.keyword(), tok, is, obr)
1924 || constructIOField<vector>(
e.keyword(), tok, is, obr)
1925 || constructIOField<sphericalTensor>(
e.keyword(), tok, is, obr)
1926 || constructIOField<symmTensor>(
e.keyword(), tok, is, obr)
1927 || constructIOField<tensor>(
e.keyword(), tok, is, obr)
1949 if (sampleDatabasePtr_)
1955 "sampleDatabasePath",
1957 sampleDatabasePtr_()
1960 coupleGroup_.write(
os);
1964 offsetMode_ == UNIFORM
1966 && (mode_ == NEARESTPATCHFACE || mode_ == NEARESTPATCHFACEAMI)
1973 os.
writeEntry(
"offsetMode", offsetModeNames_[offsetMode_]);
1975 switch (offsetMode_)
1995 if (mode_ == NEARESTPATCHFACEAMI)
2004 if (!surfDict_.empty())
2006 surfDict_.writeEntry(surfDict_.dictName(),
os);
int debug
Static debugging option.
const Field< point_type > & points() const noexcept
Return reference to global points.
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.
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...
label communicator_
Communicator.
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
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)
wordList components(const char delim='/') const
Return path components as wordList.
A class for handling words, derived from Foam::string.
static Vector< Cmpt > uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A class for handling file names.
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
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.
Type gAverage(const FieldField< Field, Type > &f)
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
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.
static const meshSearchMeshObject & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
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.
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.
bool sameWorld() const
Is sample world the local world?
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 ...
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)
static const wordList & allWorlds() noexcept
All worlds.
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.
word sampleRegion_
Region to sample.
static const multiWorldConnections & New(const Time &runTime)
Access mesh object.
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().
const polyMesh & mesh() const noexcept
Return the mesh reference.
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.
virtual const fileName & name() const
Get the name of the stream.
labelRange range() const
Return start/size range of this patch.
void setSize(const label n)
Alias for resize()
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
Class containing processor-to-processor mapping information.
label getCommByName(const word &otherWorld) const
Get communicator for myWorld to other world connection by NAME.
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)
virtual const fileName & name() const
Return the name of the stream.
static const char * name(const bool b) noexcept
A string representation of bool as "false" / "true".
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.
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.
vectorField offsets_
Offset vector (nonuniform)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
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.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
errorManip< error > abort(error &err)
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
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.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
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.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
void calcMapping() const
Calculate mapping.
bool addWorldConnection()
Add a world-world connection.
const word & name() const noexcept
Return name.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const vectorField & cellCentres() const
Centralized handling of multi-world MPI connections.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
static int & msgType() noexcept
Message tag of standard messages.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
static const Vector< scalar > max
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
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.
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.
virtual void write(Ostream &os) const
Write as a dictionary.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
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.
const T2 & second() const noexcept
Return second.
offsetMode
How to project face centres.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static bool clean(std::string &str)
const Time & time() const
Return the top-level database.
static const Vector< scalar > 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
label getWorldCommunicator() const
Get the communicator for the world-world connection.
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...
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const word & constant() const
Return constant name.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
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 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.
const Time & time() const noexcept
Return time registry.
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
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.
Minimal example by using system/controlDict.functions:
UIndirectList< label > labelUIndList
UIndirectList of labels.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.