From 585f75ed785e1eb1e6c6c0f548398d481061dc72 Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Tue, 3 Jan 2012 18:28:57 +0000
Subject: [PATCH] boxmodels: make them compile with -pedantic

tested on GCC 4.3 and GCC 4.6. Due to an incompatibility between those
two compilers (GCC 4.3 expects that there's no semicolon behind
static_assert(), GCC 4.6 requires one), it only compiles on GCC 4.6.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7288 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/boxmodels/1p2c/1p2cmodel.hh             |  2 +-
 dumux/common/propertysystem.hh                | 56 +++++++++----------
 dumux/common/quad.hh                          | 34 +++++------
 dumux/common/splinecommon_.hh                 |  2 +-
 dumux/common/valgrind.hh                      |  4 +-
 dumux/material/components/h2o.hh              |  6 +-
 dumux/material/components/iapws/common.hh     | 37 +++++++++---
 dumux/material/components/simpleh2o.hh        |  5 +-
 dumux/material/constants.hh                   | 29 +++++++---
 dumux/material/idealgas.hh                    |  5 +-
 test/boxmodels/1p2c/tissue_tumor_problem.hh   | 12 ----
 test/boxmodels/2p/lensproblem.hh              |  3 +-
 test/boxmodels/2p2c/injectionproblem.hh       | 10 +++-
 test/boxmodels/2p2cni/waterairproblem.hh      | 11 ++--
 test/boxmodels/2pni/injectionproblem2pni.hh   | 15 +++--
 test/boxmodels/MpNc/obstacleproblem.hh        |  3 +-
 .../boxmodels/richards/richardslensproblem.hh |  7 ++-
 .../generalproblem/generallensproblem.hh      |  3 +-
 tutorial/tutorialproblem_coupled.hh           |  3 +-
 19 files changed, 146 insertions(+), 101 deletions(-)

diff --git a/dumux/boxmodels/1p2c/1p2cmodel.hh b/dumux/boxmodels/1p2c/1p2cmodel.hh
index 0326eb1cc1..11e0cf88bc 100644
--- a/dumux/boxmodels/1p2c/1p2cmodel.hh
+++ b/dumux/boxmodels/1p2c/1p2cmodel.hh
@@ -135,7 +135,7 @@ public:
         ScalarField &velocityY = *writer.allocateManagedBuffer(numVertices);
         ScalarField &velocityZ = *writer.allocateManagedBuffer(numVertices);
         //use vertiacl faces for vx and horizontal faces for vy calculation
-        GlobalPosition boxSurface[numVertices];
+        std::vector<GlobalPosition> boxSurface(numVertices);
         // initialize velocity fields
           for (int i = 0; i < numVertices; ++i)
           {
diff --git a/dumux/common/propertysystem.hh b/dumux/common/propertysystem.hh
index 1c8621eedd..56ea18b473 100644
--- a/dumux/common/propertysystem.hh
+++ b/dumux/common/propertysystem.hh
@@ -107,25 +107,21 @@ namespace Properties
     int PropertyInfo<TTAG(EffTypeTagName), PTAG_(PropTagName)>::foo =   \
     PropertyInfo<TTAG(EffTypeTagName), PTAG_(PropTagName)>::init();
 
-#define FA_TTAG_(TypeTagName, ...) TTAG(TypeTagName)
-
 //! Internal macro which is only required if the property introspection is enabled
-#define TTAG_INFO_(...)                                                 \
+#define TTAG_INFO_(TypeTagName, ...)                                    \
     template <>                                                         \
-    struct TypeTagInfo<FA_TTAG_(__VA_ARGS__)>                           \
+    struct TypeTagInfo<TypeTagName>                                     \
     {                                                                   \
         static int init() {                                             \
-        TypeTagRegistry::addChildren<__VA_ARGS__ >();                   \
-        return 0;                                                       \
-    };                                                                  \
-    static int foo;                                                     \
+            TypeTagRegistry::addChildren<TypeTagName, ##__VA_ARGS__ >(); \
+            return 0;                                                   \
+        };                                                              \
+        static int foo;                                                 \
     };                                                                  \
-int TypeTagInfo<FA_TTAG_(__VA_ARGS__)>::foo =                           \
-    TypeTagInfo<FA_TTAG_(__VA_ARGS__)>::init();
+    int TypeTagInfo<TypeTagName>::foo =                                 \
+    TypeTagInfo<TypeTagName>::init();
 
 #else
