From ac1d01aa1decebf80041c18b37a5c4a98f13d95c Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Tue, 19 Jan 2016 09:47:33 +0100
Subject: [PATCH] Completely remove the ***_ORDER preprocessor macros

We can now completely control the approximation order by a const int,
which is much nicer.
---
 dune/gfe/mixedriemanniantrsolver.hh |  8 --------
 src/cosserat-continuum.cc           | 13 ++++---------
 src/mixed-cosserat-continuum.cc     |  2 --
 3 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/dune/gfe/mixedriemanniantrsolver.hh b/dune/gfe/mixedriemanniantrsolver.hh
index c59aa8b9..d291e0e8 100644
--- a/dune/gfe/mixedriemanniantrsolver.hh
+++ b/dune/gfe/mixedriemanniantrsolver.hh
@@ -49,14 +49,6 @@ class MixedRiemannianTrustRegionSolver
     typedef Dune::MultiTypeBlockVector<CorrectionType0, CorrectionType1> CorrectionType;
     typedef Dune::Functions::TupleVector<std::vector<TargetSpace0>, std::vector<TargetSpace1> > SolutionType;
 
-#if 0
-#ifdef SECOND_ORDER
-    typedef Dune::GlobalP2Mapper<typename GridType::LeafGridView> GUIndex;
-#else
-    typedef GlobalUniqueIndex<typename GridType::LeafGridView, gridDim> GUIndex;
-#endif
-#endif
-
 public:
 
     MixedRiemannianTrustRegionSolver()
diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc
index af7da69d..fba07571 100644
--- a/src/cosserat-continuum.cc
+++ b/src/cosserat-continuum.cc
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#define SECOND_ORDER
-
 #include <fenv.h>
 
 // Includes for the ADOL-C automatic differentiation library
@@ -45,6 +43,9 @@
 const int dim = 2;
 const int dimworld = 2;
 
+// Order of the approximation space
+const int order = 2;
+
 // Image space of the geodesic fe functions
 typedef RigidBodyMotion<double,3> TargetSpace;
 
@@ -149,13 +150,7 @@ int main (int argc, char *argv[]) try
     typedef GridType::LeafGridView GridView;
     GridView gridView = grid->leafGridView();
 
-#ifdef THIRD_ORDER
-    typedef Dune::Functions::PQkNodalBasis<typename GridType::LeafGridView, 3> FEBasis;
-#elif defined SECOND_ORDER
-    typedef Dune::Functions::PQkNodalBasis<typename GridType::LeafGridView, 2> FEBasis;
-#else
-    typedef Dune::Functions::PQkNodalBasis<typename GridType::LeafGridView, 1> FEBasis;
-#endif
+    typedef Dune::Functions::PQkNodalBasis<typename GridType::LeafGridView, order> FEBasis;
     FEBasis feBasis(gridView);
 
     typedef DuneFunctionsBasis<FEBasis> FufemFEBasis;
diff --git a/src/mixed-cosserat-continuum.cc b/src/mixed-cosserat-continuum.cc
index effef085..420f254f 100644
--- a/src/mixed-cosserat-continuum.cc
+++ b/src/mixed-cosserat-continuum.cc
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#define SECOND_ORDER
-
 #include <fenv.h>
 
 // Includes for the ADOL-C automatic differentiation library
-- 
GitLab