diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh index 75eb2cd4b6dab5c07d84f7b64a64c725012e45e2..838f7050ab2ce2033163e955b8f08ea5b0c399ba 100644 --- a/dune/tectonic/localnonlinearity.hh +++ b/dune/tectonic/localnonlinearity.hh @@ -27,7 +27,7 @@ template <int dimension> class LocalNonlinearity { } double regularity(VectorType const &x) const { - if (x.two_norm() < 1e-8) // TODO + if (!func_->smoothesNorm() && x.two_norm() < 1e-12) // TODO return std::numeric_limits<double>::infinity(); return func_->regularity(x.two_norm()); diff --git a/dune/tectonic/nicefunction.hh b/dune/tectonic/nicefunction.hh index 2faf43df819e2147a9b7ede1e2bc74221d589640..dc9a3eaa33867ea2582ca190277e9114ca1125db 100644 --- a/dune/tectonic/nicefunction.hh +++ b/dune/tectonic/nicefunction.hh @@ -23,6 +23,9 @@ class NiceFunction : public VirtualFunction<double, double> { double virtual regularity(double s) const { DUNE_THROW(NotImplemented, "regularity not implemented"); } + + // Whether H(|.|) is smooth at zero + bool virtual smoothesNorm() const { return false; } }; class RuinaFunction : public NiceFunction { @@ -164,6 +167,8 @@ class TrivialFunction : public NiceFunction { double virtual second_deriv(double) const { return 0; } double virtual regularity(double) const { return 0; } + + bool virtual smoothesNorm() const { return true; } }; // slope in [n-1,n] is n