-//! Internal macro which is only required if the property introspection is enabled
-//!
 //! Don't do anything if introspection is disabled
 #define PROP_INFO_(EffTypeTagName, PropKind, PropTagName, ...)
 #define TTAG_INFO_(EffTypeTagName, ...)
@@ -308,14 +304,14 @@ int TypeTagInfo<FA_TTAG_(__VA_ARGS__)>::foo =                           \
  *
  * The constant can be accessed by the 'value' attribute.
  */
-#define SET_INT_PROP(EffTypeTagName, PropTagName, Value, ...)   \
+#define SET_INT_PROP(EffTypeTagName, PropTagName, /*Value*/...)    \
     SET_PROP_(EffTypeTagName,                                   \
               /*kind=*/"int   ",                                \
               PropTagName,                                      \
-              /*value=*/Value, ##__VA_ARGS__)                   \
+              /*value=*/__VA_ARGS__)                            \
     {                                                           \
         typedef int type;                                       \
-        static constexpr int value = Value, ##__VA_ARGS__;      \
+        static constexpr int value = __VA_ARGS__;               \
     }
 
 /*!
@@ -323,14 +319,14 @@ int TypeTagInfo<FA_TTAG_(__VA_ARGS__)>::foo =                           \
  *
  * The constant can be accessed by the 'value' attribute.
  */
