From e0ad941b37d31e48a340870111848ab50f8b1eab Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Mon, 16 Apr 2018 16:58:23 +0200
Subject: [PATCH] [numericDifferentation] Pass the baseEpsilon to the
 numericDifferentation method

---
 dumux/assembly/numericepsilon.hh       | 2 +-
 dumux/common/numericdifferentiation.hh | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dumux/assembly/numericepsilon.hh b/dumux/assembly/numericepsilon.hh
index fb6ba58bec..2c868477dd 100644
--- a/dumux/assembly/numericepsilon.hh
+++ b/dumux/assembly/numericepsilon.hh
@@ -57,7 +57,7 @@ public:
     Scalar operator() (Scalar priVar, int priVarIdx) const noexcept
     {
         return magnitude_[priVarIdx] > 0.0 ? baseEps_*magnitude_[priVarIdx]
-                                           : NumericDifferentiation::epsilon(priVar);
+                                           : NumericDifferentiation::epsilon(priVar, baseEps_);
     }
 
 private:
diff --git a/dumux/common/numericdifferentiation.hh b/dumux/common/numericdifferentiation.hh
index fdc34ffa6b..a977b69bd7 100644
--- a/dumux/common/numericdifferentiation.hh
+++ b/dumux/common/numericdifferentiation.hh
@@ -43,9 +43,8 @@ public:
      * \param value The value of the variable with respect to which we are differentiating
      */
     template<class Scalar>
-    static Scalar epsilon(const Scalar value)
+    static Scalar epsilon(const Scalar value, const Scalar baseEps = 1e-10)
     {
-        static constexpr Scalar baseEps = 1e-10;
         assert(std::numeric_limits<Scalar>::epsilon()*1e4 < baseEps);
         // the epsilon value used for the numeric differentiation is
         // now scaled by the absolute value of the primary variable...
-- 
GitLab