61 runTimes.
procTimes()[0].timePath()/regionDir/
"uniform"
67 void reconstructUniform
77 runTimes.
procTimes()[0].timePath()/regionDir/
"uniform"
104 Info<<
"Wrote decomposition as volScalarField::Internal to "
105 << cellProc.name() <<
" for use in postprocessing"
130 if (!dnl.first_) os <<
nl;
141 int main(
int argc,
char *argv[])
145 "Reconstruct fields of a parallel case"
155 "write cell processor indices as a volScalarField::Internal for "
162 "specify a list of fields to be reconstructed. Eg, '(U T p)' - "
163 "regular expressions not currently supported"
168 "skip reconstructing fields"
174 "specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -"
175 "regular expressions not currently supported, "
176 "positions always included"
181 "skip reconstructing lagrangian positions and fields"
186 "skip reconstructing cellSets, faceSets, pointSets"
191 "only reconstruct new times (i.e. that do not exist already)"
196 "remove processor time directories after reconstruction"
218 Info<<
"Skipping reconstructing fields" <<
nl <<
endl;
225 Info<<
"Skipping reconstructing lagrangian positions and fields"
231 if (noReconstructSets)
233 Info<<
"Skipping reconstructing cellSets, faceSets and pointSets"
243 <<
"Cannot specify noLagrangian and lagrangianFields "
244 <<
"options together"
274 <<
"No processor* directories found"
296 existingTimesSet.
resize(2*existingTimes.
size());
299 existingTimesSet.
insert(existingTimes[i].
name());
306 if (!existingTimesSet.
found(times[timej].name()))
308 times[timei ++] = times[timej];
317 Info<<
"All times already reconstructed" <<
nl <<
nl
324 if (regionMeshes.readReconstruct(!noReconstructSets))
332 writeDecomposition(regionMeshes[regioni]());
343 runTimes.
setTime(times[timei], timei);
350 regionMeshes.readUpdateReconstruct();
354 regionMeshes.writeComplete(!noReconstructSets);
361 writeDecomposition(regionMeshes[regioni]());
371 const word regionDir =
374 const delayedNewLine dnl;
379 regionMeshes[regioni];
384 meshes().procMeshes()[0],
390 Info<< dnl <<
"Reconstructing FV fields" <<
endl;
394 fvFieldReconstructor::reconstructs
403 meshes().completeMesh(),
404 meshes().procMeshes(),
405 meshes().procFaceAddressing(),
406 meshes().procCellAddressing(),
407 meshes().procFaceAddressingBf()
410 #define DO_FV_VOL_INTERNAL_FIELDS_TYPE(Type, nullArg) \
411 fvReconstructor.reconstructVolInternalFields<Type> \
412 (objects, selectedFields);
414 #undef DO_FV_VOL_INTERNAL_FIELDS_TYPE
416 #define DO_FV_VOL_FIELDS_TYPE(Type, nullArg) \
417 fvReconstructor.reconstructVolFields<Type> \
418 (objects, selectedFields);
420 #undef DO_FV_VOL_FIELDS_TYPE
422 #define DO_FV_SURFACE_FIELDS_TYPE(Type, nullArg) \
423 fvReconstructor.reconstructFvSurfaceFields<Type> \
424 (objects, selectedFields);
426 #undef DO_FV_SURFACE_FIELDS_TYPE
430 Info<< dnl <<
" (no FV fields)" <<
endl;
436 Info<< dnl <<
"Reconstructing point fields" <<
endl;
440 pointFieldReconstructor::reconstructs
450 meshes().procMeshes(),
451 meshes().procPointAddressing()
454 #define DO_POINT_FIELDS_TYPE(Type, nullArg) \
455 pointReconstructor.reconstructFields<Type> \
456 (objects, selectedFields);
458 #undef DO_POINT_FIELDS_TYPE
462 Info<< dnl <<
" (no point fields)" <<
endl;
493 cloudsObjects.
find(cloudDirs[i]);
494 if (iter != cloudsObjects.
end())
continue;
499 meshes().procMeshes()[proci],
508 if (cloudObjs.lookup(
word(
"positions")))
510 cloudsObjects.
insert(cloudDirs[i], cloudObjs);
516 if (cloudsObjects.
size())
526 string::validate<word>(iter.
key());
530 Info<< dnl <<
"Reconstructing lagrangian fields "
535 lagrangianFieldReconstructor::reconstructs
538 selectedLagrangianFields
543 lagrangianReconstructor
545 meshes().completeMesh(),
546 meshes().procMeshes(),
547 meshes().procFaceAddressing(),
548 meshes().procCellAddressing(),
552 lagrangianReconstructor.reconstructPositions();
554 #define DO_CLOUD_FIELDS_TYPE(Type, nullArg) \
555 lagrangianReconstructor \
556 .reconstructFields<Type> \
557 (cloudObjects, selectedLagrangianFields);
558 DO_CLOUD_FIELDS_TYPE(
label, )
560 #undef DO_CLOUD_FIELDS_TYPE
564 Info<< dnl <<
" (no lagrangian fields)"
599 LagrangianObjects.
find(LagrangianDirs[i])
600 != LagrangianObjects.
end()
606 meshes().procMeshes()[proci],
619 || LagrangianFieldReconstructor::reconstructs
622 selectedLagrangianFields
636 if (LagrangianObjects.
size())
645 const word LagrangianName =
646 string::validate<word>(iter.
key());
648 Info<< dnl <<
"Reconstructing Lagrangian fields "
649 <<
"for " << LagrangianName <<
endl;
652 LagrangianReconstructor
654 meshes().completeMesh(),
655 meshes().procMeshes(),
656 meshes().procFaceAddressing(),
657 meshes().procCellAddressing(),
661 LagrangianReconstructor.reconstructPositions();
665 LagrangianFieldReconstructor::reconstructs
668 selectedLagrangianFields
672 #define DO_LAGRANGIAN_FIELDS_TYPE( \
674 LagrangianReconstructor \
675 .reconstructFields<GeoField<Type>> \
676 (iter(), selectedLagrangianFields);
697 #undef DO_LAGRANGIAN_FIELDS_TYPE
706 Info<< dnl <<
" (no Lagrangian fields)"
718 if (haveUniform(runTimes))
720 Info<<
"Collecting uniform files" <<
endl;
722 reconstructUniform(runTimes);
733 const word regionDir =
738 if (haveUniform(runTimes, regionDir))
743 regionMeshes[regioni];
745 Info<<
"Collecting uniform files" <<
endl;
747 reconstructUniform(runTimes, regionDir);
762 const word regionDir =
768 regionMeshes[regioni];
770 Info<<
"Removing processors time directory" <<
endl;
772 for (
label proci=0; proci<nProcs; proci++)
776 runTimes.
procTimes()[proci].timePath()/regionDir
779 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...
Generic GeometricField class.
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...
Lagrangian field reconstructor.
static const word coordinatesName
Name of the coordinates field.
static const word prefix
Instance prefix.
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.
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 fileName filePath(const bool globalFile, const IOobject &) const =0
Search for an object. globalFile : also check undecomposed case.
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?
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.
static const word prefix
The prefix to local: lagrangian.
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 DO_LAGRANGIAN_FIELDS_TYPE(Type, nullArg)
#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.
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?
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
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.
#define DO_POINT_FIELDS_TYPE(Type, nullArg)
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"))