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.
get<
bool>(
"sampleDatabase"))
102 "sampleDatabasePath",
108 else if (
dict.
found(
"sampleDatabasePath"))
128 ).addConnectionByName(sampleWorld_);
157 auto& facePoints = tfacePoints.ref();
175 const label mySampleWorld,
186 const label myComm = getCommunicator();
196 <<
"[rank=" << myRank <<
" procs=" << nProcs
197 <<
" comm=" << myComm <<
"] collect samples" <<
endl;
203 globalFc[myRank] = facePoints;
208 patchFc = ListListOps::combine<pointField>
217 globalSamples[myRank] = samplePoints(facePoints);
221 samples = ListListOps::combine<pointField>
230 globalFaces[myRank] =
identity(patch_.size());
234 patchFaces = ListListOps::combine<labelList>
244 UPstream::listGatherValues<label>(mySampleWorld, myComm)
248 UPstream::listGatherValues<label>(patch_.size(), myComm)
259 for (label i = 0; i < nPerProc[proci]; i++)
261 patchFaceWorlds[sampleI] = procToWorldIndex[proci];
262 patchFaceProcs[sampleI] = proci;
276 const label mySampleWorld,
277 const word& sampleRegion,
278 const word& samplePatch,
286 const label myComm = getCommunicator();
307 if (samplePatch.size() && samplePatch !=
"none")
310 <<
"No need to supply a patch name when in "
327 near.
first().second().second() = myRank;
328 near.
second() = mySampleWorld;
341 near.
first().second().second() = myRank;
342 near.
second() = mySampleWorld;
348 case NEARESTONLYCELL:
350 if (samplePatch.size() && samplePatch !=
"none")
353 <<
"No need to supply a patch name when in "
368 near.
first().first().hitPoint()
371 near.
first().second().second() = myRank;
372 near.
second() = mySampleWorld;
377 case NEARESTPATCHFACE:
381 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
389 near.
first().second().second() = myRank;
390 near.
second() = mySampleWorld;
435 near.
first().second().second() = myRank;
436 near.
second() = mySampleWorld;
443 near.
first().second().second() = myRank;
444 near.
second() = mySampleWorld;
451 case NEARESTPATCHPOINT:
455 const polyPatch& pp = lookupPatch(sampleRegion, samplePatch);
463 near.
first().second().second() = myRank;
464 near.
second() = mySampleWorld;
509 near.
first().second().second() = myRank;
510 near.
second() = mySampleWorld;
517 near.
first().second().second() = myRank;
518 near.
second() = mySampleWorld;
527 if (samplePatch.size() && samplePatch !=
"none")
530 <<
"No need to supply a patch name when in "
548 near.
first().second().second() = myRank;
549 near.
second() = mySampleWorld;
557 near.
first().second().second() = myRank;
558 near.
second() = mySampleWorld;
564 case NEARESTPATCHFACEAMI:
597 const label myComm = getCommunicator();
606 samplePatches[myRank] = samplePatch_;
611 sampleRegions[myRank] = sampleRegion_;
625 nearest[samplei].second() = wantedWorlds[samplei];
632 forAll(wantedWorlds, samplei)
634 if (wantedWorlds[samplei] == myWorld)
643 labelList localOrigProcs(origProcs, localMap);
646 const word localOrigPatch(samplePatches[localOrigProcs[0]]);
647 const word localOrigRegion(sampleRegions[localOrigProcs[0]]);
652 Pout<<
"Searching locally for " << localSamples.
size()
653 <<
" samples on region:" << localOrigRegion
654 <<
" on patch:" << localOrigPatch <<
endl;
707 if (!ni.
first().hit())
709 sampleProcs[sampleI] = -1;
710 sampleIndices[sampleI] = -1;
715 sampleProcs[sampleI] = ni.
second().second();
716 sampleIndices[sampleI] = ni.
first().index();
717 sampleLocations[sampleI] = ni.
first().hitPoint();
727 static bool hasWarned =
false;
736 const label myComm = getCommunicator();
768 const pointField offsettedPoints(samplePoints(patchPoints()));
774 mode_ == NEARESTPATCHFACE
776 && sampleRegion() == patch_.boundaryMesh().mesh().name()
777 && samplePatch() == patch_.name()
784 bool coincident = (
gAverage(
mag(d)) <= ROOTVSMALL);
786 if (sampleMyself && coincident)
789 <<
"Invalid offset " << d <<
endl
790 <<
"Offset is the vector added to the patch face centres to"
791 <<
" find the patch face supplying the data." <<
endl
792 <<
"Setting it to " << d
793 <<
" on the same patch, on the same region"
794 <<
" will find the faces themselves which does not make sense"
795 <<
" for anything but testing." <<
endl
796 <<
"patch:" << patch_.
name() <<
endl
797 <<
"sampleRegion:" << sampleRegion() <<
endl
798 <<
"mode:" << sampleModeNames_[mode_] <<
endl
799 <<
"samplePatch:" << samplePatch() <<
endl
800 <<
"offsetMode:" << offsetModeNames_[offsetMode_] <<
endl;
857 if (mode_ == NEARESTCELL)
860 forAll(sampleProcs, sampleI)
862 if (sampleProcs[sampleI] == -1)
874 <<
"Did not find " << nNotFound
875 <<
" out of " << sampleProcs.
size() <<
" total samples."
876 <<
" Sampling these on owner cell centre instead." <<
endl
877 <<
"On patch " << patch_.
name()
878 <<
" on region " << sampleRegion()
879 <<
" in mode " << sampleModeNames_[mode_] <<
endl
880 <<
"with offset mode " << offsetModeNames_[offsetMode_]
881 <<
". Suppressing further warnings from " <<
type() <<
endl;
888 forAll(sampleProcs, sampleI)
890 if (sampleProcs[sampleI] == -1)
931 if (sampleProcs[i] == -1)
934 << patchFc[i] <<
" on patch " << patch_.name()
936 << patch_.boundaryMesh().mesh().name()
937 <<
" on processor " << patchFaceProcs[i]
962 patch_.boundaryMesh().mesh().time().path()
966 Pout<<
"Dumping mapping as lines from patch faceCentres to"
967 <<
" sampled cell/faceCentres/points to file " << str.
name()
978 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
983 mapPtr_.reset(
new mapDistribute(sampleProcs, patchFaceProcs, myComm));
994 constructMap[proci] =
labelUIndList(patchFaces, constructMap[proci]);
998 Pout<<
"To proc:" << proci <<
" sending values of cells/faces:"
999 << subMap[proci] <<
endl;
1000 Pout<<
"From proc:" << proci
1001 <<
" receiving values of patch faces:"
1002 << constructMap[proci] <<
endl;
1008 mapPtr_().constructSize() = patch_.size();
1013 bitSet used(patch_.size());
1014 forAll(constructMap, proci)
1016 const labelList& map = constructMap[proci];
1020 label facei = map[i];
1022 if (used.
test(facei))
1025 <<
"On patch " << patch_.name()
1026 <<
" patchface " << facei
1027 <<
" is assigned to more than once."
1038 if (!used.
test(facei))
1041 <<
"On patch " << patch_.name()
1042 <<
" patchface " << facei
1043 <<
" is never assigned to."
1054 const word surfType(surfDict_.getOrDefault<
word>(
"type",
"none"));
1056 if (!surfPtr_ && surfType !=
"none")
1058 word surfName(surfDict_.getOrDefault(
"name", patch_.name()));
1085 if (AMIPtr_->upToDate())
1088 <<
"AMI already up-to-date"
1096 const label myComm = getCommunicator();
1102 if (sampleWorld_.empty() || sameWorld())
1104 const polyPatch& nbr = samplePolyPatch();
1122 OFstream os(patch_.name() +
"_neighbourPatch-org.obj");
1125 OFstream osN(patch_.name() +
"_neighbourPatch-trans.obj");
1128 OFstream osO(patch_.name() +
"_ownerPatch.obj");
1139 AMIPtr_->calculate(patch_, nbrPatch0, surfPtr());
1163 AMIPtr_->calculate(patch_, dummyPatch, surfPtr());
1170 AMIPtr_->calculate(dummyPatch, patch_, surfPtr());
1189 if (index == names.
size()-1)
1195 return subRegistry(sub, names, index+1);
1207 mode_(NEARESTPATCHFACE),
1210 sampleDatabasePtr_(),
1211 offsetMode_(UNIFORM),
1213 offsets_(pp.size(), offset_),
1230 const word& sampleRegion,
1232 const word& samplePatch,
1252 const word& sampleRegion,
1254 const word& samplePatch,
1255 const vector& uniformOffset
1274 const word& sampleRegion,
1276 const word& samplePatch,
1277 const scalar normalDistance
1282 sampleRegion_(sampleRegion),
1284 samplePatch_(samplePatch),
1286 sampleDatabasePtr_(),
1287 offsetMode_(NORMAL),
1290 distance_(normalDistance),
1294 sampleWorld_.empty()
1314 sampleWorld_(
dict.getOrDefault<
word>(
"sampleWorld",
word::null)),
1315 sampleRegion_(
dict.getOrDefault<
word>(
"sampleRegion",
word::null)),
1316 mode_(sampleModeNames_.get(
"sampleMode",
dict)),
1317 samplePatch_(
dict.getOrDefault<
word>(
"samplePatch",
word::null)),
1319 sampleDatabasePtr_(readDatabase(
dict)),
1320 offsetMode_(UNIFORM),
1327 sampleWorld_.empty()
1353 surfDict_(
dict.subOrEmptyDict(
"surface"))
1402 <<
"Please supply the offsetMode as one of "
1417 sampleWorld_(
dict.getOrDefault<
word>(
"sampleWorld",
word::null)),
1418 sampleRegion_(
dict.getOrDefault<
word>(
"sampleRegion",
word::null)),
1420 samplePatch_(
dict.getOrDefault<
word>(
"samplePatch",
word::null)),
1422 sampleDatabasePtr_(readDatabase(
dict)),
1423 offsetMode_(UNIFORM),
1430 sampleWorld_.empty()
1456 surfDict_(
dict.subOrEmptyDict(
"surface"))
1463 <<
"Construct from sampleMode and dictionary only applicable for "
1464 <<
" collocated patches in modes "
1489 sampleWorld_(mpb.sampleWorld_),
1490 sampleRegion_(mpb.sampleRegion_),
1492 samplePatch_(mpb.samplePatch_),
1493 coupleGroup_(mpb.coupleGroup_),
1496 mpb.sampleDatabasePtr_
1497 ? new
fileName(mpb.sampleDatabasePtr_())
1500 offsetMode_(mpb.offsetMode_),
1501 offset_(mpb.offset_),
1502 offsets_(mpb.offsets_),
1503 distance_(mpb.distance_),
1504 communicator_(mpb.communicator_),
1505 sameRegion_(mpb.sameRegion_),
1507 AMIReverse_(mpb.AMIReverse_),
1508 AMIPtr_(mpb.AMIPtr_->clone()),
1510 surfDict_(mpb.surfDict_)
1522 sampleWorld_(mpb.sampleWorld_),
1523 sampleRegion_(mpb.sampleRegion_),
1525 samplePatch_(mpb.samplePatch_),
1526 coupleGroup_(mpb.coupleGroup_),
1529 mpb.sampleDatabasePtr_
1530 ? new
fileName(mpb.sampleDatabasePtr_())
1533 offsetMode_(mpb.offsetMode_),
1534 offset_(mpb.offset_),
1537 offsetMode_ == NONUNIFORM
1541 distance_(mpb.distance_),
1542 communicator_(mpb.communicator_),
1543 sameRegion_(mpb.sameRegion_),
1545 AMIReverse_(mpb.AMIReverse_),
1546 AMIPtr_(mpb.AMIPtr_->clone()),
1548 surfDict_(mpb.surfDict_)
1562 mapPtr_.reset(
nullptr);
1563 surfPtr_.reset(
nullptr);
1564 AMIPtr_->upToDate() =
false;
1573 offsetMode_ = offsetMode::NORMAL;
1576 distance_ = normalDist;
1583 offsetMode_ = offsetMode::UNIFORM;
1584 offset_ = uniformOffset;
1593 offsetMode_ = offsetMode::NONUNIFORM;
1602 const word& sampleRegion
1608 sampleRegion.empty() || sampleRegion == thisMesh.
name()
1617 const word& sampleRegion,
1618 const word& samplePatch
1621 const polyMesh& nbrMesh = lookupMesh(sampleRegion);
1628 <<
"Cannot find patch " << samplePatch
1629 <<
" in region " << sampleRegion_ <<
endl
1641 <<
"sampleWorld : " << sampleWorld_
1645 return lookupMesh(sampleRegion());
1651 const polyMesh& nbrMesh = sampleMesh();
1658 <<
"Cannot find patch " << samplePatch()
1659 <<
" in region " << sampleRegion_ <<
endl
1674 auto&
fld = tfld.ref();
1676 switch (offsetMode_)
1705 return samplePoints(facePoints(patch_));
1750 const point& basePoint =
p[
f[fp0]];
1753 for (label i = 2; i <
f.
size(); i++)
1755 const point& thisPoint =
p[
f[fp]];
1757 const point& nextPoint =
p[
f[nextFp]];
1759 const triPointRef tri(basePoint, thisPoint, nextPoint);
1800 cleanedPath.
clean();
1809 return subRegistry(obr, names, 0);
1821 return root/
"send"/processorName;
1827 return sendPath(sampleDatabasePath(), proci);
1838 return root/
"receive"/processorName;
1844 return receivePath(sampleDatabasePath(), proci);
1859 if (isA<objectRegistry>(obj))
1866 writeIOField<scalar>(obj,
dict)
1867 || writeIOField<vector>(obj,
dict)
1868 || writeIOField<sphericalTensor>(obj,
dict)
1869 || writeIOField<symmTensor>(obj,
dict)
1870 || writeIOField<tensor>(obj,
dict)
1901 readDict(
e.dict(), sub);
1910 constructIOField<scalar>(
e.keyword(), tok, is, obr)
1911 || constructIOField<vector>(
e.keyword(), tok, is, obr)
1912 || constructIOField<sphericalTensor>(
e.keyword(), tok, is, obr)
1913 || constructIOField<symmTensor>(
e.keyword(), tok, is, obr)
1914 || constructIOField<tensor>(
e.keyword(), tok, is, obr)
1936 if (sampleDatabasePtr_)
1942 "sampleDatabasePath",
1944 sampleDatabasePtr_()
1947 coupleGroup_.write(
os);
1951 offsetMode_ == UNIFORM
1953 && (mode_ == NEARESTPATCHFACE || mode_ == NEARESTPATCHFACEAMI)
1960 os.
writeEntry(
"offsetMode", offsetModeNames_[offsetMode_]);
1962 switch (offsetMode_)
1982 if (mode_ == NEARESTPATCHFACEAMI)
1991 if (!surfDict_.empty())
1993 surfDict_.writeEntry(surfDict_.dictName(),
os);
Macros for easy insertion into run-time selection tables.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
Minimal example by using system/controlDict.functions:
bool test(const Key &key) const noexcept
Same as found() - return true if key exists in the set.
bool set(const Key &key)
Same as insert (no value to overwrite)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
virtual const fileName & name() const
Return the name of the stream.
An input stream of tokens.
void setSize(const label n)
Alias for resize()
Output to file stream, using an OSstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
virtual const fileName & name() const
Get the name of the stream.
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
scalar distance() const noexcept
Return distance to hit.
bool hit() const noexcept
Is there a hit.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
A list of faces which address into the list of points.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const Field< point_type > & points() const noexcept
Return reference to global points.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
A List obtained as a section of another List.
const word & constant() const
Return constant name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Return first.
const T2 & second() const noexcept
Return second.
A List with indirect addressing. Like IndirectList but does not store addressing.
T & first()
Return the first element of the list.
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.
void size(const label n)
Older name for setAddressableSize.
label fcIndex(const label i) const noexcept
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static int & msgType() noexcept
Message tag of standard messages.
static label worldComm
Default communicator (all processors)
static label myWorldID()
My worldID.
static const wordList & allWorlds() noexcept
All worlds.
static const word & myWorld()
My world.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
vector span() const
The bounding box span (from minimum to maximum)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
bool valid() const noexcept
Is a valid patchGroup (non-empty) name.
const DynamicList< point > & facePoints()
Returns the points of the cutting PLICface.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
T lookupOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A keyword and a list of tokens is an 'entry'.
Face area weighted Arbitrary Mesh Interface (AMI) method.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
wordList components(const char delim='/') const
Return path components as wordList.
static bool clean(std::string &str)
static const fileName null
An empty fileName.
virtual bool write()
Write the output fields.
Foam::dictionary writeDict() const
Write to dictionary.
const Time & time() const
Return the top-level database.
Non-pointer based hierarchical recursive searching.
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
Class containing processor-to-processor mapping information.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
label getWorldCommunicator() const
Get the communicator for the world-world connection.
scalar distance_
Offset distance (normal)
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
const polyPatch & patch_
Patch to sample.
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.
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
sampleMode
Mesh items to sample.
@ NEARESTPATCHFACE
nearest face on selected patch
@ NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
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.
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.
tmp< pointField > samplePoints() const
Get the sample points.
bool addWorldConnection()
Add a world-world connection.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
static fileName receivePath(const fileName &root, const label proci)
offsetMode
How to project face centres.
@ NORMAL
use face normal + distance
@ UNIFORM
single offset vector
@ NONUNIFORM
per-face offset vector
static const Enum< offsetMode > offsetModeNames_
virtual ~mappedPatchBase()
Destructor.
void calcMapping() const
Calculate mapping.
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
sampleMode mode() const noexcept
What to sample.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
const polyMesh & lookupMesh(const word ®ion) const
Lookup mesh.
vector offset_
Offset vector (uniform)
offsetMode offsetMode_
How to obtain samples.
word sampleWorld_
World to sample.
MeshObject wrapper around meshSearch(mesh).
label findNearestFace(const point &location, const label seedFacei=-1, const bool useTreeSearch=true) const
Centralized handling of multi-world MPI connections.
Registry of regIOobjects.
const Time & time() const noexcept
Return time registry.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
const Type & lookupObject(const word &name, const bool recursive=false) const
static const complex max
complex (VGREAT,VGREAT)
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
const polyMesh & mesh() const noexcept
Return the mesh reference.
wordList names() const
Return a list of patch names.
Mesh consisting of general polyhedral cells.
cellDecomposition
Enumeration defining the decomposition of the cell for.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
labelRange range() const
Return start/size range of this patch.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
const vectorField & faceCentres() const
const vectorField & cellCentres() const
int myProcNo() const noexcept
Return processor number.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool writeData(Ostream &) const =0
Pure virtual writeData function.
splitCell * master() const
A class for managing temporary objects.
A token holds an item read from Istream.
Standard boundBox with extra functionality for use in octree.
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
Encapsulation of data needed to search for faces.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
A triangle primitive used to calculate face normals and swept volumes.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define DebugInFunction
Report an information message using Foam::Info.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
label facePoint(const int facei, const block &block, const label i, const label j)
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
vectorField pointField
pointField is a vectorField.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UIndirectList< label > labelUIndList
UIndirectList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
A non-counting (dummy) refCount.
scalarField samples(nIntervals, Zero)