From 32f31a4fefbdb8f5e733bd0ffdd2adc3560fcfed Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 2 Jul 2012 15:33:50 +0100 Subject: [PATCH] ENH: reconstructPar: -newTimes cleanup --- .../reconstructPar/reconstructPar.C | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index b47a15a6e1..916a0845e5 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -143,8 +143,6 @@ int main(int argc, char *argv[]) args ); - instantList masterTimeDirs = runTime.times(); - if (timeDirs.empty()) { FatalErrorIn(args.executable()) @@ -152,6 +150,16 @@ int main(int argc, char *argv[]) << exit(FatalError); } + + // Get current times if -newTimes + instantList masterTimeDirs; + if (newTimes) + { + masterTimeDirs = runTime.times(); + } + + + # include "createNamedMesh.H" word regionDir = word::null; if (regionName != fvMesh::defaultRegion) @@ -176,11 +184,24 @@ int main(int argc, char *argv[]) // Loop over all times forAll(timeDirs, timeI) { - if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1) + if (newTimes) { - Info<< "Skipping time " << timeDirs[timeI].name() - << endl << endl; - continue; + // Compare on timeName, not value + bool foundTime = false; + forAll(masterTimeDirs, i) + { + if (masterTimeDirs[i].name() == timeDirs[timeI].name()) + { + foundTime = true; + break; + } + } + if (foundTime) + { + Info<< "Skipping time " << timeDirs[timeI].name() + << endl << endl; + continue; + } }