diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 6429453e7b..91c03b49ef 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -42,7 +42,7 @@ Description #include "regionProperties.H" #include "fvFieldReconstructor.H" #include "pointFieldReconstructor.H" -#include "reconstructLagrangian.H" +#include "lagrangianReconstructor.H" #include "faCFD.H" #include "faMesh.H" @@ -95,9 +95,9 @@ int main(int argc, char *argv[]) argList::addOption ( "fields", - "list", - "Specify a list of fields to be reconstructed. Eg, '(U T p)' - " - "regular expressions not currently supported" + "wordRes", + "Specify single or multiple fields to reconstruct (all by default)." + " Eg, 'T' or '(p T U \"alpha.*\")'" ); argList::addBoolOption ( @@ -107,16 +107,18 @@ int main(int argc, char *argv[]) argList::addOption ( "lagrangianFields", - "list", - "Specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -" - "regular expressions not currently supported, " - "positions always included." + "wordRes", + "Specify single or multiple lagrangian fields to reconstruct" + " (all by default)." + " Eg, '(U d)'" + " - Positions are always included." ); argList::addBoolOption ( "noLagrangian", "Skip reconstructing lagrangian positions and fields" ); + argList::addBoolOption ( "noSets", @@ -131,48 +133,40 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - wordHashSet selectedFields; - args.readIfPresent("fields", selectedFields); - const bool noFields = args.found("noFields"); + wordRes selectedFields; + args.readListIfPresent("fields", selectedFields); - if (noFields) + const bool doFields = !args.found("noFields"); + + if (!doFields) { Info<< "Skipping reconstructing fields" << nl << endl; } - const bool noLagrangian = args.found("noLagrangian"); + wordRes selectedLagrangianFields; + args.readListIfPresent + ( + "lagrangianFields", selectedLagrangianFields + ); - if (noLagrangian) + const bool doLagrangian = !args.found("noLagrangian"); + + if (!doLagrangian) { Info<< "Skipping reconstructing lagrangian positions and fields" << nl << endl; } + const bool doReconstructSets = !args.found("noSets"); - const bool noReconstructSets = args.found("noSets"); - - if (noReconstructSets) + if (!doReconstructSets) { Info<< "Skipping reconstructing cellSets, faceSets and pointSets" << nl << endl; } - - wordHashSet selectedLagrangianFields; - if (args.readIfPresent("lagrangianFields", selectedLagrangianFields)) - { - if (noLagrangian) - { - FatalErrorInFunction - << "Cannot specify noLagrangian and lagrangianFields " - << "options together." - << exit(FatalError); - } - } - - const bool newTimes = args.found("newTimes"); const bool allRegions = args.found("allRegions"); @@ -367,12 +361,12 @@ int main(int argc, char *argv[]) databases[0].timeName() ); - if (!noFields) + if (doFields) { // If there are any FV fields, reconstruct them Info<< "Reconstructing FV fields" << nl << endl; - fvFieldReconstructor fvReconstructor + fvFieldReconstructor reconstructor ( mesh, procMeshes.meshes(), @@ -381,92 +375,91 @@ int main(int argc, char *argv[]) procMeshes.boundaryProcAddressing() ); - fvReconstructor.reconstructFvVolumeInternalFields + reconstructor.reconstructFvVolumeInternalFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeInternalFields + reconstructor.reconstructFvVolumeInternalFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeInternalFields - + reconstructor.reconstructFvVolumeInternalFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeInternalFields + reconstructor.reconstructFvVolumeInternalFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeInternalFields + reconstructor.reconstructFvVolumeInternalFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeFields + reconstructor.reconstructFvVolumeFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeFields + reconstructor.reconstructFvVolumeFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeFields + reconstructor.reconstructFvVolumeFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeFields + reconstructor.reconstructFvVolumeFields ( objects, selectedFields ); - fvReconstructor.reconstructFvVolumeFields + reconstructor.reconstructFvVolumeFields ( objects, selectedFields ); - fvReconstructor.reconstructFvSurfaceFields + reconstructor.reconstructFvSurfaceFields ( objects, selectedFields ); - fvReconstructor.reconstructFvSurfaceFields + reconstructor.reconstructFvSurfaceFields ( objects, selectedFields ); - fvReconstructor.reconstructFvSurfaceFields + reconstructor.reconstructFvSurfaceFields ( objects, selectedFields ); - fvReconstructor.reconstructFvSurfaceFields + reconstructor.reconstructFvSurfaceFields ( objects, selectedFields ); - fvReconstructor.reconstructFvSurfaceFields + reconstructor.reconstructFvSurfaceFields ( objects, selectedFields ); - if (fvReconstructor.nReconstructed() == 0) + if (reconstructor.nReconstructed() == 0) { Info<< "No FV fields" << nl << endl; } } - if (!noFields) + if (doFields) { Info<< "Reconstructing point fields" << nl << endl; @@ -482,7 +475,7 @@ int main(int argc, char *argv[]) ); } - pointFieldReconstructor pointReconstructor + pointFieldReconstructor reconstructor ( pMesh, pMeshes, @@ -490,33 +483,33 @@ int main(int argc, char *argv[]) procMeshes.boundaryProcAddressing() ); - pointReconstructor.reconstructFields + reconstructor.reconstructFields ( objects, selectedFields ); - pointReconstructor.reconstructFields + reconstructor.reconstructFields ( objects, selectedFields ); - pointReconstructor.reconstructFields + reconstructor.reconstructFields ( objects, selectedFields ); - pointReconstructor.reconstructFields + reconstructor.reconstructFields ( objects, selectedFields ); - pointReconstructor.reconstructFields + reconstructor.reconstructFields ( objects, selectedFields ); - if (pointReconstructor.nReconstructed() == 0) + if (reconstructor.nReconstructed() == 0) { Info<< "No point fields" << nl << endl; } @@ -530,7 +523,7 @@ int main(int argc, char *argv[]) // the first processor that has them. They are in pass2 only used // for name and type (scalar, vector etc). - if (!noLagrangian) + if (doLagrangian) { HashTable allCloudObjects; @@ -585,6 +578,14 @@ int main(int argc, char *argv[]) if (allCloudObjects.size()) { + lagrangianReconstructor reconstructor + ( + mesh, + procMeshes.meshes(), + procMeshes.faceProcAddressing(), + procMeshes.cellProcAddressing() + ); + // Pass2: reconstruct the cloud forAllConstIters(allCloudObjects, iter) { @@ -596,107 +597,82 @@ int main(int argc, char *argv[]) Info<< "Reconstructing lagrangian fields for cloud " << cloudName << nl << endl; - reconstructLagrangianPositions - ( - mesh, - cloudName, - procMeshes.meshes(), - procMeshes.faceProcAddressing(), - procMeshes.cellProcAddressing() - ); - reconstructLagrangianFields