From dfe453470324c3124502ae9afcf9a42ce3a86f96 Mon Sep 17 00:00:00 2001
From: labourasse <labourassee@gmail.com>
Date: Tue, 7 Feb 2023 09:22:17 +0100
Subject: [PATCH] add normal stress bc and fix a lateral wave speed bug

---
 src/language/modules/SchemeModule.cpp | 2 +-
 src/scheme/HyperelasticSolver.cpp     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/language/modules/SchemeModule.cpp b/src/language/modules/SchemeModule.cpp
index d7c8755b0..4b4bdfaa9 100644
--- a/src/language/modules/SchemeModule.cpp
+++ b/src/language/modules/SchemeModule.cpp
@@ -265,7 +265,7 @@ SchemeModule::SchemeModule()
 
                                           ));
 
-  this->_addBuiltinFunction("normal-stress",
+  this->_addBuiltinFunction("normalstress",
                             std::function(
 
                               [](std::shared_ptr<const IBoundaryDescriptor> boundary,
diff --git a/src/scheme/HyperelasticSolver.cpp b/src/scheme/HyperelasticSolver.cpp
index d72a2655b..5850ba1c2 100644
--- a/src/scheme/HyperelasticSolver.cpp
+++ b/src/scheme/HyperelasticSolver.cpp
@@ -107,7 +107,7 @@ class HyperelasticSolverHandler::HyperelasticSolver final : public HyperelasticS
         const double& rhoaT_j  = rhoaT[j];
         for (size_t r = 0; r < nb_nodes; ++r) {
           const Rdxd& M = tensorProduct(Cjr(j, r), njr(j, r));
-          Ajr(j, r)     = rhoaL_j * M + rhoaT_j * (I - M);
+          Ajr(j, r)     = rhoaL_j * M + rhoaT_j * (l2Norm(Cjr(j, r)) * I - M);
         }
       });
 
@@ -158,7 +158,7 @@ class HyperelasticSolverHandler::HyperelasticSolver final : public HyperelasticS
           for (size_t rl = 0; rl < face_nodes.size(); ++rl) {
             const size_t R = local_node_number_in_cell(face_nodes[rl]);
             const Rdxd& M  = tensorProduct(Nlr(l, rl), nlr(l, rl));
-            Ajr(j, R) += rho_aL * M + rho_aT * (I - M);
+            Ajr(j, R) += rho_aL * M + rho_aT * (l2Norm(Nlr(l, rl)) * I - M);
           }
         }
       });
-- 
GitLab