From c9a018c1559298ddd2051a7f55659f7499c11cca Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Thu, 10 Dec 2020 15:50:56 +0100
Subject: [PATCH] [UnitTest/MFront] Added a test of getEquivalentPlasticStrain
 to MFront::MaterialStateVariables

---
 Tests/MaterialLib/MFront.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Tests/MaterialLib/MFront.cpp b/Tests/MaterialLib/MFront.cpp
index 40ea2c2081b..2b5847be01e 100644
--- a/Tests/MaterialLib/MFront.cpp
+++ b/Tests/MaterialLib/MFront.cpp
@@ -169,6 +169,12 @@ TYPED_TEST(MaterialLib_SolidModelsMFront2, IntegrateZeroDisplacement)
         this->variable_array_prev, this->variable_array, this->t, this->x,
         this->dt, *state);
 
+    double const epls_strain = state->getEquivalentPlasticStrain();
+    double const expected_epls_strain = 0.0;
+    ASSERT_LE(std::fabs(expected_epls_strain - epls_strain), 1e-10)
+        << "for expected equivalent plastic strain " << expected_epls_strain
+        << " and for computed equivalent plastic strain " << epls_strain;
+
     ASSERT_TRUE(solution != std::nullopt);
     state = std::move(std::get<1>(*solution));
     ASSERT_TRUE(state != nullptr);
@@ -185,6 +191,12 @@ TYPED_TEST(MaterialLib_SolidModelsMFront3, IntegrateZeroDisplacement)
         this->variable_array_prev, this->variable_array, this->t, this->x,
         this->dt, *state);
 
+    double const epls_strain = state->getEquivalentPlasticStrain();
+    double const expected_epls_strain = 0.0;
+    ASSERT_LE(std::fabs(expected_epls_strain - epls_strain), 1e-10)
+        << "for expected equivalent plastic strain " << expected_epls_strain
+        << " and for computed equivalent plastic strain " << epls_strain;
+
     ASSERT_TRUE(solution != std::nullopt);
     state = std::move(std::get<1>(*solution));
     ASSERT_TRUE(state != nullptr);
-- 
GitLab