From 1d3814c250049e51e554ae599e93e67f7a933def Mon Sep 17 00:00:00 2001
From: Lisa Julia Nebel <lisa_julia.nebel@tu-dresden.de>
Date: Fri, 10 Mar 2023 14:00:10 +0100
Subject: [PATCH] Do not scale the density functions with the thickness to
 avoid confusion

---
 CHANGELOG.md                             | 5 +++++
 dune/gfe/cosseratenergystiffness.hh      | 6 +++---
 dune/gfe/nonplanarcosseratshellenergy.hh | 4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b7a71f58d..5f2f6dd8e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Master
 
+- Do not scale the density functions  with the thickness to avoid confusion
+  since some densities need to be scaled and some do not need to be scaled
+  with the thickness depending on the dimension of the grid, their direction
+  and their kind (Neumann or volume load).
+
 - Fix bug in the `RealTuple::log` method: Calling `log(a,b)`returned `a-b`
   instead of `b-a`.
 
diff --git a/dune/gfe/cosseratenergystiffness.hh b/dune/gfe/cosseratenergystiffness.hh
index 6f308de62..3ddc69610 100644
--- a/dune/gfe/cosseratenergystiffness.hh
+++ b/dune/gfe/cosseratenergystiffness.hh
@@ -371,7 +371,7 @@ energy(const typename Basis::LocalView& localView,
 
         // Only translational dofs are affected by the volume load
         for (size_t i=0; i<volumeLoadDensity.size(); i++)
-            energy += thickness_ * (volumeLoadDensity[i] * value.r[i]) * quad[pt].weight() * integrationElement;
+            energy += (volumeLoadDensity[i] * value.r[i]) * quad[pt].weight() * integrationElement;
     }
 
 
@@ -405,7 +405,7 @@ energy(const typename Basis::LocalView& localView,
 
             // Only translational dofs are affected by the Neumann force
             for (size_t i=0; i<neumannValue.size(); i++)
-                energy += thickness_ * (neumannValue[i] * value.r[i]) * quad[pt].weight() * integrationElement;
+                energy += (neumannValue[i] * value.r[i]) * quad[pt].weight() * integrationElement;
 
         }
 
@@ -544,7 +544,7 @@ energy(const typename Basis::LocalView& localView,
 
             // Only translational dofs are affected by the Neumann force
             for (size_t i=0; i<neumannValue.size(); i++)
-                energy += thickness_ * (neumannValue[i] * deformationValue.globalCoordinates()[i]) * quad[pt].weight() * integrationElement;
+                energy += (neumannValue[i] * deformationValue.globalCoordinates()[i]) * quad[pt].weight() * integrationElement;
 
         }
 
diff --git a/dune/gfe/nonplanarcosseratshellenergy.hh b/dune/gfe/nonplanarcosseratshellenergy.hh
index e8a3678ee..01575c5e2 100644
--- a/dune/gfe/nonplanarcosseratshellenergy.hh
+++ b/dune/gfe/nonplanarcosseratshellenergy.hh
@@ -332,7 +332,7 @@ energy(const typename Basis::LocalView& localView,
 
     // Only translational dofs are affected by the volume load
     for (size_t i=0; i<volumeLoadDensity.size(); i++)
-      energy += thickness_ * (volumeLoadDensity[i] * value.r[i]) * quad[pt].weight() * integrationElement;
+      energy += (volumeLoadDensity[i] * value.r[i]) * quad[pt].weight() * integrationElement;
   }
 
 
@@ -365,7 +365,7 @@ energy(const typename Basis::LocalView& localView,
 
       // Only translational dofs are affected by the Neumann force
       for (size_t i=0; i<neumannValue.size(); i++)
-        energy += thickness_ * (neumannValue[i] * value.r[i]) * quad[pt].weight() * integrationElement;
+        energy += (neumannValue[i] * value.r[i]) * quad[pt].weight() * integrationElement;
     }
 
   }
-- 
GitLab