150 using namespace Foam;
186 auto&
fld = tfld.ref();
190 fld[celli] = elems[celli];
193 fld.correctBoundaryConditions();
224 auto& bandwidth = metrics.first();
225 auto& profile = metrics.second();
229 const auto& neighbours = mat[celli];
231 const label nNbr = neighbours.
size();
236 const label width = (neighbours[nNbr-1] - celli);
238 if (bandwidth < width)
243 profile += scalar(width);
254 const bool calculateIntersect,
260 scalar& sumSqrIntersect
269 const label own = owner[facei];
270 const label nei = neighbour[facei];
273 const label width = nei - own;
275 if (cellBandwidth[nei] < width)
277 cellBandwidth[nei] = width;
279 if (bandwidth < width)
288 for (
const label width : cellBandwidth)
290 profile += scalar(width);
294 if (calculateIntersect)
300 for (label colI = celli-cellBandwidth[celli]; colI <= celli; colI++)
302 nIntersect[colI] += scalar(1);
327 forAll(cellOrder, newCelli)
329 const label oldCelli = cellOrder[newCelli];
336 for (
const label facei : cFaces)
344 if (nbrCelli == newCelli)
350 if (nbrCelli <= newCelli)
361 for (
const label index : order)
365 oldToNewFace[cFaces[index]] = newFacei++;
371 for (label facei = newFacei; facei <
mesh.
nFaces(); facei++)
373 oldToNewFace[facei] = facei;
378 forAll(oldToNewFace, facei)
380 if (oldToNewFace[facei] == -1)
383 <<
"Did not determine new position" <<
" for face " << facei
410 forAll(cellOrder, newCelli)
412 const label oldCelli = cellOrder[newCelli];
419 for (
const label facei : cFaces)
427 if (nbrCelli == newCelli)
433 if (nbrCelli <= newCelli)
440 label ownRegion = cellToRegion[oldCelli];
441 label neiRegion = cellToRegion[cellOrder[nbrCelli]];
443 if (ownRegion != neiRegion)
455 for (
const label index : order)
459 oldToNewFace[cFaces[index]] = newFacei++;
468 const label nRegions =
max(cellToRegion)+1;
478 if (ownRegion != neiRegion)
481 min(ownRegion, neiRegion)*nRegions
482 +
max(ownRegion, neiRegion);
491 label
key = sortKey[i];
498 oldToNewFace[sortKey.indices()[i]] = newFacei++;
503 for (label facei = newFacei; facei <
mesh.
nFaces(); facei++)
505 oldToNewFace[facei] = facei;
510 forAll(oldToNewFace, facei)
512 if (oldToNewFace[facei] == -1)
515 <<
"Did not determine new position for face " << facei
557 forAll(newNeighbour, facei)
559 if (newOwner[facei] > newNeighbour[facei])
561 std::swap(newOwner[facei], newNeighbour[facei]);
562 newFaces[facei].flip();
563 flipFaceFlux.insert(facei);
577 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
604 label oldFacei = fZone[i];
605 newAddressing[i] = reverseFaceOrder[oldFacei];
606 if (flipFaceFlux.found(newAddressing[i]))
608 newFlipMap[i] = !fZone.
flipMap()[i];
612 newFlipMap[i] = fZone.
flipMap()[i];
701 timer.resetTimeIncrement();
703 forAll(regionCellOrder, regioni)
709 method.
renumber(regionCellOrder[regioni].size());
712 regionCellOrder[regioni] =
716 timings[TimingType::RENUMBER] +=
timer.timeIncrement();
720 timer.resetTimeIncrement();
722 forAll(regionCellOrder, regioni)
735 const labelList& cellMap = subsetter.cellMap();
742 regionCellOrder[regioni] =
labelUIndList(cellMap, subCellOrder);
745 timings[TimingType::RENUMBER] +=
timer.timeIncrement();
749 timer.resetTimeIncrement();
763 timings[TimingType::CELL_CELLS] +=
timer.timeIncrement();
768 forAll(regionCellOrder, regioni)
774 subsetCells.set(regionCellOrder[regioni]);
781 timings[TimingType::CELL_CELLS] +=
timer.timeIncrement();
791 regionCellOrder[regioni] =
labelUIndList(cellMap, subCellOrder);
793 timings[TimingType::RENUMBER] +=
timer.timeIncrement();
798 return regionCellOrder;
804 int main(
int argc,
char *argv[])
812 "Renumber mesh cells to reduce the bandwidth. Use the -lib option or" 813 " dictionary 'libs' entry to load additional libraries" 818 "Test without writing. " 819 "Changes -write-maps to write VTK output." 828 "Calculate the RMS of the front-width" 834 "Aggregate initially with a decomposition method (serial only)" 840 "Write renumber mappings" 846 "Suppress renumbering of fields (eg, when they are only uniform)" 852 "List available renumbering methods" 859 "Specify renumber method (default: CuthillMcKee) without dictionary" 866 "Specify renumber coefficients (dictionary content) as string. " 867 "eg, 'reverse true;'" 878 bool listOptions =
false;
884 <<
"Available renumber methods:" <<
nl 898 const bool readDict =
args.
found(
"dict");
899 const bool doDecompose =
args.
found(
"decompose");
900 const bool overwrite =
args.
found(
"overwrite");
901 const bool doFields = !
args.
found(
"no-fields");
902 const bool doFrontWidth =
args.
found(
"frontWidth") && !doDecompose;
904 word renumberMethodName;
910 <<
"Cannot use -decompose option in parallel ... giving up" <<
nl 921 && !decompDictFile.empty() && !decompDictFile.
isAbsolute()
946 timings[TimingType::READ_MESH] +=
timer.timeIncrement();
961 scalar sumSqrIntersect;
978 <<
"Before renumbering" <<
nl 979 <<
" band : " << band <<
nl 980 <<
" profile : " << profile <<
nl;
990 Info<<
" rms frontwidth : " << rmsFrontwidth <<
nl;
995 bool sortCoupledFaceCells =
false;
997 bool orderPoints =
false;
998 bool useRegionFaceOrder =
false;
1019 sortCoupledFaceCells =
1020 renumberDict.
getOrDefault(
"sortCoupledFaceCells",
false);
1022 if (sortCoupledFaceCells)
1024 Info<<
"Sorting cells on coupled boundaries to be last." 1028 blockSize = renumberDict.
getOrDefault<label>(
"blockSize", 0);
1032 Info<<
"Ordering cells into regions of size " << blockSize
1033 <<
" (using decomposition);" 1034 <<
" ordering faces into region-internal" 1035 <<
" and region-external." 1041 useRegionFaceOrder =
1046 orderPoints = renumberDict.
getOrDefault(
"orderPoints",
false);
1049 Info<<
"Ordering points into internal and boundary points." 1059 Info<<
"Writing renumber maps (new to old) to polyMesh." 1071 Info<<
"Specified renumber coefficients:" <<
nl 1072 << renumberDict <<
nl;
1075 if (!renumberMethodName.empty())
1078 renumberDict.
set(
"method", renumberMethodName);
1081 else if (renumberDict.
found(
"method"))
1092 Info<<
"Using renumber-method: " << renumberPtr().type()
1093 <<
" [default]" <<
endl;
1097 Info<<
"Using renumber-method: " << renumberPtr().type()
1107 "cellProcAddressing",
1121 "faceProcAddressing",
1134 "pointProcAddressing",
1147 "boundaryProcAddressing",
1161 if (!dryrun && doFields)
1163 Info<<
nl <<
"Reading fields" <<
nl;
1165 timer.resetTimeIncrement();
1168 storedObjects.
reserve(objects.size());
1175 #define doLocalCode(FieldType) \ 1176 readFields<FieldType>(mesh, objects, nameMatcher, storedObjects); 1203 #define doLocalCode(FieldType) \ 1204 readFields<FieldType>(pMesh, objects, nameMatcher, storedObjects); 1214 timings[TimingType::READ_FIELDS] +=
timer.timeIncrement();
1217 for (
auto* fldptr : storedObjects)
1246 if (blockSize > 0 && !doDecompose)
1248 timer.resetTimeIncrement();
1254 Info<<
"nBlocks = " << nBlocks <<
endl;
1258 decomposeDict.
set(
"numberOfSubdomains", nBlocks);
1268 decomposePtr().decompose
1277 timings[TimingType::DECOMPOSE] +=
timer.timeIncrement();
1287 Info<<
nl <<
"Written decomposition as volScalarField to " 1288 <<
"cellDist for use in postprocessing." 1298 decomposePtr().nDomains()
1301 cellOrder = regionCellOrder.
values();
1304 if (useRegionFaceOrder)
1306 faceOrder = getRegionFaceOrder(
mesh, cellOrder, cellToRegion);
1310 faceOrder = getFaceOrder(
mesh, cellOrder);
1321 timer.resetTimeIncrement();
1350 decomposePtr().decompose
1357 timings[TimingType::DECOMPOSE] +=
timer.timeIncrement();
1367 decomposePtr().nDomains()
1370 cellOrder = regionCellOrder.
values();
1376 "requested.partition-offsets",
1384 const auto& method = renumberPtr();
1386 timer.resetTimeIncrement();
1397 timings[TimingType::RENUMBER] +=
timer.timeIncrement();
1401 if (sortCoupledFaceCells)
1407 label nBndCells = 0;
1412 nBndCells +=
pbm[patchi].
size();
1430 if (reverseCellOrder[celli] != -1)
1432 bndCells[nBndCells] = celli;
1433 bndCellMap[nBndCells++] =
1434 reverseCellOrder[celli];
1435 reverseCellOrder[celli] = -1;
1440 bndCells.
resize(nBndCells);
1441 bndCellMap.resize(nBndCells);
1452 label origCelli = bndCells[order[i]];
1453 newReverseCellOrder[origCelli] = --sortedI;
1456 Info<<
"Ordered all " << nBndCells
1457 <<
" cells with a coupled face" 1458 <<
" to the end of the cell list, starting at " << sortedI
1463 forAll(cellOrder, newCelli)
1465 label origCelli = cellOrder[newCelli];
1466 if (newReverseCellOrder[origCelli] == -1)
1468 newReverseCellOrder[origCelli] = sortedI++;
1478 faceOrder = getFaceOrder(
mesh, cellOrder);
1508 pointOrderMap().pointMap()
1513 pointOrderMap().reversePointMap(),
1514 const_cast<labelList&>(map().reversePointMap())
1523 if (cellProcAddressing.headerOk())
1527 Info<<
"Renumbering processor cell decomposition map " 1528 << cellProcAddressing.name() <<
endl;
1537 Info<<
"Not writing inconsistent processor cell decomposition" 1538 <<
" map " << cellProcAddressing.filePath() <<
endl;
1547 if (faceProcAddressing.headerOk())
1551 Info<<
"Renumbering processor face decomposition map " 1552 << faceProcAddressing.name() <<
endl;
1561 for (
const label facei : fff)
1563 label masterFacei = faceProcAddressing[facei];
1565 faceProcAddressing[facei] = -masterFacei;
1567 if (masterFacei == 0)
1570 <<
" masterFacei:" << masterFacei
1577 Info<<
"Not writing inconsistent processor face decomposition" 1578 <<
" map " << faceProcAddressing.filePath() <<
endl;
1587 if (pointProcAddressing.headerOk())
1591 Info<<
"Renumbering processor point decomposition map " 1592 << pointProcAddressing.name() <<
endl;
1601 Info<<
"Not writing inconsistent processor point decomposition" 1602 <<
" map " << pointProcAddressing.filePath() <<
endl;
1611 if (boundaryProcAddressing.headerOk())
1625 Info<<
"Not writing inconsistent processor patch decomposition" 1626 <<
" map " << boundaryProcAddressing.filePath() <<
endl;
1639 if (map().hasMotionPoints())
1648 scalar sumSqrIntersect;
1662 Info<<
"After renumbering";
1665 Info<<
" [values are misleading with -decompose option]";
1669 <<
" band : " << band <<
nl 1670 <<
" profile : " << profile <<
nl;
1680 Info<<
" rms frontwidth : " << rmsFrontwidth <<
nl;
1725 <<
" total : " << nTotPoints <<
nl 1726 <<
" internal: " << nTotIntPoints <<
nl 1727 <<
" boundary: " << nTotPoints-nTotIntPoints <<
nl 1729 <<
" total : " << nTotEdges <<
nl 1730 <<
" internal: " << nTotIntEdges <<
nl 1731 <<
" internal using 0 boundary points: " 1732 << nTotInt0Edges <<
nl 1733 <<
" internal using 1 boundary points: " 1734 << nTotInt1Edges-nTotInt0Edges <<
nl 1735 <<
" internal using 2 boundary points: " 1736 << nTotIntEdges-nTotInt1Edges <<
nl 1737 <<
" boundary: " << nTotEdges-nTotIntEdges <<
nl 1775 const label cellOffset =
1781 map().cellMap().
cbegin(),
1782 map().cellMap().
cend(),
1784 [=](
const label id) {
return (
id + cellOffset); }
1800 "requested.partition-offsets",
1808 <<
"Requested partition total-size: " 1810 <<
" mesh total-size: " 1812 <<
" ... ignoring" <<
endl;
1814 partitionOffsets.
clear();
1820 for (
const label proci : partitionOffsets.
allProcs())
1822 ids.
slice(partitionOffsets.
range(proci)) = proci;
1825 if (!partitionOffsets.
empty())
1831 Info<<
"Wrote renumbered mesh to " 1833 <<
" for visualization." 1840 timer.resetTimeIncrement();
1881 timings[TimingType::WRITING] +=
timer.timeIncrement();
1901 <<
"Wrote current cellID and origCellID as volScalarField" 1902 <<
" for use in postprocessing." <<
nl <<
endl;
1927 while (!storedObjects.empty())
1929 storedObjects.back()->checkOut();
1930 storedObjects.pop_back();
1936 <<
" read mesh : " << timings[TimingType::READ_MESH] <<
nl 1937 <<
" read fields : " << timings[TimingType::READ_FIELDS] <<
nl 1938 <<
" decompose : " << timings[TimingType::DECOMPOSE] <<
nl 1939 <<
" cell-cells : " << timings[TimingType::CELL_CELLS] <<
nl 1940 <<
" renumber : " << timings[TimingType::RENUMBER] <<
nl 1941 <<
" write : " << timings[TimingType::WRITING] <<
nl 1942 <<
"TotalTime = " <<
timer.elapsedTime() <<
" s" <<
nl static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
labelRange range(const label proci) const
Return start/size range of proci data.
const polyBoundaryMesh & pbm
CompactListList< label > subsetAdjacency(const bitSet &select, const CompactListList< label > &input, labelList &subMap)
const Type & value() const noexcept
Return const reference to value.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
const labelList & offsets() const noexcept
Return the offset table (= size()+1)
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
void clearAddressing()
Clear addressing.
A class for handling file names.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fields, const bool syncPar=true, const bool readOldTime=false)
Read Geometric fields of templated type.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label size() const noexcept
The primary size (the number of rows/sublists)
const fileName & facesInstance() const
Return the current instance directory for faces.
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
A 1D vector of objects of type <T> with a fixed length <N>.
void resize(const label len)
Adjust allocated size of list.
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...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
virtual const labelList & faceNeighbour() const
Return face neighbour.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const word & name() const noexcept
Return the object name.
A list that is sorted upon construction or when explicitly requested with the sort() method...
Cell-face mesh analysis engine.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values within a list.
constexpr char nl
The newline '\n' character (0x0a)
Implements a timeout mechanism via sigalarm.
label start() const noexcept
The start label of boundary faces in the polyMesh face list.
virtual bool no_topology() const
Renumbering method without mesh or cell-cell topology (very special case)
UIndirectList< label > labelUIndList
UIndirectList of labels.
const word dictName("faMeshDefinition")
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
static bool & parRun() noexcept
Test if this a parallel run.
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...
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
bool writeProcIDs()
Write processor ids for each line as CellData or for each point as PointData, depending on isPointDat...
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
void resetPrimitives(autoPtr< pointField > &&points, autoPtr< faceList > &&faces, autoPtr< labelList > &&owner, autoPtr< labelList > &&neighbour, const labelUList &patchSizes, const labelUList &patchStarts, const bool validBoundary=true)
Reset mesh primitive data. Assumes all patch info correct.
static bool setTimeIfPresent(Time &runTime, const argList &args, const bool forceInitial=false)
Set the runTime based on -constant (if present), -time (value), or -latestTime.
const cellList & cells() const
Field reading functions for post-processing utilities.
static bool isAbsolute(const std::string &str)
Return true if filename starts with a '/' or '\' or (windows-only) with a filesystem-root.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
Smooth ATC in cells next to a set of patches supplied by type.
const Time & time() const
Return the top-level database.
const globalIndex & globalMeshCellAddr() const noexcept
Global numbering for mesh cells.
label nFaces() const noexcept
Number of mesh faces.
void push_back(const T &val)
Append an element at the end of the list.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
List< labelList > labelListList
List of labelList.
#define doLocalCode(FieldType, Variable)
static dictionary readContents(const IOobject &io)
Read and return contents, testing for "dictionary" type. The IOobject will not be registered...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Mesh representing a set of points created from polyMesh.
#define forAll(list, i)
Loop across all elements in list.
const labelList & offsets() const noexcept
Const-access to the offsets.
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
void writeCellData(const word &fieldName, const UList< Type > &field)
Write primitive field of CellData.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
virtual labelList renumber(const label nCells) const
Return the cell visit order (from ordered back to original cell id) based solely on the number of cel...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Abstract base class for renumbering.
Unary and binary predicates that always return true, useful for templating.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
CompactListList< label > invertOneToManyCompact(const label len, const labelUList &map)
Invert one-to-many compact map. Unmapped elements will be size 0.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
label totalSize() const noexcept
The total addressed size, which corresponds to the end offset and also the sum of all localSizes...
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vectorField pointField
pointField is a vectorField.
const fileName & pointsInstance() const
Return the current instance directory for points.
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.
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 clear()
Clear the list, i.e. set size to zero.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName. Same as TimePaths::globalPath() ...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
static void addDryRunOption(const string &usage, bool advanced=false)
Enable a 'dry-run' bool option, with usage information.
const Time & time() const noexcept
Return time registry.
const word & executable() const noexcept
Name of executable without the path.
int dryRun() const noexcept
Return the dry-run flag.
void sort(UList< T > &list)
Sort the list.
Cuthill-McKee renumbering (CM or RCM)
static void addOptions_singleTime()
Add single-time timeSelector options to argList::validOptions()
label nInternalPoints() const noexcept
Points not on boundary.
label size() const noexcept
The number of entries in the list.
const word & system() const noexcept
Return system name.
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
virtual const labelList & faceOwner() const
Return face owner.
Reading is optional [identical to LAZY_READ].
static const word null
An empty word.
virtual void resetAddressing(faceZone &&zn)
Move reset addressing and flip map from another zone.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
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.
virtual const faceList & faces() const
Return raw faces.
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const vectorField & cellCentres() const
void updateMesh(const mapPolyMesh &)
Update local numbering for changed mesh.
errorManip< error > abort(error &err)
label nEdges() const
Number of mesh edges.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
ITstream lookup(const word &optName) const
Return an input stream from the named option.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
virtual bool needs_mesh() const
Renumbering method requires a polyMesh for its topology.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
A packed storage of objects of type <T> using an offset table for access.
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
static wordList supportedMethods()
Return a list of the known methods.
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
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.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
static const word canonicalName
The canonical name ("decomposeParDict") under which the MeshObject is registered. ...
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
label nTotalCells() const noexcept
Total global number of mesh cells.
labelRange allProcs() const noexcept
Range of process indices for all addressed offsets (processes)
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))
Write an OpenFOAM volume (internal) geometry and internal fields as a vtu file or a legacy vtk file...
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
static autoPtr< renumberMethod > New(const dictionary &dict)
Construct/select a renumbering method.
static autoPtr< decompositionMethod > New(const dictionary &decompDict, const word ®ionName="")
Return a reference to the selected decomposition method, optionally region-specific.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define WarningInFunction
Report a warning using Foam::Warning.
const word & name() const
Return reference to name.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
A cell is defined as a list of faces with extra functionality.
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...
const polyBoundaryMesh & patches
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Automatically write from objectRegistry::writeObject()
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
const boolList & flipMap() const noexcept
Return face flip map.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool writeGeometry()
Write patch topology.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
label localStart(const label proci) const
Start of proci data.
bool empty() const noexcept
Check for default constructed or total-size == 0.
const List< T > & values() const noexcept
Return the packed values.
Various for reading/decomposing/reconstructing/distributing refinement data.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
A subset of mesh faces organised as a primitive patch.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
static void calcCellCells(const polyMesh &mesh, const labelUList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells)
Determine (local or global) cellCells from mesh agglomeration.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
List< label > labelList
A List of labels.
A class for managing temporary objects.
const fileName & output() const noexcept
The current output file name.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Foam::argList args(argc, argv)
A IOList wrapper for writing external data.
void resetHeader(const word &newName=word::null)
Clear various bits (headerClassName, note, sizeof...) that would be obtained when reading from a file...
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels. Not implemented.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using no boundary point.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static void writeMaps(Ostream &os, const word &key, const labelListList &maps)
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
Do not request registration (bool: false)
A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGr...
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
void clear()
Reset to be empty (no offsets)
UIndirectList< bool > boolUIndList
UIndirectList of bools.
bool found(const word &optName) const
Return true if the named option is found.
An input stream of tokens.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Starts timing and returns elapsed time from start. Uses std::chrono::high_resolution_clock for better...