From e965fa0751952596fc982c6dfb463bec955b9976 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Tue, 22 Nov 2011 14:43:36 +0100
Subject: [PATCH] Compute second derivative (ignored)

---
 dune/tectonic/nicefunction.hh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dune/tectonic/nicefunction.hh b/dune/tectonic/nicefunction.hh
index fdcdc0e4..6ff57720 100644
--- a/dune/tectonic/nicefunction.hh
+++ b/dune/tectonic/nicefunction.hh
@@ -73,6 +73,20 @@ class RuinaFunction : public NiceFunction {
     return coefficient * normalStress * (a * std::log(eta * s) + mu);
   }
 
+  /*
+    d/dx a * log(eta x) + mu
+    = a * 1/(eta x) * eta
+    = a/x
+  */
+  double virtual second_deriv(double s) const {
+    if (eta * s < rho)
+      return 0;
+    else if (eta * s == rho)
+      return 37; // TODO: not differentiable;
+    else
+      return coefficient * normalStress * (a / s);
+  }
+
 private:
   double coefficient;
   double a;
-- 
GitLab