From de0e07bea4f2703cf9aa126b2e08f052decb5b13 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 19 Jun 2014 15:39:23 +0200
Subject: [PATCH] [Noise]   Get rid of logVmin

---
 dune/tectonic/frictionpotential.hh | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dune/tectonic/frictionpotential.hh b/dune/tectonic/frictionpotential.hh
index 909ccd5e..6d2c0154 100644
--- a/dune/tectonic/frictionpotential.hh
+++ b/dune/tectonic/frictionpotential.hh
@@ -37,7 +37,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
     if (V <= Vmin)
       return 0.0;
 
-    return fd.a * (std::log(V) - logVmin);
+    return fd.a * (std::log(V / fd.V0) + logrest);
   }
 
   double differential(double V) const {
@@ -61,17 +61,15 @@ class FrictionPotential : public FrictionPotentialWrapper {
   }
 
   void updateLogState(double logState) {
-    double const tmp =
-        (fd.mu0 + fd.b * (logState + std::log(fd.V0 / fd.L))) / fd.a;
-    logVmin = std::log(fd.V0) - tmp;
-    Vmin = fd.V0 / std::exp(tmp);
+    logrest = (fd.mu0 + fd.b * (logState + std::log(fd.V0 / fd.L))) / fd.a;
+    Vmin = fd.V0 / std::exp(logrest);
   }
 
 private:
   FrictionData const fd;
   double const weight;
   double const normalStress;
-  double logVmin;
+  double logrest;
   double Vmin;
 };
 
-- 
GitLab