@@ -116,6 +116,12 @@ TEST_CASE("MohrCoulomb is checked in 2D (cohesion only, without softening)",
116116 REQUIRE (state_variables.at (" rho" ) == Approx (0 .).epsilon (Tolerance));
117117 REQUIRE (state_variables.at (" theta" ) == Approx (0 .).epsilon (Tolerance));
118118 REQUIRE (state_variables.at (" pdstrain" ) == Approx (0 .).epsilon (Tolerance));
119+ REQUIRE (state_variables.at (" e_el" ) == 0 .);
120+ REQUIRE (state_variables.at (" w_pl" ) == 0 .);
121+ REQUIRE (state_variables.at (" tensile_fail_curr" ) == 0 );
122+ REQUIRE (state_variables.at (" tensile_fail" ) == 0 );
123+ REQUIRE (state_variables.at (" shear_fail_curr" ) == 0 );
124+ REQUIRE (state_variables.at (" shear_fail" ) == 0 );
119125
120126 const std::vector<std::string> state_vars = {" phi" ,
121127 " psi" ,
@@ -124,8 +130,8 @@ TEST_CASE("MohrCoulomb is checked in 2D (cohesion only, without softening)",
124130 " rho" ,
125131 " theta" ,
126132 " pdstrain" ,
127- " E_el " ,
128- " W_pl " ,
133+ " e_el " ,
134+ " w_pl " ,
129135 " tensile_fail_curr" ,
130136 " shear_fail_curr" ,
131137 " tensile_fail" ,
@@ -566,6 +572,11 @@ TEST_CASE("MohrCoulomb is checked in 2D (cohesion only, without softening)",
566572 REQUIRE (updated_stress (3 ) == Approx (0 .).epsilon (Tolerance));
567573 REQUIRE (updated_stress (4 ) == Approx (0 .).epsilon (Tolerance));
568574 REQUIRE (updated_stress (5 ) == Approx (0 .).epsilon (Tolerance));
575+ // Check whether failure flag state variables (after being computed in compute_stress) are correct
576+ REQUIRE (state_variables.at (" shear_fail" ) == 1 );
577+ REQUIRE (state_variables.at (" shear_fail_curr" ) == 1 );
578+ REQUIRE (state_variables.at (" tensile_fail" ) == 0 );
579+ REQUIRE (state_variables.at (" tensile_fail_curr" ) == 0 );
569580 }
570581 }
571582}
@@ -2866,6 +2877,10 @@ TEST_CASE("MohrCoulomb is checked in 3D (c & phi & psi, with softening)",
28662877 // Check plastic strain
28672878 REQUIRE (state_variables.at (" pdstrain" ) ==
28682879 Approx (0.0007751567 ).epsilon (Tolerance));
2880+ // In the present workflow, all failure flags remain at 0 ?...
2881+ // Check plastic work and elastic energy
2882+ REQUIRE (state_variables.at (" e_el" ) == Approx (15.33614017380 ).epsilon (Tolerance));
2883+ REQUIRE (state_variables.at (" w_pl" ) == Approx (4.5135130001 ).epsilon (Tolerance));
28692884 }
28702885
28712886 // ! Check for shear failure (pdstrain > pdstrain_residual)
@@ -3373,6 +3388,14 @@ TEST_CASE("MohrCoulomb is checked in 3D (c & phi & psi, with softening)",
33733388 // Check plastic strain
33743389 REQUIRE (state_variables.at (" pdstrain" ) ==
33753390 Approx (0.0002112522 ).epsilon (Tolerance));
3391+ // Check failure flags
3392+ REQUIRE (state_variables.at (" shear_fail" ) == 1 );
3393+ REQUIRE (state_variables.at (" shear_fail_curr" ) == 1 );
3394+ REQUIRE (state_variables.at (" tensile_fail" ) == 0 );
3395+ REQUIRE (state_variables.at (" tensile_fail_curr" ) == 0 );
3396+ // Check plastic work and elastic energy
3397+ REQUIRE (state_variables.at (" e_el" ) == Approx (1.153960429 ).epsilon (Tolerance));
3398+ REQUIRE (state_variables.at (" w_pl" ) == Approx (1.0964114497 ).epsilon (Tolerance));
33763399 }
33773400
33783401 // ! Check for shear failure (pdstrain > pdstrain_residual)
0 commit comments