diff --git a/dune/tectonic/nicefunction.hh b/dune/tectonic/nicefunction.hh index e284e95a83dc3286987d0410b18aa314f155bd1e..027d8a4b959b9f13a697a83d3d33f6f26c7e0dfa 100644 --- a/dune/tectonic/nicefunction.hh +++ b/dune/tectonic/nicefunction.hh @@ -55,7 +55,7 @@ class RuinaFunction : public NiceFunction { double virtual leftDifferential(double x) const { double const arg = eta_h * x; - if (arg == 0) // TODO: Make this controllable + if (arg < 1e-14) // TODO: Make this controllable return 0; double const ret = (a * std::log(arg) + c + K); @@ -67,6 +67,9 @@ class RuinaFunction : public NiceFunction { } double virtual second_deriv(double s) const { + if (s < 1e-14) // TODO: Make this controllable + return 0; + return coefficientProduct * a / s; }