From 6e860577b381e30ada14465bd1e30a21fb76ecbc Mon Sep 17 00:00:00 2001
From: podlesny <podlesny@zedat.fu-berlin.de>
Date: Mon, 15 Mar 2021 23:28:55 +0100
Subject: [PATCH] fix hessian, should only yield components in tangential
 direction

---
 dune/tectonic/data-structures/friction/localfriction.hh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dune/tectonic/data-structures/friction/localfriction.hh b/dune/tectonic/data-structures/friction/localfriction.hh
index e6014373..8008b40f 100644
--- a/dune/tectonic/data-structures/friction/localfriction.hh
+++ b/dune/tectonic/data-structures/friction/localfriction.hh
@@ -150,16 +150,16 @@ class WrappedScalarFriction : public LocalFriction<dimension> {
     double const tensorweight = (H2 - H1 / xnorm);
     double const idweight = H1 / xnorm;
 
-    //std::cout << tensorweight << " " << idweight << std::endl;
+    //std::cout << "weights: " << tensorweight << " " << idweight << std::endl;
 
-    for (size_t i = 0; i < dimension; ++i)
-      for (size_t j = 0; j < i; ++j) {
+    for (size_t i = 1; i < dimension; ++i)
+      for (size_t j = 1; j < i; ++j) {
         double const entry = tensorweight * y[i] * y[j];
         A[i][j] += entry;
         A[j][i] += entry;
       }
 
-    for (size_t k = 0; k < dimension; ++k) {
+    for (size_t k = 1; k < dimension; ++k) {
       double const entry = tensorweight * y[k] * y[k];
       A[k][k] += entry + idweight;
     }
-- 
GitLab