From aa7ea2dc6b34d5dbca84d8a3945891e8797666f2 Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Tue, 28 Jun 2011 14:54:26 +0000
Subject: [PATCH] make the startFromInputFile() function really work

grr, the DUNE_VERSION_NEWER_REV macro seems to be broken. why does
nothing ever work at the first try...

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@6093 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/common/start.hh         | 18 ++++++++++++------
 dumux/io/vtkmultiwriter.hh    |  2 +-
 dumux/io/vtknestedfunction.hh |  2 +-
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dumux/common/start.hh b/dumux/common/start.hh
index 09d29d5c4c..27d06f066c 100644
--- a/dumux/common/start.hh
+++ b/dumux/common/start.hh
@@ -29,7 +29,16 @@
 #include <dune/grid/io/file/dgfparser.hh>
 #include <dune/common/mpihelper.hh>
 #include <iostream>
-//#include <dune/common/parametertreeparser.hh>
+
+#include <dune/common/version.hh>
+
+#define HAVE_DUNE21 \
+    (DUNE_COMMON_VERSION_MAJOR > 2   \
+     || (DUNE_COMMON_VERSION_MAJOR == 2 && DUNE_COMMON_VERSION_MINOR >= 1))
+
+#if HAVE_DUNE21 //DUNE_VERSION_NEWER_REV(COMMON, 2, 0, 99)
+#include <dune/common/parametertreeparser.hh>
+#endif // DUNE_VERSION_NEWER_REV(COMMON, 2, 0, 99)
 
 
 namespace Dumux
@@ -229,10 +238,7 @@ int startWithGrid(const typename GET_PROP_TYPE(TypeTag, PTAG(Grid)) &grid,
     return 3;
 };
 
-///////
-// commented out, because it does not work with dune 2.0
-///////
-#if DUNE_VERSION_NEWER_REV(GRID, 2, 0, 99)
+#if HAVE_DUNE21 //DUNE_VERSION_NEWER_REV(COMMON, 2, 0, 99)
 // requires DUNE 2.1 and above
 
 /*!
@@ -329,7 +335,7 @@ int startFromInputFile(int argc, char **argv)
 
    return 3;
 }
-#endif // DUNE_VERSION_NEWER_REV(GRID, 2, 0, 99)
+#endif // DUNE_VERSION_NEWER_REV(COMMON, 2, 0, 99)
 
 }
 
diff --git a/dumux/io/vtkmultiwriter.hh b/dumux/io/vtkmultiwriter.hh
index 8501f3b0f5..ac3b9c9b9b 100644
--- a/dumux/io/vtkmultiwriter.hh
+++ b/dumux/io/vtkmultiwriter.hh
@@ -59,7 +59,7 @@ class VtkMultiWriter
     typedef typename GridView::Grid Grid;
     enum { dim = GridView::dimension };
 
-#if DUNE_VERSION_NEWER_REV(GRID, 2, 0, 99)
+#if DUNE_VERSION_NEWER_REV(GRID, 2, 1, 0)
     // DUNE 2.1 and above
     typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout> VertexMapper;
     typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper;
diff --git a/dumux/io/vtknestedfunction.hh b/dumux/io/vtknestedfunction.hh
index 551f6cc7c3..98c50d1db7 100644
--- a/dumux/io/vtknestedfunction.hh
+++ b/dumux/io/vtknestedfunction.hh
@@ -29,7 +29,7 @@
 #include <dune/istl/bvector.hh>
 #include <dune/common/version.hh>
 
-#if DUNE_VERSION_NEWER_REV(GRID, 2, 0, 99)
+#if DUNE_VERSION_NEWER_REV(GRID, 2, 1, 0)
 // DUNE 2.1 and above
 #include <dune/grid/io/file/vtk/function.hh>
 #else
-- 
GitLab