85 static const scalar defaultMergeTol = 1
e-7;
95 const label masterMeshProcStart,
96 const label masterMeshProcEnd,
98 const label meshToAddProcStart,
99 const label meshToAddProcEnd,
101 const scalar mergeDist
104 if (fullMatch || masterMesh.
nCells() == 0)
126 if (isA<processorPolyPatch>(
pp))
130 label proci=meshToAddProcStart;
131 proci<meshToAddProcEnd;
135 const string toProcString(
"to" +
Foam::name(proci));
136 if (
pp.name().ends_with(toProcString))
138 label meshFacei =
pp.start();
141 masterFaces.append(meshFacei++);
160 if (isA<processorPolyPatch>(
pp))
162 bool isConnected =
false;
166 label mergedProci=masterMeshProcStart;
167 !isConnected && (mergedProci < masterMeshProcEnd);
173 label proci = meshToAddProcStart;
174 proci < meshToAddProcEnd;
178 const word fromProcString
183 if (
pp.name() == fromProcString)
193 label meshFacei =
pp.start();
196 addFaces.append(meshFacei++);
220 const scalar mergeDist,
236 Info<<
"mergeSharedPoints : detected " << pointToMaster.size()
237 <<
" points that are to be merged." <<
endl;
258 forAll(pointProcAddressing, proci)
260 labelList& constructMap = pointProcAddressing[proci];
264 label oldPointi = constructMap[i];
267 label
newPointi = map().reversePointMap()[oldPointi];
280 <<
"Problem. oldPointi:" << oldPointi
298 for (
const Time& procDb : databases)
305 if (pointsInstance != procDb.timeName())
308 <<
"Your time was specified as " << procDb.timeName()
309 <<
" but there is no polyMesh/points in that time." <<
nl 310 <<
"(points file at " << pointsInstance <<
')' <<
nl 311 <<
"Please rerun with the correct time specified" 312 <<
" (through the -constant, -time or -latestTime " 313 <<
"(at your option)." 317 Info<<
"Reading points from " 319 <<
" for time = " << procDb.timeName()
343 void writeDistribution
366 forAll(cellProcAddressing, proci)
368 const labelList& pCells = cellProcAddressing[proci];
372 cellDecomposition.write();
374 Info<<
nl <<
"Wrote decomposition to " 375 << cellDecomposition.objectRelPath()
376 <<
" for use in manual decomposition." <<
endl;
404 forAll(cellDecomposition, celli)
406 cellDist[celli] = cellDecomposition[celli];
409 cellDist.correctBoundaryConditions();
412 Info<<
nl <<
"Wrote decomposition to " 413 << cellDist.objectRelPath()
414 <<
" (volScalarField) for visualization." 437 Info<<
nl <<
"Writing merged mesh to " 443 <<
"Failed writing polyMesh." 452 const label masterInternalFaces,
481 Info<<
"Writing addressing : " << outputDir <<
nl;
485 Info<<
" pointProcAddressing" <<
endl;
486 ioAddr.rename(
"pointProcAddressing");
493 labelList faceProcAddr(faceProcAddressing);
495 forAll(faceProcAddr, procFacei)
497 const label masterFacei = faceProcAddr[procFacei];
501 !procMesh.isInternalFace(procFacei)
502 && masterFacei < masterInternalFaces
508 label procOwn = procMesh.faceOwner()[procFacei];
509 label masterOwn = masterOwner[masterFacei];
511 if (cellProcAddressing[procOwn] == masterOwn)
514 faceProcAddr[procFacei]++;
519 faceProcAddr[procFacei] = -1 - faceProcAddr[procFacei];
525 faceProcAddr[procFacei]++;
529 Info<<
" faceProcAddressing" <<
endl;
530 ioAddr.rename(
"faceProcAddressing");
532 faceProcAddr.clear();
535 Info<<
" cellProcAddressing" <<
endl;
536 ioAddr.rename(
"cellProcAddressing");
541 Info<<
" boundaryProcAddressing" <<
endl;
542 ioAddr.rename(
"boundaryProcAddressing");
552 "Merge individual processor meshes back into one master mesh.\n" 553 "Use if the original master mesh has been deleted or the processor meshes\n" 554 "have been modified (topology change).\n" 555 "This tool will write the resulting mesh to a new time step and construct\n" 556 "{cell,face,point}ProcAddressing files in the processor directories so that\n" 557 "reconstructPar can be used to reconstruct fields onto the master mesh.\n\n" 558 "Reasonably tested, but use at your own risk!\n\n";
564 void determineFaEdgeMapping
587 for (
const auto& patchEdge : onePatch.
edges())
589 const edge serialMeshEdge(
mp, patchEdge);
590 edgesHash.
insert(serialMeshEdge, edgesHash.
size());
598 forAll(procFaMeshes, proci)
600 const auto& procMesh = procFaMeshes[proci];
601 const auto& procPatch = procMesh.patch();
602 const auto&
mp = procPatch.meshPoints();
603 const auto& ppAddressing = pointProcAddressing[proci];
605 auto& edgeProcAddr = faEdgeProcAddressing[proci];
609 for (
const auto&
e : procPatch.edges())
611 const edge procMeshEdge(
mp,
e);
612 const edge serialMeshEdge(ppAddressing, procMeshEdge);
614 edgeProcAddr[edgei] = edgesHash[serialMeshEdge];
621 void sortFaEdgeMapping
645 remapGlobal.
insert(edgei, remapGlobal.
size());
649 const faMesh& procMesh0 = procFaMeshes[0];
654 forAll(singlePatchEdgeLabels, patchi)
656 if (isA<ignoreFaPatch>(procMesh0.
boundary()[patchi]))
662 forAll(procFaMeshes, proci)
664 const auto& procMesh = procFaMeshes[proci];
665 const auto& fap = procMesh.boundary()[patchi];
670 for (label& edgeId : patchEdgeLabels)
672 edgeId = faEdgeProcAddressing[proci][edgeId];
676 singlePatchEdgeLabels[patchi].
append(patchEdgeLabels);
682 for (
const label sortedEdgei : singlePatchEdgeLabels[patchi])
684 remapGlobal.
insert(sortedEdgei, remapGlobal.
size());
693 forAll(procFaMeshes, proci)
695 const auto& procMesh = procFaMeshes[proci];
696 const auto& procPatch = procMesh.patch();
698 const auto& procEdgeAddr = faEdgeProcAddressing[proci];
699 const auto& procFaceAddr = faFaceProcAddressing[proci];
700 auto& newEdgeProcAddr = newEdgeProcAddressing[proci];
706 newEdgeProcAddr.slice(0, procMesh.nInternalEdges())
708 for (
auto& val : internalSlice)
714 label edgei = procMesh.nInternalEdges();
716 for (
const faPatch& fap : procMesh.boundary())
718 for (
const label patchEdgei : fap.
edgeLabels())
720 const label globalEdgei = procEdgeAddr[patchEdgei];
725 == procFaceAddr[procPatch.edgeOwner(patchEdgei)]
728 if (
auto fnd = remapGlobal.
cfind(globalEdgei); fnd.
good())
732 newEdgeProcAddr[edgei] = (fnd.val()+1);
736 newEdgeProcAddr[edgei] = -(fnd.val()+1);
742 <<
"Failed to find edge " << globalEdgei
743 <<
" this indicates a programming error" <<
nl 750 faEdgeProcAddressing = std::move(newEdgeProcAddressing);
755 int main(
int argc,
char *argv[])
759 "Reconstruct a mesh using geometric/topological information only" 772 "Create procAddressing only without overwriting the mesh" 778 "The merge distance relative to the bounding box size (default 1e-7)" 783 "Do (slower) geometric matching on all boundary faces" 788 "Do matching on processor faces only" 793 "Write cell distribution as a labelList - for use with 'manual' " 794 "decomposition method or as a volScalarField for post-processing." 799 "Suppress finiteArea mesh reconstruction",
805 "disable-edge-encoding",
806 "Emit edgeProcAddressing without encoding edge flips, " 807 "as per 2512 and earlier [special use]",
825 const bool fullMatch =
args.
found(
"fullMatch");
826 const bool procMatch =
args.
found(
"procMatch");
827 const bool writeCellDist =
args.
found(
"cellDist");
828 bool doFiniteArea = !
args.
found(
"no-finite-area");
829 const bool writeAddrOnly =
args.
found(
"addressing-only");
831 const scalar mergeTol =
836 const bool disallowEdgeEncoding =
args.
found(
"disable-edge-encoding");
841 Info<<
"Use geometric matching on all boundary faces." <<
nl <<
endl;
845 Info<<
"Use geometric matching on correct procBoundaries only." <<
nl 846 <<
"This assumes a correct decomposition." <<
endl;
850 Info<<
"Merge assuming correct, fully matched procBoundaries." <<
nl 854 if (fullMatch || procMatch)
856 const scalar writeTol =
859 Info<<
"Merge tolerance : " << mergeTol <<
nl 860 <<
"Write tolerance : " << writeTol <<
endl;
865 && mergeTol < writeTol
869 <<
"Your current settings specify ASCII writing with " 871 <<
"Your merging tolerance (" << mergeTol <<
")" 872 <<
" is finer than this." <<
endl 873 <<
"Please change your writeFormat to binary" 874 <<
" or increase the writePrecision" <<
endl 875 <<
"or adjust the merge tolerance (-mergeTol)." 897 <<
"No regions specified or detected." 917 <<
"No processor* directories found" 924 Info<<
"Found " << nProcs <<
" processor directories" <<
endl;
927 Info<<
" Reading database " 950 databases[0].times(),
963 databases[proci].setTime(timeDirs[timei], timei);
969 label nMeshChanged = 0;
994 hasRegionMesh[regioni] =
true;
1013 if (!hasRegionMesh[regioni])
1033 label masterInternalFaces;
1045 const scalar mergeDist = mergeTol*bb.
mag();
1047 Info<<
"Overall mesh bounding box : " << bb <<
nl 1048 <<
"Relative tolerance : " << mergeTol <<
nl 1049 <<
"Absolute matching distance : " << mergeDist <<
nl 1056 for (label proci=0; proci<nProcs; proci++)
1088 boundProcAddressing[proci] =
1113 renumber(map().addedCellMap(), cellProcAddressing[proci]);
1114 renumber(map().addedFaceMap(), faceProcAddressing[proci]);
1115 renumber(map().addedPointMap(), pointProcAddressing[proci]);
1116 renumber(map().addedPatchMap(), boundProcAddressing[proci]);
1118 for (label step=2; step<nProcs*2; step*=2)
1120 for (label proci=0; proci<nProcs; proci+=step)
1122 label next = proci + step/2;
1128 Info<<
"Merging mesh " << proci <<
" with " 1153 for (label mergedI=proci; mergedI<next; mergedI++)
1158 cellProcAddressing[mergedI]
1164 faceProcAddressing[mergedI]
1169 map().oldPointMap(),
1170 pointProcAddressing[mergedI]
1176 map().oldPatchMap(),
1177 boundProcAddressing[mergedI]
1191 map().addedCellMap(),
1192 cellProcAddressing[addedI]
1197 map().addedFaceMap(),
1198 faceProcAddressing[addedI]
1203 map().addedPointMap(),
1204 pointProcAddressing[addedI]
1209 map().addedPatchMap(),
1210 boundProcAddressing[addedI]
1214 masterMesh.
set(next,
nullptr);
1218 for (label proci=0; proci<nProcs; proci++)
1220 Info<<
"Reading mesh to add from " 1221 << databases[proci].caseName()
1222 <<
" for time = " << databases[proci].timeName()
1228 mergeSharedPoints(mergeDist,masterMesh[0],pointProcAddressing);
1232 masterOwner = masterMesh[0].
faceOwner();
1238 <<
"Disabled writing of merged mesh (-addressing-only)" 1244 writeMesh(masterMesh[0], cellProcAddressing);
1260 for (label proci=0; proci<nProcs; proci++)
1316 const labelList& procFaces = localBoundaryFace[proci];
1317 remoteFaceStart[proci].
setSize(procFaces.
size(), 0);
1332 patchMap[proci].
setSize(nGlobalPatches);
1344 const labelList oldFaceOwner(fvMeshes[0].faceOwner());
1357 boundProcAddressing,
1370 const auto&
pp =
pbm[patchi];
1371 if (!isA<processorPolyPatch>(
pp) ||
pp.size())
1373 oldToNew[patchi] = newi++;
1376 const label nNonProcPatches = newi;
1381 if (oldToNew[patchi] == -1)
1383 oldToNew[patchi] = newi++;
1394 masterMeshPtr.
cref(fvMeshes[0]);
1398 const fvMesh& masterMesh = masterMeshPtr();
1418 <<
"Disabled writing of merged mesh (-addressing-only)" 1423 Time& masterTime =
const_cast<Time&
>(masterMesh.
time());
1430 writeMesh(masterMesh, cellProcAddressing);
1440 masterTime.
caseName() = oldCaseName;
1448 Info<<
"Reconstructing addressing from processor meshes" 1449 <<
" to the newly reconstructed mesh" <<
nl <<
endl;
1462 Info<<
"Processor " << proci <<
nl 1463 <<
"Read processor mesh: " 1479 masterInternalFaces,
1482 cellProcAddressing[proci],
1483 faceProcAddressing[proci],
1484 pointProcAddressing[proci],
1485 boundProcAddressing[proci]
1491 const word boundaryInst =
1492 procMesh.time().findInstance
1514 auto& procFaMeshes = procAreaRegionMeshes(areaName);
1515 procFaMeshes.
resize(databases.size());
1520 new faMesh(areaName, procMesh)
1534 if (!procAreaRegionMeshes.
empty())
1536 masterPolyMeshPtr.
reset 1552 for (
const auto& iter : procAreaRegionMeshes.csorted())
1554 const auto& areaName = iter.key();
1555 const auto& procFaMeshes = iter.val();
1557 const polyMesh& masterMesh = masterPolyMeshPtr();
1569 label nPatchFaces = 0;
1571 forAll(procFaMeshes, proci)
1573 const auto& procMesh = procFaMeshes[proci];
1574 const auto& bm = procMesh.boundary();
1576 nPatchFaces += procMesh.nFaces();
1580 faBoundProcAddressing[proci].
slice(bm.nNonProcessor()) = -1;
1587 labelList masterFaceLabels(nPatchFaces);
1589 forAll(procFaMeshes, proci)
1591 const auto& procMesh = procFaMeshes[proci];
1592 const auto& procPolyFaces = procMesh.faceLabels();
1593 const auto nProcFaces = procMesh.nFaces();
1594 const auto& fpa = faceProcAddressing[proci];
1599 masterFaceLabels.slice(nPatchFaces, nProcFaces) =
1603 faFaceProcAddressing[proci] =
1606 nPatchFaces += nProcFaces;
1621 std::move(masterFaceLabels),
1625 const auto& masterPatch = masterFaMesh.patch();
1631 const auto& mpm = masterPatch.meshPointMap();
1632 forAll(procFaMeshes, proci)
1634 const auto& procPatch = procFaMeshes[proci].patch();
1635 const auto&
mp = procPatch.meshPoints();
1637 auto& pointAddr = faPointProcAddressing[proci];
1638 pointAddr.resize_nocopy(
mp.size());
1642 pointAddr[i] = mpm[pointProcAddressing[proci][
mp[i]]];
1651 determineFaEdgeMapping
1655 pointProcAddressing,
1657 faEdgeProcAddressing
1670 pointProcAddressing,
1671 faFaceProcAddressing,
1674 faEdgeProcAddressing,
1675 singlePatchEdgeLabels
1679 const faMesh& procMesh0 = procFaMeshes[0];
1687 forAll(completePatches, patchi)
1689 const auto& patchEdgeLabels = singlePatchEdgeLabels[patchi];
1693 if (isA<ignoreFaPatch>(fap))
1706 masterFaMesh.boundary(),
1722 masterFaMesh.addFaPatches(completePatches);
1734 masterFaMesh.faceLabels()
1737 forAll(procFaMeshes, proci)
1739 const faMesh& procMesh = procFaMeshes[proci];
1753 faBoundProcAddressing[proci],
1754 faFaceProcAddressing[proci],
1755 faPointProcAddressing[proci],
1756 faEdgeProcAddressing[proci],
1758 disallowEdgeEncoding
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
const polyBoundaryMesh & pbm
const Type & value() const noexcept
Return const reference to value.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
void writeMesh() const
Write equivalent mesh information at the polyMesh faceInstances time.
Info<< "Creating field kinetic energy K\"<< endl;volScalarField K("K", 0.5 *magSqr(U));if(U.nOldTimes()){ volVectorField *Uold=&U.oldTime();volScalarField *Kold=&K.oldTime();*Kold==0.5 *magSqr(*Uold);while(Uold->nOldTimes()) { Uold=&Uold-> oldTime()
A class for handling file names.
bool emplace(const Key &key, Args &&... args)
Emplace insert a new entry, not overwriting existing entries.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fileName & facesInstance() const
Return the current instance directory for faces.
label edgeOwner(label edgei) const
The edge owner face.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
fileName path() const
The path for the case = rootPath/caseName.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
bool allowFaModels() noexcept
The enable/disable state for regionFaModel (default: true)
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values within a list.
const fileName & caseName() const noexcept
The case name.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
UIndirectList< label > labelUIndList
UIndirectList of labels.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static word newName(const label myProcNo, const label neighbProcNo)
Return the name of a processorPolyPatch ("procBoundary..") constructed from the pair of processor IDs...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
virtual autoPtr< faPatch > clone(const faBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath...
label nInternalEdges() const
Number of internal edges.
static unsigned int defaultPrecision() noexcept
Return the default precision.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
A bounding box defined in terms of min/max extrema points.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
static void writeContents(const IOobject &io, const UList< label > &content)
Write contents. The IOobject is never registered.
const Time & time() const
Return the top-level database.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
label nFaces() const noexcept
Number of mesh faces.
const labelList & edgeLabels() const noexcept
Return the list of edges.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for managing references or pointers (no reference counting)
instantList select(const instantList ×) const
Select a list of Time values that are within the ranges.
bool processorCase() const noexcept
True if this is a processor case.
bool allowFunctionObjects() const
The controlDict 'functions' entry is allowed to be used.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
virtual const objectRegistry & thisDb() const
Reference to the mesh database.
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
A list of faces which address into the list of points.
bool allowLibs() const
The controlDict 'libs' entry is allowed to be used. (eg, has not been disabled by the -no-libs option...
void add(const boundBox &bb)
Extend to include the second box.
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
const dimensionedScalar e
Elementary charge.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
SubList< T > slice(const label pos, label len=-1)
Return SubList slice (non-const access) - no range checking.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
static void mergePoints(const polyMesh &, const Map< label > &pointToMaster, polyTopoChange &meshMod)
Helper: Merge points.
void clear()
Clear the list, i.e. set size to zero.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
const Time & time() const noexcept
Return time registry.
void sort(UList< T > &list)
Sort the list.
static word defaultRegion
Return the default region name.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
scalar mag() const
The magnitude/length of the bounding box diagonal.
label size() const noexcept
The number of entries in the list.
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
static autoPtr< mapAddedPolyMesh > add(fvMesh &mesh0, const fvMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true, const bool fullyMapped=false)
Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
virtual const labelList & faceOwner() const
Return face owner.
Reading is optional [identical to LAZY_READ].
static const word null
An empty word.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
label nInternalFaces() const noexcept
Number of internal faces.
label timeIndex() const noexcept
Return the current time index.
A HashTable similar to std::unordered_map.
void resize(const label newLen)
Change the size of the list. Any new entries are nullptr.
static word controlDictName
The default control dictionary name (normally "controlDict")
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
static label procPatchPairs(const UPtrList< polyMesh > &meshes, List< DynamicList< label >> &localPatch, List< DynamicList< label >> &remoteMesh, List< DynamicList< label >> &remotePatch)
Helper: find pairs of processor patches. Return number of non-processor patches.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh...
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
label nEdges() const
Number of edges in patch.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
const word & constant() const noexcept
Return constant name.
const fileName & rootPath() const noexcept
Return root path.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
fileName path() const
Return the full path to the (processor local) case.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
void writeAddressing() const
Write proc addressing at the polyMesh faceInstances time.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
static void patchFacePairs(const UPtrList< polyMesh > &meshes, const List< DynamicList< label >> &localPatch, const List< DynamicList< label >> &remoteMesh, const List< DynamicList< label >> &remotePatch, labelListList &localBoundaryFace, labelListList &remoteFaceMesh, labelListList &remoteBoundaryFace)
Helper: expand list of coupled patches into pairs of coupled faces.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
label nNonProcessor() const
The number of patches before the first processor patch.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
Direct mesh changes based on v1.3 polyTopoChange syntax.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
Finite area boundary mesh, which is a faPatch list with registered IO, a reference to the associated ...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
IOstreamOption::streamFormat writeFormat() const noexcept
Get write stream format.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
bool good() const noexcept
True if iterator points to an entry.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
A primitive field of type <T> with automated input and output.
void setSize(label n)
Alias for resize()
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
Do not request registration (bool: false)
const dimensionedScalar mp
Proton mass.
static Map< label > findSharedPoints(const polyMesh &, const scalar mergeTol)
Find topologically and geometrically shared points.
bool found(const word &optName) const
Return true if the named option is found.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
bool set(const Key &key, const T &obj)
Copy assign a new entry, overwriting existing entries.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
label ngbPolyPatchIndex() const noexcept
The neighbour polyPatch index.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
void reset(T *p=nullptr) noexcept
Delete managed pointer and set to new given pointer.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
static constexpr const zero Zero
Global zero (0)