From e7156dbec0f9e001e3cd636f48973c71c10314ec Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 9 Jan 2014 10:20:26 +0000
Subject: [PATCH] ENH: reconstructParMesh: handle times without meshes

---
 .../reconstructParMesh/reconstructParMesh.C     | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index 284110b2c58..11a0ae0be2d 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -578,7 +578,7 @@ int main(int argc, char *argv[])
 
 
     // Loop over all times
-    forAll(Times, timeI)
+    for (label timeI = startTime; timeI < endTime; timeI++)
     {
         // Set time for global database
         runTime.setTime(Times[timeI], timeI);
@@ -591,6 +591,19 @@ int main(int argc, char *argv[])
             databases[procI].setTime(Times[timeI], timeI);
         }
 
+        const fileName meshPath =
+            databases[0].path()
+           /databases[0].timeName()
+           /regionDir
+           /polyMesh::meshSubDir;
+
+        if (!isFile(meshPath/"faces"))
+        {
+            Info<< "No mesh." << nl << endl;
+            continue;
+        }
+
+
         // Read point on individual processors to determine merge tolerance
         // (otherwise single cell domains might give problems)
 
-- 
GitLab