-#define SET_BOOL_PROP(EffTypeTagName, PropTagName, Value, ...)  \
-    SET_PROP_(EffTypeTagName,                                   \
-              /*kind=*/"bool  ",                                \
-              PropTagName,                                      \
-              /*value=*/Value, ##__VA_ARGS__)                   \
-    {                                                           \
-        typedef bool type;                                      \
-        static constexpr bool value = Value, ##__VA_ARGS__;     \
+#define SET_BOOL_PROP(EffTypeTagName, PropTagName, /*Value*/...)    \
+    SET_PROP_(EffTypeTagName,                                       \
+              /*kind=*/"bool  ",                                    \
+              PropTagName,                                          \
+              /*value=*/__VA_ARGS__)                                \
+    {                                                               \
+        typedef bool type;                                          \
+        static constexpr bool value = __VA_ARGS__;                  \
     }
 
 /*!
@@ -338,13 +334,13 @@ int TypeTagInfo<FA_TTAG_(__VA_ARGS__)>::foo =                           \
  *
  * The type can be accessed by the 'type' attribute.
  */
-#define SET_TYPE_PROP(EffTypeTagName, PropTagName, Type, ...)   \
-    SET_PROP_(EffTypeTagName,                                   \
-              /*kind=*/"type  ",                                \
-              PropTagName,                                      \
-              /*value=*/Type, __VA_ARGS__)                      \
-    {                                                           \
-        typedef Type, ##__VA_ARGS__ type;                       \
+#define SET_TYPE_PROP(EffTypeTagName, PropTagName, /*Value*/...)  \
+    SET_PROP_(EffTypeTagName,                                     \
+              /*kind=*/"type  ",                                  \
+              PropTagName,                                        \
+              /*value=*/__VA_ARGS__)                              \
+    {                                                             \
+        typedef __VA_ARGS__ type;                                 \
     }
 
 /*!
diff --git a/dumux/common/quad.hh b/dumux/common/quad.hh
index 75467eb1f7..c5f9ba26c9 100644
--- a/dumux/common/quad.hh
+++ b/dumux/common/quad.hh
@@ -117,47 +117,47 @@ inline quad ceil(quad val)
 { return ceilq(val); }
 
 inline quad max(quad a, quad b)
-{ return (a>b)?a:b; };
+{ return (a>b)?a:b; }
 
 inline quad min(quad a, quad b)
-{ return (a<b)?a:b; };
+{ return (a<b)?a:b; }
 
 inline quad sqrt(quad val)
-{ return sqrtq(val); };
+{ return sqrtq(val); }
 
 template <class ExpType>
 inline quad pow(quad base, ExpType exp)
-{ return powq(base, exp); };
+{ return powq(base, exp); }
 
 inline quad exp(quad val)
-{ return expq(val); };
+{ return expq(val); }
 
 inline quad log(quad val)
-{ return logq(val); };
+{ return logq(val); }
 
 inline quad sin(quad val)
-{ return sinq(val); };
+{ return sinq(val); }
 
 inline quad cos(quad val)
-{ return cosq(val); };
+{ return cosq(val); }
 
 inline quad tan(quad val)
-{ return tanq(val); };
+{ return tanq(val); }
 
 inline quad atan(quad val)
-{ return atanq(val); };
+{ return atanq(val); }
 
 inline quad atan2(quad a, quad b)
-{ return atan2q(a, b); };
+{ return atan2q(a, b); }
 
 inline bool isfinite(quad val)
-{ return !isnanq(val) && !isinfq(val); };
+{ return !isnanq(val) && !isinfq(val); }
 
 inline bool isnan(quad val)
-{ return isnanq(val); };
+{ return isnanq(val); }
 
 inline bool isinf(quad val)
-{ return isinfq(val); };
+{ return isinfq(val); }
 
 } // namespace std
 
@@ -211,14 +211,14 @@ template <class T>
 std::string className()
 {
     return ClassNameHelper_<T>::name();
-};
+}
 
 template <class T>
 std::string className(const T &t)
 {
     return ClassNameHelper_<T>::name();
-};
+}
 
-};
+}
 
 #endif // DUMUX_QUAD_HH
diff --git a/dumux/common/splinecommon_.hh b/dumux/common/splinecommon_.hh
index b895d49f2b..ab7060f732 100644
--- a/dumux/common/splinecommon_.hh
+++ b/dumux/common/splinecommon_.hh
@@ -39,7 +39,7 @@
 #if __GNUC__ <= 4 &&  __GNUC_MINOR__ < 5
 namespace std {
 using tr1::get;
-};
+}
 #endif
 
 namespace Dumux
diff --git a/dumux/common/valgrind.hh b/dumux/common/valgrind.hh
index 3280ed9099..8a6cc8cc5a 100644
--- a/dumux/common/valgrind.hh
+++ b/dumux/common/valgrind.hh
@@ -41,8 +41,8 @@
 // the BoundaryTypes class)
 namespace Valgrind
 {
-bool boolBlubb() { return true; };
-void voidBlubb() { };
+bool boolBlubb() { return true; }
+void voidBlubb() { }
 
 #define SetUndefined(t) voidBlubb()
 #define SetDefined(t) voidBlubb()
diff --git a/dumux/material/components/h2o.hh b/dumux/material/components/h2o.hh
index a4496fa898..0c8e302fa8 100644
--- a/dumux/material/components/h2o.hh
+++ b/dumux/material/components/h2o.hh
@@ -68,7 +68,8 @@ class H2O : public Component<Scalar, H2O<Scalar> >
     typedef IAPWS::Region2<Scalar> Region2;
     typedef IAPWS::Region4<Scalar> Region4;
 
-    static constexpr Scalar Rs = Common::Rs;  // specific gas constant of water
+    static const Scalar Rs; // specific gas constant of water
+
 public:
     /*!
      * \brief A human readable name for the water.
@@ -873,6 +874,9 @@ private:
     };
 }; // end class
 
+template <class Scalar>
+const Scalar H2O<Scalar>::Rs = Common::Rs;
+
 } // end namepace
 
 #endif
diff --git a/dumux/material/components/iapws/common.hh b/dumux/material/components/iapws/common.hh
index 531de33c02..be29ebe4e2 100644
--- a/dumux/material/components/iapws/common.hh
+++ b/dumux/material/components/iapws/common.hh
@@ -66,31 +66,31 @@ class Common
 {
 public:
     //! The molar mass of water \f$\mathrm{[kg/mol]}\f$
-    static constexpr Scalar molarMass = 18.01518e-3;
+    static const Scalar molarMass;
 
     //! Specific gas constant of water \f$\mathrm{[J/(kg*K)]}\f$
-    static constexpr Scalar Rs = Dumux::Constants<Scalar>::R/molarMass;
+    static const Scalar Rs;
 
     //! Critical temperature of water \f$\mathrm{[K]}\f$
-    static constexpr Scalar criticalTemperature = 647.096;
+    static const Scalar criticalTemperature;
 
     //! Critical pressure of water \f$\mathrm{[Pa]}\f$
-    static constexpr Scalar criticalPressure = 22.064e6;
+    static const Scalar criticalPressure;
 
     //! Critical molar volume of water \f$\mathrm{[m^3/mol]}\f$
-    static constexpr Scalar criticalMolarVolume = molarMass/322.0;
+    static const Scalar criticalMolarVolume;
 
     //! The acentric factor of water \f$\mathrm{[-]}\f$
-    static constexpr Scalar acentricFactor = 0.344;
+    static const Scalar acentricFactor;
 
     //! Density of water at the critical point \f$\mathrm{[kg/m^3]}\f$
-    static constexpr Scalar criticalDensity = 322;
+    static const Scalar criticalDensity;
 
     //! Triple temperature of water \f$\mathrm{[K]}\f$
-    static constexpr Scalar tripleTemperature = 273.16;
+    static const Scalar tripleTemperature;
 
     //! Triple pressure of water \f$\mathrm{[Pa]}\f$
-    static constexpr Scalar triplePressure = 611.657;
+    static const Scalar triplePressure;
 
     /*!
      * \brief The dynamic viscosity \f$\mathrm{[(N/m^2)*s]}\f$of pure water.
@@ -153,6 +153,25 @@ public:
     }
 };
 
+template <class Scalar>
+const Scalar Common<Scalar>::molarMass = 18.01518e-3;
+template <class Scalar>
+const Scalar Common<Scalar>::Rs = Dumux::Constants<Scalar>::R/Common<Scalar>::molarMass;
+template <class Scalar>
+const Scalar Common<Scalar>::criticalTemperature = 647.096;
+template <class Scalar>
+const Scalar Common<Scalar>::criticalPressure = 22.064e6;
+template <class Scalar>
+const Scalar Common<Scalar>::criticalMolarVolume = Common<Scalar>::molarMass/322.0;
+template <class Scalar>
+const Scalar Common<Scalar>::acentricFactor = 0.344;
+template <class Scalar>
+const Scalar Common<Scalar>::criticalDensity = 322;
+template <class Scalar>
+const Scalar Common<Scalar>::tripleTemperature = 273.16;
+template <class Scalar>
+const Scalar Common<Scalar>::triplePressure = 611.657;
+
 } // end namepace IAPWS
 } // end namepace Dune
 
diff --git a/dumux/material/components/simpleh2o.hh b/dumux/material/components/simpleh2o.hh
index a10c616f13..fba5f30efe 100644
--- a/dumux/material/components/simpleh2o.hh
+++ b/dumux/material/components/simpleh2o.hh
@@ -50,7 +50,7 @@ class SimpleH2O : public Component<Scalar, SimpleH2O<Scalar> >
     typedef Component<Scalar, SimpleH2O<Scalar> > ParentType;
     typedef Dumux::IdealGas<Scalar> IdealGas;
 
-    static constexpr double R = 461.526;  // specific gas constant of water
+    static const Scalar R;  // specific gas constant of water
 
 public:
     /*!
@@ -267,6 +267,9 @@ public:
     };
 };
 
+template <class Scalar>
+const Scalar SimpleH2O<Scalar>::R = Dumux::Constants<Scalar>::R / 18e-3;
+
 } // end namepace
 
 #endif
diff --git a/dumux/material/constants.hh b/dumux/material/constants.hh
index f7e5cf3b45..1550ee4de1 100644
--- a/dumux/material/constants.hh
+++ b/dumux/material/constants.hh
@@ -43,38 +43,53 @@ class Constants
     /*!
      * \brief The ideal gas constant [J/(mol K)]
      */
-    static constexpr Scalar R = 8.314472;
+    static const Scalar R;
 
     /*!
      * \brief The Avogadro constant [1/mol]
      */
-    static constexpr Scalar Na = 6.02214179e23;
+    static const Scalar Na;
 
     /*!
      * \brief The Boltzmann constant [J/K]
      */
-    static constexpr Scalar kb = R/Na;
+    static const Scalar kb;
 
     /*!
      * \brief Speed of light in vacuum [m/s]
      */
-    static constexpr Scalar c = 299792458;
+    static const Scalar c;
 
     /*!
      * \brief Newtonian constant of gravitation [m^3/(kg s^2)]
      */
-    static constexpr Scalar G = 6.67428e-11;
+    static const Scalar G;
 
     /*!
      * \brief Planck constant [J s]
      */
-    static constexpr Scalar h = 6.62606896e-34;
+    static const Scalar h;
 
     /*!
      * \brief Reduced Planck constant [J s]
      */
-    static constexpr Scalar hRed = h / (2 * M_PI);
+    static const Scalar hRed;
 };
+
+template<class Scalar>
+const Scalar Constants<Scalar>::R = 8.314472;
+template<class Scalar>
+const Scalar Constants<Scalar>::Na = 6.02214179e23;
+template<class Scalar>
+const Scalar Constants<Scalar>::kb = Constants<Scalar>::R/Constants<Scalar>::Na;
+template<class Scalar>
+const Scalar Constants<Scalar>::c = 299792458;
+template<class Scalar>
+const Scalar Constants<Scalar>::G = 6.67428e-11;
+template<class Scalar>
+const Scalar Constants<Scalar>::h = 6.62606896e-34;
+template<class Scalar>
+const Scalar Constants<Scalar>::hRed = Constants<Scalar>::h / (2 * M_PI);
 }
 
 #endif
diff --git a/dumux/material/idealgas.hh b/dumux/material/idealgas.hh
index 21b4b57f8a..56f42de2a3 100644
--- a/dumux/material/idealgas.hh
+++ b/dumux/material/idealgas.hh
@@ -40,7 +40,7 @@ class IdealGas
 {
 public:
     //! The ideal gas constant \f$\mathrm{[J/mol/K]}\f$
-    static constexpr Scalar R = Dumux::Constants<Scalar>::R;
+    static const Scalar R;
 
     /*!
      * \brief The density of the gas in \f$\mathrm{[kg/m^3]}\f$, depending on
@@ -73,6 +73,9 @@ public:
     { return molarDensity(temperature, pressure); }
 };
 
+template <class Scalar>
+const Scalar IdealGas<Scalar>::R = Dumux::Constants<Scalar>::R;
+
 } // end namepace
 
 #endif
diff --git a/test/boxmodels/1p2c/tissue_tumor_problem.hh b/test/boxmodels/1p2c/tissue_tumor_problem.hh
index 8da4f28eec..69a405d72a 100644
--- a/test/boxmodels/1p2c/tissue_tumor_problem.hh
+++ b/test/boxmodels/1p2c/tissue_tumor_problem.hh
@@ -243,17 +243,6 @@ public:
     {
         //const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
         values = 0;
-
-        //int globalIdx = this->model().vertexMapper().map(element, scvIdx, dim);
-
-        //Scalar lambda = (globalPos[1])/height_;
-//        if (globalPos[0] < eps_ ) {
-//            values[contiEqIdx] = -3.8676e-2; // [kg/(m^2 * s)]
-
-            //values[transEqIdx] = -4.35064e-4; // [mol/(m^2*s)
-            //Robin-Boundary
-            //values[transEqIdx] = (*this->model().curSolFunction())[globalIdx][transEqIdx];
-//        }
     }
 
     // \}
@@ -337,7 +326,6 @@ private:
     }
 
     Scalar totalInjectionVolume_;
-    static constexpr Scalar eps_ = 1e-6;
 }; //end namespace
 }
 #endif
diff --git a/test/boxmodels/2p/lensproblem.hh b/test/boxmodels/2p/lensproblem.hh
index 34325e2c31..10db15f0cc 100644
--- a/test/boxmodels/2p/lensproblem.hh
+++ b/test/boxmodels/2p/lensproblem.hh
@@ -216,6 +216,7 @@ public:
                 const GlobalPosition &lensUpperRight)
         : ParentType(timeManager, gridView)
     {
+        eps_ = 3e-6;
         temperature_ = 273.15 + 20; // -> 20°C
         this->spatialParameters().setLensCoords(lensLowerLeft, lensUpperRight);
     }
@@ -412,7 +413,7 @@ private:
     }
 
     Scalar temperature_;
-    static constexpr Scalar eps_ = 3e-6;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/test/boxmodels/2p2c/injectionproblem.hh b/test/boxmodels/2p2c/injectionproblem.hh
index ccdadbc70a..a712447bde 100644
--- a/test/boxmodels/2p2c/injectionproblem.hh
+++ b/test/boxmodels/2p2c/injectionproblem.hh
@@ -149,6 +149,10 @@ public:
     InjectionProblem(TimeManager &timeManager, const GridView &gridView)
         : ParentType(timeManager, gridView)
     {
+        temperature_ = 273.15 + 40; // [K]
+        depthBOR_ = 2700.0; // [m]
+        eps_ = 1e-6;
+
         // initialize the tables of the fluid system
         //FluidSystem::init();
         FluidSystem::init(/*Tmin=*/temperature_ - 1.0,
@@ -336,9 +340,9 @@ private:
         values[Indices::switchIdx] = massFracLiquidN2;
     }
 
-    static constexpr Scalar temperature_ = 273.15 + 40; // [K]
-    static constexpr Scalar depthBOR_ = 2700.0; // [m]
-    static constexpr Scalar eps_ = 1e-6;
+    Scalar temperature_;
+    Scalar depthBOR_;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/test/boxmodels/2p2cni/waterairproblem.hh b/test/boxmodels/2p2cni/waterairproblem.hh
index cb5aaa62a4..2aaf97a91c 100644
--- a/test/boxmodels/2p2cni/waterairproblem.hh
+++ b/test/boxmodels/2p2cni/waterairproblem.hh
@@ -167,6 +167,9 @@ public:
     WaterAirProblem(TimeManager &timeManager, const GridView &gridView)
         : ParentType(timeManager, gridView)
     {
+        maxDepth_ = 1000.0; // [m]
+        eps_ = 1e-6;
+
         FluidSystem::init();
     }
 
@@ -335,15 +338,15 @@ private:
                   const GlobalPosition &globalPos) const
     {
         Scalar densityW = 1000.0;
-        values[pressureIdx] = 1e5 + (depthBOR_ - globalPos[1])*densityW*9.81;
+        values[pressureIdx] = 1e5 + (maxDepth_ - globalPos[1])*densityW*9.81;
         values[switchIdx] = 0.0;
 #if !ISOTHERMAL
-        values[temperatureIdx] = 283.0 + (depthBOR_ - globalPos[1])*0.03;
+        values[temperatureIdx] = 283.0 + (maxDepth_ - globalPos[1])*0.03;
 #endif
     }
 
