From ab4aec9ee70ef453eb6bab4f2b2db6e829c27d2b Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Tue, 3 Jan 2012 16:39:05 +0100
Subject: [PATCH] H(|.|) can be regular at zero

---
 dune/tectonic/localnonlinearity.hh | 2 +-
 dune/tectonic/nicefunction.hh      | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh
index 75eb2cd4..838f7050 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 2faf43df..dc9a3eaa 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
-- 
GitLab