From 9c6a3c66d7d41b505cb37e7c59077d17354c750d Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Sat, 18 Apr 2015 11:51:51 +0100
Subject: [PATCH] reconstructParMesh: Correct handling of time and constant
 command-line options Resolves bug-report
 http://openfoam.org/mantisbt/view.php?id=1641

---
 .../reconstructParMesh/reconstructParMesh.C   | 23 ++++---------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index 00f547d702d..7f8f3d67fc8 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -454,7 +454,6 @@ int main(int argc, char *argv[])
         "decomposition method or as a volScalarField for post-processing."
     );
 
-    #include "addTimeOptions.H"
     #include "addRegionOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
@@ -564,38 +563,26 @@ int main(int argc, char *argv[])
         );
     }
 
-
     // Use the times list from the master processor
     // and select a subset based on the command-line options
-    instantList Times = timeSelector::select
+    instantList timeDirs = timeSelector::select
     (
         databases[0].times(),
         args
     );
 
-    // Set startTime and endTime depending on -time and -latestTime options
-    #include "checkTimeOptions.H"
-
-    if (Times.empty())
-    {
-        FatalErrorIn(args.executable())
-            << "No times selected"
-            << exit(FatalError);
-    }
-
-
     // Loop over all times
-    for (label timeI = startTime; timeI < endTime; timeI++)
+    forAll(timeDirs, timeI)
     {
         // Set time for global database
-        runTime.setTime(Times[timeI], timeI);
+        runTime.setTime(timeDirs[timeI], timeI);
 
-        Info<< "Time = " << runTime.timeName() << endl << endl;
+        Info<< "Time = " << runTime.timeName() << nl << endl;
 
         // Set time for all databases
         forAll(databases, procI)
         {
-            databases[procI].setTime(Times[timeI], timeI);
+            databases[procI].setTime(timeDirs[timeI], timeI);
         }
 
         const fileName meshPath =
-- 
GitLab