From 0be6d6ea9153f8bea782d7383bab27349fca9798 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sun, 22 Jun 2014 13:28:49 +0200
Subject: [PATCH] [Cleanup] Do not hardcode friction law

---
 dune/tectonic/globalratestatefriction.hh | 6 ++----
 src/assemblers.cc                        | 4 +++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dune/tectonic/globalratestatefriction.hh b/dune/tectonic/globalratestatefriction.hh
index ddc2af2d..8a00d350 100644
--- a/dune/tectonic/globalratestatefriction.hh
+++ b/dune/tectonic/globalratestatefriction.hh
@@ -13,9 +13,7 @@
 #include <dune/tectonic/globalfrictiondata.hh>
 #include <dune/tectonic/globalfriction.hh>
 
-#include "frictionpotential.hh"
-
-template <class Matrix, class Vector, class GridView>
+template <class Matrix, class Vector, class ScalarFriction, class GridView>
 class GlobalRateStateFriction : public GlobalFriction<Matrix, Vector> {
 public:
   using GlobalFriction<Matrix, Vector>::block_size;
@@ -45,7 +43,7 @@ class GlobalRateStateFriction : public GlobalFriction<Matrix, Vector> {
         restrictions[i] = trivialNonlinearity;
         continue;
       }
-      auto const fp = std::make_shared<TruncatedRateState>(
+      auto const fp = std::make_shared<ScalarFriction>(
           weights[i], normalStress[i], frictionInfo(coordinate));
       restrictions[i] = std::make_shared<Friction>(fp);
     }
diff --git a/src/assemblers.cc b/src/assemblers.cc
index b42bb301..23602583 100644
--- a/src/assemblers.cc
+++ b/src/assemblers.cc
@@ -17,6 +17,7 @@
 #include <dune/fufem/functions/constantfunction.hh>
 #include <dune/fufem/quadraturerules/quadraturerulecache.hh>
 
+#include <dune/tectonic/frictionpotential.hh>
 #include <dune/tectonic/globalratestatefriction.hh>
 
 #include "assemblers.hh"
@@ -135,7 +136,8 @@ auto MyAssembler<GridView, dimension>::assembleFrictionNonlinearity(
     vertexAssembler.assembleBoundaryFunctional(frictionalBoundaryAssembler,
                                                weights, frictionalBoundary);
   }
-  return std::make_shared<GlobalRateStateFriction<Matrix, Vector, GridView>>(
+  return std::make_shared<
+      GlobalRateStateFriction<Matrix, Vector, TruncatedRateState, GridView>>(
       frictionalBoundary, gridView, frictionInfo, weights, normalStress);
 }
 
-- 
GitLab