diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 37d4a04f22..b47a15a6e1 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,6 +69,11 @@ int main(int argc, char *argv[]) "noLagrangian", "skip reconstructing lagrangian positions and fields" ); + argList::addBoolOption + ( + "newTimes", + "only reconstruct new times (i.e. that do not exist already)" + ); # include "setRootCase.H" # include "createTime.H" @@ -95,6 +100,10 @@ int main(int argc, char *argv[]) args.optionLookup("lagrangianFields")() >> selectedLagrangianFields; } + + const bool newTimes = args.optionFound("newTimes"); + + // determine the processor count directly label nProcs = 0; while (isDir(args.path()/(word("processor") + name(nProcs)))) @@ -134,6 +143,8 @@ int main(int argc, char *argv[]) args ); + instantList masterTimeDirs = runTime.times(); + if (timeDirs.empty()) { FatalErrorIn(args.executable()) @@ -165,6 +176,14 @@ int main(int argc, char *argv[]) // Loop over all times forAll(timeDirs, timeI) { + if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1) + { + Info<< "Skipping time " << timeDirs[timeI].name() + << endl << endl; + continue; + } + + // Set time for global database runTime.setTime(timeDirs[timeI], timeI);