-    static constexpr Scalar depthBOR_ = 1000.0; // [m]
-    static constexpr Scalar eps_ = 1e-6;
+    Scalar maxDepth_;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/test/boxmodels/2pni/injectionproblem2pni.hh b/test/boxmodels/2pni/injectionproblem2pni.hh
index c2b6933195..cf147375af 100644
--- a/test/boxmodels/2pni/injectionproblem2pni.hh
+++ b/test/boxmodels/2pni/injectionproblem2pni.hh
@@ -197,6 +197,9 @@ public:
     InjectionProblem2PNI(TimeManager &timeManager, const GridView &gridView)
         : ParentType(timeManager, gridView)
     {
+        maxDepth_ = 2700.0; // [m]
+        eps_ = 1e-6;
+
         // initialize the tables of the fluid system
         FluidSystem::init(/*tempMin=*/273.15,
                 /*tempMax=*/423.15,
@@ -287,10 +290,10 @@ public:
         const GlobalPosition globalPos = vertex.geometry().center();
 
         Scalar densityW = 1000.0;
-        values[pressureIdx] = 1e5 + (depthBOR_ - globalPos[1])*densityW*9.81;
+        values[pressureIdx] = 1e5 + (maxDepth_ - globalPos[1])*densityW*9.81;
         values[saturationIdx] = 0.0;
 #if !ISOTHERMAL
-        values[temperatureIdx] = 283.0 + (depthBOR_ - globalPos[1])*0.03;
+        values[temperatureIdx] = 283.0 + (maxDepth_ - globalPos[1])*0.03;
 #endif
     }
 
@@ -351,11 +354,11 @@ public:
         const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
 
         Scalar densityW = 1000.0;
-        values[pressureIdx] = 1e5 + (depthBOR_ - globalPos[1])*densityW*9.81;
+        values[pressureIdx] = 1e5 + (maxDepth_ - globalPos[1])*densityW*9.81;
         values[saturationIdx] = 0.0;
 
 #if !ISOTHERMAL
-        values[temperatureIdx] = 283.0 + (depthBOR_ - globalPos[1])*0.03;
+        values[temperatureIdx] = 283.0 + (maxDepth_ - globalPos[1])*0.03;
         if (globalPos[0] > 20 && globalPos[0] < 30 && globalPos[1] > 5 && globalPos[1] < 35)
             values[temperatureIdx] = 380;
 #endif // !ISOTHERMAL
@@ -363,8 +366,8 @@ public:
     // \}
 
 private:
-    static constexpr Scalar depthBOR_ = 2700.0; // [m]
-    static constexpr Scalar eps_ = 1e-6;
+    Scalar maxDepth_;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/test/boxmodels/MpNc/obstacleproblem.hh b/test/boxmodels/MpNc/obstacleproblem.hh
index fcf929dfbb..54b9d27f16 100644
--- a/test/boxmodels/MpNc/obstacleproblem.hh
+++ b/test/boxmodels/MpNc/obstacleproblem.hh
@@ -178,6 +178,7 @@ public:
     ObstacleProblem(TimeManager &timeManager, const GridView &gridView)
         : ParentType(timeManager, gridView)
     {
+        eps_ = 1e-6;
         temperature_ = 273.15 + 25; // -> 25°C
 
         // initialize the tables of the fluid system
@@ -450,7 +451,7 @@ private:
     };
 
     Scalar temperature_;
-    static constexpr Scalar eps_ = 1e-6;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/test/boxmodels/richards/richardslensproblem.hh b/test/boxmodels/richards/richardslensproblem.hh
index 9df615ed36..cc8703cfe4 100644
--- a/test/boxmodels/richards/richardslensproblem.hh
+++ b/test/boxmodels/richards/richardslensproblem.hh
@@ -160,13 +160,15 @@ public:
                         const GridView &gridView)
         : ParentType(timeManager, gridView)
     {
+        eps_ = 3e-6;
+        pnRef_ = 1e5;
+
         lensLowerLeft_[0] = 1.0;
         lensLowerLeft_[1] = 2.0;
 
         lensUpperRight_[0] = 4.0;
         lensUpperRight_[1] = 3.0;
 
-        pnRef_ = 1e5;
         this->spatialParameters().setLensCoords(lensLowerLeft_, lensUpperRight_);
     }
 
