From 05c30eee745a8a048b51ffbbff8b50d9768717d2 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Thu, 28 Nov 2013 09:09:13 +0000
Subject: [PATCH] Look for 'path' and 'gridFile' parameters only if an
 unstructured grid is used

[[Imported from SVN: r9550]]
---
 cosserat-continuum.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc
index 49a04722..83bf4cd1 100644
--- a/cosserat-continuum.cc
+++ b/cosserat-continuum.cc
@@ -139,10 +139,6 @@ int main (int argc, char *argv[]) try
     const bool instrumented               = parameterSet.get<bool>("instrumented");
     std::string resultPath                = parameterSet.get("resultPath", "");
 
-    // read problem settings
-    std::string path                = parameterSet.get<std::string>("path");
-    std::string gridFile            = parameterSet.get<std::string>("gridFile");
-
     // ///////////////////////////////////////
     //    Create the grid
     // ///////////////////////////////////////
@@ -158,8 +154,11 @@ int main (int argc, char *argv[]) try
         array<unsigned int,dim> elements = parameterSet.get<array<unsigned int,dim> >("elements");
         grid = StructuredGridFactory<GridType>::createCubeGrid(lower, upper, elements);
 
-    } else
+    } else {
+        std::string path                = parameterSet.get<std::string>("path");
+        std::string gridFile            = parameterSet.get<std::string>("gridFile");
         grid = shared_ptr<GridType>(GmshReader<GridType>::read(path + "/" + gridFile));
+    }
 
     grid->globalRefine(numLevels-1);
 
-- 
GitLab