From f0cb20737ad743ab3b314192c68d17d08afda4b9 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Fri, 12 May 2017 00:22:51 +0200
Subject: [PATCH] [MatL] Ehlers: Remove plastic multiplier from state.

---
 MaterialLib/SolidModels/Ehlers-impl.h | 9 ++++-----
 MaterialLib/SolidModels/Ehlers.h      | 3 ---
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/MaterialLib/SolidModels/Ehlers-impl.h b/MaterialLib/SolidModels/Ehlers-impl.h
index 5d293367d01..10b1a23b98f 100644
--- a/MaterialLib/SolidModels/Ehlers-impl.h
+++ b/MaterialLib/SolidModels/Ehlers-impl.h
@@ -592,6 +592,7 @@ newton(double const dt, MaterialProperties const& mp,
     // same matrix. This saves one decomposition.
     Eigen::FullPivLU<JacobianMatrix> linear_solver;
 
+    double lambda = 0;  // plastic multiplier
     auto const update_residual = [&](ResidualVectorType& residual) {
 
         KelvinVector const eps_p_D_dot =
@@ -604,13 +605,11 @@ newton(double const dt, MaterialProperties const& mp,
             mp.kappa, mp.hardening_coefficient, state.eps_p.eff);
         calculatePlasticResidual<DisplacementDim>(
             eps_D, eps_V, s, state.eps_p.D, eps_p_D_dot, state.eps_p.V,
-            eps_p_V_dot, eps_p_eff_dot, state.lambda, k_hardening, mp,
-            residual);
+            eps_p_V_dot, eps_p_eff_dot, lambda, k_hardening, mp, residual);
     };
 
     auto const update_jacobian = [&](JacobianMatrix& jacobian) {
-        calculatePlasticJacobian<DisplacementDim>(dt, jacobian, s, state.lambda,
-                                                  mp);
+        calculatePlasticJacobian<DisplacementDim>(dt, jacobian, s, lambda, mp);
     };
 
     auto const update_solution = [&](ResidualVectorType const& increment) {
@@ -621,7 +620,7 @@ newton(double const dt, MaterialProperties const& mp,
             increment.template segment<KelvinVectorSize>(KelvinVectorSize * 1);
         state.eps_p.V += increment(KelvinVectorSize * 2);
         state.eps_p.eff += increment(KelvinVectorSize * 2 + 1);
-        state.lambda += increment(KelvinVectorSize * 2 + 2);
+        lambda += increment(KelvinVectorSize * 2 + 2);
     };
 
     auto newton_solver =
diff --git a/MaterialLib/SolidModels/Ehlers.h b/MaterialLib/SolidModels/Ehlers.h
index edc092e2ffd..1493b8fe777 100644
--- a/MaterialLib/SolidModels/Ehlers.h
+++ b/MaterialLib/SolidModels/Ehlers.h
@@ -148,14 +148,12 @@ struct MaterialStateVariables
     void setInitialConditions()
     {
         eps_p = eps_p_prev;
-        lambda = 0;
         damage = damage_prev;
     }
 
     void pushBackState() override
     {
         eps_p_prev = eps_p;
-        lambda = 0;
         damage_prev = damage;
     }
 
@@ -166,7 +164,6 @@ struct MaterialStateVariables
 
     // Initial values from previous timestep
     PlasticStrain<KelvinVector> eps_p_prev;  ///< \copydoc eps_p
-    double lambda = 0;                       ///< plastic multiplier
     Damage damage_prev;                      ///< \copydoc damage
 
 #ifndef NDEBUG
-- 
GitLab