@@ -333,8 +335,9 @@ private:
         return onUpperBoundary_(globalPos) && 0.5 < lambda && lambda < 2.0/3.0;
     }
 
-    static constexpr Scalar eps_ = 3e-6;
+    Scalar eps_;
     Scalar pnRef_;
+
     GlobalPosition lensLowerLeft_;
     GlobalPosition lensUpperRight_;
 };
diff --git a/test/common/generalproblem/generallensproblem.hh b/test/common/generalproblem/generallensproblem.hh
index 14bf15e837..422222afa2 100644
--- a/test/common/generalproblem/generallensproblem.hh
+++ b/test/common/generalproblem/generallensproblem.hh
@@ -259,6 +259,7 @@ public:
                        const GlobalPosition &lensUpperRight)
         : ParentType(timeManager, gridView)
     {
+        eps_ = 3e-6;
         temperature_ = 273.15 + 20; // -> 20°C
         this->spatialParameters().setLensCoords(lensLowerLeft, lensUpperRight);
         this->timeManager().startNextEpisode(500);
@@ -463,7 +464,7 @@ private:
     }
 
     Scalar temperature_;
-    static constexpr Scalar eps_ = 3e-6;
+    Scalar eps_;
 };
 } //end namespace
 
diff --git a/tutorial/tutorialproblem_coupled.hh b/tutorial/tutorialproblem_coupled.hh
index cb4b9e370b..52cd3b69f0 100644
--- a/tutorial/tutorialproblem_coupled.hh
+++ b/tutorial/tutorialproblem_coupled.hh
@@ -130,6 +130,7 @@ public:
     TutorialProblemCoupled(TimeManager &timeManager,
                            const GridView &gridView)
         : ParentType(timeManager, gridView)
+        , eps_(3e-6)
     {
     }
 
@@ -234,7 +235,7 @@ public:
 
 private:
     // small epsilon value
-    static constexpr Scalar eps_ = 3e-6;
+    Scalar eps_;
 };
 }
 
-- 
GitLab