Go to the documentation of this file.
105 using namespace Foam;
111 static const scalar defaultMergeTol = 1
e-6;
115 scalar getMergeDistance
122 const scalar mergeTol =
125 const scalar writeTol =
128 Info<<
"Merge tolerance : " << mergeTol <<
nl
129 <<
"Write tolerance : " << writeTol <<
endl;
134 <<
"Your current settings specify ASCII writing with "
136 <<
"Your merging tolerance (" << mergeTol <<
") is finer than this."
138 <<
"Please change your writeFormat to binary"
139 <<
" or increase the writePrecision" <<
endl
140 <<
"or adjust the merge tolerance (-mergeTol)."
144 const scalar mergeDist = mergeTol * bb.
mag();
146 Info<<
"Overall meshes bounding box : " << bb <<
nl
147 <<
"Relative tolerance : " << mergeTol <<
nl
148 <<
"Absolute matching distance : " << mergeDist <<
nl
182 label maxProcCells = 0;
183 label totProcFaces = 0;
184 label maxProcPatches = 0;
185 label totProcPatches = 0;
186 label maxProcFaces = 0;
191 <<
"Processor " << procI <<
nl
192 <<
" Number of cells = " << globalCells.localSize(procI)
195 label nProcFaces = 0;
197 const labelList& nei = patchNeiProcNo[procI];
199 forAll(patchNeiProcNo[procI], i)
201 Info<<
" Number of faces shared with processor "
202 << patchNeiProcNo[procI][i] <<
" = " << patchSize[procI][i]
205 nProcFaces += patchSize[procI][i];
208 Info<<
" Number of processor patches = " << nei.size() <<
nl
209 <<
" Number of processor faces = " << nProcFaces <<
nl
210 <<
" Number of boundary faces = "
211 << globalBoundaryFaces.localSize(procI)-nProcFaces <<
endl;
213 maxProcCells =
max(maxProcCells, globalCells.localSize(procI));
214 totProcFaces += nProcFaces;
215 totProcPatches += nei.size();
216 maxProcPatches =
max(maxProcPatches, nei.size());
217 maxProcFaces =
max(maxProcFaces, nProcFaces);
227 if (totProcPatches == 0)
231 if (totProcFaces == 0)
237 <<
"Number of processor faces = " << totProcFaces/2 <<
nl
238 <<
"Max number of cells = " << maxProcCells
239 <<
" (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells
240 <<
"% above average " << avgProcCells <<
")" <<
nl
241 <<
"Max number of processor patches = " << maxProcPatches
242 <<
" (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches
243 <<
"% above average " << avgProcPatches <<
")" <<
nl
244 <<
"Max number of faces between processors = " << maxProcFaces
245 <<
" (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces
246 <<
"% above average " << avgProcFaces <<
")" <<
nl
252 void writeDecomposition
274 cellDecomposition.write();
276 Info<<
"Writing wanted cell distribution to volScalarField " <<
name
277 <<
" for postprocessing purposes." <<
nl <<
endl;
292 zeroGradientFvPatchScalarField::typeName
297 procCells[cI] = decomp[cI];
300 procCells.correctBoundaryConditions();
305 void determineDecomposition
307 const Time& baseRunTime,
309 const bool decompose,
312 const bool writeCellDist,
330 <<
"You have selected decomposition method "
331 << decomposer.typeName
332 <<
" which does" <<
nl
333 <<
"not synchronise the decomposition across"
334 <<
" processor patches." <<
nl
335 <<
" You might want to select a decomposition method"
336 <<
" which is aware of this. Continuing."
343 <<
" to read decomposeParDict" <<
endl;
348 if (method.
found(
"weightField"))
364 cellWeights = weights.internalField();
372 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
373 const_cast<Time&
>(
mesh.
time()).caseName() = proc0CaseName;
385 <<
" to write undecomposed cellDist" <<
endl;
390 writeDecomposition(
"cellDist",
mesh, decomp);
391 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
397 writeDecomposition(
"cellDist",
mesh, decomp);
404 void writeProcAddressing
418 "cellProcAddressing",
431 "faceProcAddressing",
444 "pointProcAddressing",
457 "boundaryProcAddressing",
508 patchDistMap.constructSize(),
509 patchDistMap.subMap(),
510 patchDistMap.subHasFlip(),
511 patchDistMap.constructMap(),
512 patchDistMap.constructHasFlip(),
562 const bool cellOk = cellMap.write();
563 const bool faceOk =
faceMap.write();
564 const bool pointOk = pointMap.write();
565 const bool patchOk = patchMap.write();
567 if (!cellOk || !faceOk || !pointOk || !patchOk)
570 <<
"Failed to write " << cellMap.objectPath()
571 <<
", " <<
faceMap.objectPath()
572 <<
", " << pointMap.objectPath()
573 <<
", " << patchMap.objectPath()
582 for (
const auto prefix : {
"boundary",
"cell",
"face",
"point"})
586 prefix +
word(
"ProcAddressing"),
599 template<
class GeoField>
613 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
631 template<
class GeoField>
645 wordList objectNames = objects.sortedNames();
654 <<
"Objects not synchronised across processors." <<
nl
661 fields.setSize(masterNames.size());
675 if (subsetterPtr.
valid())
682 if (!haveMesh[procI])
747 template<
class GeoField,
class CoupledPatchType>
748 void correctCoupledBoundaryConditions(
fvMesh&
mesh)
752 mesh.objectRegistry::lookupClass<GeoField>()
757 GeoField&
fld = *iter();
759 typename GeoField::Boundary& bfld =
fld.boundaryFieldRef();
770 auto& pfld = bfld[patchi];
773 if (fvp.coupled() && !isA<cyclicACMIFvPatch>(fvp))
789 for (
auto& pfld : bfld)
791 if (pfld.patch().coupled())
800 fld.mesh().globalData().patchSchedule();
802 forAll(patchSchedule, patchEvali)
804 const label patchi = patchSchedule[patchEvali].patch;
806 auto& pfld = bfld[patchi];
808 if (fvp.coupled() && !isA<cyclicACMIFvPatch>(fvp))
810 if (patchSchedule[patchEvali].init)
824 <<
"Unsupported communications type "
835 const Time& baseRunTime,
839 const bool doReadFields,
840 const bool decompose,
842 const bool overwrite,
844 const label nDestProcs,
887 const bool allHaveMesh = !haveMesh.found(
false);
898 <<
"Cannot find non-processor patch on processor "
925 <<
" have objects:" << objects.names() <<
endl;
929 auto iter = objects.find(
"cellDist");
966 volSphereTensorFields
1014 surfSphereTensorFields
1023 surfSymmTensorFields
1061 dimSphereTensorFields
1089 objects.lookupClass(pointScalarField::typeName).sortedNames()
1093 objects.lookupClass(pointVectorField::typeName).sortedNames()
1099 pointSphericalTensorField::typeName
1106 pointSymmTensorField::typeName
1111 objects.lookupClass(pointTensorField::typeName).sortedNames()
1132 Info<<
"After distribution:" <<
endl;
1133 printMeshData(
mesh);
1136 correctCoupledBoundaryConditions
1141 correctCoupledBoundaryConditions
1146 correctCoupledBoundaryConditions
1151 correctCoupledBoundaryConditions
1156 correctCoupledBoundaryConditions
1198 Info<<
"Setting caseName to " << baseRunTime.
caseName()
1199 <<
" to write reconstructed mesh and fields." <<
endl;
1204 for (
const word& fieldName : pointFieldNames)
1219 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
1227 for (
const word& fieldName : pointFieldNames)
1249 writeProcAddressing(
mesh, map, decompose);
1256 removeProcAddressing(
mesh);
1290 refData.distribute(map);
1300 Info<<
"Setting caseName to " << baseRunTime.
caseName()
1301 <<
" to write reconstructed refinement data." <<
endl;
1307 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
1404 forAll(boundaryProcAddressing, i)
1406 if (boundaryProcAddressing[i] != -1)
1408 patchProcAddressing.append(boundaryProcAddressing[i]);
1418 if (baseMeshPtr.
valid() && baseMeshPtr().nCells())
1420 const fvMesh& baseMesh = baseMeshPtr();
1428 std::move(cellSubMap),
1429 std::move(cellAddressing)
1438 std::move(faceSubMap),
1439 std::move(faceAddressing),
1450 std::move(pointSubMap),
1451 std::move(pointAddressing)
1462 std::move(patchSubMap),
1463 std::move(boundaryAddressing)
1472 labelList oldPatchNMeshPoints(pbm.size());
1475 oldPatchStarts[patchI] = pbm[patchI].
start();
1476 oldPatchNMeshPoints[patchI] = pbm[patchI].nPoints();
1486 std::move(oldPatchStarts),
1487 std::move(oldPatchNMeshPoints),
1488 std::move(pointMap),
1504 std::move(cellSubMap),
1505 std::move(cellConstructMap)
1515 std::move(faceSubMap),
1516 std::move(faceConstructMap),
1528 std::move(pointSubMap),
1529 std::move(pointConstructMap)
1541 std::move(patchSubMap),
1542 std::move(patchConstructMap)
1551 labelList oldPatchNMeshPoints(pbm.size());
1554 oldPatchStarts[patchI] = pbm[patchI].
start();
1555 oldPatchNMeshPoints[patchI] = pbm[patchI].nPoints();
1565 std::move(oldPatchStarts),
1566 std::move(oldPatchNMeshPoints),
1567 std::move(pointMap),
1579 void readProcAddressing
1602 Info<<
"Reading addressing from procXXXAddressing at "
1608 "cellProcAddressing",
1620 "faceProcAddressing",
1632 "pointProcAddressing",
1644 "boundaryProcAddressing",
1663 <<
"Read addressing inconsistent with mesh sizes" <<
nl
1665 <<
" addressing:" << cellProcAddressing.objectPath()
1666 <<
" size:" << cellProcAddressing.size() <<
nl
1671 <<
" addressing:" << pointProcAddressing.objectPath()
1672 <<
" size:" << pointProcAddressing.size()
1674 <<
" addressing:" << boundaryProcAddressing.objectPath()
1675 <<
" size:" << boundaryProcAddressing.size()
1680 distMap = createReconstructMap
1686 pointProcAddressing,
1687 boundaryProcAddressing
1693 void reconstructMeshFields
1788 void reconstructLagrangian
1794 const wordRes& selectedLagrangianFields
1806 if (!lagrangianReconstructorPtr.
valid())
1808 lagrangianReconstructorPtr.
reset
1820 *lagrangianReconstructorPtr;
1824 Info<<
"Reconstructing lagrangian fields for cloud "
1847 selectedLagrangianFields
1854 selectedLagrangianFields
1861 selectedLagrangianFields
1868 selectedLagrangianFields
1875 selectedLagrangianFields
1882 selectedLagrangianFields
1890 selectedLagrangianFields
1898 selectedLagrangianFields
1905 selectedLagrangianFields
1913 selectedLagrangianFields
1920 selectedLagrangianFields
1927 selectedLagrangianFields
1939 const wordRes& selectedLagrangianFields,
1973 selectedLagrangianFields
1980 selectedLagrangianFields
1987 selectedLagrangianFields
1996 selectedLagrangianFields
2003 selectedLagrangianFields
2010 selectedLagrangianFields
2019 selectedLagrangianFields
2026 selectedLagrangianFields
2033 selectedLagrangianFields
2042 selectedLagrangianFields
2049 selectedLagrangianFields
2056 selectedLagrangianFields
2065 selectedLagrangianFields
2072 selectedLagrangianFields
2079 selectedLagrangianFields
2088 selectedLagrangianFields
2095 selectedLagrangianFields
2102 selectedLagrangianFields
2108 void redistributeLagrangian
2112 const label nOldCells,
2119 if (!lagrangianReconstructorPtr.
valid())
2121 lagrangianReconstructorPtr.
reset
2133 lagrangianReconstructorPtr();
2264 int main(
int argc,
char *argv[])
2268 "Redistribute decomposed mesh and fields according"
2269 " to the decomposeParDict settings.\n"
2270 "Optionally run in decompose/reconstruct mode"
2282 "operate on all regions in regionProperties"
2290 "Test without writing the decomposition. "
2291 "Changes -cellDist to only write volScalarField."
2297 "The merge distance relative to the bounding box size (default 1e-6)"
2302 "Write cell distribution as a labelList - for use with 'manual' "
2303 "decomposition method or as a volScalarField for post-processing."
2308 "Only reconstruct new times (i.e. that do not exist already)"
2320 const bool writeCellDist =
args.
found(
"cellDist");
2321 const bool dryrun =
args.
found(
"dry-run");
2322 const bool newTimes =
args.
found(
"newTimes");
2324 bool decompose =
args.
found(
"decompose");
2325 bool overwrite =
args.
found(
"overwrite");
2330 <<
"Detected floating point exception trapping (FOAM_SIGFPE)."
2331 <<
" This might give" <<
nl
2332 <<
" problems when mapping fields. Switch it off in case"
2333 <<
" of problems." <<
endl;
2338 const wordRes selectedLagrangianFields;
2343 Info<<
"Decomposing case (like decomposePar)" <<
nl <<
endl;
2347 <<
"Cannot specify both -decompose and -reconstruct"
2353 Info<<
"Reconstructing case (like reconstructParMesh)" <<
nl <<
endl;
2362 <<
"Working in decompose or reconstruction mode automatically"
2363 <<
" implies -overwrite" <<
nl <<
endl;
2372 <<
": This utility can only be run parallel"
2389 nfs = (roots.size() == 1);
2394 Info<<
"Detected multiple roots i.e. non-nfs running"
2402 Info<<
"Removing existing processor directories" <<
endl;
2410 Info<<
"No processor directories; switching on decompose mode"
2424 Info<<
"Creating time directories on all processors" <<
nl <<
endl;
2434 for (
const instant& t : timeDirs)
2459 Info<<
"Creating time directories for undecomposed Time"
2460 <<
" on all processors" <<
nl <<
endl;
2473 for (
const instant& t : timeDirs)
2475 mkDir(basePath/t.name());
2480 Info<<
"Create undecomposed database"<<
nl <<
endl;
2496 for (
const instant& t : baseTimeDirs)
2498 masterTimeDirSet.insert(t.name());
2513 Info<<
"Decomposing all regions in regionProperties" <<
nl
2518 regionNames.resize(1);
2519 regionNames.first() =
2535 if (timeDirs.empty())
2538 <<
"No times selected"
2548 <<
"Pass1 : reconstructing mesh and addressing" <<
nl <<
endl;
2551 forAll(regionNames, regioni)
2568 baseRunTime.
setTime(timeDirs[timeI], timeI);
2588 Info<<
"Checking for mesh in " << meshPath <<
nl <<
endl;
2594 Info<<
"Per processor mesh availability:" <<
nl
2606 bool haveAddressing =
false;
2627 "faceProcAddressing",
2641 haveAddressing =
true;
2647 haveAddressing =
true;
2652 Info<<
"loading mesh from " << facesInstance <<
endl;
2666 const scalar tolDim = getMergeDistance
2677 Info<<
"Reconstructing mesh for time " << facesInstance
2680 label nDestProcs = 1;
2683 redistributeAndWrite
2707 <<
"Pass2 : reconstructing fields" <<
nl <<
endl;
2710 baseRunTime.
setTime(timeDirs[0], 0);
2714 Info<<
"Reading undecomposed mesh (on master)" <<
endl;
2727 Info<<
"Reading local, decomposed mesh" <<
endl;
2733 baseMeshPtr().facesInstance(),
2743 readProcAddressing(
mesh, baseMeshPtr, distMap);
2765 Info<<
" Detected initial mesh motion;"
2766 <<
" reconstructing points" <<
nl
2768 fvReconstructorPtr().reconstructPoints();
2775 if (newTimes && masterTimeDirSet.found(timeDirs[timeI].name()))
2777 Info<<
"Skipping time " << timeDirs[timeI].name()
2784 baseRunTime.
setTime(timeDirs[timeI], timeI);
2794 Info<<
" Dected mesh motion; reconstructing points" <<
nl
2796 fvReconstructorPtr().reconstructPoints();
2804 Info<<
" Detected topology change;"
2805 <<
" reconstructing addressing" <<
nl <<
endl;
2807 if (baseMeshPtr.
valid())
2812 baseMeshPtr.
clear();
2827 readProcAddressing(
mesh, baseMeshPtr, distMap);
2830 fvReconstructorPtr.reset
2840 lagrangianReconstructorPtr.
clear();
2849 reconstructMeshFields
2851 fvReconstructorPtr(),
2857 reconstructLagrangian
2859 lagrangianReconstructorPtr,
2863 selectedLagrangianFields
2871 if (
isDir(uniformDir0))
2873 Info<<
"Detected additional non-decomposed files in "
2874 << uniformDir0 <<
endl;
2904 Info<<
"Setting time to that of master or undecomposed case : "
2905 << masterTime <<
endl;
2910 forAll(regionNames, regioni)
2941 Info<<
"Setting caseName to " << baseRunTime.
caseName()
2942 <<
" to find undecomposed mesh" <<
endl;
2955 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
2965 Info<<
"Checking for mesh in " << meshPath <<
nl <<
endl;
2972 Info<<
"Per processor mesh availability:" <<
nl
2980 Info<<
"Setting caseName to " << baseRunTime.
caseName()
2981 <<
" to read undecomposed mesh" <<
endl;
2998 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
3011 const scalar tolDim = getMergeDistance
3023 determineDecomposition
3044 rmDir(
mesh.objectRegistry::objectPath());
3076 selectedLagrangianFields,
3106 redistributeLagrangian
3108 lagrangianReconstructorPtr,
3117 const fileName uniformDir(
"uniform");
3120 Info<<
"Detected additional non-decomposed files in "
int debug
Static debugging option.
static instantList findTimes(const fileName &directory, const word &constantName="constant")
Search a given directory for valid time directories.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
List< label > labelList
A List of labels.
const labelListList & subMap() const
From subsetted data back to original data.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
static const word prefix
The prefix to local: lagrangian.
label reconstructFvVolumeInternalFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, reconstruct and write all/selected volume internal fields.
const fileName & globalCaseName() const
Return global case name.
bool constructHasFlip() const
Does constructMap include a sign.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
Defines the attributes of an object for which implicit objectRegistry management is supported,...
PtrList< labelIOList > & faceProcAddressing
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
scalar mag() const
The magnitude of the bounding box span.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
static constexpr int masterNo() noexcept
Process index of the master.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
label redistributeStoredFields(const mapDistributeBase &map, passivePositionParticleCloud &cloud) const
Redistribute and write stored lagrangian fields.
A class for handling file names.
A primitive field of type <T> with automated input and output.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static word defaultRegion
Return the default region name.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
This boundary condition enables processor communication across patches.
A class for managing temporary objects.
Given the original mesh and the list of selected cells, it creates the mesh consisting only of the de...
static constexpr const zero Zero
Global zero (0)
const labelList & processorPatches() const
Return list of processor patch labels.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for.
Output inter-processor communications stream.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
IOstream::streamFormat writeFormat() const
The write stream format.
void distributeCellData(List< T > &lst) const
Distribute list of cell data.
label nFaces() const
Number of mesh faces.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static bool & parRun()
Is this a parallel run?
wordList names() const
The region names. Sorted by region type.
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
Add extra notes for the usage information.
const functionObjectList & functionObjects() const
Return the list of function objects.
instantList select(const instantList ×) const
Select a list of Time values that are within the ranges.
const fileName & facesInstance() const
Return the current instance directory for faces.
void transfer(mapDistributePolyMesh &map)
Transfer the contents of the argument and annul the argument.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
int neighbProcNo() const
Return neighbour processor number.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Extract command arguments and options from the supplied argc and argv parameters.
passivePositionParticleCloud but with autoMap and writing disabled. Only used for its objectRegistry ...
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
bool valid() const noexcept
True if the managed pointer is non-null.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static commsTypes defaultCommsType
Default commsType.
A Field of objects of type <T> with automated input and output using a compact storage....
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
static void removeFiles(const polyMesh &)
Helper: remove all relevant files from mesh instance.
MeshObject wrapper of decompositionMethod.
label start() const
The start label of the boundary faces in the polyMesh face list.
const fileName & rootPath() const
Return root path.
Mesh consisting of general polyhedral cells.
wordList names() const
Return a list of patch names.
#define forAll(list, i)
Loop across all elements in list.
const mapDistribute & cellMap() const
Cell distribute map.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
static void findClouds(const fvMesh &, wordList &cloudNames, List< wordList > &objectNames)
Find all clouds (on all processors) and for each cloud all.
label reconstructFvSurfaceFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, reconstruct and write all/selected surface fields.
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual bool parallelAware() const =0
Is method parallel aware?
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
label nCells() const
Number of mesh cells.
writeOption writeOpt() const
The write option.
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
void off()
Switch the function objects off.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
Lagrangian field redistributor.
fileName timePath() const
Return current time path.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
const mapDistribute & faceMap() const
Face distribute map.
Class containing processor-to-processor mapping information.
decompositionMethod & decomposer() const
const mapDistribute & patchMap() const
Patch distribute map.
static label nDomains(const dictionary &decompDict)
Return the numberOfSubdomains entry from the dictionary.
instantList times() const
Search the case for valid time directories.
autoPtr< mapDistributeBase > redistributeLagrangianPositions(passivePositionParticleCloud &cloud) const
Redistribute and write lagrangian positions.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Neighbour processor patch.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Simple class to hold region information for coupled region simulations.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Various for reading/decomposing/reconstructing/distributing refinement data.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
static instantList selectIfPresent(Time &runTime, const argList &args)
const labelList & oldPatchSizes() const
List of the old patch sizes.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
fileName path() const
Return the full path to the (processor local) case.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
Abstract base class for domain decomposition.
bool subHasFlip() const
Does subMap include a sign.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Mesh data needed to do the Finite Volume discretisation.
const wordList cloudNames(cloudFields.sortedToc())
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
List helper to append y unique elements onto the end of x.
Inter-processor communication reduction functions.
List of IOobjects with searching and retrieving facilities.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
readUpdateState
Enumeration defining the state of the mesh after a read update.
A HashTable similar to std::unordered_map.
static bool requested()
Check if SIGFPE signals handler is to be enabled.
label nNonProcessor() const
The number of patches before the first processor patch.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const boundBox & bounds() const
Return mesh bounding box.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
label constructSize() const
Constructed data size.
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="")
Read (optionally from absolute path) and register on mesh.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const word & system() const
Return system name.
static int & msgType()
Message tag of standard messages.
#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.
const fileName & caseName() const
Return case name.
label reconstructFvVolumeFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, reconstruct and write all/selected volume fields.
static label nRequests()
Get number of outstanding requests.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
static label readFields(const passivePositionParticleCloud &cloud, const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read and store all fields of a cloud.
fileName path() const
Return path.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
static unsigned int defaultPrecision()
Return the default precision.
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
Reconstructor for lagrangian positions and fields.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
const fileName & rootPath() const
Return root path.
IOmapDistributePolyMesh is derived from mapDistributePolyMesh and IOobject to give the mapDistributeP...
virtual labelList decompose(const pointField &points, const scalarField &pointWeights) const
Return for every coordinate the wanted processor number.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
const dimensionedScalar e
Elementary charge.
label nPoints() const
Number of mesh points.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A List of wordRe with additional matching capabilities.
fileName globalPath() const
Return the full path to the global case.
const polyBoundaryMesh & patches
void clear() noexcept
Same as reset(nullptr)
A bounding box defined in terms of min/max extrema points.
Class containing processor-to-processor mapping information.
void reverseDistribute(const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
const Time & time() const
Return the top-level database.
Input inter-processor communications stream.
const mapDistribute & pointMap() const
Point distribute map.
label nOldFaces() const
Number of faces in mesh before distribution.
An instant of time. Contains the time value and name.
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const globalMeshData & globalData() const
Return parallel info.
label nOldPoints() const
Number of points in mesh before distribution.
fileName objectPath() const
The complete path + object name.
label nOldCells() const
Number of cells in mesh before distribution.
void setSize(const label newSize)
Alias for resize(const label)
const word & constant() const
Return constant name.
const labelListList & constructMap() const
From subsetted data to new reconstructed data.
IOobjectList lookupClass(const char *clsName) const
The list of IOobjects with the given headerClassName.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
void distributePointData(List< T > &lst) const
Distribute list of point data.
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
#define DebugVar(var)
Report a variable name and value.
#define WarningInFunction
Report a warning using Foam::Warning.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Finite volume reconstructor for volume and surface fields.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
autoPtr< fvMesh > loadOrCreateMesh(const IOobject &io)
Load (if it exists) or create zero cell mesh given an IOobject:
bool found(const word &optName) const
Return true if the named option is found.
Load or create (0 size) a mesh. Used in distributing meshes to a larger number of processors.
Functor to negate primitives. Dummy for most other types.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.