60 runTimes.
procTimes()[0].timePath()/regionDir/
"uniform"
66 void reconstructUniform
76 runTimes.
procTimes()[0].timePath()/regionDir/
"uniform"
103 Info<<
"Wrote decomposition as volScalarField::Internal to "
104 << cellProc.name() <<
" for use in postprocessing"
129 if (!dnl.first_) os <<
nl;
140 int main(
int argc,
char *argv[])
144 "Reconstruct fields of a parallel case"
153 "write cell processor indices as a volScalarField::Internal for "
160 "specify a list of fields to be reconstructed. Eg, '(U T p)' - "
161 "regular expressions not currently supported"
166 "skip reconstructing fields"
172 "specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -"
173 "regular expressions not currently supported, "
174 "positions always included"
179 "skip reconstructing lagrangian positions and fields"
184 "skip reconstructing cellSets, faceSets, pointSets"
189 "only reconstruct new times (i.e. that do not exist already)"
194 "remove processor time directories after reconstruction"
215 Info<<
"Skipping reconstructing fields" <<
nl <<
endl;
222 Info<<
"Skipping reconstructing lagrangian positions and fields"
228 if (noReconstructSets)
230 Info<<
"Skipping reconstructing cellSets, faceSets and pointSets"
240 <<
"Cannot specify noLagrangian and lagrangianFields "
241 <<
"options together"
271 <<
"No processor* directories found"
293 existingTimesSet.
resize(2*existingTimes.
size());
296 existingTimesSet.
insert(existingTimes[i].
name());
303 if (!existingTimesSet.
found(times[timej].name()))
305 times[timei ++] = times[timej];
314 Info<<
"All times already reconstructed" <<
nl <<
nl
321 if (regionMeshes.readReconstruct(!noReconstructSets))
329 writeDecomposition(regionMeshes[regioni]());
340 runTimes.
setTime(times[timei], timei);
347 regionMeshes.readUpdateReconstruct();
351 regionMeshes.writeComplete(!noReconstructSets);
358 writeDecomposition(regionMeshes[regioni]());
368 const word regionDir =
371 const delayedNewLine dnl;
376 regionMeshes[regioni];
381 meshes().procMeshes()[0],
387 Info<< dnl <<
"Reconstructing FV fields" <<
endl;
391 fvFieldReconstructor::reconstructs
400 meshes().completeMesh(),
401 meshes().procMeshes(),
402 meshes().procFaceAddressing(),
403 meshes().procCellAddressing(),
404 meshes().procFaceAddressingBf()
407 #define DO_FV_VOL_INTERNAL_FIELDS_TYPE(Type, nullArg) \
408 fvReconstructor.reconstructVolInternalFields<Type> \
409 (objects, selectedFields);
411 #undef DO_FV_VOL_INTERNAL_FIELDS_TYPE
413 #define DO_FV_VOL_FIELDS_TYPE(Type, nullArg) \
414 fvReconstructor.reconstructVolFields<Type> \
415 (objects, selectedFields);
417 #undef DO_FV_VOL_FIELDS_TYPE
419 #define DO_FV_SURFACE_FIELDS_TYPE(Type, nullArg) \
420 fvReconstructor.reconstructFvSurfaceFields<Type> \
421 (objects, selectedFields);
423 #undef DO_FV_SURFACE_FIELDS_TYPE
427 Info<< dnl <<
" (no FV fields)" <<
endl;
433 Info<< dnl <<
"Reconstructing point fields" <<
endl;
437 pointFieldReconstructor::reconstructs
447 meshes().procMeshes(),
448 meshes().procPointAddressing()
451 #define DO_POINT_FIELDS_TYPE(Type, nullArg) \
452 pointReconstructor.reconstructFields<Type> \
453 (objects, selectedFields);
455 #undef DO_POINT_FIELDS_TYPE
459 Info<< dnl <<
" (no point fields)" <<
endl;
490 cloudsObjects.
find(cloudDirs[i]);
491 if (iter != cloudsObjects.
end())
continue;
496 meshes().procMeshes()[proci],
505 if (cloudObjs.lookup(
word(
"positions")))
507 cloudsObjects.
insert(cloudDirs[i], cloudObjs);
513 if (cloudsObjects.
size())
523 string::validate<word>(iter.
key());
527 Info<< dnl <<
"Reconstructing lagrangian fields "
532 lagrangianFieldReconstructor::reconstructs
535 selectedLagrangianFields
540 lagrangianReconstructor
542 meshes().completeMesh(),
543 meshes().procMeshes(),
544 meshes().procFaceAddressing(),
545 meshes().procCellAddressing(),
549 #define DO_CLOUD_FIELDS_TYPE(Type, nullArg) \
550 lagrangianReconstructor \
551 .reconstructFields<Type> \
552 (cloudObjects, selectedLagrangianFields);
553 DO_CLOUD_FIELDS_TYPE(
label, );
555 #undef DO_CLOUD_FIELDS_TYPE
559 Info<< dnl <<
" (no lagrangian fields)"
571 if (haveUniform(runTimes))
573 Info<<
"Collecting uniform files" <<
endl;
575 reconstructUniform(runTimes);
586 const word regionDir =
591 if (haveUniform(runTimes, regionDir))
596 regionMeshes[regioni];
598 Info<<
"Collecting uniform files" <<
endl;
600 reconstructUniform(runTimes, regionDir);
615 const word regionDir =
621 regionMeshes[regioni];
623 Info<<
"Removing processors time directory" <<
endl;
625 for (
label proci=0; proci<nProcs; proci++)
629 runTimes.
procTimes()[proci].timePath()/regionDir
632 if (
isDir(procTimePath))
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming const_iterator.
const Key & key() const
Return the Key corresponding to the iterator.
An STL-conforming hash table.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void resize(const label newSize)
Resize the hash table for efficiency.
List of IOobjects with searching and retrieving facilities.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const word constantName
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
instantList times() const
Search the case for valid time directories.
word userTimeName() const
Return current user time name with units.
static word controlDictName
The default control dictionary name (normally "controlDict")
fileName timePath() const
Return current time path.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
fileName path() const
Return the path to the caseName.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
static const word prefix
The prefix to local: lagrangian.
const word & name() const
Return const reference to name.
Automatic domain decomposition class for finite-volume meshes.
const labelList & cellProc() const
Return the distribution as an FV field for writing.
const fvMesh & completeMesh() const
Access the global mesh.
A class for handling file names.
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const =0
Copy, recursively if necessary, the source to the destination.
virtual label nProcs(const fileName &dir, const fileName &local="") const
Get number of processor directories/results. Used for e.g.
virtual bool isDir(const fileName &, const bool followLink=true) const =0
Does the name exist as a directory in the file system?
virtual fileName filePath(const bool globalFile, const IOobject &, const word &typeName) const =0
Search for an object. globalFile : also check undecomposed case.
Finite volume reconstructor for volume and surface fields.
const Time & time() const
Return the top-level database.
readUpdateState
Enumeration defining the state of the mesh after a read update.
Lagrangian field reconstructor.
Point field reconstructor.
static word defaultRegion
Return the default region name.
instantList selectProc(const argList &args)
Select the time.
const PtrList< Time > & procTimes() const
Access the processor run times.
void setTime(const instant &inst, const label newIndex)
Set the time.
const Time & completeTime() const
Access the complete run time.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
#define WarningInFunction
Report a warning using Foam::Warning.
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const word & regionName(const solver ®ion)
List< scalar > scalarList
A List of scalars.
bool rmDir(const fileName &)
Remove a directory and its contents.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
const Foam::wordList regionNames(args.optionFound("allRegions") ? runTime .controlDict().subDict("regionSolvers").toc() :wordList(1, args.optionFound("region") ? args.optionRead< word >("region") :polyMesh::defaultRegion))
Foam::argList args(argc, argv)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
const word cloudName(propsDict.lookup("cloudName"))