50 const HashSet<word>& masterTimeDirSet,
57 if (!masterTimeDirSet.found(timeDirs[timei].name()))
67 int main(
int argc,
char *argv[])
71 "Reconstruct fields of a parallel case" 84 "specify a list of fields to be reconstructed. Eg, '(U T p)' - " 85 "regular expressions not currently supported" 90 "skip reconstructing fields" 96 "specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -" 97 "regular expressions not currently supported, " 98 "positions always included." 103 "skip reconstructing lagrangian positions and fields" 108 "skip reconstructing cellSets, faceSets, pointSets" 113 "only reconstruct new times (i.e. that do not exist already)" 118 HashSet<word> selectedFields;
128 Info<<
"Skipping reconstructing fields" 136 Info<<
"Skipping reconstructing lagrangian positions and fields" 142 if (noReconstructSets)
144 Info<<
"Skipping reconstructing cellSets, faceSets and pointSets" 148 HashSet<word> selectedLagrangianFields;
154 <<
"Cannot specify noLagrangian and lagrangianFields " 155 <<
"options together." 179 <<
"No processor* directories found" 184 const_cast<fileOperation&
>(
fileHandler()).setNProcs(nProcs);
202 masterTimeDirs = runTimes.completeTime().times();
204 HashSet<word> masterTimeDirSet(2*masterTimeDirs.size());
207 masterTimeDirSet.insert(masterTimeDirs[i].
name());
212 && regionNames.size() == 1
214 && haveAllTimes(masterTimeDirSet, times)
217 Info<<
"All times already reconstructed.\n\nEnd\n" <<
endl;
222 forAll(regionNames, regioni)
224 const word& regionName = regionNames[regioni];
228 Info<<
"\n\nReconstructing fields for mesh " << regionName
230 domainDecomposition meshes(runTimes, regionName);
231 meshes.readComplete();
233 meshes.readAddressing();
242 runTimes.completeTime().timeName()
243 == runTimes.completeTime().constant()
246 meshes.writeComplete(!noReconstructSets);
252 if (newTimes && masterTimeDirSet.found(times[timei].name()))
254 Info<<
"Skipping time " << times[timei].name()
260 runTimes.setTime(times[timei], timei);
262 Info<<
"Time = " << runTimes.completeTime().userTimeName()
269 meshes.writeComplete(
false);
277 meshes.writeComplete(!noReconstructSets);
283 meshes.procMeshes()[0],
284 runTimes.procTimes()[0].timeName()
290 Info<<
"Reconstructing FV fields" <<
nl <<
endl;
292 fvFieldReconstructor fvReconstructor
294 meshes.completeMesh(),
296 meshes.procFaceAddressing(),
297 meshes.procCellAddressing(),
298 meshes.procFaceAddressingBf()
301 fvReconstructor.reconstructFvVolumeInternalFields<scalar>
306 fvReconstructor.reconstructFvVolumeInternalFields<
vector>
311 fvReconstructor.reconstructFvVolumeInternalFields
317 fvReconstructor.reconstructFvVolumeInternalFields<
symmTensor>
322 fvReconstructor.reconstructFvVolumeInternalFields<
tensor>
328 fvReconstructor.reconstructFvVolumeFields<scalar>
333 fvReconstructor.reconstructFvVolumeFields<
vector>
343 fvReconstructor.reconstructFvVolumeFields<
symmTensor>
348 fvReconstructor.reconstructFvVolumeFields<
tensor>
354 fvReconstructor.reconstructFvSurfaceFields<scalar>
359 fvReconstructor.reconstructFvSurfaceFields<
vector>
369 fvReconstructor.reconstructFvSurfaceFields<
symmTensor>
374 fvReconstructor.reconstructFvSurfaceFields<
tensor>
380 if (fvReconstructor.nReconstructed() == 0)
388 Info<<
"Reconstructing point fields" <<
nl <<
endl;
390 const pointMesh& completePMesh =
392 PtrList<pointMesh> procPMeshes(nProcs);
393 forAll(procPMeshes, proci)
398 new pointMesh(meshes.procMeshes()[proci])
402 pointFieldReconstructor pointReconstructor
406 meshes.procPointAddressing()
409 pointReconstructor.reconstructFields<scalar>
414 pointReconstructor.reconstructFields<
vector>
424 pointReconstructor.reconstructFields<
symmTensor>
429 pointReconstructor.reconstructFields<
tensor>
435 if (pointReconstructor.nReconstructed() == 0)
451 HashTable<IOobjectList> cloudObjects;
453 forAll(runTimes.procTimes(), proci)
455 fileName lagrangianDir
459 runTimes.procTimes()[proci].timePath()
466 if (!lagrangianDir.empty())
480 cloudObjects.find(cloudDirs[i]);
482 if (iter == cloudObjects.end())
485 IOobjectList sprayObjs
487 meshes.procMeshes()[proci],
488 runTimes.procTimes()[proci].timeName(),
492 IOobject* positionsPtr =
493 sprayObjs.lookup(word(
"positions"));
497 cloudObjects.insert(cloudDirs[i], sprayObjs);
503 if (cloudObjects.size())
508 const word cloudName =
509 string::validate<word>(iter.key());
512 const IOobjectList& sprayObjs = iter();
514 Info<<
"Reconstructing lagrangian fields for cloud " 515 << cloudName <<
nl <<
endl;
519 meshes.completeMesh(),
522 meshes.procFaceAddressing(),
523 meshes.procCellAddressing()
525 reconstructLagrangianFields<label>
528 meshes.completeMesh(),
531 selectedLagrangianFields
533 reconstructLagrangianFieldFields<label>
536 meshes.completeMesh(),
539 selectedLagrangianFields
541 reconstructLagrangianFields<scalar>
544 meshes.completeMesh(),
547 selectedLagrangianFields
549 reconstructLagrangianFieldFields<scalar>
552 meshes.completeMesh(),
555 selectedLagrangianFields
557 reconstructLagrangianFields<vector>
560 meshes.completeMesh(),
563 selectedLagrangianFields
565 reconstructLagrangianFieldFields<vector>
568 meshes.completeMesh(),
571 selectedLagrangianFields
573 reconstructLagrangianFields<sphericalTensor>
576 meshes.completeMesh(),
579 selectedLagrangianFields
581 reconstructLagrangianFieldFields<sphericalTensor>
584 meshes.completeMesh(),
587 selectedLagrangianFields
589 reconstructLagrangianFields<symmTensor>
592 meshes.completeMesh(),
595 selectedLagrangianFields
597 reconstructLagrangianFieldFields<symmTensor>
600 meshes.completeMesh(),
603 selectedLagrangianFields
605 reconstructLagrangianFields<tensor>
608 meshes.completeMesh(),
611 selectedLagrangianFields
613 reconstructLagrangianFieldFields<tensor>
616 meshes.completeMesh(),
619 selectedLagrangianFields
636 runTimes.procTimes()[0].timePath()/regionDir/
"uniform" 645 runTimes.completeTime().timePath()/
regionDir 658 runTimes.procTimes()[0].timePath()/
"uniform" 667 runTimes.completeTime().timePath()
List< instant > instantList
List of instants.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
Vector< scalar > vector
A scalar version of the templated Vector.
virtual fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true) const =0
Read a directory and return the entries as a string list.
const word & regionDir(const word ®ionName)
static instantList timeDirs
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
friend class const_iterator
Declare friendship with the const_iterator.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static const word null
An empty word.
const fileOperation & fileHandler()
Get current file handler.
static word controlDictName
The default control dictionary name (normally "controlDict")
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const =0
Copy, recursively if necessary, the source to the destination.
static const word prefix
The prefix to local: lagrangian.
static pointMesh & New(polyMesh &mesh)
word name(const complex &)
Return a string representation of a complex.
fileName path() const
Return the path to the caseName.
List< word > wordList
A List of words.
virtual label nProcs(const fileName &dir, const fileName &local="") const
Get number of processor directories/results. Used for e.g.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool isDir(const fileName &, const bool followLink=true) const =0
Does the name exist as a directory in the file system?
const word cloudName(propsDict.lookup("cloudName"))
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
readUpdateState
Enumeration defining the state of the mesh after a read update.
Foam::argList args(argc, argv)
List< fileName > fileNameList
A List of fileNames.
void reconstructLagrangianPositions(const polyMesh &mesh, const word &cloudName, const PtrList< fvMesh > &meshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing)
Tensor< scalar > tensor
Tensor of scalars.
wordList selectRegionNames(const argList &args, const Time &runTime)
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.