From 2944d3fd8c38f24bd6d8772bd0261b724bcccb8b Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Fri, 29 May 2026 13:50:40 +0200 Subject: [PATCH 01/27] Changed type to std::optional, but still assume it's always filled --- .../coulomb_with_tension_cut_off_impl.cpp | 31 ++++++++++--------- .../coulomb_with_tension_cut_off_impl.h | 14 +++++---- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp index f421cb67f96e..81d19d6cb78f 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp @@ -44,7 +44,8 @@ namespace Kratos { CoulombWithTensionCutOffImpl::CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties) - : mCoulombYieldSurface{rMaterialProperties}, mTensionCutOff{rMaterialProperties[GEO_TENSILE_STRENGTH]} + : mCoulombYieldSurface{rMaterialProperties}, + mTensionCutOff{std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH])} { if (rMaterialProperties.Has(GEO_ABS_YIELD_FUNCTION_TOLERANCE)) { mAbsoluteYieldFunctionValueTolerance = rMaterialProperties[GEO_ABS_YIELD_FUNCTION_TOLERANCE]; @@ -98,7 +99,7 @@ template bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const StressStateType& rTrialStressState) { const auto coulomb_yield_function_value = mCoulombYieldSurface.YieldFunctionValue(rTrialStressState); - const auto tension_yield_function_value = mTensionCutOff.YieldFunctionValue(rTrialStressState); + const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); constexpr auto tolerance = 1.0e-10; const auto coulomb_tolerance = tolerance * (1.0 + std::abs(coulomb_yield_function_value)); const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); @@ -154,7 +155,7 @@ StressStateType CoulombWithTensionCutOffImpl::DoReturnMapping(const StressStateT Geo::SigmaTau CoulombWithTensionCutOffImpl::CalculateCornerPoint() const { - const auto tensile_strength = mTensionCutOff.GetTensileStrength(); + const auto tensile_strength = mTensionCutOff->GetTensileStrength(); if (const auto apex = mCoulombYieldSurface.CalculateApex(); tensile_strength > apex.Sigma()) return apex; @@ -167,7 +168,7 @@ Geo::SigmaTau CoulombWithTensionCutOffImpl::CalculateCornerPoint() const bool CoulombWithTensionCutOffImpl::IsStressAtTensionApexReturnZone(const Geo::SigmaTau& rTrialTraction) const { - const auto tensile_strength = mTensionCutOff.GetTensileStrength(); + const auto tensile_strength = mTensionCutOff->GetTensileStrength(); return tensile_strength < mCoulombYieldSurface.CalculateApex().Sigma() && rTrialTraction.Sigma() - rTrialTraction.Tau() - tensile_strength > 0.0; } @@ -175,7 +176,7 @@ bool CoulombWithTensionCutOffImpl::IsStressAtTensionApexReturnZone(const Geo::Si bool CoulombWithTensionCutOffImpl::IsStressAtTensionCutoffReturnZone(const Geo::SigmaTau& rTrialTraction) const { const auto corner_point = CalculateCornerPoint(); - return mTensionCutOff.GetTensileStrength() < mCoulombYieldSurface.CalculateApex().Sigma() && + return mTensionCutOff->GetTensileStrength() < mCoulombYieldSurface.CalculateApex().Sigma() && corner_point.Tau() - rTrialTraction.Tau() - corner_point.Sigma() + rTrialTraction.Sigma() > 0.0; } @@ -192,7 +193,7 @@ bool CoulombWithTensionCutOffImpl::IsStressAtCornerReturnZone(const Geo::SigmaTa Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtTensionApexReturnZone(const Geo::SigmaTau&) const { - return Geo::SigmaTau{mTensionCutOff.GetTensileStrength(), 0.0}; + return Geo::SigmaTau{mTensionCutOff->GetTensileStrength(), 0.0}; } Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionApexReturnZone( @@ -210,8 +211,8 @@ Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoffReturnZon Geo::PrincipalStresses::AveragingType AveragingType) const { const auto derivative_of_flow_function = - mTensionCutOff.DerivativeOfFlowFunction(rTrialTraction, AveragingType); - const auto lambda = mTensionCutOff.CalculatePlasticMultiplier( + mTensionCutOff->DerivativeOfFlowFunction(rTrialTraction, AveragingType); + const auto lambda = mTensionCutOff->CalculatePlasticMultiplier( rTrialTraction, derivative_of_flow_function, rElasticConstitutiveTensor); return rTrialTraction + Geo::SigmaTau{lambda * prod(rElasticConstitutiveTensor, derivative_of_flow_function)}; @@ -223,8 +224,8 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoff Geo::PrincipalStresses::AveragingType AveragingType) const { const auto derivative_of_flow_function = - mTensionCutOff.DerivativeOfFlowFunction(rTrialPrincipalStresses, AveragingType); - const auto lambda = mTensionCutOff.CalculatePlasticMultiplier( + mTensionCutOff->DerivativeOfFlowFunction(rTrialPrincipalStresses, AveragingType); + const auto lambda = mTensionCutOff->CalculatePlasticMultiplier( rTrialPrincipalStresses, derivative_of_flow_function, rElasticConstitutiveTensor); return rTrialPrincipalStresses + Geo::PrincipalStresses{lambda * prod(subrange(rElasticConstitutiveTensor, 0, 3, 0, 3), @@ -264,7 +265,7 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( Geo::PrincipalStresses::AveragingType AveragingType) const { if (const auto apex = mCoulombYieldSurface.CalculateApex(); - mTensionCutOff.GetTensileStrength() > apex.Sigma()) + mTensionCutOff->GetTensileStrength() > apex.Sigma()) return StressStrainUtilities::TransformSigmaTauToPrincipalStresses(apex, rTrialPrincipalStresses); const auto principal_stress_correction_Coulomb = CalculatePrincipalStressCorrection( @@ -273,7 +274,7 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( StressStrainUtilities::TransformPrincipalStressesToSigmaTau(principal_stress_correction_Coulomb); const auto principal_stress_correction_tension_cut_off = CalculatePrincipalStressCorrection( - rTrialPrincipalStresses, AveragingType, rElasticConstitutiveTensor, mTensionCutOff); + rTrialPrincipalStresses, AveragingType, rElasticConstitutiveTensor, *mTensionCutOff); const auto traction_correction_tension_cut_off = StressStrainUtilities::TransformPrincipalStressesToSigmaTau(principal_stress_correction_tension_cut_off); @@ -290,7 +291,7 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( const auto b = UblasUtilities::CreateVector( {-1.0 * mCoulombYieldSurface.YieldFunctionValue(rTrialPrincipalStresses), - -1.0 * mTensionCutOff.YieldFunctionValue(rTrialPrincipalStresses)}); + -1.0 * mTensionCutOff->YieldFunctionValue(rTrialPrincipalStresses)}); const auto plastic_multipliers = Vector{prod(A_inverse, b)}; return rTrialPrincipalStresses + @@ -315,14 +316,14 @@ PlasticityStatus CoulombWithTensionCutOffImpl::GetPlasticityStatus() const void CoulombWithTensionCutOffImpl::save(Serializer& rSerializer) const { rSerializer.save("CoulombYieldSurface", mCoulombYieldSurface); - rSerializer.save("TensionCutOff", mTensionCutOff); + rSerializer.save("TensionCutOff", *mTensionCutOff); rSerializer.save("PlasticityStatus", static_cast(mPlasticityStatus)); } void CoulombWithTensionCutOffImpl::load(Serializer& rSerializer) { rSerializer.load("CoulombYieldSurface", mCoulombYieldSurface); - rSerializer.load("TensionCutOff", mTensionCutOff); + rSerializer.load("TensionCutOff", *mTensionCutOff); int plasticity_status; rSerializer.load("PlasticityStatus", plasticity_status); mPlasticityStatus = static_cast(plasticity_status); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h index 7b3bbeeca557..ac29de859e32 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h @@ -15,6 +15,8 @@ #pragma once +#include + #include "coulomb_yield_surface.h" #include "custom_constitutive/principal_stresses.hpp" #include "geo_mechanics_application_constants.h" @@ -52,12 +54,12 @@ class CoulombWithTensionCutOffImpl [[nodiscard]] PlasticityStatus GetPlasticityStatus() const; private: - CoulombYieldSurface mCoulombYieldSurface; - TensionCutoff mTensionCutOff; - double mSavedKappaOfCoulombYieldSurface{0.0}; - double mAbsoluteYieldFunctionValueTolerance{1.0e-8}; - std::size_t mMaxNumberOfPlasticIterations{100}; - PlasticityStatus mPlasticityStatus{PlasticityStatus::ELASTIC}; + CoulombYieldSurface mCoulombYieldSurface; + std::optional mTensionCutOff; + double mSavedKappaOfCoulombYieldSurface{0.0}; + double mAbsoluteYieldFunctionValueTolerance{1.0e-8}; + std::size_t mMaxNumberOfPlasticIterations{100}; + PlasticityStatus mPlasticityStatus{PlasticityStatus::ELASTIC}; template [[nodiscard]] bool IsAdmissibleStressState(const StressStateType& rTrialStressState); From b803901d9dd720c4e718352e287d721b2ac62123 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 1 Jun 2026 11:54:26 +0200 Subject: [PATCH 02/27] Added the GEO_ENABLE_TENSION_CUT_OFF variable and construct the tension cutoff object based on that --- .../coulomb_with_tension_cut_off_impl.cpp | 9 ++++++++- .../coulomb_with_tension_cut_off_impl.h | 1 + .../geo_mechanics_application.cpp | 1 + .../geo_mechanics_application_variables.cpp | 1 + .../geo_mechanics_application_variables.h | 1 + .../MaterialParameters_stage2.json | 1 + .../mohr_coulomb/MaterialParameters.json | 12 ++++++++++++ ..._interface_coulomb_with_tension_cut_off.cpp | 7 +++++++ .../test_mohr_coulomb_with_tension_cutoff.cpp | 18 ++++++++++++++++++ .../MaterialParameters.json | 16 ++++++++++++++++ .../mohr_coulomb/MaterialParameters.json | 1 + .../mohr_coulomb/MaterialParameters.json | 1 + .../drained/MaterialParameters.json | 1 + .../common/MaterialParameters2D.json | 1 + .../common/MaterialParameters3D.json | 1 + .../MaterialParameters.json | 1 + .../MaterialParameters.json | 3 ++- .../MaterialParameters2D.json | 1 + 18 files changed, 75 insertions(+), 2 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp index 81d19d6cb78f..75a6df61faaa 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp @@ -42,10 +42,17 @@ auto CalculatePrincipalStressCorrection(const Geo::PrincipalStresses& rTrialPrin namespace Kratos { +std::optional CoulombWithTensionCutOffImpl::CreateOptionalTensionCutOff(const Properties& rMaterialProperties) +{ + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { + return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); + } + return std::nullopt; +} CoulombWithTensionCutOffImpl::CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties) : mCoulombYieldSurface{rMaterialProperties}, - mTensionCutOff{std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH])} + mTensionCutOff{(CreateOptionalTensionCutOff(rMaterialProperties))} { if (rMaterialProperties.Has(GEO_ABS_YIELD_FUNCTION_TOLERANCE)) { mAbsoluteYieldFunctionValueTolerance = rMaterialProperties[GEO_ABS_YIELD_FUNCTION_TOLERANCE]; diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h index ac29de859e32..0779314ceefe 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h @@ -37,6 +37,7 @@ class CoulombWithTensionCutOffImpl { public: CoulombWithTensionCutOffImpl() = default; + std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties); explicit CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties); [[nodiscard]] bool IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction); diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index f7b5ffb27519..84232fd81020 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -379,6 +379,7 @@ void KratosGeoMechanicsApplication::Register() KRATOS_REGISTER_VARIABLE(GEO_COHESION) KRATOS_REGISTER_VARIABLE(GEO_FRICTION_ANGLE) KRATOS_REGISTER_VARIABLE(GEO_DILATANCY_ANGLE) + KRATOS_REGISTER_VARIABLE(GEO_ENABLE_TENSION_CUT_OFF) KRATOS_REGISTER_VARIABLE(GEO_TENSILE_STRENGTH) KRATOS_REGISTER_VARIABLE(GEO_COULOMB_HARDENING_TYPE) KRATOS_REGISTER_VARIABLE(GEO_COHESION_FUNCTION_COEFFICIENTS) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp index 1552d48d1da6..390acab5eed2 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp @@ -35,6 +35,7 @@ KRATOS_CREATE_VARIABLE(double, GEO_COHESION) KRATOS_CREATE_VARIABLE(double, GEO_FRICTION_ANGLE) KRATOS_CREATE_VARIABLE(double, GEO_DILATANCY_ANGLE) KRATOS_CREATE_VARIABLE(double, GEO_TENSILE_STRENGTH) +KRATOS_CREATE_VARIABLE(bool, GEO_ENABLE_TENSION_CUT_OFF) KRATOS_CREATE_VARIABLE(std::string, GEO_COULOMB_HARDENING_TYPE) KRATOS_CREATE_VARIABLE(Vector, GEO_COHESION_FUNCTION_COEFFICIENTS) KRATOS_CREATE_VARIABLE(Vector, GEO_FRICTION_ANGLE_FUNCTION_COEFFICIENTS) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h index ba0a8a1cf571..6a8cf710867d 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h @@ -65,6 +65,7 @@ KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, double, GEO_COHESI KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, double, GEO_FRICTION_ANGLE) KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, double, GEO_DILATANCY_ANGLE) KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, double, GEO_TENSILE_STRENGTH) +KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, bool, GEO_ENABLE_TENSION_CUT_OFF) KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, std::string, GEO_COULOMB_HARDENING_TYPE) KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, Vector, GEO_COHESION_FUNCTION_COEFFICIENTS) KRATOS_DEFINE_APPLICATION_VARIABLE(GEO_MECHANICS_APPLICATION, Vector, GEO_FRICTION_ANGLE_FUNCTION_COEFFICIENTS) diff --git a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json index c1e82fc3e579..e95840b3a5e1 100644 --- a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json +++ b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json @@ -25,6 +25,7 @@ "GEO_COHESION" : 1000.0, "GEO_FRICTION_ANGLE" : 30.0, "GEO_TENSILE_STRENGTH" : 1000.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE" : 0.0 } } diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index bcc1771c8e4b..5ef73afac955 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -28,6 +28,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -60,6 +61,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -92,6 +94,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -124,6 +127,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -156,6 +160,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -188,6 +193,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -205,6 +211,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -228,6 +235,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -251,6 +259,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -274,6 +283,7 @@ "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 2.1445e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -297,6 +307,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -320,6 +331,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp index 99a8a163496d..32be53518fbb 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp @@ -63,6 +63,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -129,6 +130,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -168,6 +170,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -209,6 +212,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -248,6 +252,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -289,6 +294,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_DoesNotCalculateStre properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -324,6 +330,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp index 92ffbfaefe5c..2b4635984310 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp @@ -114,6 +114,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); @@ -151,6 +152,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.25); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -218,6 +220,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.25); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -273,6 +276,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -324,6 +328,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -367,6 +372,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 20.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -393,6 +399,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -450,6 +457,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatr properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); parameters.GetOptions().Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR); @@ -562,6 +570,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -594,6 +603,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); ConstitutiveLaw::Parameters parameters; @@ -622,6 +632,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); ConstitutiveLaw::Parameters parameters; @@ -653,6 +664,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); const auto tensile_strength = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); properties.SetValue(GEO_TENSILE_STRENGTH, tensile_strength); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.15); ConstitutiveLaw::Parameters parameters; @@ -690,6 +702,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -724,6 +737,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_DoesNotCalculateStressWhe properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -758,6 +772,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -784,6 +799,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_MAX_PLASTIC_ITERATIONS, 100); @@ -844,6 +860,7 @@ Vector ComputeStressVectorUsingCPhiReductionTestData(double Cohesion, properties.SetValue(GEO_FRICTION_ANGLE, FrictionAngle); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); @@ -965,6 +982,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutoff_InitialPlasticityStatusEq properties.SetValue(GEO_FRICTION_ANGLE, 30.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json index bd899aa43de6..d91f3165be76 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json @@ -24,6 +24,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -52,6 +53,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -80,6 +82,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -108,6 +111,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -136,6 +140,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -164,6 +169,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -192,6 +198,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -220,6 +227,7 @@ "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -239,6 +247,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -262,6 +271,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -285,6 +295,7 @@ "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -308,6 +319,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -331,6 +343,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -354,6 +367,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -377,6 +391,7 @@ "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -400,6 +415,7 @@ "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json index 15deed90d5b6..a9bfff3608a5 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json @@ -18,6 +18,7 @@ "GEO_COHESION": 2.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json index 15deed90d5b6..a9bfff3608a5 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json @@ -18,6 +18,7 @@ "GEO_COHESION": 2.0e+03, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json index ca1cb4612993..1def02c2da8f 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json @@ -18,6 +18,7 @@ "GEO_COHESION": 2.0, "GEO_FRICTION_ANGLE": 25.0, "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json index 0cb6641b1949..cef0a5d9c8cd 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json @@ -25,6 +25,7 @@ "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, "GEO_TENSILE_STRENGTH" : 10.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 20.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json index 72277b663d61..795206a59721 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json @@ -28,6 +28,7 @@ "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, "GEO_TENSILE_STRENGTH" : 10.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 20.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json index d3647ba860ad..018683906155 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json @@ -12,6 +12,7 @@ "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, "GEO_TENSILE_STRENGTH" : 10.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 0.0, "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED" } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json index 86e8e7c58e00..9aa69a935ee0 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json @@ -22,7 +22,8 @@ "GEO_COHESION" : 1000.0, "GEO_FRICTION_ANGLE" : 30.0, "GEO_DILATANCY_ANGLE" : 0.0, - "GEO_TENSILE_STRENGTH" : 1000.0 + "GEO_TENSILE_STRENGTH" : 1000.0, + "GEO_ENABLE_TENSION_CUT_OFF": true } } }] diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json index bfe3bba355c0..3d73abc2936e 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json @@ -25,6 +25,7 @@ "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, "GEO_TENSILE_STRENGTH" : 10.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 20.0 } } From 2371c82a006d1223a88d9f6ad2bffc67eb2da467 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 1 Jun 2026 16:47:17 +0200 Subject: [PATCH 03/27] Fixed typo in README of Mohr Coulomb --- .../GeoMechanicsApplication/custom_constitutive/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/README.md b/applications/GeoMechanicsApplication/custom_constitutive/README.md index 8372890701fa..be5eb35462cb 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/README.md +++ b/applications/GeoMechanicsApplication/custom_constitutive/README.md @@ -132,7 +132,7 @@ To incorporate the Mohr-Coulomb model with tension cutoff in numerical simulatio ``` where $`\psi`$ is the dilatancy angle. -5. If after mapping, the condidition $`\sigma_1 \ge \sigma_2 \ge \sigma_3`$ is not valid, average the principal stresses of stage 2 and the direction of the mapping and map the principal stresses again. +5. If after mapping, the condition $`\sigma_1 \ge \sigma_2 \ge \sigma_3`$ is not valid, average the principal stresses of stage 2 and the direction of the mapping and map the principal stresses again. - If $`\sigma_1 \le \sigma_2`$ set: ```math From e959925e47f20ef89fd1b4ea10a7bcaf2ce64133 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 1 Jun 2026 16:51:57 +0200 Subject: [PATCH 04/27] Made the usage of the tension cut-off optional --- .../coulomb_with_tension_cut_off_impl.cpp | 21 ++++++++++++------- .../test_mohr_coulomb_with_tension_cutoff.cpp | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp index 75a6df61faaa..090e4f3168bc 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp @@ -106,13 +106,17 @@ template bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const StressStateType& rTrialStressState) { const auto coulomb_yield_function_value = mCoulombYieldSurface.YieldFunctionValue(rTrialStressState); - const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); - constexpr auto tolerance = 1.0e-10; + constexpr auto tolerance = 1.0e-10; const auto coulomb_tolerance = tolerance * (1.0 + std::abs(coulomb_yield_function_value)); - const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); - const auto admissible_state = coulomb_yield_function_value < coulomb_tolerance && - tension_yield_function_value < tension_tolerance; + auto tension_admissable = true; + if (mTensionCutOff) { + const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); + const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); + tension_admissable = tension_yield_function_value < tension_tolerance; + } + + const auto admissible_state = coulomb_yield_function_value < coulomb_tolerance && tension_admissable; if (admissible_state) mPlasticityStatus = PlasticityStatus::ELASTIC; return admissible_state; } @@ -129,12 +133,12 @@ StressStateType CoulombWithTensionCutOffImpl::DoReturnMapping(const StressStateT auto kappa_start = mCoulombYieldSurface.GetKappa(); for (auto counter = std::size_t{0}; counter < mMaxNumberOfPlasticIterations; ++counter) { - if (IsStressAtTensionApexReturnZone(trial_traction)) { + if (mTensionCutOff && IsStressAtTensionApexReturnZone(trial_traction)) { mPlasticityStatus = PlasticityStatus::TENSION_APEX; return ReturnStressAtTensionApexReturnZone(rTrialStressState); } - if (IsStressAtTensionCutoffReturnZone(trial_traction)) { + if (mTensionCutOff && IsStressAtTensionCutoffReturnZone(trial_traction)) { mPlasticityStatus = PlasticityStatus::TENSION_CUT_OFF; return ReturnStressAtTensionCutoffReturnZone(rTrialStressState, rElasticConstitutiveTensor, AveragingType); @@ -162,6 +166,7 @@ StressStateType CoulombWithTensionCutOffImpl::DoReturnMapping(const StressStateT Geo::SigmaTau CoulombWithTensionCutOffImpl::CalculateCornerPoint() const { + if (const auto apex = mCoulombYieldSurface.CalculateApex(); !mTensionCutOff) return apex; const auto tensile_strength = mTensionCutOff->GetTensileStrength(); if (const auto apex = mCoulombYieldSurface.CalculateApex(); tensile_strength > apex.Sigma()) return apex; @@ -272,7 +277,7 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( Geo::PrincipalStresses::AveragingType AveragingType) const { if (const auto apex = mCoulombYieldSurface.CalculateApex(); - mTensionCutOff->GetTensileStrength() > apex.Sigma()) + !mTensionCutOff || mTensionCutOff->GetTensileStrength() > apex.Sigma()) return StressStrainUtilities::TransformSigmaTauToPrincipalStresses(apex, rTrialPrincipalStresses); const auto principal_stress_correction_Coulomb = CalculatePrincipalStressCorrection( diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp index 2b4635984310..5b64d6e85b25 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp @@ -664,7 +664,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); const auto tensile_strength = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); properties.SetValue(GEO_TENSILE_STRENGTH, tensile_strength); - properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, false); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.15); ConstitutiveLaw::Parameters parameters; From 60b720e123924575004a28ceb428a8764fc585e8 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 1 Jun 2026 16:55:47 +0200 Subject: [PATCH 05/27] Removed redundant parentheses --- .../custom_constitutive/coulomb_with_tension_cut_off_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp index 090e4f3168bc..99237ed78306 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp @@ -52,7 +52,7 @@ std::optional CoulombWithTensionCutOffImpl::CreateOptionalTension CoulombWithTensionCutOffImpl::CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties) : mCoulombYieldSurface{rMaterialProperties}, - mTensionCutOff{(CreateOptionalTensionCutOff(rMaterialProperties))} + mTensionCutOff{CreateOptionalTensionCutOff(rMaterialProperties)} { if (rMaterialProperties.Has(GEO_ABS_YIELD_FUNCTION_TOLERANCE)) { mAbsoluteYieldFunctionValueTolerance = rMaterialProperties[GEO_ABS_YIELD_FUNCTION_TOLERANCE]; From 78b6f0d052a36a3adbdeb9a4889f861d4f882320 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 1 Jun 2026 17:04:15 +0200 Subject: [PATCH 06/27] Clarified meaning of variable (hopefully correct) --- .../test_mohr_coulomb_with_tension_cutoff.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp index 5b64d6e85b25..0a4e28186ce4 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp @@ -662,9 +662,6 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT constexpr auto cohesion = 10.0; properties.SetValue(GEO_COHESION, cohesion); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - const auto tensile_strength = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); - properties.SetValue(GEO_TENSILE_STRENGTH, tensile_strength); - properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, false); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.15); ConstitutiveLaw::Parameters parameters; @@ -674,8 +671,9 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT law.InitializeMaterial(properties, dummy_element_geometry, dummy_shape_function_values); // Act - auto cauchy_stress_vector = UblasUtilities::CreateVector( - {tensile_strength + 20.0, tensile_strength + 10.0, tensile_strength, 0.0}); + const auto sigma_corner = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); + auto cauchy_stress_vector = + UblasUtilities::CreateVector({sigma_corner + 20.0, sigma_corner + 10.0, sigma_corner, 0.0}); const auto resulting_cauchy_stress_vector = CalculateMappedStressVector(cauchy_stress_vector, parameters, law); auto plasticity_status = 0; @@ -683,7 +681,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT // Assert const auto expected_cauchy_stress_vector = - UblasUtilities::CreateVector({tensile_strength, tensile_strength, tensile_strength, 0.0}); + UblasUtilities::CreateVector({sigma_corner, sigma_corner, sigma_corner, 0.0}); KRATOS_EXPECT_VECTOR_NEAR(resulting_cauchy_stress_vector, expected_cauchy_stress_vector, Defaults::absolute_tolerance); KRATOS_EXPECT_EQ(plasticity_status, static_cast(PlasticityStatus::TENSION_MOHR_COULOMB_CORNER)); From 20a319fd49a4a837c854e2c7f6039c93551235a4 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Wed, 3 Jun 2026 12:10:09 +0200 Subject: [PATCH 07/27] Attempt at fixing serialization --- .../coulomb_with_tension_cut_off_impl.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp index 99237ed78306..cfff61937f94 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp @@ -328,14 +328,23 @@ PlasticityStatus CoulombWithTensionCutOffImpl::GetPlasticityStatus() const void CoulombWithTensionCutOffImpl::save(Serializer& rSerializer) const { rSerializer.save("CoulombYieldSurface", mCoulombYieldSurface); - rSerializer.save("TensionCutOff", *mTensionCutOff); + rSerializer.save("HasTensionCutOff", mTensionCutOff.has_value()); + if (mTensionCutOff.has_value()) + rSerializer.save("TensionCutOff", *mTensionCutOff); rSerializer.save("PlasticityStatus", static_cast(mPlasticityStatus)); } void CoulombWithTensionCutOffImpl::load(Serializer& rSerializer) { rSerializer.load("CoulombYieldSurface", mCoulombYieldSurface); - rSerializer.load("TensionCutOff", *mTensionCutOff); + bool HasTensionCutOff; + rSerializer.load("HasTensionCutOff", HasTensionCutOff); + if (HasTensionCutOff) + { + TensionCutoff tension_cutoff; + rSerializer.load("TensionCutoff", tension_cutoff); + mTensionCutOff = std::make_optional(tension_cutoff); + } int plasticity_status; rSerializer.load("PlasticityStatus", plasticity_status); mPlasticityStatus = static_cast(plasticity_status); From f6e480c9673ed526ff630497ce46a6a195fd9818 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Wed, 3 Jun 2026 15:00:16 +0200 Subject: [PATCH 08/27] Converted an integration test to use mohr coulomb without tension cut-off --- ...interface_coulomb_with_tension_cut_off.cpp | 11 +++++---- .../mohr_coulomb_with_tension_cutoff.cpp | 11 +++++---- .../mohr_coulomb/MaterialParameters.json | 24 +++++++------------ 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp index 93d2e521651d..9f52bd042944 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp @@ -93,10 +93,13 @@ int InterfaceCoulombWithTensionCutOff::Check(const Properties& rMaterialProper constexpr auto max_value_angle = 90.0; check_properties.SingleUseBounds(CheckProperties::Bounds::AllExclusive).Check(GEO_FRICTION_ANGLE, 0.0, max_value_angle); check_properties.Check(GEO_DILATANCY_ANGLE, rMaterialProperties[GEO_FRICTION_ANGLE]); - check_properties.Check( - GEO_TENSILE_STRENGTH, - rMaterialProperties[GEO_COHESION] / - std::tan(MathUtils<>::DegreesToRadians(rMaterialProperties[GEO_FRICTION_ANGLE]))); + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) + { + check_properties.Check( + GEO_TENSILE_STRENGTH, + rMaterialProperties[GEO_COHESION] / + std::tan(MathUtils<>::DegreesToRadians(rMaterialProperties[GEO_FRICTION_ANGLE]))); + } check_properties.Check(INTERFACE_NORMAL_STIFFNESS); check_properties.Check(INTERFACE_SHEAR_STIFFNESS); return result; diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp index f42a376b55ea..95d3e789f9fa 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp @@ -137,10 +137,13 @@ int MohrCoulombWithTensionCutOff::Check(const Properties& rMaterialProperties, const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); const CheckProperties check_properties(rMaterialProperties, "property", CheckProperties::Bounds::AllInclusive); - check_properties.Check( - GEO_TENSILE_STRENGTH, - rMaterialProperties[GEO_COHESION] / - std::tan(MathUtils<>::DegreesToRadians(rMaterialProperties[GEO_FRICTION_ANGLE]))); + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) + { + check_properties.Check( + GEO_TENSILE_STRENGTH, + rMaterialProperties[GEO_COHESION] / + std::tan(MathUtils<>::DegreesToRadians(rMaterialProperties[GEO_FRICTION_ANGLE]))); + } check_properties.Check(YOUNG_MODULUS); constexpr auto max_value_poisson_ratio = 0.5; check_properties.Check(POISSON_RATIO, max_value_poisson_ratio); diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index 5ef73afac955..a0f14bf2b77e 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -27,8 +27,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -60,8 +59,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -93,8 +91,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -126,8 +123,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -210,8 +206,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0869565e+07, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -234,8 +229,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0869565e+07, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -258,8 +252,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0869565e+07, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -282,8 +275,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0869565e+07, "GEO_COHESION": 1.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 2.1445e+03, - "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", From e16733c3aaa2b452dda82433ba7a05f6a6d00153 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Wed, 3 Jun 2026 15:21:41 +0200 Subject: [PATCH 09/27] Renamed laws and impl --- ...sion_cut_off_impl.cpp => coulomb_impl.cpp} | 101 ++++++++--------- ..._tension_cut_off_impl.h => coulomb_impl.h} | 6 +- ...sion_cut_off.cpp => interface_coulomb.cpp} | 77 ++++++------- ..._tension_cut_off.h => interface_coulomb.h} | 22 ++-- ...th_tension_cutoff.cpp => mohr_coulomb.cpp} | 88 +++++++-------- ...b_with_tension_cutoff.h => mohr_coulomb.h} | 22 ++-- .../apply_c_phi_reduction_process.cpp | 7 +- .../geo_mechanics_application.cpp | 6 +- .../geo_mechanics_application.h | 11 +- ...interface_coulomb_with_tension_cut_off.cpp | 66 +++++------ .../test_mohr_coulomb_with_tension_cutoff.cpp | 105 +++++++++--------- 11 files changed, 241 insertions(+), 270 deletions(-) rename applications/GeoMechanicsApplication/custom_constitutive/{coulomb_with_tension_cut_off_impl.cpp => coulomb_impl.cpp} (77%) rename applications/GeoMechanicsApplication/custom_constitutive/{coulomb_with_tension_cut_off_impl.h => coulomb_impl.h} (97%) rename applications/GeoMechanicsApplication/custom_constitutive/{interface_coulomb_with_tension_cut_off.cpp => interface_coulomb.cpp} (66%) rename applications/GeoMechanicsApplication/custom_constitutive/{interface_coulomb_with_tension_cut_off.h => interface_coulomb.h} (77%) rename applications/GeoMechanicsApplication/custom_constitutive/{mohr_coulomb_with_tension_cutoff.cpp => mohr_coulomb.cpp} (68%) rename applications/GeoMechanicsApplication/custom_constitutive/{mohr_coulomb_with_tension_cutoff.h => mohr_coulomb.h} (76%) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp similarity index 77% rename from applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp rename to applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index cfff61937f94..e1cd159f812b 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -13,7 +13,7 @@ // Anne van de Graaf // -#include "custom_constitutive/coulomb_with_tension_cut_off_impl.h" +#include "custom_constitutive/coulomb_impl.h" #include "custom_constitutive/principal_stresses.hpp" #include "custom_constitutive/sigma_tau.hpp" #include "custom_utilities/stress_strain_utilities.h" @@ -42,7 +42,7 @@ auto CalculatePrincipalStressCorrection(const Geo::PrincipalStresses& rTrialPrin namespace Kratos { -std::optional CoulombWithTensionCutOffImpl::CreateOptionalTensionCutOff(const Properties& rMaterialProperties) +std::optional CoulombImpl::CreateOptionalTensionCutOff(const Properties& rMaterialProperties) { if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); @@ -50,7 +50,7 @@ std::optional CoulombWithTensionCutOffImpl::CreateOptionalTension return std::nullopt; } -CoulombWithTensionCutOffImpl::CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties) +CoulombImpl::CoulombImpl(const Properties& rMaterialProperties) : mCoulombYieldSurface{rMaterialProperties}, mTensionCutOff{CreateOptionalTensionCutOff(rMaterialProperties)} { @@ -63,27 +63,27 @@ CoulombWithTensionCutOffImpl::CoulombWithTensionCutOffImpl(const Properties& rMa } } -bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction) +bool CoulombImpl::IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction) { return IsAdmissibleStressState<>(rTrialTraction); } -bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const Geo::PrincipalStresses& rTrialPrincipalStresses) +bool CoulombImpl::IsAdmissibleStressState(const Geo::PrincipalStresses& rTrialPrincipalStresses) { return IsAdmissibleStressState<>(rTrialPrincipalStresses); } -Geo::SigmaTau CoulombWithTensionCutOffImpl::DoReturnMapping(const Geo::SigmaTau& rTrialTraction, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) +Geo::SigmaTau CoulombImpl::DoReturnMapping(const Geo::SigmaTau& rTrialTraction, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) { auto sigma_tau_to_sigma_tau = [](const Geo::SigmaTau& rTraction) { return rTraction; }; return DoReturnMapping<>(rTrialTraction, sigma_tau_to_sigma_tau, rElasticConstitutiveTensor, AveragingType); } -Geo::PrincipalStresses CoulombWithTensionCutOffImpl::DoReturnMapping(const Geo::PrincipalStresses& rTrialPrincipalStresses, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) +Geo::PrincipalStresses CoulombImpl::DoReturnMapping(const Geo::PrincipalStresses& rTrialPrincipalStresses, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) { auto principal_stresses_to_sigma_tau = [](const Geo::PrincipalStresses& rPrincipalStresses) { return StressStrainUtilities::TransformPrincipalStressesToSigmaTau(rPrincipalStresses); @@ -92,18 +92,18 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::DoReturnMapping(const Geo:: rElasticConstitutiveTensor, AveragingType); } -void CoulombWithTensionCutOffImpl::SaveKappaOfCoulombYieldSurface() +void CoulombImpl::SaveKappaOfCoulombYieldSurface() { mSavedKappaOfCoulombYieldSurface = mCoulombYieldSurface.GetKappa(); } -void CoulombWithTensionCutOffImpl::RestoreKappaOfCoulombYieldSurface() +void CoulombImpl::RestoreKappaOfCoulombYieldSurface() { mCoulombYieldSurface.SetKappa(mSavedKappaOfCoulombYieldSurface); } template -bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const StressStateType& rTrialStressState) +bool CoulombImpl::IsAdmissibleStressState(const StressStateType& rTrialStressState) { const auto coulomb_yield_function_value = mCoulombYieldSurface.YieldFunctionValue(rTrialStressState); constexpr auto tolerance = 1.0e-10; @@ -122,10 +122,10 @@ bool CoulombWithTensionCutOffImpl::IsAdmissibleStressState(const StressStateType } template -StressStateType CoulombWithTensionCutOffImpl::DoReturnMapping(const StressStateType& rTrialStressState, - const StressStateToSigmaTauFunctionType& rStressStateToSigmaTau, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) +StressStateType CoulombImpl::DoReturnMapping(const StressStateType& rTrialStressState, + const StressStateToSigmaTauFunctionType& rStressStateToSigmaTau, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) { auto result = StressStateType{}; @@ -164,7 +164,7 @@ StressStateType CoulombWithTensionCutOffImpl::DoReturnMapping(const StressStateT return result; } -Geo::SigmaTau CoulombWithTensionCutOffImpl::CalculateCornerPoint() const +Geo::SigmaTau CoulombImpl::CalculateCornerPoint() const { if (const auto apex = mCoulombYieldSurface.CalculateApex(); !mTensionCutOff) return apex; const auto tensile_strength = mTensionCutOff->GetTensileStrength(); @@ -178,22 +178,22 @@ Geo::SigmaTau CoulombWithTensionCutOffImpl::CalculateCornerPoint() const (cohesion * cos_phi - tensile_strength * sin_phi) / (1.0 - sin_phi)}; } -bool CoulombWithTensionCutOffImpl::IsStressAtTensionApexReturnZone(const Geo::SigmaTau& rTrialTraction) const +bool CoulombImpl::IsStressAtTensionApexReturnZone(const Geo::SigmaTau& rTrialTraction) const { const auto tensile_strength = mTensionCutOff->GetTensileStrength(); return tensile_strength < mCoulombYieldSurface.CalculateApex().Sigma() && rTrialTraction.Sigma() - rTrialTraction.Tau() - tensile_strength > 0.0; } -bool CoulombWithTensionCutOffImpl::IsStressAtTensionCutoffReturnZone(const Geo::SigmaTau& rTrialTraction) const +bool CoulombImpl::IsStressAtTensionCutoffReturnZone(const Geo::SigmaTau& rTrialTraction) const { const auto corner_point = CalculateCornerPoint(); return mTensionCutOff->GetTensileStrength() < mCoulombYieldSurface.CalculateApex().Sigma() && corner_point.Tau() - rTrialTraction.Tau() - corner_point.Sigma() + rTrialTraction.Sigma() > 0.0; } -bool CoulombWithTensionCutOffImpl::IsStressAtCornerReturnZone(const Geo::SigmaTau& rTrialTraction, - Geo::PrincipalStresses::AveragingType AveragingType) const +bool CoulombImpl::IsStressAtCornerReturnZone(const Geo::SigmaTau& rTrialTraction, + Geo::PrincipalStresses::AveragingType AveragingType) const { const auto corner_point = CalculateCornerPoint(); const auto derivative_of_flow_function = @@ -203,13 +203,12 @@ bool CoulombWithTensionCutOffImpl::IsStressAtCornerReturnZone(const Geo::SigmaTa 0.0; } -Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtTensionApexReturnZone(const Geo::SigmaTau&) const +Geo::SigmaTau CoulombImpl::ReturnStressAtTensionApexReturnZone(const Geo::SigmaTau&) const { return Geo::SigmaTau{mTensionCutOff->GetTensileStrength(), 0.0}; } -Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionApexReturnZone( - const Geo::PrincipalStresses& rTrialPrincipalStresses) const +Geo::PrincipalStresses CoulombImpl::ReturnStressAtTensionApexReturnZone(const Geo::PrincipalStresses& rTrialPrincipalStresses) const { return StressStrainUtilities::TransformSigmaTauToPrincipalStresses( ReturnStressAtTensionApexReturnZone( @@ -217,10 +216,9 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionApexRe rTrialPrincipalStresses); } -Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoffReturnZone( - const Geo::SigmaTau& rTrialTraction, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) const +Geo::SigmaTau CoulombImpl::ReturnStressAtTensionCutoffReturnZone(const Geo::SigmaTau& rTrialTraction, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) const { const auto derivative_of_flow_function = mTensionCutOff->DerivativeOfFlowFunction(rTrialTraction, AveragingType); @@ -230,7 +228,7 @@ Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoffReturnZon Geo::SigmaTau{lambda * prod(rElasticConstitutiveTensor, derivative_of_flow_function)}; } -Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoffReturnZone( +Geo::PrincipalStresses CoulombImpl::ReturnStressAtTensionCutoffReturnZone( const Geo::PrincipalStresses& rTrialPrincipalStresses, const Matrix& rElasticConstitutiveTensor, Geo::PrincipalStresses::AveragingType AveragingType) const @@ -244,10 +242,9 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtTensionCutoff derivative_of_flow_function)}; } -Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtRegularFailureZone( - const Geo::SigmaTau& rTrialTraction, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) const +Geo::SigmaTau CoulombImpl::ReturnStressAtRegularFailureZone(const Geo::SigmaTau& rTrialTraction, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) const { const auto derivative_of_flow_function = mCoulombYieldSurface.DerivativeOfFlowFunction(rTrialTraction, AveragingType); @@ -257,10 +254,9 @@ Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtRegularFailureZone( Geo::SigmaTau{lambda * prod(rElasticConstitutiveTensor, derivative_of_flow_function)}; } -Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtRegularFailureZone( - const Geo::PrincipalStresses& rTrialPrincipalStresses, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) const +Geo::PrincipalStresses CoulombImpl::ReturnStressAtRegularFailureZone(const Geo::PrincipalStresses& rTrialPrincipalStresses, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) const { const auto derivative_of_flow_function = mCoulombYieldSurface.DerivativeOfFlowFunction(rTrialPrincipalStresses, AveragingType); @@ -271,10 +267,9 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtRegularFailur derivative_of_flow_function)}; } -Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( - const Geo::PrincipalStresses& rTrialPrincipalStresses, - const Matrix& rElasticConstitutiveTensor, - Geo::PrincipalStresses::AveragingType AveragingType) const +Geo::PrincipalStresses CoulombImpl::ReturnStressAtCornerPoint(const Geo::PrincipalStresses& rTrialPrincipalStresses, + const Matrix& rElasticConstitutiveTensor, + Geo::PrincipalStresses::AveragingType AveragingType) const { if (const auto apex = mCoulombYieldSurface.CalculateApex(); !mTensionCutOff || mTensionCutOff->GetTensileStrength() > apex.Sigma()) @@ -312,35 +307,31 @@ Geo::PrincipalStresses CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( plastic_multipliers[1] * principal_stress_correction_tension_cut_off.Values()}; } -Geo::SigmaTau CoulombWithTensionCutOffImpl::ReturnStressAtCornerPoint( - const Geo::SigmaTau&, const Matrix&, Geo::PrincipalStresses::AveragingType AveragingType) const +Geo::SigmaTau CoulombImpl::ReturnStressAtCornerPoint(const Geo::SigmaTau&, + const Matrix&, + Geo::PrincipalStresses::AveragingType AveragingType) const { KRATOS_DEBUG_ERROR_IF(AveragingType != Geo::PrincipalStresses::AveragingType::NO_AVERAGING) << "When returning the traction to the corner point, averaging of principal stresses is not supported\n"; return CalculateCornerPoint(); } -PlasticityStatus CoulombWithTensionCutOffImpl::GetPlasticityStatus() const -{ - return mPlasticityStatus; -} +PlasticityStatus CoulombImpl::GetPlasticityStatus() const { return mPlasticityStatus; } -void CoulombWithTensionCutOffImpl::save(Serializer& rSerializer) const +void CoulombImpl::save(Serializer& rSerializer) const { rSerializer.save("CoulombYieldSurface", mCoulombYieldSurface); rSerializer.save("HasTensionCutOff", mTensionCutOff.has_value()); - if (mTensionCutOff.has_value()) - rSerializer.save("TensionCutOff", *mTensionCutOff); + if (mTensionCutOff.has_value()) rSerializer.save("TensionCutOff", *mTensionCutOff); rSerializer.save("PlasticityStatus", static_cast(mPlasticityStatus)); } -void CoulombWithTensionCutOffImpl::load(Serializer& rSerializer) +void CoulombImpl::load(Serializer& rSerializer) { rSerializer.load("CoulombYieldSurface", mCoulombYieldSurface); bool HasTensionCutOff; rSerializer.load("HasTensionCutOff", HasTensionCutOff); - if (HasTensionCutOff) - { + if (HasTensionCutOff) { TensionCutoff tension_cutoff; rSerializer.load("TensionCutoff", tension_cutoff); mTensionCutOff = std::make_optional(tension_cutoff); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h similarity index 97% rename from applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h rename to applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h index 0779314ceefe..4833eb704227 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_with_tension_cut_off_impl.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h @@ -33,12 +33,12 @@ namespace Geo class SigmaTau; } // namespace Geo -class CoulombWithTensionCutOffImpl +class CoulombImpl { public: - CoulombWithTensionCutOffImpl() = default; + CoulombImpl() = default; std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties); - explicit CoulombWithTensionCutOffImpl(const Properties& rMaterialProperties); + explicit CoulombImpl(const Properties& rMaterialProperties); [[nodiscard]] bool IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction); [[nodiscard]] bool IsAdmissibleStressState(const Geo::PrincipalStresses& rTrialPrincipalStresses); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp similarity index 66% rename from applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp rename to applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp index 9f52bd042944..ba35d321fc96 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp @@ -13,7 +13,7 @@ // // Application includes -#include "custom_constitutive/interface_coulomb_with_tension_cut_off.h" +#include "custom_constitutive/interface_coulomb.h" #include "custom_constitutive/constitutive_law_dimension.h" #include "custom_constitutive/sigma_tau.hpp" #include "custom_utilities/check_utilities.hpp" @@ -28,7 +28,7 @@ namespace Kratos { -InterfaceCoulombWithTensionCutOff::InterfaceCoulombWithTensionCutOff(std::unique_ptr pConstitutiveDimension) +InterfaceCoulomb::InterfaceCoulomb(std::unique_ptr pConstitutiveDimension) : mpConstitutiveDimension(std::move(pConstitutiveDimension)), mTractionVector(ZeroVector(mpConstitutiveDimension->GetStrainSize())), mTractionVectorFinalized(ZeroVector(mpConstitutiveDimension->GetStrainSize())), @@ -36,18 +36,18 @@ InterfaceCoulombWithTensionCutOff::InterfaceCoulombWithTensionCutOff(std::unique { } -ConstitutiveLaw::Pointer InterfaceCoulombWithTensionCutOff::Clone() const +ConstitutiveLaw::Pointer InterfaceCoulomb::Clone() const { - auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); + auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); p_result->mTractionVector = mTractionVector; p_result->mTractionVectorFinalized = mTractionVectorFinalized; p_result->mRelativeDisplacementVectorFinalized = mRelativeDisplacementVectorFinalized; - p_result->mCoulombWithTensionCutOffImpl = mCoulombWithTensionCutOffImpl; + p_result->mCoulombImpl = mCoulombImpl; p_result->mIsModelInitialized = mIsModelInitialized; return p_result; } -Vector& InterfaceCoulombWithTensionCutOff::GetValue(const Variable& rVariable, Vector& rValue) +Vector& InterfaceCoulomb::GetValue(const Variable& rVariable, Vector& rValue) { if (rVariable == GEO_EFFECTIVE_TRACTION_VECTOR) { rValue = mTractionVector; @@ -57,17 +57,15 @@ Vector& InterfaceCoulombWithTensionCutOff::GetValue(const Variable& rVar return rValue; } -int& InterfaceCoulombWithTensionCutOff::GetValue(const Variable& rVariable, int& rValue) +int& InterfaceCoulomb::GetValue(const Variable& rVariable, int& rValue) { if (rVariable == GEO_PLASTICITY_STATUS) { - rValue = static_cast(mCoulombWithTensionCutOffImpl.GetPlasticityStatus()); + rValue = static_cast(mCoulombImpl.GetPlasticityStatus()); } return rValue; } -void InterfaceCoulombWithTensionCutOff::SetValue(const Variable& rVariable, - const Vector& rValue, - const ProcessInfo& rCurrentProcessInfo) +void InterfaceCoulomb::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) { if (rVariable == GEO_EFFECTIVE_TRACTION_VECTOR) { mTractionVector = rValue; @@ -76,15 +74,15 @@ void InterfaceCoulombWithTensionCutOff::SetValue(const Variable& rVariab } } -SizeType InterfaceCoulombWithTensionCutOff::WorkingSpaceDimension() +SizeType InterfaceCoulomb::WorkingSpaceDimension() { // Note that this implementation assumes line interface elements. It needs to be modified when planar interface elements become available. return N_DIM_2D; } -int InterfaceCoulombWithTensionCutOff::Check(const Properties& rMaterialProperties, - const GeometryType& rElementGeometry, - const ProcessInfo& rCurrentProcessInfo) const +int InterfaceCoulomb::Check(const Properties& rMaterialProperties, + const GeometryType& rElementGeometry, + const ProcessInfo& rCurrentProcessInfo) const { const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); @@ -93,8 +91,7 @@ int InterfaceCoulombWithTensionCutOff::Check(const Properties& rMaterialProper constexpr auto max_value_angle = 90.0; check_properties.SingleUseBounds(CheckProperties::Bounds::AllExclusive).Check(GEO_FRICTION_ANGLE, 0.0, max_value_angle); check_properties.Check(GEO_DILATANCY_ANGLE, rMaterialProperties[GEO_FRICTION_ANGLE]); - if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) - { + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { check_properties.Check( GEO_TENSILE_STRENGTH, rMaterialProperties[GEO_COHESION] / @@ -105,31 +102,29 @@ int InterfaceCoulombWithTensionCutOff::Check(const Properties& rMaterialProper return result; } -ConstitutiveLaw::StressMeasure InterfaceCoulombWithTensionCutOff::GetStressMeasure() +ConstitutiveLaw::StressMeasure InterfaceCoulomb::GetStressMeasure() { return ConstitutiveLaw::StressMeasure_Cauchy; } -SizeType InterfaceCoulombWithTensionCutOff::GetStrainSize() const +SizeType InterfaceCoulomb::GetStrainSize() const { // Note that this implementation assumes line interface elements. It needs to be modified when planar interface elements become available. return VOIGT_SIZE_2D_INTERFACE; } -ConstitutiveLaw::StrainMeasure InterfaceCoulombWithTensionCutOff::GetStrainMeasure() +ConstitutiveLaw::StrainMeasure InterfaceCoulomb::GetStrainMeasure() { return ConstitutiveLaw::StrainMeasure_Infinitesimal; } -bool InterfaceCoulombWithTensionCutOff::IsIncremental() { return true; } +bool InterfaceCoulomb::IsIncremental() { return true; } -bool InterfaceCoulombWithTensionCutOff::RequiresInitializeMaterialResponse() { return true; } +bool InterfaceCoulomb::RequiresInitializeMaterialResponse() { return true; } -void InterfaceCoulombWithTensionCutOff::InitializeMaterial(const Properties& rMaterialProperties, - const Geometry&, - const Vector&) +void InterfaceCoulomb::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) { - mCoulombWithTensionCutOffImpl = CoulombWithTensionCutOffImpl{rMaterialProperties}; + mCoulombImpl = CoulombImpl{rMaterialProperties}; mRelativeDisplacementVectorFinalized = HasInitialState() ? GetInitialState().GetInitialStrainVector() : ZeroVector{GetStrainSize()}; @@ -137,7 +132,7 @@ void InterfaceCoulombWithTensionCutOff::InitializeMaterial(const Properties& rMa HasInitialState() ? GetInitialState().GetInitialStressVector() : ZeroVector{GetStrainSize()}; } -void InterfaceCoulombWithTensionCutOff::InitializeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulomb::InitializeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { if (!mIsModelInitialized) { mTractionVectorFinalized = rConstitutiveLawParameters.GetStressVector(); @@ -146,7 +141,7 @@ void InterfaceCoulombWithTensionCutOff::InitializeMaterialResponseCauchy(Paramet } } -void InterfaceCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulomb::CalculateMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { if (!rConstitutiveLawParameters.GetOptions().Is(ConstitutiveLaw::COMPUTE_STRESS)) { return; @@ -162,8 +157,8 @@ void InterfaceCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(Paramete const auto negative = std::signbit(trial_sigma_tau.Tau()); trial_sigma_tau.Tau() = std::abs(trial_sigma_tau.Tau()); - if (!mCoulombWithTensionCutOffImpl.IsAdmissibleStressState(trial_sigma_tau)) { - mapped_sigma_tau = mCoulombWithTensionCutOffImpl.DoReturnMapping( + if (!mCoulombImpl.IsAdmissibleStressState(trial_sigma_tau)) { + mapped_sigma_tau = mCoulombImpl.DoReturnMapping( trial_sigma_tau, mpConstitutiveDimension->CalculateElasticConstitutiveTensor(r_properties), Geo::PrincipalStresses::AveragingType::NO_AVERAGING); if (negative) mapped_sigma_tau.Tau() *= -1.0; @@ -173,9 +168,9 @@ void InterfaceCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(Paramete rConstitutiveLawParameters.GetStressVector() = mTractionVector; } -Geo::SigmaTau InterfaceCoulombWithTensionCutOff::CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, - double NormalStiffness, - double ShearStiffness) const +Geo::SigmaTau InterfaceCoulomb::CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, + double NormalStiffness, + double ShearStiffness) const { constexpr auto number_of_normal_components = std::size_t{1}; return Geo::SigmaTau{mTractionVectorFinalized + @@ -184,15 +179,15 @@ Geo::SigmaTau InterfaceCoulombWithTensionCutOff::CalculateTrialTractionVector(co rRelativeDisplacementVector - mRelativeDisplacementVectorFinalized)}; } -void InterfaceCoulombWithTensionCutOff::FinalizeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulomb::FinalizeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { mRelativeDisplacementVectorFinalized = rConstitutiveLawParameters.GetStrainVector(); mTractionVectorFinalized = mTractionVector; } -Matrix& InterfaceCoulombWithTensionCutOff::CalculateValue(Parameters& rConstitutiveLawParameters, - const Variable& rVariable, - Matrix& rValue) +Matrix& InterfaceCoulomb::CalculateValue(Parameters& rConstitutiveLawParameters, + const Variable& rVariable, + Matrix& rValue) { if (rVariable == CONSTITUTIVE_MATRIX) { const auto& r_properties = rConstitutiveLawParameters.GetMaterialProperties(); @@ -207,25 +202,25 @@ Matrix& InterfaceCoulombWithTensionCutOff::CalculateValue(Parameters& rConstitut return rValue; } -void InterfaceCoulombWithTensionCutOff::save(Serializer& rSerializer) const +void InterfaceCoulomb::save(Serializer& rSerializer) const { KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.save("ConstitutiveDimension", mpConstitutiveDimension); rSerializer.save("TractionVector", mTractionVector); rSerializer.save("TractionVectorFinalized", mTractionVectorFinalized); rSerializer.save("RelativeDisplacementVectorFinalized", mRelativeDisplacementVectorFinalized); - rSerializer.save("CoulombWithTensionCutOffImpl", mCoulombWithTensionCutOffImpl); + rSerializer.save("CoulombImpl", mCoulombImpl); rSerializer.save("IsModelInitialized", mIsModelInitialized); } -void InterfaceCoulombWithTensionCutOff::load(Serializer& rSerializer) +void InterfaceCoulomb::load(Serializer& rSerializer) { KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.load("ConstitutiveDimension", mpConstitutiveDimension); rSerializer.load("TractionVector", mTractionVector); rSerializer.load("TractionVectorFinalized", mTractionVectorFinalized); rSerializer.load("RelativeDisplacementVectorFinalized", mRelativeDisplacementVectorFinalized); - rSerializer.load("CoulombWithTensionCutOffImpl", mCoulombWithTensionCutOffImpl); + rSerializer.load("CoulombImpl", mCoulombImpl); rSerializer.load("IsModelInitialized", mIsModelInitialized); } diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.h b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h similarity index 77% rename from applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.h rename to applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h index a41aa3c52244..f84d3f10cd9a 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_with_tension_cut_off.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h @@ -14,7 +14,7 @@ #pragma once -#include "custom_constitutive/coulomb_with_tension_cut_off_impl.h" +#include "custom_constitutive/coulomb_impl.h" #include "includes/constitutive_law.h" namespace Kratos @@ -22,21 +22,21 @@ namespace Kratos class ConstitutiveLawDimension; -class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulombWithTensionCutOff : public ConstitutiveLaw +class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulomb : public ConstitutiveLaw { public: - KRATOS_CLASS_POINTER_DEFINITION(InterfaceCoulombWithTensionCutOff); + KRATOS_CLASS_POINTER_DEFINITION(InterfaceCoulomb); - InterfaceCoulombWithTensionCutOff() = default; - explicit InterfaceCoulombWithTensionCutOff(std::unique_ptr pConstitutiveDimension); + InterfaceCoulomb() = default; + explicit InterfaceCoulomb(std::unique_ptr pConstitutiveDimension); // Copying is not allowed. Use member `Clone` instead. - InterfaceCoulombWithTensionCutOff(const InterfaceCoulombWithTensionCutOff&) = delete; - InterfaceCoulombWithTensionCutOff& operator=(const InterfaceCoulombWithTensionCutOff&) = delete; + InterfaceCoulomb(const InterfaceCoulomb&) = delete; + InterfaceCoulomb& operator=(const InterfaceCoulomb&) = delete; // Moving is supported - InterfaceCoulombWithTensionCutOff(InterfaceCoulombWithTensionCutOff&&) noexcept = default; - InterfaceCoulombWithTensionCutOff& operator=(InterfaceCoulombWithTensionCutOff&&) noexcept = default; + InterfaceCoulomb(InterfaceCoulomb&&) noexcept = default; + InterfaceCoulomb& operator=(InterfaceCoulomb&&) noexcept = default; [[nodiscard]] ConstitutiveLaw::Pointer Clone() const override; SizeType WorkingSpaceDimension() override; @@ -69,7 +69,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulombWithTensionCutOff : Vector mTractionVector; Vector mTractionVectorFinalized; Vector mRelativeDisplacementVectorFinalized; - CoulombWithTensionCutOffImpl mCoulombWithTensionCutOffImpl; + CoulombImpl mCoulombImpl; bool mIsModelInitialized = false; [[nodiscard]] Geo::SigmaTau CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, @@ -79,6 +79,6 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulombWithTensionCutOff : friend class Serializer; void save(Serializer& rSerializer) const override; void load(Serializer& rSerializer) override; -}; // Class InterfaceMohrCoulombWithTensionCutOff +}; // Class InterfaceMohrCoulomb } // namespace Kratos diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp similarity index 68% rename from applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp rename to applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp index 95d3e789f9fa..9268c23b307e 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp @@ -13,7 +13,7 @@ // // Application includes -#include "custom_constitutive/mohr_coulomb_with_tension_cutoff.h" +#include "custom_constitutive/mohr_coulomb.h" #include "custom_constitutive/constitutive_law_dimension.h" #include "custom_constitutive/principal_stresses.hpp" #include "custom_utilities/check_utilities.hpp" @@ -78,7 +78,7 @@ Geo::PrincipalStresses::AveragingType FindAveragingType(const Geo::PrincipalStre namespace Kratos { -MohrCoulombWithTensionCutOff::MohrCoulombWithTensionCutOff(std::unique_ptr pConstitutiveDimension) +MohrCoulomb::MohrCoulomb(std::unique_ptr pConstitutiveDimension) : mpConstitutiveDimension(std::move(pConstitutiveDimension)), mStressVector(ZeroVector(mpConstitutiveDimension->GetStrainSize())), mStressVectorFinalized(ZeroVector(mpConstitutiveDimension->GetStrainSize())), @@ -86,17 +86,17 @@ MohrCoulombWithTensionCutOff::MohrCoulombWithTensionCutOff(std::unique_ptr(mpConstitutiveDimension->Clone()); - p_result->mStressVector = mStressVector; - p_result->mStressVectorFinalized = mStressVectorFinalized; - p_result->mStrainVectorFinalized = mStrainVectorFinalized; - p_result->mCoulombWithTensionCutOffImpl = mCoulombWithTensionCutOffImpl; + auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); + p_result->mStressVector = mStressVector; + p_result->mStressVectorFinalized = mStressVectorFinalized; + p_result->mStrainVectorFinalized = mStrainVectorFinalized; + p_result->mCoulombImpl = mCoulombImpl; return p_result; } -Vector& MohrCoulombWithTensionCutOff::GetValue(const Variable& rVariable, Vector& rValue) +Vector& MohrCoulomb::GetValue(const Variable& rVariable, Vector& rValue) { if (rVariable == CAUCHY_STRESS_VECTOR) { rValue = mStressVector; @@ -106,17 +106,15 @@ Vector& MohrCoulombWithTensionCutOff::GetValue(const Variable& rVariable return rValue; } -int& MohrCoulombWithTensionCutOff::GetValue(const Variable& rVariable, int& rValue) +int& MohrCoulomb::GetValue(const Variable& rVariable, int& rValue) { if (rVariable == GEO_PLASTICITY_STATUS) { - rValue = static_cast(mCoulombWithTensionCutOffImpl.GetPlasticityStatus()); + rValue = static_cast(mCoulombImpl.GetPlasticityStatus()); } return rValue; } -void MohrCoulombWithTensionCutOff::SetValue(const Variable& rVariable, - const Vector& rValue, - const ProcessInfo& rCurrentProcessInfo) +void MohrCoulomb::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) { if (rVariable == CAUCHY_STRESS_VECTOR) { mStressVector = rValue; @@ -125,20 +123,16 @@ void MohrCoulombWithTensionCutOff::SetValue(const Variable& rVariable, } } -SizeType MohrCoulombWithTensionCutOff::WorkingSpaceDimension() -{ - return mpConstitutiveDimension->GetDimension(); -} +SizeType MohrCoulomb::WorkingSpaceDimension() { return mpConstitutiveDimension->GetDimension(); } -int MohrCoulombWithTensionCutOff::Check(const Properties& rMaterialProperties, - const GeometryType& rElementGeometry, - const ProcessInfo& rCurrentProcessInfo) const +int MohrCoulomb::Check(const Properties& rMaterialProperties, + const GeometryType& rElementGeometry, + const ProcessInfo& rCurrentProcessInfo) const { const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); const CheckProperties check_properties(rMaterialProperties, "property", CheckProperties::Bounds::AllInclusive); - if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) - { + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { check_properties.Check( GEO_TENSILE_STRENGTH, rMaterialProperties[GEO_COHESION] / @@ -150,33 +144,28 @@ int MohrCoulombWithTensionCutOff::Check(const Properties& rMaterialProperties, return result; } -ConstitutiveLaw::StressMeasure MohrCoulombWithTensionCutOff::GetStressMeasure() +ConstitutiveLaw::StressMeasure MohrCoulomb::GetStressMeasure() { return ConstitutiveLaw::StressMeasure_Cauchy; } -SizeType MohrCoulombWithTensionCutOff::GetStrainSize() const -{ - return mpConstitutiveDimension->GetStrainSize(); -} +SizeType MohrCoulomb::GetStrainSize() const { return mpConstitutiveDimension->GetStrainSize(); } -ConstitutiveLaw::StrainMeasure MohrCoulombWithTensionCutOff::GetStrainMeasure() +ConstitutiveLaw::StrainMeasure MohrCoulomb::GetStrainMeasure() { return ConstitutiveLaw::StrainMeasure_Infinitesimal; } -bool MohrCoulombWithTensionCutOff::IsIncremental() { return true; } +bool MohrCoulomb::IsIncremental() { return true; } -bool MohrCoulombWithTensionCutOff::RequiresInitializeMaterialResponse() { return true; } +bool MohrCoulomb::RequiresInitializeMaterialResponse() { return true; } -void MohrCoulombWithTensionCutOff::InitializeMaterial(const Properties& rMaterialProperties, - const Geometry&, - const Vector&) +void MohrCoulomb::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) { - mCoulombWithTensionCutOffImpl = CoulombWithTensionCutOffImpl{rMaterialProperties}; + mCoulombImpl = CoulombImpl{rMaterialProperties}; } -void MohrCoulombWithTensionCutOff::InitializeMaterialResponseCauchy(Parameters& rValues) +void MohrCoulomb::InitializeMaterialResponseCauchy(Parameters& rValues) { if (!mIsModelInitialized) { mStressVectorFinalized = rValues.GetStressVector(); @@ -185,7 +174,7 @@ void MohrCoulombWithTensionCutOff::InitializeMaterialResponseCauchy(Parameters& } } -void MohrCoulombWithTensionCutOff::GetLawFeatures(Features& rFeatures) +void MohrCoulomb::GetLawFeatures(Features& rFeatures) { auto options = Flags{}; options.Set(mpConstitutiveDimension->GetSpatialType()); @@ -198,7 +187,7 @@ void MohrCoulombWithTensionCutOff::GetLawFeatures(Features& rFeatures) rFeatures.SetSpaceDimension(WorkingSpaceDimension()); } -void MohrCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rParameters) +void MohrCoulomb::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rParameters) { const auto& r_properties = rParameters.GetMaterialProperties(); @@ -214,11 +203,11 @@ void MohrCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(ConstitutiveL const auto& [trial_principal_stresses, rotation_matrix] = StressStrainUtilities::CalculatePrincipalStressesAndRotationMatrix(trial_stress_vector); - if (mCoulombWithTensionCutOffImpl.IsAdmissibleStressState(trial_principal_stresses)) { + if (mCoulombImpl.IsAdmissibleStressState(trial_principal_stresses)) { mStressVector = trial_stress_vector; } else { - mCoulombWithTensionCutOffImpl.SaveKappaOfCoulombYieldSurface(); - auto mapped_principal_stresses = mCoulombWithTensionCutOffImpl.DoReturnMapping( + mCoulombImpl.SaveKappaOfCoulombYieldSurface(); + auto mapped_principal_stresses = mCoulombImpl.DoReturnMapping( trial_principal_stresses, mpConstitutiveDimension->CalculateElasticConstitutiveTensor(r_properties), Geo::PrincipalStresses::AveragingType::NO_AVERAGING); @@ -227,8 +216,8 @@ void MohrCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(ConstitutiveL averaging_type != Geo::PrincipalStresses::AveragingType::NO_AVERAGING) { const auto averaged_principal_trial_stress_vector = AveragePrincipalStressComponents(trial_principal_stresses, averaging_type); - mCoulombWithTensionCutOffImpl.RestoreKappaOfCoulombYieldSurface(); - mapped_principal_stresses = mCoulombWithTensionCutOffImpl.DoReturnMapping( + mCoulombImpl.RestoreKappaOfCoulombYieldSurface(); + mapped_principal_stresses = mCoulombImpl.DoReturnMapping( averaged_principal_trial_stress_vector, mpConstitutiveDimension->CalculateElasticConstitutiveTensor(r_properties), averaging_type); mapped_principal_stresses.Values()[1] = @@ -241,38 +230,37 @@ void MohrCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(ConstitutiveL rParameters.GetStressVector() = mStressVector; } -Vector MohrCoulombWithTensionCutOff::CalculateTrialStressVector(const Vector& rStrainVector, - const Properties& rProperties) const +Vector MohrCoulomb::CalculateTrialStressVector(const Vector& rStrainVector, const Properties& rProperties) const { return mStressVectorFinalized + prod(mpConstitutiveDimension->CalculateElasticConstitutiveTensor(rProperties), rStrainVector - mStrainVectorFinalized); } -void MohrCoulombWithTensionCutOff::FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) +void MohrCoulomb::FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) { mStrainVectorFinalized = rValues.GetStrainVector(); mStressVectorFinalized = mStressVector; } -void MohrCoulombWithTensionCutOff::save(Serializer& rSerializer) const +void MohrCoulomb::save(Serializer& rSerializer) const { KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.save("ConstitutiveLawDimension", mpConstitutiveDimension); rSerializer.save("StressVector", mStressVector); rSerializer.save("StressVectorFinalized", mStressVectorFinalized); rSerializer.save("StrainVectorFinalized", mStrainVectorFinalized); - rSerializer.save("CoulombWithTensionCutOffImpl", mCoulombWithTensionCutOffImpl); + rSerializer.save("mCoulombImpl", mCoulombImpl); rSerializer.save("IsModelInitialized", mIsModelInitialized); } -void MohrCoulombWithTensionCutOff::load(Serializer& rSerializer) +void MohrCoulomb::load(Serializer& rSerializer) { KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.load("ConstitutiveLawDimension", mpConstitutiveDimension); rSerializer.load("StressVector", mStressVector); rSerializer.load("StressVectorFinalized", mStressVectorFinalized); rSerializer.load("StrainVectorFinalized", mStrainVectorFinalized); - rSerializer.load("CoulombWithTensionCutOffImpl", mCoulombWithTensionCutOffImpl); + rSerializer.load("mCoulombImpl", mCoulombImpl); rSerializer.load("IsModelInitialized", mIsModelInitialized); } diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.h b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h similarity index 76% rename from applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.h rename to applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h index ca41e6cb96a3..687ce9dfe086 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h @@ -14,7 +14,7 @@ #pragma once -#include "custom_constitutive/coulomb_with_tension_cut_off_impl.h" +#include "custom_constitutive/coulomb_impl.h" #include "includes/constitutive_law.h" namespace Kratos @@ -22,21 +22,21 @@ namespace Kratos class ConstitutiveLawDimension; -class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulombWithTensionCutOff : public ConstitutiveLaw +class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulomb : public ConstitutiveLaw { public: - KRATOS_CLASS_POINTER_DEFINITION(MohrCoulombWithTensionCutOff); + KRATOS_CLASS_POINTER_DEFINITION(MohrCoulomb); - MohrCoulombWithTensionCutOff() = default; - explicit MohrCoulombWithTensionCutOff(std::unique_ptr pConstitutiveDimension); + MohrCoulomb() = default; + explicit MohrCoulomb(std::unique_ptr pConstitutiveDimension); // Copying is not allowed. Use member `Clone` instead. - MohrCoulombWithTensionCutOff(const MohrCoulombWithTensionCutOff&) = delete; - MohrCoulombWithTensionCutOff& operator=(const MohrCoulombWithTensionCutOff&) = delete; + MohrCoulomb(const MohrCoulomb&) = delete; + MohrCoulomb& operator=(const MohrCoulomb&) = delete; // Moving is supported - MohrCoulombWithTensionCutOff(MohrCoulombWithTensionCutOff&&) noexcept = default; - MohrCoulombWithTensionCutOff& operator=(MohrCoulombWithTensionCutOff&&) noexcept = default; + MohrCoulomb(MohrCoulomb&&) noexcept = default; + MohrCoulomb& operator=(MohrCoulomb&&) noexcept = default; [[nodiscard]] ConstitutiveLaw::Pointer Clone() const override; SizeType WorkingSpaceDimension() override; @@ -66,7 +66,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulombWithTensionCutOff : publi Vector mStressVector; Vector mStressVectorFinalized; Vector mStrainVectorFinalized; - CoulombWithTensionCutOffImpl mCoulombWithTensionCutOffImpl; + CoulombImpl mCoulombImpl; bool mIsModelInitialized = false; [[nodiscard]] Vector CalculateTrialStressVector(const Vector& rStrainVector, const Properties& rProperties) const; @@ -74,6 +74,6 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulombWithTensionCutOff : publi friend class Serializer; void save(Serializer& rSerializer) const override; void load(Serializer& rSerializer) override; -}; // Class MohrCoulombWithTensionCutOff +}; // Class MohrCoulomb } // namespace Kratos diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp index 1a896ea34fe4..392e7f2ff1a8 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp @@ -16,7 +16,7 @@ #include "custom_processes/apply_c_phi_reduction_process.h" #include "containers/model.h" #include "custom_constitutive/constitutive_law_dimension.h" -#include "custom_constitutive/mohr_coulomb_with_tension_cutoff.h" +#include "custom_constitutive/mohr_coulomb.h" #include "custom_utilities/check_utilities.hpp" #include "custom_utilities/constitutive_law_utilities.h" #include "custom_utilities/process_utilities.h" @@ -45,8 +45,7 @@ bool UsesInternalMohrCoulombModel(const Element& rElement) KRATOS_ERROR_IF_NOT(rElement.GetProperties().Has(CONSTITUTIVE_LAW)) << "Properties do not have CONSTITUTIVE_LAW" << std::endl; - return dynamic_cast( - rElement.GetProperties()[CONSTITUTIVE_LAW].get()) != nullptr; + return dynamic_cast(rElement.GetProperties()[CONSTITUTIVE_LAW].get()) != nullptr; } } // namespace @@ -200,7 +199,7 @@ void ApplyCPhiReductionProcess::InitializeParametersForInternalMohrCoulombModel( const auto dummy_geometry = Geometry{}; const auto dummy_vector = Vector(); for (const auto& p_law : constitutive_laws) { - if (const auto p_mohr_coulomb = dynamic_cast(p_law.get())) { + if (const auto p_mohr_coulomb = dynamic_cast(p_law.get())) { p_mohr_coulomb->InitializeMaterial(r_properties, dummy_geometry, dummy_vector); } } diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index 84232fd81020..7d29295ac2e1 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -355,10 +355,10 @@ void KratosGeoMechanicsApplication::Register() KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoIncrementalLinearElasticInterface3DSurfaceLaw", mIncrementalLinearElasticInterface3DSurfaceLaw) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulombWithTensionCutOff2D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulombWithTensionCutOff3D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulomb2D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulomb3D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulombWithTensionCutOff) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulomb) // Register Variables KRATOS_REGISTER_VARIABLE(VELOCITY_COEFFICIENT) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.h b/applications/GeoMechanicsApplication/geo_mechanics_application.h index 61d59449cacd..1adb4da0d896 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.h @@ -107,12 +107,12 @@ // constitutive models #include "custom_constitutive/incremental_linear_elastic_interface_law.h" #include "custom_constitutive/incremental_linear_elastic_law.h" -#include "custom_constitutive/interface_coulomb_with_tension_cut_off.h" +#include "custom_constitutive/interface_coulomb.h" #include "custom_constitutive/interface_plane_strain.h" #include "custom_constitutive/interface_three_dimensional_surface.h" #include "custom_constitutive/linear_elastic_2D_interface_law.h" #include "custom_constitutive/linear_elastic_3D_interface_law.h" -#include "custom_constitutive/mohr_coulomb_with_tension_cutoff.h" +#include "custom_constitutive/mohr_coulomb.h" #include "custom_constitutive/plane_strain.h" #include "custom_constitutive/small_strain_udsm_2D_interface_law.h" #include "custom_constitutive/small_strain_udsm_3D_interface_law.h" @@ -961,11 +961,10 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ const GeoIncrementalLinearElasticInterfaceLaw mIncrementalLinearElasticInterface3DSurfaceLaw{ std::make_unique()}; - const MohrCoulombWithTensionCutOff mMohrCoulombWithTensionCutOff2D{std::make_unique()}; - const MohrCoulombWithTensionCutOff mMohrCoulombWithTensionCutOff3D{std::make_unique()}; + const MohrCoulomb mMohrCoulomb2D{std::make_unique()}; + const MohrCoulomb mMohrCoulomb3D{std::make_unique()}; - const InterfaceCoulombWithTensionCutOff mInterfaceCoulombWithTensionCutOff{ - std::make_unique()}; + const InterfaceCoulomb mInterfaceCoulomb{std::make_unique()}; ///@} diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp index 32be53518fbb..f3d3ff33d87a 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp @@ -11,7 +11,7 @@ // Mohamed Nabi // -#include "custom_constitutive/interface_coulomb_with_tension_cut_off.h" +#include "custom_constitutive/interface_coulomb.h" #include "custom_constitutive/interface_plane_strain.h" #include "custom_utilities/registration_utilities.hpp" #include "custom_utilities/ublas_utilities.h" @@ -43,7 +43,7 @@ namespace Kratos::Testing KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - const auto original_law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + const auto original_law = InterfaceCoulomb{std::make_unique()}; // Act auto p_cloned_law = original_law.Clone(); @@ -51,7 +51,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Clone, KratosGeoMech // Assert KRATOS_EXPECT_NE(p_cloned_law.get(), nullptr); KRATOS_EXPECT_NE(p_cloned_law.get(), &original_law); - KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); + KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtElasticZone, @@ -78,7 +78,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -145,7 +145,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -187,7 +187,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -227,7 +227,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -269,7 +269,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -305,7 +305,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_DoesNotCalculateStre auto relative_displacement_vector = Vector{2, 1.0}; parameters.SetStrainVector(relative_displacement_vector); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; InitializeLawMaterial(law, properties); // Act @@ -346,15 +346,15 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); auto p_law = std::unique_ptr{ - std::make_unique(std::make_unique())}; + std::make_unique(std::make_unique())}; p_law->SetInitialState(p_initial_state); InitializeLawMaterial(*p_law, properties); p_law->CalculateMaterialResponseCauchy(parameters); const auto calculated_traction_vector = parameters.GetStressVector(); - const auto scoped_registration_law = ScopedSerializerRegistration{ - std::make_pair("InterfaceCoulombWithTensionCutOff"s, InterfaceCoulombWithTensionCutOff{})}; + const auto scoped_registration_law = + ScopedSerializerRegistration{std::make_pair("InterfaceCoulomb"s, InterfaceCoulomb{})}; auto serializer = StreamSerializer{}; // Act @@ -377,44 +377,42 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Has2DWorkingSpaceDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulombWithTensionCutOff{std::make_unique()}.WorkingSpaceDimension(), - N_DIM_2D); + KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.WorkingSpaceDimension(), N_DIM_2D); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasCauchyStressMeasure, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulombWithTensionCutOff{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_StrainSizeEqualsTwo, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ( - InterfaceCoulombWithTensionCutOff{std::make_unique()}.GetStrainSize(), 2); + KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStrainSize(), 2); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasInfinitesimalStrainMeasure, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulombWithTensionCutOff{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasIncrementalFormulation, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(InterfaceCoulombWithTensionCutOff{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(InterfaceCoulomb{std::make_unique()}.IsIncremental()); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_RequiresInitializeMaterialResponse, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(InterfaceCoulombWithTensionCutOff{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(InterfaceCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Check, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; ConstitutiveLaw::Parameters parameters; Properties properties(3); parameters.SetMaterialProperties(properties); @@ -449,17 +447,6 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Check, KratosGeoMech [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_DILATANCY_ANGLE in the property with Id 3 has an invalid value: 40 is out of the range [0, 30].") properties.SetValue(GEO_DILATANCY_ANGLE, 30.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), - "GEO_TENSILE_STRENGTH does not exist in the property with Id 3.") - properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: -1 is out of the range [0, 1.73205].") - properties.SetValue(GEO_TENSILE_STRENGTH, 2.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: 2 is out of the range [0, 1.73205].") - properties.SetValue(GEO_TENSILE_STRENGTH, 1.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "INTERFACE_NORMAL_STIFFNESS does not exist in the property with Id 3.") @@ -475,6 +462,19 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Check, KratosGeoMech KRATOS_EXPECT_EXCEPTION_IS_THROWN( [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "INTERFACE_SHEAR_STIFFNESS in the property with Id 3 has an invalid value: -1 is out of the range [0, -).") properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 1.0); + KRATOS_EXPECT_EQ(law.Check(properties, element_geometry, process_info), 0); + + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), + "GEO_TENSILE_STRENGTH does not exist in the property with Id 3.") + properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: -1 is out of the range [0, 1.73205].") + properties.SetValue(GEO_TENSILE_STRENGTH, 2.0); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: 2 is out of the range [0, 1.73205].") + properties.SetValue(GEO_TENSILE_STRENGTH, 1.0); KRATOS_EXPECT_EQ(law.Check(properties, element_geometry, process_info), 0); } @@ -493,7 +493,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateConstitutiv auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); - auto law = InterfaceCoulombWithTensionCutOff{std::make_unique()}; + auto law = InterfaceCoulomb{std::make_unique()}; InitializeLawMaterial(law, properties); // Act diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp index 0a4e28186ce4..660ed332c4c7 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp @@ -11,7 +11,7 @@ // Mohamed Nabi // -#include "custom_constitutive/mohr_coulomb_with_tension_cutoff.h" +#include "custom_constitutive/mohr_coulomb.h" #include "custom_constitutive/plane_strain.h" #include "custom_constitutive/three_dimensional.h" #include "custom_utilities/registration_utilities.hpp" @@ -25,9 +25,7 @@ using namespace std::string_literals; namespace Kratos::Testing { -Vector CalculateMappedStressVector(Vector& rCauchyStressVector, - ConstitutiveLaw::Parameters& rParameters, - MohrCoulombWithTensionCutOff& rLaw) +Vector CalculateMappedStressVector(Vector& rCauchyStressVector, ConstitutiveLaw::Parameters& rParameters, MohrCoulomb& rLaw) { Vector strain_vector = ZeroVector(4); rParameters.SetStrainVector(strain_vector); @@ -47,7 +45,7 @@ Vector CalculateMappedStressVector(Vector& rCauchyStressVe KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - const auto original_law = MohrCoulombWithTensionCutOff(std::make_unique()); + const auto original_law = MohrCoulomb(std::make_unique()); // Act auto p_cloned_law = original_law.Clone(); @@ -55,13 +53,13 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Clone, KratosGeoMechanics // Assert KRATOS_EXPECT_NE(p_cloned_law.get(), nullptr); KRATOS_EXPECT_NE(p_cloned_law.get(), &original_law); - KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); + KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Check, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); ConstitutiveLaw::Parameters parameters; Properties properties(3); parameters.SetMaterialProperties(properties); @@ -71,16 +69,6 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Check, KratosGeoMechanics // Act & Assert properties.SetValue(GEO_COHESION, 1.0); properties.SetValue(GEO_FRICTION_ANGLE, 30.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), - "GEO_TENSILE_STRENGTH does not exist in the property with Id 3.") - properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: -1 is out of the range [0, 1.73205].") - properties.SetValue(GEO_TENSILE_STRENGTH, 2.0); - KRATOS_EXPECT_EXCEPTION_IS_THROWN( - [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: 2 is out of the range [0, 1.73205].") - properties.SetValue(GEO_TENSILE_STRENGTH, 1.0); KRATOS_EXPECT_EXCEPTION_IS_THROWN( [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), @@ -101,6 +89,19 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Check, KratosGeoMechanics [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), " POISSON_RATIO in the property with Id 3 has an invalid value: 1 is out of the range [0, 0.5].") properties.SetValue(POISSON_RATIO, 0.3); + KRATOS_EXPECT_EQ(law.Check(properties, element_geometry, process_info), 0); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), + "GEO_TENSILE_STRENGTH does not exist in the property with Id 3.") + properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: -1 is out of the range [0, 1.73205].") + properties.SetValue(GEO_TENSILE_STRENGTH, 2.0); + KRATOS_EXPECT_EXCEPTION_IS_THROWN( + [[maybe_unused]] const auto unused = law.Check(properties, element_geometry, process_info), "GEO_TENSILE_STRENGTH in the property with Id 3 has an invalid value: 2 is out of the range [0, 1.73205].") + properties.SetValue(GEO_TENSILE_STRENGTH, 1.0); + KRATOS_EXPECT_EQ(law.Check(properties, element_geometry, process_info), 0); } @@ -108,7 +109,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -146,7 +147,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -214,7 +215,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -270,7 +271,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -322,7 +323,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -363,7 +364,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -391,8 +392,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto p_law = std::unique_ptr{ - std::make_unique(std::make_unique())}; + auto p_law = + std::unique_ptr{std::make_unique(std::make_unique())}; Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"s); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -419,8 +420,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM p_law->GetValue(CAUCHY_STRESS_VECTOR, calculated_cauchy_stress_vector); const auto scoped_registration = ScopedSerializerRegistration{ - std::make_pair("PlaneStrain"s, PlaneStrain{}), - std::make_pair("MohrCoulombWithTensionCutOff"s, MohrCoulombWithTensionCutOff{})}; + std::make_pair("PlaneStrain"s, PlaneStrain{}), std::make_pair("MohrCoulomb"s, MohrCoulomb{})}; auto serializer = StreamSerializer{}; ConstitutiveLaw::Parameters parameters_to_be_ignored; @@ -448,7 +448,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatrix, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e8); @@ -487,53 +487,52 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatr KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_WorkingSpaceDimensionDependsOnConstitutiveLawDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.WorkingSpaceDimension(), 2); - KRATOS_EXPECT_EQ( - MohrCoulombWithTensionCutOff{std::make_unique()}.WorkingSpaceDimension(), 3); + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.WorkingSpaceDimension(), 2); + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.WorkingSpaceDimension(), 3); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StressMeasureIsAlwaysCauchy, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StrainSizeDependsOnConstitutiveLawDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStrainSize(), 4); - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStrainSize(), 6); + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainSize(), 4); + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainSize(), 6); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StrainMeasureIsAlwaysInfinitesimal, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); - KRATOS_EXPECT_EQ(MohrCoulombWithTensionCutOff{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_HasIncrementalFormulation, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(MohrCoulombWithTensionCutOff{std::make_unique()}.IsIncremental()); - EXPECT_TRUE(MohrCoulombWithTensionCutOff{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(MohrCoulomb{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(MohrCoulomb{std::make_unique()}.IsIncremental()); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_RequiresInitializeMaterialResponse, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(MohrCoulombWithTensionCutOff{std::make_unique()}.RequiresInitializeMaterialResponse()); - EXPECT_TRUE(MohrCoulombWithTensionCutOff{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(MohrCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(MohrCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_GetPlaneStrainLawFeatures, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange & act ConstitutiveLaw::Features features; - MohrCoulombWithTensionCutOff{std::make_unique()}.GetLawFeatures(features); + MohrCoulomb{std::make_unique()}.GetLawFeatures(features); // Assert KRATOS_EXPECT_TRUE(features.GetOptions().Is(ConstitutiveLaw::INFINITESIMAL_STRAINS)) @@ -548,7 +547,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Get3DLawFeatures, KratosG { // Arrange & act ConstitutiveLaw::Features features; - MohrCoulombWithTensionCutOff{std::make_unique()}.GetLawFeatures(features); + MohrCoulomb{std::make_unique()}.GetLawFeatures(features); // Assert KRATOS_EXPECT_TRUE(features.GetOptions().Is(ConstitutiveLaw::INFINITESIMAL_STRAINS)) @@ -563,7 +562,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -596,7 +595,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -625,7 +624,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -654,7 +653,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); constexpr auto phi_in_degrees = 30.0; @@ -691,7 +690,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -726,7 +725,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_DoesNotCalculateStressWhe KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -763,7 +762,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -789,7 +788,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_COULOMB_HARDENING_TYPE, "Linear"); @@ -862,7 +861,7 @@ Vector ComputeStressVectorUsingCPhiReductionTestData(double Cohesion, properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); const auto dummy_element_geometry = Geometry{}; const auto dummy_shape_function_values = Vector{}; @@ -984,7 +983,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutoff_InitialPlasticityStatusEq properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); - auto law = MohrCoulombWithTensionCutOff(std::make_unique()); + auto law = MohrCoulomb(std::make_unique()); const auto dummy_element_geometry = Geometry{}; const auto dummy_shape_function_values = Vector{}; From 3166bd698e3266db75ad8dd602d4e51bcd1e0306 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Wed, 3 Jun 2026 15:35:41 +0200 Subject: [PATCH 10/27] Moved tensile bool above the value --- .../MaterialParameters_stage2.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 8 ++--- ...interface_coulomb_with_tension_cut_off.cpp | 14 ++++---- .../test_mohr_coulomb_with_tension_cutoff.cpp | 34 +++++++++---------- .../MaterialParameters.json | 32 ++++++++--------- .../mohr_coulomb/MaterialParameters.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 2 +- .../drained/MaterialParameters.json | 2 +- .../common/MaterialParameters2D.json | 2 +- .../common/MaterialParameters3D.json | 2 +- .../MaterialParameters.json | 2 +- .../MaterialParameters.json | 34 +++++++++---------- .../MaterialParameters2D.json | 2 +- 13 files changed, 69 insertions(+), 69 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json index e95840b3a5e1..e52a388c89b1 100644 --- a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json +++ b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json @@ -24,8 +24,8 @@ "POISSON_RATIO" : 0.2, "GEO_COHESION" : 1000.0, "GEO_FRICTION_ANGLE" : 30.0, - "GEO_TENSILE_STRENGTH" : 1000.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH" : 1000.0, "GEO_DILATANCY_ANGLE" : 0.0 } } diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index a0f14bf2b77e..35b3d6b45fef 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -155,8 +155,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -188,8 +188,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -298,8 +298,8 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0e+08, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -322,8 +322,8 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0e+08, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp index f3d3ff33d87a..7e0d2d0a4d29 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp @@ -62,8 +62,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -129,8 +129,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -169,8 +169,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -211,8 +211,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); @@ -251,8 +251,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -293,8 +293,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_DoesNotCalculateStre properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(INTERFACE_NORMAL_STIFFNESS, 25.0); properties.SetValue(INTERFACE_SHEAR_STIFFNESS, 12.5); @@ -329,8 +329,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp index 660ed332c4c7..bb767e551359 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp @@ -114,8 +114,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); @@ -152,8 +152,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.25); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -220,8 +220,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.25); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -276,8 +276,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -328,8 +328,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); @@ -372,8 +372,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 20.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 20.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -399,8 +399,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -456,8 +456,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatr properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); parameters.GetOptions().Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR); @@ -568,8 +568,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -601,8 +601,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); ConstitutiveLaw::Parameters parameters; @@ -630,8 +630,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); ConstitutiveLaw::Parameters parameters; @@ -698,8 +698,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -733,8 +733,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_DoesNotCalculateStressWhe properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -768,8 +768,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); - properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, -1.0); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -795,8 +795,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse properties.SetValue(GEO_FRICTION_ANGLE, 30.0); properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 10.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.0); properties.SetValue(GEO_MAX_PLASTIC_ITERATIONS, 100); @@ -856,8 +856,8 @@ Vector ComputeStressVectorUsingCPhiReductionTestData(double Cohesion, properties.SetValue(GEO_COHESION, Cohesion); properties.SetValue(GEO_FRICTION_ANGLE, FrictionAngle); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); @@ -978,8 +978,8 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutoff_InitialPlasticityStatusEq properties.SetValue(GEO_COHESION, 10.0); properties.SetValue(GEO_FRICTION_ANGLE, 30.0); properties.SetValue(GEO_DILATANCY_ANGLE, 0.0); - properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, true); + properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0); properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json index d91f3165be76..315a3986d26e 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json @@ -23,8 +23,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -52,8 +52,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -81,8 +81,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -110,8 +110,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -139,8 +139,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -168,8 +168,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -197,8 +197,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -226,8 +226,8 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -246,8 +246,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -270,8 +270,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -294,8 +294,8 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -318,8 +318,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -342,8 +342,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -366,8 +366,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -390,8 +390,8 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 7.24263e+03, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 7.24263e+03, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -414,8 +414,8 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json index a9bfff3608a5..94f88c3dd51a 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json @@ -17,8 +17,8 @@ "POISSON_RATIO": 0.25, "GEO_COHESION": 2.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json index a9bfff3608a5..94f88c3dd51a 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json @@ -17,8 +17,8 @@ "POISSON_RATIO": 0.25, "GEO_COHESION": 2.0e+03, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json index 1def02c2da8f..70ee60c7bc06 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json @@ -17,8 +17,8 @@ "POISSON_RATIO": 0.25, "GEO_COHESION": 2.0, "GEO_FRICTION_ANGLE": 25.0, - "GEO_TENSILE_STRENGTH": 0.0, "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH": 0.0, "GEO_DILATANCY_ANGLE": 2.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json index cef0a5d9c8cd..d888d7b1726f 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json @@ -24,8 +24,8 @@ "SATURATED_SATURATION" : 1.0, "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_TENSILE_STRENGTH" : 10.0, - "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 20.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json index 795206a59721..200383488bb8 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json @@ -27,8 +27,8 @@ "SATURATED_SATURATION" : 1.0, "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, + "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_TENSILE_STRENGTH" : 10.0, - "GEO_ENABLE_TENSION_CUT_OFF" : true, "GEO_DILATANCY_ANGLE" : 20.0 } } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json index 018683906155..46374554a96a 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json @@ -11,8 +11,8 @@ "INTERFACE_SHEAR_STIFFNESS" : 5000, "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, - "GEO_TENSILE_STRENGTH" : 10.0, "GEO_ENABLE_TENSION_CUT_OFF" : true, + "GEO_TENSILE_STRENGTH" : 10.0, "GEO_DILATANCY_ANGLE" : 0.0, "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED" } diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json index 9aa69a935ee0..0d9a34a23b9e 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json @@ -7,23 +7,23 @@ "name" : "GeoMohrCoulombWithTensionCutOff2D" }, "Variables": { - "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", - "DENSITY_SOLID" : 3.0e3, - "DENSITY_WATER" : 1.0e3, - "POROSITY" : 0.3, - "BULK_MODULUS_SOLID" : 1.0e9, - "BULK_MODULUS_FLUID" : 2.0e6, - "PERMEABILITY_XX" : 4.5e-13, - "PERMEABILITY_YY" : 4.5e-13, - "PERMEABILITY_XY" : 0.0, - "DYNAMIC_VISCOSITY" : 8.90e-7, - "YOUNG_MODULUS" : 30.0e6, - "POISSON_RATIO" : 0.0, - "GEO_COHESION" : 1000.0, - "GEO_FRICTION_ANGLE" : 30.0, - "GEO_DILATANCY_ANGLE" : 0.0, - "GEO_TENSILE_STRENGTH" : 1000.0, - "GEO_ENABLE_TENSION_CUT_OFF": true + "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", + "DENSITY_SOLID" : 3.0e3, + "DENSITY_WATER" : 1.0e3, + "POROSITY" : 0.3, + "BULK_MODULUS_SOLID" : 1.0e9, + "BULK_MODULUS_FLUID" : 2.0e6, + "PERMEABILITY_XX" : 4.5e-13, + "PERMEABILITY_YY" : 4.5e-13, + "PERMEABILITY_XY" : 0.0, + "DYNAMIC_VISCOSITY" : 8.90e-7, + "YOUNG_MODULUS" : 30.0e6, + "POISSON_RATIO" : 0.0, + "GEO_COHESION" : 1000.0, + "GEO_FRICTION_ANGLE" : 30.0, + "GEO_DILATANCY_ANGLE" : 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": true, + "GEO_TENSILE_STRENGTH" : 1000.0 } } }] diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json index 3d73abc2936e..f26ce59f1df6 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json @@ -24,8 +24,8 @@ "SATURATED_SATURATION" : 1.0, "GEO_COHESION" : 10.0, "GEO_FRICTION_ANGLE" : 35.0, - "GEO_TENSILE_STRENGTH" : 10.0, "GEO_ENABLE_TENSION_CUT_OFF" : true, + "GEO_TENSILE_STRENGTH" : 10.0, "GEO_DILATANCY_ANGLE" : 20.0 } } From b82c4cdd1e701639a9facad628670016b49f8e70 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 11:33:25 +0200 Subject: [PATCH 11/27] fixed serialization tests and backward compatibility --- .../custom_constitutive/coulomb_impl.cpp | 6 ++++++ .../cpp_tests/geo_mechanics_fast_suite_without_kernel.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index e1cd159f812b..fc27bda08f6a 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -47,6 +47,12 @@ std::optional CoulombImpl::CreateOptionalTensionCutOff(const Prop if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); } + + // The following statement is to support backward compatibility + if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) + { + return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); + } return std::nullopt; } diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/geo_mechanics_fast_suite_without_kernel.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/geo_mechanics_fast_suite_without_kernel.cpp index 741b8601685e..b2785cd3291f 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/geo_mechanics_fast_suite_without_kernel.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/geo_mechanics_fast_suite_without_kernel.cpp @@ -52,6 +52,7 @@ KratosGeoMechanicsFastSuiteWithoutKernel::KratosGeoMechanicsFastSuiteWithoutKern KRATOS_REGISTER_VARIABLE(GEO_FRICTION_ANGLE) KRATOS_REGISTER_VARIABLE(GEO_COHESION) KRATOS_REGISTER_VARIABLE(GEO_DILATANCY_ANGLE) + KRATOS_REGISTER_VARIABLE(GEO_ENABLE_TENSION_CUT_OFF) KRATOS_REGISTER_VARIABLE(GEO_TENSILE_STRENGTH) KRATOS_REGISTER_VARIABLE(GEO_MAX_PLASTIC_ITERATIONS) KRATOS_REGISTER_VARIABLE(GEO_ABS_YIELD_FUNCTION_TOLERANCE) From 73ad2acffe414aa2b446fae53c7c0166ae39d346 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 11:38:57 +0200 Subject: [PATCH 12/27] Removed tension cut-off explicitly (instead of implicitly through the values) in all crow materials --- .../MaterialParameters.json | 48 +++++++------------ ...ll_installation__expected_results_wall.csv | 10 ++-- ...irst_excavation__expected_results_wall.csv | 8 ++-- ...hird_excavation__expected_results_wall.csv | 6 +-- 4 files changed, 28 insertions(+), 44 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json index 315a3986d26e..f0d367a1a34e 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json @@ -23,8 +23,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -52,8 +51,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -81,8 +79,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -110,8 +107,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -139,8 +135,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -168,8 +163,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -197,8 +191,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -226,8 +219,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 3.0e+03, "GEO_FRICTION_ANGLE": 22.5, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 0.0 } } @@ -246,8 +238,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -270,8 +261,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -294,8 +284,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -318,8 +307,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -342,8 +330,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -366,8 +353,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -390,8 +376,7 @@ "GEO_COHESION": 1.44065e+03, "GEO_FRICTION_ANGLE": 11.25, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 7.24263e+03, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, @@ -414,8 +399,7 @@ "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 20.0, "GEO_DILATANCY_ANGLE": 0.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "BIOT_COEFFICIENT": 1.0, "RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw", "SATURATED_SATURATION": 1.0, diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/3_Wall_installation__expected_results_wall.csv b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/3_Wall_installation__expected_results_wall.csv index b9601fe5adcb..195f954b305b 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/3_Wall_installation__expected_results_wall.csv +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/3_Wall_installation__expected_results_wall.csv @@ -11,7 +11,7 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4090,15084.1,-9329.6,-0.00600868 4102,17421.5,-8844.16,-0.00635568 4120,19486.2,-8238.82,-0.00668975 -4135,21549.0,-7634.68,-0.00700933 +4135,21549.0,-7634.67,-0.00700933 4148,23291.3,-6956.89,-0.00731291 4161,25032.4,-6280.28,-0.00759917 4172,26423.9,-5558.53,-0.00786685 @@ -47,8 +47,8 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4571,1795.19,3507.96,-0.00660404 4582,924.432,2461.82,-0.00637605 4595,539.331,1565.35,-0.00614732 -4604,169.336,718.947,-0.00591819 -4614,94.4921,384.744,-0.0056889 -4624,12.1328,55.508,-0.00545954 +4604,169.336,718.946,-0.00591819 +4614,94.4921,384.743,-0.0056889 +4624,12.1328,55.5083,-0.00545954 4633,11.4316,58.1114,-0.00523015 -4639,-3.09622,20.9569,-0.00500076 +4639,-3.09622,20.9568,-0.00500076 diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/4_First_excavation__expected_results_wall.csv b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/4_First_excavation__expected_results_wall.csv index 81e0360b38fd..da34361cc6da 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/4_First_excavation__expected_results_wall.csv +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/4_First_excavation__expected_results_wall.csv @@ -28,7 +28,7 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4322,-17584.9,12290.7,-0.0284111 4338,-20665.3,12270.6,-0.0298497 4352,-23746.9,12254.0,-0.0313257 -4361,-26736.3,11901.4,-0.0328406 +4361,-26736.3,11901.5,-0.0328406 4375,-29729.9,11552.7,-0.0343958 4390,-32439.6,10766.0,-0.0359927 4403,-35158.1,9986.7,-0.0376322 @@ -38,7 +38,7 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4457,-41940.1,2217.02,-0.0446275 4470,-41668.8,-1249.35,-0.0464855 4483,-41413.3,-4675.49,-0.0483853 -4497,-39103.8,-9465.37,-0.0503251 +4497,-39103.8,-9465.38,-0.0503251 4509,-36661.7,-14472.2,-0.052302 4522,-32170.6,-17661.7,-0.0543126 4536,-27661.7,-20528.4,-0.0563525 @@ -49,6 +49,6 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4595,-5348.15,-10308.3,-0.0668249 4604,-2807.88,-7138.78,-0.0689453 4614,-1631.54,-4852.56,-0.0710681 -4624,-455.179,-2592.7,-0.0731922 +4624,-455.179,-2592.69,-0.0731922 4633,-188.084,-1215.49,-0.0753167 -4639,115.789,173.976,-0.0774414 +4639,115.789,173.971,-0.0774414 diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/7_Third_excavation__expected_results_wall.csv b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/7_Third_excavation__expected_results_wall.csv index 37667e47f9ad..bc2139341568 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/7_Third_excavation__expected_results_wall.csv +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/staged_construction/7_Third_excavation__expected_results_wall.csv @@ -1,5 +1,5 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_in_m -3968,-453.737,-7386.38,-0.0153258 +3968,-453.737,-7386.37,-0.0153258 3982,2754.07,-12831.2,-0.0173536 3996,5322.71,-17087.8,-0.0193781 4010,13854.6,-36684.4,-0.0213953 @@ -31,7 +31,7 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4361,324218.0,30171.7,-0.0434495 4375,316654.0,37393.7,-0.0421605 4390,305606.0,44109.6,-0.0407082 -4403,294559.0,50826.4,-0.0391025 +4403,294559.0,50826.5,-0.0391025 4415,280270.0,57078.4,-0.0373536 4430,265980.0,63324.4,-0.0354725 4444,248689.0,69082.6,-0.0334698 @@ -51,4 +51,4 @@ node,bending_moment_in_Nm_per_m,shear_force_in_N_per_m,horizontal_displacement_i 4614,-4083.95,-10493.4,0.0014717 4624,-1464.33,-6959.38,0.00410448 4633,-589.333,-3514.93,0.00673654 -4639,289.401,-42.123,0.00936835 +4639,289.401,-42.1226,0.00936835 From 4f608a574c4774c072c1fdf589c9c46f9bf98d82 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 11:46:30 +0200 Subject: [PATCH 13/27] Renamed variable --- .../custom_constitutive/coulomb_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index fc27bda08f6a..21dbc963d35b 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -335,9 +335,9 @@ void CoulombImpl::save(Serializer& rSerializer) const void CoulombImpl::load(Serializer& rSerializer) { rSerializer.load("CoulombYieldSurface", mCoulombYieldSurface); - bool HasTensionCutOff; - rSerializer.load("HasTensionCutOff", HasTensionCutOff); - if (HasTensionCutOff) { + bool has_tension_cutoff; + rSerializer.load("HasTensionCutOff", has_tension_cutoff); + if (has_tension_cutoff) { TensionCutoff tension_cutoff; rSerializer.load("TensionCutoff", tension_cutoff); mTensionCutOff = std::make_optional(tension_cutoff); From e60a27f782a87e323ee0f167349fa77b8882e61e Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 11:47:36 +0200 Subject: [PATCH 14/27] Formatting --- .../custom_constitutive/coulomb_impl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index 21dbc963d35b..d9b2049c6ccb 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -49,8 +49,7 @@ std::optional CoulombImpl::CreateOptionalTensionCutOff(const Prop } // The following statement is to support backward compatibility - if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) - { + if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) { return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); } return std::nullopt; From bdfdfbded4d0c93f44b33bfe4bcc3313a8f74d5b Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 14:44:59 +0200 Subject: [PATCH 15/27] Added simplified registered names (but kept the old ones for compatibility) --- .../geo_mechanics_application.cpp | 7 +++- .../MaterialParameters_stage2.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 24 +++++++------- .../MaterialParameters.json | 32 +++++++++---------- .../mohr_coulomb/MaterialParameters.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 2 +- .../drained/MaterialParameters.json | 2 +- .../common/MaterialParameters2D.json | 2 +- .../common/MaterialParameters3D.json | 2 +- .../MaterialParameters.json | 2 +- .../MaterialParameters.json | 2 +- .../MaterialParameters2D.json | 2 +- 12 files changed, 43 insertions(+), 38 deletions(-) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index 7d29295ac2e1..c01cf3562169 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -355,11 +355,16 @@ void KratosGeoMechanicsApplication::Register() KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoIncrementalLinearElasticInterface3DSurfaceLaw", mIncrementalLinearElasticInterface3DSurfaceLaw) + // Keeping the old names for backward compatibility KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulomb2D) KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulomb3D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulomb) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulomb2D", mMohrCoulomb2D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulomb3D", mMohrCoulomb3D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulomb", mInterfaceCoulomb) + + // Register Variables KRATOS_REGISTER_VARIABLE(VELOCITY_COEFFICIENT) KRATOS_REGISTER_VARIABLE(DT_PRESSURE_COEFFICIENT) diff --git a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json index e52a388c89b1..bd59b7de2027 100644 --- a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json +++ b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulombWithTensionCutOff2D" + "name" : "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index 35b3d6b45fef..cb6b135e3bcc 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -37,7 +37,7 @@ "properties_id": 2, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -69,7 +69,7 @@ "properties_id": 3, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -101,7 +101,7 @@ "properties_id": 4, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -133,7 +133,7 @@ "properties_id": 5, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -166,7 +166,7 @@ "properties_id": 6, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -199,7 +199,7 @@ "properties_id": 7, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -222,7 +222,7 @@ "properties_id": 8, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -245,7 +245,7 @@ "properties_id": 9, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -268,7 +268,7 @@ "properties_id": 10, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -291,7 +291,7 @@ "properties_id": 11, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+08, @@ -315,7 +315,7 @@ "properties_id": 12, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+08, diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json index f0d367a1a34e..e48505255a14 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -33,7 +33,7 @@ "properties_id": 2, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -61,7 +61,7 @@ "properties_id": 3, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -89,7 +89,7 @@ "properties_id": 4, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -117,7 +117,7 @@ "properties_id": 5, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -145,7 +145,7 @@ "properties_id": 6, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -173,7 +173,7 @@ "properties_id": 7, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -201,7 +201,7 @@ "properties_id": 8, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -229,7 +229,7 @@ "properties_id": 9, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -252,7 +252,7 @@ "properties_id": 10, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -275,7 +275,7 @@ "properties_id": 11, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -298,7 +298,7 @@ "properties_id": 12, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -321,7 +321,7 @@ "properties_id": 13, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -344,7 +344,7 @@ "properties_id": 14, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -367,7 +367,7 @@ "properties_id": 15, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -390,7 +390,7 @@ "properties_id": 16, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulombWithTensionCutOff" + "name": "GeoInterfaceCoulomb" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json index 94f88c3dd51a..203d442a0020 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json index 94f88c3dd51a..203d442a0020 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json index 70ee60c7bc06..a75b0a4a9bbc 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulombWithTensionCutOff2D" + "name": "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json index d888d7b1726f..e805dc978d29 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulombWithTensionCutOff2D" + "name" : "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json index 200383488bb8..2fb0945f5af2 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulombWithTensionCutOff3D" + "name" : "GeoMohrCoulomb3D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json index 46374554a96a..a8cd9b513c95 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoInterfaceCoulombWithTensionCutOff" + "name" : "GeoInterfaceCoulomb" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS" : 30000000, diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json index 0d9a34a23b9e..5b1a520e7dfd 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulombWithTensionCutOff2D" + "name" : "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json index f26ce59f1df6..524c61b9bb9d 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulombWithTensionCutOff2D" + "name" : "GeoMohrCoulomb2D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", From eb93996f183ef6dc69728b00d62e60b72b36e568 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 14:52:16 +0200 Subject: [PATCH 16/27] Formatting --- .../GeoMechanicsApplication/geo_mechanics_application.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index c01cf3562169..ecef8e5c58e5 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -364,7 +364,6 @@ void KratosGeoMechanicsApplication::Register() KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulomb3D", mMohrCoulomb3D) KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulomb", mInterfaceCoulomb) - // Register Variables KRATOS_REGISTER_VARIABLE(VELOCITY_COEFFICIENT) KRATOS_REGISTER_VARIABLE(DT_PRESSURE_COEFFICIENT) From 8e982fdf8cfbc2dae4a0648ee0ba9002a390700a Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 16:01:26 +0200 Subject: [PATCH 17/27] Adjusted the readme after making tension cutoff optional --- .../custom_constitutive/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/README.md b/applications/GeoMechanicsApplication/custom_constitutive/README.md index be5eb35462cb..c9d748c72806 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/README.md +++ b/applications/GeoMechanicsApplication/custom_constitutive/README.md @@ -94,7 +94,7 @@ where: This criterion represents a linear envelope in the Mohr stress space, approximating the shear strength of a material under different stress states. For $`F_{MC} \le 0`$ we have elastic behavior, while $`F_{MC} \gt 0`$ corresponds to plastic behavior. -Since the Mohr-Coulomb criterion primarily accounts for shear failure, it does not limit tensile stresses. In geomechanical applications, materials such as rocks and soils have a limited tensile strength . A tension cutoff is imposed as: +Since the Mohr-Coulomb criterion primarily accounts for shear failure, it does not limit tensile stresses. In geomechanical applications, materials such as rocks and soils have a limited tensile strength . Therefore, the Mohr-Coulomb model in the geomechanics application supports an optional tension cutoff, which is imposed as: ```math F_{tc}(\sigma) = \sigma_1 - t_c = 0 @@ -106,6 +106,8 @@ The combination of these two, yields to the following figure: Mohr-Coulomb with tension cutoff +If the tension cutoff is not active, the figure can be simplified. In that case, the corner return coincides with the apex, resulting in the regular failure zone and the adjacent apex return zone, bound by the $\frac{\partial G_{MC}}{\partial \sigma}$ line and the horizontal $\sigma$ axis. + ### 2.2 Implementation Mohr-Coulomb with tension cutoff @@ -123,9 +125,9 @@ To incorporate the Mohr-Coulomb model with tension cutoff in numerical simulatio 4. Evaluate the condition and mapping 4.1. If the trial stress falls in the elastic zone, it stays unchanged. No mapping is applied. - 4.2. If the trial stress falls in the tensile apex return zone. The trial stress then needs to be mapped back to the apex. - 4.3. If the trial stress falls in the tension cutoff zone. The trial stress then needs to be mapped back to the tension cutoff yield surface. - 4.4. If it falls in the tensile corner return zone, then it needs to be mapped to the corner point. + 4.2. If the trial stress falls in the (tensile) apex return zone. The trial stress then needs to be mapped back to the apex. + 4.3. If the trial stress falls in the tension cutoff zone. The trial stress then needs to be mapped back to the tension cutoff yield surface (optional). + 4.4. If it falls in the tensile corner return zone, then it needs to be mapped to the corner point (optional). 4.5. In the case of regular failure zone, then it is mapped back to the Mohr-Coulomb yield surface along the normal direction of flow function. The flow function is defined by ```math G_{MC}(\sigma) = \frac{\sigma_1 - \sigma_3}{2} + \frac{\sigma_1 + \sigma_3}{2} \sin⁡{\psi} From d651da7a3351a9666849dfb7febc5a9fe5e8de17 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 16:13:31 +0200 Subject: [PATCH 18/27] Added warning if tensile strength is set, but tension cut off is not enabled --- .../custom_constitutive/coulomb_impl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index d9b2049c6ccb..7422a84c1501 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -52,6 +52,14 @@ std::optional CoulombImpl::CreateOptionalTensionCutOff(const Prop if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) { return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); } + + KRATOS_WARNING_IF("CoulombImpl", rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && + rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && + !rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) + << "Material property " << GEO_TENSILE_STRENGTH << " is provided but " << GEO_ENABLE_TENSION_CUT_OFF + << " is false. The provided " << GEO_TENSILE_STRENGTH << " value will be ignored. Please set " + << GEO_ENABLE_TENSION_CUT_OFF << " to true to enable the tension cut-off behavior.\n"; + return std::nullopt; } From 587162c181ed48adc273e1cdaa2f9d69495f2c54 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 16:14:54 +0200 Subject: [PATCH 19/27] Clarified comment about backward compatibility --- .../custom_constitutive/coulomb_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index 7422a84c1501..6acc05bd8bd1 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -48,7 +48,8 @@ std::optional CoulombImpl::CreateOptionalTensionCutOff(const Prop return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); } - // The following statement is to support backward compatibility + // The following statement is to support backward compatibility (i.e. GEO_ENABLE_TENSION_CUT_OFF is not specified, + // but the GEO_TENSILE_STRENGTH is provided), which results in an enabled tension cutoff. if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) { return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); } From d1d4ef0526b49890004a3cbdcbf31a91e86306c8 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 16:23:00 +0200 Subject: [PATCH 20/27] Clarified comment about deprecated names --- .../GeoMechanicsApplication/geo_mechanics_application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index ecef8e5c58e5..6fee5f917a01 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -355,7 +355,7 @@ void KratosGeoMechanicsApplication::Register() KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoIncrementalLinearElasticInterface3DSurfaceLaw", mIncrementalLinearElasticInterface3DSurfaceLaw) - // Keeping the old names for backward compatibility + // Deprecated! Keeping the old names for backward compatibility, but will be removed. KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulomb2D) KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulomb3D) KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulomb) From 719b2146cf256959b575634da1f0cbc1b1d23c1b Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Thu, 4 Jun 2026 16:28:01 +0200 Subject: [PATCH 21/27] Made function private and static --- .../custom_constitutive/coulomb_impl.cpp | 27 ++++++++++--------- .../custom_constitutive/coulomb_impl.h | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index 6acc05bd8bd1..e3cbb8f4b444 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -42,6 +42,20 @@ auto CalculatePrincipalStressCorrection(const Geo::PrincipalStresses& rTrialPrin namespace Kratos { + +CoulombImpl::CoulombImpl(const Properties& rMaterialProperties) + : mCoulombYieldSurface{rMaterialProperties}, + mTensionCutOff{CreateOptionalTensionCutOff(rMaterialProperties)} +{ + if (rMaterialProperties.Has(GEO_ABS_YIELD_FUNCTION_TOLERANCE)) { + mAbsoluteYieldFunctionValueTolerance = rMaterialProperties[GEO_ABS_YIELD_FUNCTION_TOLERANCE]; + } + + if (rMaterialProperties.Has(GEO_MAX_PLASTIC_ITERATIONS)) { + mMaxNumberOfPlasticIterations = rMaterialProperties[GEO_MAX_PLASTIC_ITERATIONS]; + } +} + std::optional CoulombImpl::CreateOptionalTensionCutOff(const Properties& rMaterialProperties) { if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { @@ -64,19 +78,6 @@ std::optional CoulombImpl::CreateOptionalTensionCutOff(const Prop return std::nullopt; } -CoulombImpl::CoulombImpl(const Properties& rMaterialProperties) - : mCoulombYieldSurface{rMaterialProperties}, - mTensionCutOff{CreateOptionalTensionCutOff(rMaterialProperties)} -{ - if (rMaterialProperties.Has(GEO_ABS_YIELD_FUNCTION_TOLERANCE)) { - mAbsoluteYieldFunctionValueTolerance = rMaterialProperties[GEO_ABS_YIELD_FUNCTION_TOLERANCE]; - } - - if (rMaterialProperties.Has(GEO_MAX_PLASTIC_ITERATIONS)) { - mMaxNumberOfPlasticIterations = rMaterialProperties[GEO_MAX_PLASTIC_ITERATIONS]; - } -} - bool CoulombImpl::IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction) { return IsAdmissibleStressState<>(rTrialTraction); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h index 4833eb704227..550b7e8c31fd 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h @@ -37,7 +37,6 @@ class CoulombImpl { public: CoulombImpl() = default; - std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties); explicit CoulombImpl(const Properties& rMaterialProperties); [[nodiscard]] bool IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction); @@ -98,6 +97,7 @@ class CoulombImpl [[nodiscard]] Geo::SigmaTau ReturnStressAtCornerPoint(const Geo::SigmaTau&, const Matrix&, Geo::PrincipalStresses::AveragingType AveragingType) const; + static std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties); friend class Serializer; void save(Serializer& rSerializer) const; From 973ddcc4c257fac2634df947514fe663cbabd346 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Fri, 5 Jun 2026 10:12:12 +0200 Subject: [PATCH 22/27] Processing review comments --- .../custom_constitutive/coulomb_impl.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index e3cbb8f4b444..dd49d3cd8fb9 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -124,14 +124,12 @@ bool CoulombImpl::IsAdmissibleStressState(const StressStateType& rTrialStressSta constexpr auto tolerance = 1.0e-10; const auto coulomb_tolerance = tolerance * (1.0 + std::abs(coulomb_yield_function_value)); - auto tension_admissable = true; - if (mTensionCutOff) { + auto admissible_state = coulomb_yield_function_value < coulomb_tolerance; + if (admissible_state && mTensionCutOff) { const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); - tension_admissable = tension_yield_function_value < tension_tolerance; + admissible_state = tension_yield_function_value < tension_tolerance; } - - const auto admissible_state = coulomb_yield_function_value < coulomb_tolerance && tension_admissable; if (admissible_state) mPlasticityStatus = PlasticityStatus::ELASTIC; return admissible_state; } From 7481a1f4f6aad8ca48eb67c8427478e2aa79ba31 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 9 Jun 2026 09:20:25 +0200 Subject: [PATCH 23/27] Renamed MohrCoulomb to MohrCoulombLaw (and related file renames) --- ...{mohr_coulomb.cpp => mohr_coulomb_law.cpp} | 44 ++++----- .../{mohr_coulomb.h => mohr_coulomb_law.h} | 18 ++-- .../apply_c_phi_reduction_process.cpp | 6 +- .../geo_mechanics_application.h | 6 +- ...n_cutoff.cpp => test_mohr_coulomb_law.cpp} | 89 ++++++++++--------- 5 files changed, 82 insertions(+), 81 deletions(-) rename applications/GeoMechanicsApplication/custom_constitutive/{mohr_coulomb.cpp => mohr_coulomb_law.cpp} (83%) rename applications/GeoMechanicsApplication/custom_constitutive/{mohr_coulomb.h => mohr_coulomb_law.h} (84%) rename applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/{test_mohr_coulomb_with_tension_cutoff.cpp => test_mohr_coulomb_law.cpp} (93%) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp similarity index 83% rename from applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp rename to applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp index 9268c23b307e..513281eb20ba 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp @@ -13,7 +13,7 @@ // // Application includes -#include "custom_constitutive/mohr_coulomb.h" +#include "custom_constitutive/mohr_coulomb_law.h" #include "custom_constitutive/constitutive_law_dimension.h" #include "custom_constitutive/principal_stresses.hpp" #include "custom_utilities/check_utilities.hpp" @@ -78,7 +78,7 @@ Geo::PrincipalStresses::AveragingType FindAveragingType(const Geo::PrincipalStre namespace Kratos { -MohrCoulomb::MohrCoulomb(std::unique_ptr pConstitutiveDimension) +MohrCoulombLaw::MohrCoulombLaw(std::unique_ptr pConstitutiveDimension) : mpConstitutiveDimension(std::move(pConstitutiveDimension)), mStressVector(ZeroVector(mpConstitutiveDimension->GetStrainSize())), mStressVectorFinalized(ZeroVector(mpConstitutiveDimension->GetStrainSize())), @@ -86,9 +86,9 @@ MohrCoulomb::MohrCoulomb(std::unique_ptr pConstitutive { } -ConstitutiveLaw::Pointer MohrCoulomb::Clone() const +ConstitutiveLaw::Pointer MohrCoulombLaw::Clone() const { - auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); + auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); p_result->mStressVector = mStressVector; p_result->mStressVectorFinalized = mStressVectorFinalized; p_result->mStrainVectorFinalized = mStrainVectorFinalized; @@ -96,7 +96,7 @@ ConstitutiveLaw::Pointer MohrCoulomb::Clone() const return p_result; } -Vector& MohrCoulomb::GetValue(const Variable& rVariable, Vector& rValue) +Vector& MohrCoulombLaw::GetValue(const Variable& rVariable, Vector& rValue) { if (rVariable == CAUCHY_STRESS_VECTOR) { rValue = mStressVector; @@ -106,7 +106,7 @@ Vector& MohrCoulomb::GetValue(const Variable& rVariable, Vector& rValue) return rValue; } -int& MohrCoulomb::GetValue(const Variable& rVariable, int& rValue) +int& MohrCoulombLaw::GetValue(const Variable& rVariable, int& rValue) { if (rVariable == GEO_PLASTICITY_STATUS) { rValue = static_cast(mCoulombImpl.GetPlasticityStatus()); @@ -114,7 +114,7 @@ int& MohrCoulomb::GetValue(const Variable& rVariable, int& rValue) return rValue; } -void MohrCoulomb::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) +void MohrCoulombLaw::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) { if (rVariable == CAUCHY_STRESS_VECTOR) { mStressVector = rValue; @@ -123,9 +123,9 @@ void MohrCoulomb::SetValue(const Variable& rVariable, const Vector& rVal } } -SizeType MohrCoulomb::WorkingSpaceDimension() { return mpConstitutiveDimension->GetDimension(); } +SizeType MohrCoulombLaw::WorkingSpaceDimension() { return mpConstitutiveDimension->GetDimension(); } -int MohrCoulomb::Check(const Properties& rMaterialProperties, +int MohrCoulombLaw::Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo) const { @@ -144,28 +144,28 @@ int MohrCoulomb::Check(const Properties& rMaterialProperties, return result; } -ConstitutiveLaw::StressMeasure MohrCoulomb::GetStressMeasure() +ConstitutiveLaw::StressMeasure MohrCoulombLaw::GetStressMeasure() { return ConstitutiveLaw::StressMeasure_Cauchy; } -SizeType MohrCoulomb::GetStrainSize() const { return mpConstitutiveDimension->GetStrainSize(); } +SizeType MohrCoulombLaw::GetStrainSize() const { return mpConstitutiveDimension->GetStrainSize(); } -ConstitutiveLaw::StrainMeasure MohrCoulomb::GetStrainMeasure() +ConstitutiveLaw::StrainMeasure MohrCoulombLaw::GetStrainMeasure() { return ConstitutiveLaw::StrainMeasure_Infinitesimal; } -bool MohrCoulomb::IsIncremental() { return true; } +bool MohrCoulombLaw::IsIncremental() { return true; } -bool MohrCoulomb::RequiresInitializeMaterialResponse() { return true; } +bool MohrCoulombLaw::RequiresInitializeMaterialResponse() { return true; } -void MohrCoulomb::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) +void MohrCoulombLaw::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) { mCoulombImpl = CoulombImpl{rMaterialProperties}; } -void MohrCoulomb::InitializeMaterialResponseCauchy(Parameters& rValues) +void MohrCoulombLaw::InitializeMaterialResponseCauchy(Parameters& rValues) { if (!mIsModelInitialized) { mStressVectorFinalized = rValues.GetStressVector(); @@ -174,7 +174,7 @@ void MohrCoulomb::InitializeMaterialResponseCauchy(Parameters& rValues) } } -void MohrCoulomb::GetLawFeatures(Features& rFeatures) +void MohrCoulombLaw::GetLawFeatures(Features& rFeatures) { auto options = Flags{}; options.Set(mpConstitutiveDimension->GetSpatialType()); @@ -187,7 +187,7 @@ void MohrCoulomb::GetLawFeatures(Features& rFeatures) rFeatures.SetSpaceDimension(WorkingSpaceDimension()); } -void MohrCoulomb::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rParameters) +void MohrCoulombLaw::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rParameters) { const auto& r_properties = rParameters.GetMaterialProperties(); @@ -230,19 +230,19 @@ void MohrCoulomb::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& r rParameters.GetStressVector() = mStressVector; } -Vector MohrCoulomb::CalculateTrialStressVector(const Vector& rStrainVector, const Properties& rProperties) const +Vector MohrCoulombLaw::CalculateTrialStressVector(const Vector& rStrainVector, const Properties& rProperties) const { return mStressVectorFinalized + prod(mpConstitutiveDimension->CalculateElasticConstitutiveTensor(rProperties), rStrainVector - mStrainVectorFinalized); } -void MohrCoulomb::FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) +void MohrCoulombLaw::FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) { mStrainVectorFinalized = rValues.GetStrainVector(); mStressVectorFinalized = mStressVector; } -void MohrCoulomb::save(Serializer& rSerializer) const +void MohrCoulombLaw::save(Serializer& rSerializer) const { KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.save("ConstitutiveLawDimension", mpConstitutiveDimension); @@ -253,7 +253,7 @@ void MohrCoulomb::save(Serializer& rSerializer) const rSerializer.save("IsModelInitialized", mIsModelInitialized); } -void MohrCoulomb::load(Serializer& rSerializer) +void MohrCoulombLaw::load(Serializer& rSerializer) { KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.load("ConstitutiveLawDimension", mpConstitutiveDimension); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.h similarity index 84% rename from applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h rename to applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.h index 687ce9dfe086..773d47b154f7 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.h @@ -22,21 +22,21 @@ namespace Kratos class ConstitutiveLawDimension; -class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulomb : public ConstitutiveLaw +class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulombLaw : public ConstitutiveLaw { public: - KRATOS_CLASS_POINTER_DEFINITION(MohrCoulomb); + KRATOS_CLASS_POINTER_DEFINITION(MohrCoulombLaw); - MohrCoulomb() = default; - explicit MohrCoulomb(std::unique_ptr pConstitutiveDimension); + MohrCoulombLaw() = default; + explicit MohrCoulombLaw(std::unique_ptr pConstitutiveDimension); // Copying is not allowed. Use member `Clone` instead. - MohrCoulomb(const MohrCoulomb&) = delete; - MohrCoulomb& operator=(const MohrCoulomb&) = delete; + MohrCoulombLaw(const MohrCoulombLaw&) = delete; + MohrCoulombLaw& operator=(const MohrCoulombLaw&) = delete; // Moving is supported - MohrCoulomb(MohrCoulomb&&) noexcept = default; - MohrCoulomb& operator=(MohrCoulomb&&) noexcept = default; + MohrCoulombLaw(MohrCoulombLaw&&) noexcept = default; + MohrCoulombLaw& operator=(MohrCoulombLaw&&) noexcept = default; [[nodiscard]] ConstitutiveLaw::Pointer Clone() const override; SizeType WorkingSpaceDimension() override; @@ -74,6 +74,6 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) MohrCoulomb : public ConstitutiveLaw friend class Serializer; void save(Serializer& rSerializer) const override; void load(Serializer& rSerializer) override; -}; // Class MohrCoulomb +}; // Class MohrCoulombLaw } // namespace Kratos diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp index 392e7f2ff1a8..35297cc25c71 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp @@ -16,7 +16,7 @@ #include "custom_processes/apply_c_phi_reduction_process.h" #include "containers/model.h" #include "custom_constitutive/constitutive_law_dimension.h" -#include "custom_constitutive/mohr_coulomb.h" +#include "custom_constitutive/mohr_coulomb_law.h" #include "custom_utilities/check_utilities.hpp" #include "custom_utilities/constitutive_law_utilities.h" #include "custom_utilities/process_utilities.h" @@ -45,7 +45,7 @@ bool UsesInternalMohrCoulombModel(const Element& rElement) KRATOS_ERROR_IF_NOT(rElement.GetProperties().Has(CONSTITUTIVE_LAW)) << "Properties do not have CONSTITUTIVE_LAW" << std::endl; - return dynamic_cast(rElement.GetProperties()[CONSTITUTIVE_LAW].get()) != nullptr; + return dynamic_cast(rElement.GetProperties()[CONSTITUTIVE_LAW].get()) != nullptr; } } // namespace @@ -199,7 +199,7 @@ void ApplyCPhiReductionProcess::InitializeParametersForInternalMohrCoulombModel( const auto dummy_geometry = Geometry{}; const auto dummy_vector = Vector(); for (const auto& p_law : constitutive_laws) { - if (const auto p_mohr_coulomb = dynamic_cast(p_law.get())) { + if (const auto p_mohr_coulomb = dynamic_cast(p_law.get())) { p_mohr_coulomb->InitializeMaterial(r_properties, dummy_geometry, dummy_vector); } } diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.h b/applications/GeoMechanicsApplication/geo_mechanics_application.h index 1adb4da0d896..0f38efe4bf63 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.h @@ -112,7 +112,7 @@ #include "custom_constitutive/interface_three_dimensional_surface.h" #include "custom_constitutive/linear_elastic_2D_interface_law.h" #include "custom_constitutive/linear_elastic_3D_interface_law.h" -#include "custom_constitutive/mohr_coulomb.h" +#include "custom_constitutive/mohr_coulomb_law.h" #include "custom_constitutive/plane_strain.h" #include "custom_constitutive/small_strain_udsm_2D_interface_law.h" #include "custom_constitutive/small_strain_udsm_3D_interface_law.h" @@ -961,8 +961,8 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ const GeoIncrementalLinearElasticInterfaceLaw mIncrementalLinearElasticInterface3DSurfaceLaw{ std::make_unique()}; - const MohrCoulomb mMohrCoulomb2D{std::make_unique()}; - const MohrCoulomb mMohrCoulomb3D{std::make_unique()}; + const MohrCoulombLaw mMohrCoulomb2D{std::make_unique()}; + const MohrCoulombLaw mMohrCoulomb3D{std::make_unique()}; const InterfaceCoulomb mInterfaceCoulomb{std::make_unique()}; diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp similarity index 93% rename from applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp rename to applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp index bb767e551359..11e3bb2911eb 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_with_tension_cutoff.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp @@ -11,7 +11,7 @@ // Mohamed Nabi // -#include "custom_constitutive/mohr_coulomb.h" +#include "custom_constitutive/mohr_coulomb_law.h" #include "custom_constitutive/plane_strain.h" #include "custom_constitutive/three_dimensional.h" #include "custom_utilities/registration_utilities.hpp" @@ -25,7 +25,7 @@ using namespace std::string_literals; namespace Kratos::Testing { -Vector CalculateMappedStressVector(Vector& rCauchyStressVector, ConstitutiveLaw::Parameters& rParameters, MohrCoulomb& rLaw) +Vector CalculateMappedStressVector(Vector& rCauchyStressVector, ConstitutiveLaw::Parameters& rParameters, MohrCoulombLaw& rLaw) { Vector strain_vector = ZeroVector(4); rParameters.SetStrainVector(strain_vector); @@ -42,10 +42,10 @@ Vector CalculateMappedStressVector(Vector& rCauchyStressVector, ConstitutiveLaw: return result; } -KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) +KRATOS_TEST_CASE_IN_SUITE(MohrCoulombLaw_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - const auto original_law = MohrCoulomb(std::make_unique()); + const auto original_law = MohrCoulombLaw(std::make_unique()); // Act auto p_cloned_law = original_law.Clone(); @@ -53,13 +53,13 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Clone, KratosGeoMechanics // Assert KRATOS_EXPECT_NE(p_cloned_law.get(), nullptr); KRATOS_EXPECT_NE(p_cloned_law.get(), &original_law); - KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); + KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); } -KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Check, KratosGeoMechanicsFastSuiteWithoutKernel) +KRATOS_TEST_CASE_IN_SUITE(MohrCoulombLaw_Check, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); ConstitutiveLaw::Parameters parameters; Properties properties(3); parameters.SetMaterialProperties(properties); @@ -109,7 +109,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -147,7 +147,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -215,7 +215,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -271,7 +271,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -323,7 +323,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_FRICTION_ANGLE, 35.0); properties.SetValue(GEO_COHESION, 10.0); @@ -364,7 +364,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -393,7 +393,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM { // Arrange auto p_law = - std::unique_ptr{std::make_unique(std::make_unique())}; + std::unique_ptr{std::make_unique(std::make_unique())}; Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"s); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -420,7 +420,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM p_law->GetValue(CAUCHY_STRESS_VECTOR, calculated_cauchy_stress_vector); const auto scoped_registration = ScopedSerializerRegistration{ - std::make_pair("PlaneStrain"s, PlaneStrain{}), std::make_pair("MohrCoulomb"s, MohrCoulomb{})}; + std::make_pair("PlaneStrain"s, PlaneStrain{}), std::make_pair("MohrCoulombLaw"s, MohrCoulombLaw{})}; auto serializer = StreamSerializer{}; ConstitutiveLaw::Parameters parameters_to_be_ignored; @@ -448,7 +448,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Serialization, KratosGeoM KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatrix, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e8); @@ -487,52 +487,52 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateConstitutiveMatr KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_WorkingSpaceDimensionDependsOnConstitutiveLawDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.WorkingSpaceDimension(), 2); - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.WorkingSpaceDimension(), 3); + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.WorkingSpaceDimension(), 2); + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.WorkingSpaceDimension(), 3); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StressMeasureIsAlwaysCauchy, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StrainSizeDependsOnConstitutiveLawDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainSize(), 4); - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainSize(), 6); + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStrainSize(), 4); + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStrainSize(), 6); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_StrainMeasureIsAlwaysInfinitesimal, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); - KRATOS_EXPECT_EQ(MohrCoulomb{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(MohrCoulombLaw{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_HasIncrementalFormulation, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(MohrCoulomb{std::make_unique()}.IsIncremental()); - EXPECT_TRUE(MohrCoulomb{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(MohrCoulombLaw{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(MohrCoulombLaw{std::make_unique()}.IsIncremental()); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_RequiresInitializeMaterialResponse, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(MohrCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); - EXPECT_TRUE(MohrCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(MohrCoulombLaw{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(MohrCoulombLaw{std::make_unique()}.RequiresInitializeMaterialResponse()); } KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_GetPlaneStrainLawFeatures, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange & act ConstitutiveLaw::Features features; - MohrCoulomb{std::make_unique()}.GetLawFeatures(features); + MohrCoulombLaw{std::make_unique()}.GetLawFeatures(features); // Assert KRATOS_EXPECT_TRUE(features.GetOptions().Is(ConstitutiveLaw::INFINITESIMAL_STRAINS)) @@ -547,7 +547,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_Get3DLawFeatures, KratosG { // Arrange & act ConstitutiveLaw::Features features; - MohrCoulomb{std::make_unique()}.GetLawFeatures(features); + MohrCoulombLaw{std::make_unique()}.GetLawFeatures(features); // Assert KRATOS_EXPECT_TRUE(features.GetOptions().Is(ConstitutiveLaw::INFINITESIMAL_STRAINS)) @@ -562,7 +562,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -595,7 +595,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -624,7 +624,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -649,11 +649,11 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse Defaults::absolute_tolerance); } -KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedTensileApexReturnZoneIsReturnedToApex, +KRATOS_TEST_CASE_IN_SUITE(MohrCoulombLawWithoutTensionCutoff_TrialStressInDegeneratedTensileApexReturnZoneIsReturnedToApex, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); constexpr auto phi_in_degrees = 30.0; @@ -663,6 +663,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT properties.SetValue(GEO_DILATANCY_ANGLE, 20.0); properties.SetValue(YOUNG_MODULUS, 1.0e6); properties.SetValue(POISSON_RATIO, 0.15); + properties.SetValue(GEO_ENABLE_TENSION_CUT_OFF, false); ConstitutiveLaw::Parameters parameters; parameters.SetMaterialProperties(properties); const auto dummy_element_geometry = Geometry{}; @@ -670,9 +671,9 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT law.InitializeMaterial(properties, dummy_element_geometry, dummy_shape_function_values); // Act - const auto sigma_corner = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); + const auto apex = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); auto cauchy_stress_vector = - UblasUtilities::CreateVector({sigma_corner + 20.0, sigma_corner + 10.0, sigma_corner, 0.0}); + UblasUtilities::CreateVector({apex + 20.0, apex + 10.0, apex, 0.0}); const auto resulting_cauchy_stress_vector = CalculateMappedStressVector(cauchy_stress_vector, parameters, law); auto plasticity_status = 0; @@ -680,7 +681,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_TrialStressInDegeneratedT // Assert const auto expected_cauchy_stress_vector = - UblasUtilities::CreateVector({sigma_corner, sigma_corner, sigma_corner, 0.0}); + UblasUtilities::CreateVector({apex, apex, apex, 0.0}); KRATOS_EXPECT_VECTOR_NEAR(resulting_cauchy_stress_vector, expected_cauchy_stress_vector, Defaults::absolute_tolerance); KRATOS_EXPECT_EQ(plasticity_status, static_cast(PlasticityStatus::TENSION_MOHR_COULOMB_CORNER)); @@ -690,7 +691,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -725,7 +726,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_DoesNotCalculateStressWhe KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(YOUNG_MODULUS, 1.0e6); @@ -762,7 +763,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_FRICTION_ANGLE, 35.0); @@ -788,7 +789,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); Properties properties; properties.SetValue(GEO_DRAINAGE_TYPE, "FULLY_COUPLED"); properties.SetValue(GEO_COULOMB_HARDENING_TYPE, "Linear"); @@ -861,7 +862,7 @@ Vector ComputeStressVectorUsingCPhiReductionTestData(double Cohesion, properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); const auto dummy_element_geometry = Geometry{}; const auto dummy_shape_function_values = Vector{}; @@ -983,7 +984,7 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutoff_InitialPlasticityStatusEq properties.SetValue(YOUNG_MODULUS, 30.0e6); properties.SetValue(POISSON_RATIO, 0.2); - auto law = MohrCoulomb(std::make_unique()); + auto law = MohrCoulombLaw(std::make_unique()); const auto dummy_element_geometry = Geometry{}; const auto dummy_shape_function_values = Vector{}; From 452f34dfaf917f06a2a0981639bb13a458fc3a21 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 9 Jun 2026 09:24:17 +0200 Subject: [PATCH 24/27] Renamed InterfaceCoulomb to InterfaceCoulombLaw (and related file renames) --- ..._coulomb.cpp => interface_coulomb_law.cpp} | 44 +++++++++---------- ...face_coulomb.h => interface_coulomb_law.h} | 16 +++---- .../geo_mechanics_application.h | 4 +- ...off.cpp => test_interface_coulomb_law.cpp} | 40 ++++++++--------- 4 files changed, 52 insertions(+), 52 deletions(-) rename applications/GeoMechanicsApplication/custom_constitutive/{interface_coulomb.cpp => interface_coulomb_law.cpp} (81%) rename applications/GeoMechanicsApplication/custom_constitutive/{interface_coulomb.h => interface_coulomb_law.h} (85%) rename applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/{test_interface_coulomb_with_tension_cut_off.cpp => test_interface_coulomb_law.cpp} (92%) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp similarity index 81% rename from applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp rename to applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp index ba35d321fc96..5282d76ba7b4 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp @@ -13,7 +13,7 @@ // // Application includes -#include "custom_constitutive/interface_coulomb.h" +#include "custom_constitutive/interface_coulomb_law.h" #include "custom_constitutive/constitutive_law_dimension.h" #include "custom_constitutive/sigma_tau.hpp" #include "custom_utilities/check_utilities.hpp" @@ -28,7 +28,7 @@ namespace Kratos { -InterfaceCoulomb::InterfaceCoulomb(std::unique_ptr pConstitutiveDimension) +InterfaceCoulombLaw::InterfaceCoulombLaw(std::unique_ptr pConstitutiveDimension) : mpConstitutiveDimension(std::move(pConstitutiveDimension)), mTractionVector(ZeroVector(mpConstitutiveDimension->GetStrainSize())), mTractionVectorFinalized(ZeroVector(mpConstitutiveDimension->GetStrainSize())), @@ -36,9 +36,9 @@ InterfaceCoulomb::InterfaceCoulomb(std::unique_ptr pCo { } -ConstitutiveLaw::Pointer InterfaceCoulomb::Clone() const +ConstitutiveLaw::Pointer InterfaceCoulombLaw::Clone() const { - auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); + auto p_result = std::make_shared(mpConstitutiveDimension->Clone()); p_result->mTractionVector = mTractionVector; p_result->mTractionVectorFinalized = mTractionVectorFinalized; p_result->mRelativeDisplacementVectorFinalized = mRelativeDisplacementVectorFinalized; @@ -47,7 +47,7 @@ ConstitutiveLaw::Pointer InterfaceCoulomb::Clone() const return p_result; } -Vector& InterfaceCoulomb::GetValue(const Variable& rVariable, Vector& rValue) +Vector& InterfaceCoulombLaw::GetValue(const Variable& rVariable, Vector& rValue) { if (rVariable == GEO_EFFECTIVE_TRACTION_VECTOR) { rValue = mTractionVector; @@ -57,7 +57,7 @@ Vector& InterfaceCoulomb::GetValue(const Variable& rVariable, Vector& rV return rValue; } -int& InterfaceCoulomb::GetValue(const Variable& rVariable, int& rValue) +int& InterfaceCoulombLaw::GetValue(const Variable& rVariable, int& rValue) { if (rVariable == GEO_PLASTICITY_STATUS) { rValue = static_cast(mCoulombImpl.GetPlasticityStatus()); @@ -65,7 +65,7 @@ int& InterfaceCoulomb::GetValue(const Variable& rVariable, int& rValue) return rValue; } -void InterfaceCoulomb::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) +void InterfaceCoulombLaw::SetValue(const Variable& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) { if (rVariable == GEO_EFFECTIVE_TRACTION_VECTOR) { mTractionVector = rValue; @@ -74,13 +74,13 @@ void InterfaceCoulomb::SetValue(const Variable& rVariable, const Vector& } } -SizeType InterfaceCoulomb::WorkingSpaceDimension() +SizeType InterfaceCoulombLaw::WorkingSpaceDimension() { // Note that this implementation assumes line interface elements. It needs to be modified when planar interface elements become available. return N_DIM_2D; } -int InterfaceCoulomb::Check(const Properties& rMaterialProperties, +int InterfaceCoulombLaw::Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo) const { @@ -102,27 +102,27 @@ int InterfaceCoulomb::Check(const Properties& rMaterialProperties, return result; } -ConstitutiveLaw::StressMeasure InterfaceCoulomb::GetStressMeasure() +ConstitutiveLaw::StressMeasure InterfaceCoulombLaw::GetStressMeasure() { return ConstitutiveLaw::StressMeasure_Cauchy; } -SizeType InterfaceCoulomb::GetStrainSize() const +SizeType InterfaceCoulombLaw::GetStrainSize() const { // Note that this implementation assumes line interface elements. It needs to be modified when planar interface elements become available. return VOIGT_SIZE_2D_INTERFACE; } -ConstitutiveLaw::StrainMeasure InterfaceCoulomb::GetStrainMeasure() +ConstitutiveLaw::StrainMeasure InterfaceCoulombLaw::GetStrainMeasure() { return ConstitutiveLaw::StrainMeasure_Infinitesimal; } -bool InterfaceCoulomb::IsIncremental() { return true; } +bool InterfaceCoulombLaw::IsIncremental() { return true; } -bool InterfaceCoulomb::RequiresInitializeMaterialResponse() { return true; } +bool InterfaceCoulombLaw::RequiresInitializeMaterialResponse() { return true; } -void InterfaceCoulomb::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) +void InterfaceCoulombLaw::InitializeMaterial(const Properties& rMaterialProperties, const Geometry&, const Vector&) { mCoulombImpl = CoulombImpl{rMaterialProperties}; @@ -132,7 +132,7 @@ void InterfaceCoulomb::InitializeMaterial(const Properties& rMaterialProperties, HasInitialState() ? GetInitialState().GetInitialStressVector() : ZeroVector{GetStrainSize()}; } -void InterfaceCoulomb::InitializeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulombLaw::InitializeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { if (!mIsModelInitialized) { mTractionVectorFinalized = rConstitutiveLawParameters.GetStressVector(); @@ -141,7 +141,7 @@ void InterfaceCoulomb::InitializeMaterialResponseCauchy(Parameters& rConstitutiv } } -void InterfaceCoulomb::CalculateMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulombLaw::CalculateMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { if (!rConstitutiveLawParameters.GetOptions().Is(ConstitutiveLaw::COMPUTE_STRESS)) { return; @@ -168,7 +168,7 @@ void InterfaceCoulomb::CalculateMaterialResponseCauchy(Parameters& rConstitutive rConstitutiveLawParameters.GetStressVector() = mTractionVector; } -Geo::SigmaTau InterfaceCoulomb::CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, +Geo::SigmaTau InterfaceCoulombLaw::CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, double NormalStiffness, double ShearStiffness) const { @@ -179,13 +179,13 @@ Geo::SigmaTau InterfaceCoulomb::CalculateTrialTractionVector(const Vector& rRela rRelativeDisplacementVector - mRelativeDisplacementVectorFinalized)}; } -void InterfaceCoulomb::FinalizeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) +void InterfaceCoulombLaw::FinalizeMaterialResponseCauchy(Parameters& rConstitutiveLawParameters) { mRelativeDisplacementVectorFinalized = rConstitutiveLawParameters.GetStrainVector(); mTractionVectorFinalized = mTractionVector; } -Matrix& InterfaceCoulomb::CalculateValue(Parameters& rConstitutiveLawParameters, +Matrix& InterfaceCoulombLaw::CalculateValue(Parameters& rConstitutiveLawParameters, const Variable& rVariable, Matrix& rValue) { @@ -202,7 +202,7 @@ Matrix& InterfaceCoulomb::CalculateValue(Parameters& rConstitutiveLa return rValue; } -void InterfaceCoulomb::save(Serializer& rSerializer) const +void InterfaceCoulombLaw::save(Serializer& rSerializer) const { KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.save("ConstitutiveDimension", mpConstitutiveDimension); @@ -213,7 +213,7 @@ void InterfaceCoulomb::save(Serializer& rSerializer) const rSerializer.save("IsModelInitialized", mIsModelInitialized); } -void InterfaceCoulomb::load(Serializer& rSerializer) +void InterfaceCoulombLaw::load(Serializer& rSerializer) { KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw) rSerializer.load("ConstitutiveDimension", mpConstitutiveDimension); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.h similarity index 85% rename from applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h rename to applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.h index f84d3f10cd9a..e90318649104 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.h @@ -22,21 +22,21 @@ namespace Kratos class ConstitutiveLawDimension; -class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulomb : public ConstitutiveLaw +class KRATOS_API(GEO_MECHANICS_APPLICATION) InterfaceCoulombLaw : public ConstitutiveLaw { public: - KRATOS_CLASS_POINTER_DEFINITION(InterfaceCoulomb); + KRATOS_CLASS_POINTER_DEFINITION(InterfaceCoulombLaw); - InterfaceCoulomb() = default; - explicit InterfaceCoulomb(std::unique_ptr pConstitutiveDimension); + InterfaceCoulombLaw() = default; + explicit InterfaceCoulombLaw(std::unique_ptr pConstitutiveDimension); // Copying is not allowed. Use member `Clone` instead. - InterfaceCoulomb(const InterfaceCoulomb&) = delete; - InterfaceCoulomb& operator=(const InterfaceCoulomb&) = delete; + InterfaceCoulombLaw(const InterfaceCoulombLaw&) = delete; + InterfaceCoulombLaw& operator=(const InterfaceCoulombLaw&) = delete; // Moving is supported - InterfaceCoulomb(InterfaceCoulomb&&) noexcept = default; - InterfaceCoulomb& operator=(InterfaceCoulomb&&) noexcept = default; + InterfaceCoulombLaw(InterfaceCoulombLaw&&) noexcept = default; + InterfaceCoulombLaw& operator=(InterfaceCoulombLaw&&) noexcept = default; [[nodiscard]] ConstitutiveLaw::Pointer Clone() const override; SizeType WorkingSpaceDimension() override; diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.h b/applications/GeoMechanicsApplication/geo_mechanics_application.h index 0f38efe4bf63..f7b8453be765 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.h @@ -107,7 +107,7 @@ // constitutive models #include "custom_constitutive/incremental_linear_elastic_interface_law.h" #include "custom_constitutive/incremental_linear_elastic_law.h" -#include "custom_constitutive/interface_coulomb.h" +#include "custom_constitutive/interface_coulomb_law.h" #include "custom_constitutive/interface_plane_strain.h" #include "custom_constitutive/interface_three_dimensional_surface.h" #include "custom_constitutive/linear_elastic_2D_interface_law.h" @@ -964,7 +964,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ const MohrCoulombLaw mMohrCoulomb2D{std::make_unique()}; const MohrCoulombLaw mMohrCoulomb3D{std::make_unique()}; - const InterfaceCoulomb mInterfaceCoulomb{std::make_unique()}; + const InterfaceCoulombLaw mInterfaceCoulomb{std::make_unique()}; ///@} diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp similarity index 92% rename from applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp rename to applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp index 7e0d2d0a4d29..812a21551901 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_with_tension_cut_off.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp @@ -11,7 +11,7 @@ // Mohamed Nabi // -#include "custom_constitutive/interface_coulomb.h" +#include "custom_constitutive/interface_coulomb_law.h" #include "custom_constitutive/interface_plane_strain.h" #include "custom_utilities/registration_utilities.hpp" #include "custom_utilities/ublas_utilities.h" @@ -40,10 +40,10 @@ void InitializeLawMaterial(ConstitutiveLaw& rLaw, const Properties& rProperties) namespace Kratos::Testing { -KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) +KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulomb_Clone, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - const auto original_law = InterfaceCoulomb{std::make_unique()}; + const auto original_law = InterfaceCoulombLaw{std::make_unique()}; // Act auto p_cloned_law = original_law.Clone(); @@ -51,7 +51,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Clone, KratosGeoMech // Assert KRATOS_EXPECT_NE(p_cloned_law.get(), nullptr); KRATOS_EXPECT_NE(p_cloned_law.get(), &original_law); - KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); + KRATOS_EXPECT_NE(dynamic_cast(p_cloned_law.get()), nullptr); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtElasticZone, @@ -78,7 +78,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -145,7 +145,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -187,7 +187,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -227,7 +227,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -269,7 +269,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateMaterialRes p_initial_state->SetInitialStressVector(initial_traction_vector); p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; law.SetInitialState(p_initial_state); InitializeLawMaterial(law, properties); @@ -305,7 +305,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_DoesNotCalculateStre auto relative_displacement_vector = Vector{2, 1.0}; parameters.SetStrainVector(relative_displacement_vector); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; InitializeLawMaterial(law, properties); // Act @@ -346,7 +346,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato p_initial_state->SetInitialStrainVector(Vector{ZeroVector{2}}); auto p_law = std::unique_ptr{ - std::make_unique(std::make_unique())}; + std::make_unique(std::make_unique())}; p_law->SetInitialState(p_initial_state); InitializeLawMaterial(*p_law, properties); @@ -354,7 +354,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato const auto calculated_traction_vector = parameters.GetStressVector(); const auto scoped_registration_law = - ScopedSerializerRegistration{std::make_pair("InterfaceCoulomb"s, InterfaceCoulomb{})}; + ScopedSerializerRegistration{std::make_pair("InterfaceCoulombLaw"s, InterfaceCoulombLaw{})}; auto serializer = StreamSerializer{}; // Act @@ -377,42 +377,42 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Has2DWorkingSpaceDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.WorkingSpaceDimension(), N_DIM_2D); + KRATOS_EXPECT_EQ(InterfaceCoulombLaw{std::make_unique()}.WorkingSpaceDimension(), N_DIM_2D); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasCauchyStressMeasure, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStressMeasure(), + KRATOS_EXPECT_EQ(InterfaceCoulombLaw{std::make_unique()}.GetStressMeasure(), ConstitutiveLaw::StressMeasure_Cauchy); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_StrainSizeEqualsTwo, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStrainSize(), 2); + KRATOS_EXPECT_EQ(InterfaceCoulombLaw{std::make_unique()}.GetStrainSize(), 2); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasInfinitesimalStrainMeasure, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulomb{std::make_unique()}.GetStrainMeasure(), + KRATOS_EXPECT_EQ(InterfaceCoulombLaw{std::make_unique()}.GetStrainMeasure(), ConstitutiveLaw::StrainMeasure_Infinitesimal); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasIncrementalFormulation, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(InterfaceCoulomb{std::make_unique()}.IsIncremental()); + EXPECT_TRUE(InterfaceCoulombLaw{std::make_unique()}.IsIncremental()); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_RequiresInitializeMaterialResponse, KratosGeoMechanicsFastSuiteWithoutKernel) { - EXPECT_TRUE(InterfaceCoulomb{std::make_unique()}.RequiresInitializeMaterialResponse()); + EXPECT_TRUE(InterfaceCoulombLaw{std::make_unique()}.RequiresInitializeMaterialResponse()); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Check, KratosGeoMechanicsFastSuiteWithoutKernel) { // Arrange - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; ConstitutiveLaw::Parameters parameters; Properties properties(3); parameters.SetMaterialProperties(properties); @@ -493,7 +493,7 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_CalculateConstitutiv auto parameters = ConstitutiveLaw::Parameters{}; parameters.SetMaterialProperties(properties); - auto law = InterfaceCoulomb{std::make_unique()}; + auto law = InterfaceCoulombLaw{std::make_unique()}; InitializeLawMaterial(law, properties); // Act From ddcb4dc211878b523a4aea5e8ecf5ca369687ca6 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 9 Jun 2026 10:02:42 +0200 Subject: [PATCH 25/27] Processing batch of review comments --- .../custom_constitutive/coulomb_impl.cpp | 63 +++++++++---------- .../custom_constitutive/coulomb_impl.h | 1 - .../interface_coulomb_law.cpp | 2 +- .../custom_constitutive/mohr_coulomb_law.cpp | 2 +- .../constitutive_law_utilities.cpp | 11 ++++ .../constitutive_law_utilities.h | 3 + 6 files changed, 47 insertions(+), 35 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index dd49d3cd8fb9..d4cc2a4d1f10 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -19,6 +19,7 @@ #include "custom_utilities/stress_strain_utilities.h" #include "custom_utilities/ublas_utilities.h" #include "geo_mechanics_application_variables.h" +#include "custom_utilities/constitutive_law_utilities.h" #include "includes/properties.h" #include "includes/serializer.h" #include "utilities/math_utils.h" @@ -38,6 +39,22 @@ auto CalculatePrincipalStressCorrection(const Geo::PrincipalStresses& rTrialPrin return Geo::PrincipalStresses{prod(subrange(rElasticConstitutiveTensor, 0, 3, 0, 3), dG_dSigma)}; } +std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties) +{ + if (ConstitutiveLawUtilities::WantTensionCutOff(rMaterialProperties)) { + return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); + } + + KRATOS_WARNING_IF("CoulombImpl", rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && + rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && + !rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) + << "Material property " << GEO_TENSILE_STRENGTH << " is provided but " << GEO_ENABLE_TENSION_CUT_OFF + << " is false. The provided " << GEO_TENSILE_STRENGTH << " value will be ignored. Please set " + << GEO_ENABLE_TENSION_CUT_OFF << " to true to enable the tension cut-off behavior.\n"; + + return std::nullopt; +} + } // namespace namespace Kratos @@ -56,28 +73,6 @@ CoulombImpl::CoulombImpl(const Properties& rMaterialProperties) } } -std::optional CoulombImpl::CreateOptionalTensionCutOff(const Properties& rMaterialProperties) -{ - if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { - return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); - } - - // The following statement is to support backward compatibility (i.e. GEO_ENABLE_TENSION_CUT_OFF is not specified, - // but the GEO_TENSILE_STRENGTH is provided), which results in an enabled tension cutoff. - if (rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF)) { - return std::make_optional(rMaterialProperties[GEO_TENSILE_STRENGTH]); - } - - KRATOS_WARNING_IF("CoulombImpl", rMaterialProperties.Has(GEO_TENSILE_STRENGTH) && - rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && - !rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) - << "Material property " << GEO_TENSILE_STRENGTH << " is provided but " << GEO_ENABLE_TENSION_CUT_OFF - << " is false. The provided " << GEO_TENSILE_STRENGTH << " value will be ignored. Please set " - << GEO_ENABLE_TENSION_CUT_OFF << " to true to enable the tension cut-off behavior.\n"; - - return std::nullopt; -} - bool CoulombImpl::IsAdmissibleStressState(const Geo::SigmaTau& rTrialTraction) { return IsAdmissibleStressState<>(rTrialTraction); @@ -146,15 +141,18 @@ StressStateType CoulombImpl::DoReturnMapping(const StressStateType& rTrialStress auto kappa_start = mCoulombYieldSurface.GetKappa(); for (auto counter = std::size_t{0}; counter < mMaxNumberOfPlasticIterations; ++counter) { - if (mTensionCutOff && IsStressAtTensionApexReturnZone(trial_traction)) { - mPlasticityStatus = PlasticityStatus::TENSION_APEX; - return ReturnStressAtTensionApexReturnZone(rTrialStressState); - } - - if (mTensionCutOff && IsStressAtTensionCutoffReturnZone(trial_traction)) { - mPlasticityStatus = PlasticityStatus::TENSION_CUT_OFF; - return ReturnStressAtTensionCutoffReturnZone(rTrialStressState, - rElasticConstitutiveTensor, AveragingType); + if (mTensionCutOff) + { + if (IsStressAtTensionApexReturnZone(trial_traction)) { + mPlasticityStatus = PlasticityStatus::TENSION_APEX; + return ReturnStressAtTensionApexReturnZone(rTrialStressState); + } + + if (IsStressAtTensionCutoffReturnZone(trial_traction)) { + mPlasticityStatus = PlasticityStatus::TENSION_CUT_OFF; + return ReturnStressAtTensionCutoffReturnZone(rTrialStressState, + rElasticConstitutiveTensor, AveragingType); + } } if (IsStressAtCornerReturnZone(trial_traction, AveragingType)) { @@ -179,7 +177,8 @@ StressStateType CoulombImpl::DoReturnMapping(const StressStateType& rTrialStress Geo::SigmaTau CoulombImpl::CalculateCornerPoint() const { - if (const auto apex = mCoulombYieldSurface.CalculateApex(); !mTensionCutOff) return apex; + if (!mTensionCutOff) return mCoulombYieldSurface.CalculateApex(); + const auto tensile_strength = mTensionCutOff->GetTensileStrength(); if (const auto apex = mCoulombYieldSurface.CalculateApex(); tensile_strength > apex.Sigma()) return apex; diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h index 550b7e8c31fd..9f40d9fe70ef 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.h @@ -97,7 +97,6 @@ class CoulombImpl [[nodiscard]] Geo::SigmaTau ReturnStressAtCornerPoint(const Geo::SigmaTau&, const Matrix&, Geo::PrincipalStresses::AveragingType AveragingType) const; - static std::optional CreateOptionalTensionCutOff(const Properties& rMaterialProperties); friend class Serializer; void save(Serializer& rSerializer) const; diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp index 5282d76ba7b4..390fd93b6823 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp @@ -91,7 +91,7 @@ int InterfaceCoulombLaw::Check(const Properties& rMaterialProperties, constexpr auto max_value_angle = 90.0; check_properties.SingleUseBounds(CheckProperties::Bounds::AllExclusive).Check(GEO_FRICTION_ANGLE, 0.0, max_value_angle); check_properties.Check(GEO_DILATANCY_ANGLE, rMaterialProperties[GEO_FRICTION_ANGLE]); - if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { + if (ConstitutiveLawUtilities::WantTensionCutOff(rMaterialProperties)) { check_properties.Check( GEO_TENSILE_STRENGTH, rMaterialProperties[GEO_COHESION] / diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp index 513281eb20ba..db7a7a0ce7a3 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp @@ -132,7 +132,7 @@ int MohrCoulombLaw::Check(const Properties& rMaterialProperties, const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); const CheckProperties check_properties(rMaterialProperties, "property", CheckProperties::Bounds::AllInclusive); - if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { + if (ConstitutiveLawUtilities::WantTensionCutOff(rMaterialProperties)) { check_properties.Check( GEO_TENSILE_STRENGTH, rMaterialProperties[GEO_COHESION] / diff --git a/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.cpp b/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.cpp index 82cce9b1b40c..8510dc5f156a 100644 --- a/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.cpp +++ b/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.cpp @@ -342,4 +342,15 @@ double ConstitutiveLawUtilities::CalculateExcessPorePressureIncrement(const Prop << "." << std::endl; return biot_coefficient * VolumetricStrainIncrement / denominator; } + +bool ConstitutiveLawUtilities::WantTensionCutOff(const Properties& rMaterialProperties) +{ + if (rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties[GEO_ENABLE_TENSION_CUT_OFF]) { + return true; + } + + // The following statement is to support backward compatibility (i.e. GEO_ENABLE_TENSION_CUT_OFF is not specified, + // but the GEO_TENSILE_STRENGTH is provided), which results in an enabled tension cutoff. + return !rMaterialProperties.Has(GEO_ENABLE_TENSION_CUT_OFF) && rMaterialProperties.Has(GEO_TENSILE_STRENGTH); +} } // namespace Kratos \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.h b/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.h index 786d508d3a0f..0302a9bae8c8 100644 --- a/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.h +++ b/applications/GeoMechanicsApplication/custom_utilities/constitutive_law_utilities.h @@ -73,6 +73,9 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) ConstitutiveLawUtilities [[nodiscard]] static double CalculateExcessPorePressureIncrement(const Properties& rProperties, double VolumetricStrainIncrement); + + [[nodiscard]] static bool WantTensionCutOff(const Properties& rProperties); + }; /* Class ConstitutiveLawUtilities*/ } // namespace Kratos From 23b533100d059b1a06689c2b719749cf5c05cb6a Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 9 Jun 2026 10:11:23 +0200 Subject: [PATCH 26/27] Renamed registered names --- .../custom_constitutive/coulomb_impl.cpp | 13 ++++---- .../interface_coulomb_law.cpp | 12 +++---- .../custom_constitutive/mohr_coulomb_law.cpp | 4 +-- .../geo_mechanics_application.cpp | 12 +++---- .../geo_mechanics_application.h | 6 ++-- .../MaterialParameters_stage2.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 24 +++++++------- .../test_interface_coulomb_law.cpp | 3 +- .../test_mohr_coulomb_law.cpp | 12 +++---- .../MaterialParameters.json | 32 +++++++++---------- .../mohr_coulomb/MaterialParameters.json | 2 +- .../mohr_coulomb/MaterialParameters.json | 2 +- .../drained/MaterialParameters.json | 2 +- .../common/MaterialParameters2D.json | 2 +- .../common/MaterialParameters3D.json | 2 +- .../MaterialParameters.json | 2 +- .../MaterialParameters.json | 2 +- .../MaterialParameters2D.json | 2 +- 18 files changed, 68 insertions(+), 68 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index d4cc2a4d1f10..c3cbd3ae7fa2 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -16,10 +16,10 @@ #include "custom_constitutive/coulomb_impl.h" #include "custom_constitutive/principal_stresses.hpp" #include "custom_constitutive/sigma_tau.hpp" +#include "custom_utilities/constitutive_law_utilities.h" #include "custom_utilities/stress_strain_utilities.h" #include "custom_utilities/ublas_utilities.h" #include "geo_mechanics_application_variables.h" -#include "custom_utilities/constitutive_law_utilities.h" #include "includes/properties.h" #include "includes/serializer.h" #include "utilities/math_utils.h" @@ -120,10 +120,10 @@ bool CoulombImpl::IsAdmissibleStressState(const StressStateType& rTrialStressSta const auto coulomb_tolerance = tolerance * (1.0 + std::abs(coulomb_yield_function_value)); auto admissible_state = coulomb_yield_function_value < coulomb_tolerance; - if (admissible_state && mTensionCutOff) { + if (admissible_state && mTensionCutOff) { const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); - admissible_state = tension_yield_function_value < tension_tolerance; + admissible_state = tension_yield_function_value < tension_tolerance; } if (admissible_state) mPlasticityStatus = PlasticityStatus::ELASTIC; return admissible_state; @@ -141,8 +141,7 @@ StressStateType CoulombImpl::DoReturnMapping(const StressStateType& rTrialStress auto kappa_start = mCoulombYieldSurface.GetKappa(); for (auto counter = std::size_t{0}; counter < mMaxNumberOfPlasticIterations; ++counter) { - if (mTensionCutOff) - { + if (mTensionCutOff) { if (IsStressAtTensionApexReturnZone(trial_traction)) { mPlasticityStatus = PlasticityStatus::TENSION_APEX; return ReturnStressAtTensionApexReturnZone(rTrialStressState); @@ -150,8 +149,8 @@ StressStateType CoulombImpl::DoReturnMapping(const StressStateType& rTrialStress if (IsStressAtTensionCutoffReturnZone(trial_traction)) { mPlasticityStatus = PlasticityStatus::TENSION_CUT_OFF; - return ReturnStressAtTensionCutoffReturnZone(rTrialStressState, - rElasticConstitutiveTensor, AveragingType); + return ReturnStressAtTensionCutoffReturnZone( + rTrialStressState, rElasticConstitutiveTensor, AveragingType); } } diff --git a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp index 390fd93b6823..89ce12994997 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/interface_coulomb_law.cpp @@ -81,8 +81,8 @@ SizeType InterfaceCoulombLaw::WorkingSpaceDimension() } int InterfaceCoulombLaw::Check(const Properties& rMaterialProperties, - const GeometryType& rElementGeometry, - const ProcessInfo& rCurrentProcessInfo) const + const GeometryType& rElementGeometry, + const ProcessInfo& rCurrentProcessInfo) const { const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); @@ -169,8 +169,8 @@ void InterfaceCoulombLaw::CalculateMaterialResponseCauchy(Parameters& rConstitut } Geo::SigmaTau InterfaceCoulombLaw::CalculateTrialTractionVector(const Vector& rRelativeDisplacementVector, - double NormalStiffness, - double ShearStiffness) const + double NormalStiffness, + double ShearStiffness) const { constexpr auto number_of_normal_components = std::size_t{1}; return Geo::SigmaTau{mTractionVectorFinalized + @@ -186,8 +186,8 @@ void InterfaceCoulombLaw::FinalizeMaterialResponseCauchy(Parameters& rConstituti } Matrix& InterfaceCoulombLaw::CalculateValue(Parameters& rConstitutiveLawParameters, - const Variable& rVariable, - Matrix& rValue) + const Variable& rVariable, + Matrix& rValue) { if (rVariable == CONSTITUTIVE_MATRIX) { const auto& r_properties = rConstitutiveLawParameters.GetMaterialProperties(); diff --git a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp index db7a7a0ce7a3..bf6e04f47658 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_law.cpp @@ -126,8 +126,8 @@ void MohrCoulombLaw::SetValue(const Variable& rVariable, const Vector& r SizeType MohrCoulombLaw::WorkingSpaceDimension() { return mpConstitutiveDimension->GetDimension(); } int MohrCoulombLaw::Check(const Properties& rMaterialProperties, - const GeometryType& rElementGeometry, - const ProcessInfo& rCurrentProcessInfo) const + const GeometryType& rElementGeometry, + const ProcessInfo& rCurrentProcessInfo) const { const auto result = ConstitutiveLaw::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo); diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index 6fee5f917a01..ad22fb3c2c3b 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -356,13 +356,13 @@ void KratosGeoMechanicsApplication::Register() mIncrementalLinearElasticInterface3DSurfaceLaw) // Deprecated! Keeping the old names for backward compatibility, but will be removed. - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulomb2D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulomb3D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulomb) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff2D", mMohrCoulombLawPlaneStrain) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombWithTensionCutOff3D", mMohrCoulombLaw3D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombWithTensionCutOff", mInterfaceCoulombLawPlaneStrain) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulomb2D", mMohrCoulomb2D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulomb3D", mMohrCoulomb3D) - KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulomb", mInterfaceCoulomb) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombLawPlaneStrain", mMohrCoulombLawPlaneStrain) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoMohrCoulombLaw3D", mMohrCoulombLaw3D) + KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoInterfaceCoulombLawPlaneStrain", mInterfaceCoulombLawPlaneStrain) // Register Variables KRATOS_REGISTER_VARIABLE(VELOCITY_COEFFICIENT) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.h b/applications/GeoMechanicsApplication/geo_mechanics_application.h index f7b8453be765..d56fb0ee2910 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.h @@ -961,10 +961,10 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ const GeoIncrementalLinearElasticInterfaceLaw mIncrementalLinearElasticInterface3DSurfaceLaw{ std::make_unique()}; - const MohrCoulombLaw mMohrCoulomb2D{std::make_unique()}; - const MohrCoulombLaw mMohrCoulomb3D{std::make_unique()}; + const MohrCoulombLaw mMohrCoulombLawPlaneStrain{std::make_unique()}; + const MohrCoulombLaw mMohrCoulombLaw3D{std::make_unique()}; - const InterfaceCoulombLaw mInterfaceCoulomb{std::make_unique()}; + const InterfaceCoulombLaw mInterfaceCoulombLawPlaneStrain{std::make_unique()}; ///@} diff --git a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json index bd59b7de2027..e9c88e71e563 100644 --- a/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json +++ b/applications/GeoMechanicsApplication/tests/C-Phi_reduction_process/Mohr_Coulomb_model/MaterialParameters_stage2.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulomb2D" + "name" : "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index cb6b135e3bcc..7a52c0191a0d 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -37,7 +37,7 @@ "properties_id": 2, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -69,7 +69,7 @@ "properties_id": 3, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -101,7 +101,7 @@ "properties_id": 4, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -133,7 +133,7 @@ "properties_id": 5, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -166,7 +166,7 @@ "properties_id": 6, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -199,7 +199,7 @@ "properties_id": 7, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -222,7 +222,7 @@ "properties_id": 8, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -245,7 +245,7 @@ "properties_id": 9, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -268,7 +268,7 @@ "properties_id": 10, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+07, @@ -291,7 +291,7 @@ "properties_id": 11, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+08, @@ -315,7 +315,7 @@ "properties_id": 12, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS": 4.8e+08, diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp index 812a21551901..518f70f57773 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_interface_coulomb_law.cpp @@ -377,7 +377,8 @@ KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Serialization, Krato KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_Has2DWorkingSpaceDimension, KratosGeoMechanicsFastSuiteWithoutKernel) { - KRATOS_EXPECT_EQ(InterfaceCoulombLaw{std::make_unique()}.WorkingSpaceDimension(), N_DIM_2D); + KRATOS_EXPECT_EQ( + InterfaceCoulombLaw{std::make_unique()}.WorkingSpaceDimension(), N_DIM_2D); } KRATOS_TEST_CASE_IN_SUITE(InterfaceCoulombWithTensionCutOff_HasCauchyStressMeasure, KratosGeoMechanicsFastSuiteWithoutKernel) diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp index 11e3bb2911eb..7cb021a43b7f 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_mohr_coulomb_law.cpp @@ -25,7 +25,9 @@ using namespace std::string_literals; namespace Kratos::Testing { -Vector CalculateMappedStressVector(Vector& rCauchyStressVector, ConstitutiveLaw::Parameters& rParameters, MohrCoulombLaw& rLaw) +Vector CalculateMappedStressVector(Vector& rCauchyStressVector, + ConstitutiveLaw::Parameters& rParameters, + MohrCoulombLaw& rLaw) { Vector strain_vector = ZeroVector(4); rParameters.SetStrainVector(strain_vector); @@ -671,17 +673,15 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombLawWithoutTensionCutoff_TrialStressInDegene law.InitializeMaterial(properties, dummy_element_geometry, dummy_shape_function_values); // Act - const auto apex = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); - auto cauchy_stress_vector = - UblasUtilities::CreateVector({apex + 20.0, apex + 10.0, apex, 0.0}); + const auto apex = cohesion / std::tan(MathUtils<>::DegreesToRadians(phi_in_degrees)); + auto cauchy_stress_vector = UblasUtilities::CreateVector({apex + 20.0, apex + 10.0, apex, 0.0}); const auto resulting_cauchy_stress_vector = CalculateMappedStressVector(cauchy_stress_vector, parameters, law); auto plasticity_status = 0; law.GetValue(GEO_PLASTICITY_STATUS, plasticity_status); // Assert - const auto expected_cauchy_stress_vector = - UblasUtilities::CreateVector({apex, apex, apex, 0.0}); + const auto expected_cauchy_stress_vector = UblasUtilities::CreateVector({apex, apex, apex, 0.0}); KRATOS_EXPECT_VECTOR_NEAR(resulting_cauchy_stress_vector, expected_cauchy_stress_vector, Defaults::absolute_tolerance); KRATOS_EXPECT_EQ(plasticity_status, static_cast(PlasticityStatus::TENSION_MOHR_COULOMB_CORNER)); diff --git a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json index e48505255a14..6e36e09803f2 100644 --- a/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/crow_validation/mohr_coulomb_clay-sand/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -33,7 +33,7 @@ "properties_id": 2, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -61,7 +61,7 @@ "properties_id": 3, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -89,7 +89,7 @@ "properties_id": 4, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -117,7 +117,7 @@ "properties_id": 5, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -145,7 +145,7 @@ "properties_id": 6, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -173,7 +173,7 @@ "properties_id": 7, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -201,7 +201,7 @@ "properties_id": 8, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -229,7 +229,7 @@ "properties_id": 9, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -252,7 +252,7 @@ "properties_id": 10, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -275,7 +275,7 @@ "properties_id": 11, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -298,7 +298,7 @@ "properties_id": 12, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -321,7 +321,7 @@ "properties_id": 13, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -344,7 +344,7 @@ "properties_id": 14, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -367,7 +367,7 @@ "properties_id": 15, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -390,7 +390,7 @@ "properties_id": 16, "Material": { "constitutive_law": { - "name": "GeoInterfaceCoulomb" + "name": "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json index 203d442a0020..5d5c47f1649d 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_crs/drained/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json index 203d442a0020..5d5c47f1649d 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_dss/drained/mohr_coulomb/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json index a75b0a4a9bbc..4e17d2222844 100644 --- a/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_element_lab/test_triaxial/drained/MaterialParameters.json @@ -5,7 +5,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name": "GeoMohrCoulomb2D" + "name": "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json index e805dc978d29..45c7a4276a6e 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters2D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulomb2D" + "name" : "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json index 2fb0945f5af2..97ea52fc9aef 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/common/MaterialParameters3D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulomb3D" + "name" : "GeoMohrCoulombLaw3D" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json index a8cd9b513c95..846cf4124f66 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/interface_coulomb_2plus2/MaterialParameters.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoInterfaceCoulomb" + "name" : "GeoInterfaceCoulombLawPlaneStrain" }, "Variables": { "INTERFACE_NORMAL_STIFFNESS" : 30000000, diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json index 5b1a520e7dfd..7cb2011e4216 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_column_under_gravity/MaterialParameters.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulomb2D" + "name" : "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE" : "CONSTANT_PW_FIELD", diff --git a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json index 524c61b9bb9d..144a4c7f0e57 100644 --- a/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json +++ b/applications/GeoMechanicsApplication/tests/test_mohr_coulomb_with_tension_cutoff/test_dirichlet_tension_apex_return_zone_2d/MaterialParameters2D.json @@ -4,7 +4,7 @@ "properties_id": 1, "Material": { "constitutive_law": { - "name" : "GeoMohrCoulomb2D" + "name" : "GeoMohrCoulombLawPlaneStrain" }, "Variables": { "GEO_DRAINAGE_TYPE" : "FULLY_COUPLED", From 254c5c28a87d13c4b15cd455508e3b7a7357032f Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 9 Jun 2026 10:24:14 +0200 Subject: [PATCH 27/27] Disabled tension cutoff in some more materials and applied review comment --- .../custom_constitutive/coulomb_impl.cpp | 27 ++++++++++--------- .../mohr_coulomb/MaterialParameters.json | 12 +++------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp index c3cbd3ae7fa2..df3545731b7e 100644 --- a/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp +++ b/applications/GeoMechanicsApplication/custom_constitutive/coulomb_impl.cpp @@ -55,6 +55,14 @@ std::optional CreateOptionalTensionCutOff(const Properties& rMate return std::nullopt; } +template +bool IsAdmissibleStressState(const YieldSurfaceType& rYieldSurface, const StressStateType& rTrialStressState) +{ + const auto yield_function_value = rYieldSurface.YieldFunctionValue(rTrialStressState); + const auto tolerance = 1.0e-10 * (1.0 + std::abs(yield_function_value)); + return yield_function_value < tolerance; +} + } // namespace namespace Kratos @@ -115,18 +123,13 @@ void CoulombImpl::RestoreKappaOfCoulombYieldSurface() template bool CoulombImpl::IsAdmissibleStressState(const StressStateType& rTrialStressState) { - const auto coulomb_yield_function_value = mCoulombYieldSurface.YieldFunctionValue(rTrialStressState); - constexpr auto tolerance = 1.0e-10; - const auto coulomb_tolerance = tolerance * (1.0 + std::abs(coulomb_yield_function_value)); - - auto admissible_state = coulomb_yield_function_value < coulomb_tolerance; - if (admissible_state && mTensionCutOff) { - const auto tension_yield_function_value = mTensionCutOff->YieldFunctionValue(rTrialStressState); - const auto tension_tolerance = tolerance * (1.0 + std::abs(tension_yield_function_value)); - admissible_state = tension_yield_function_value < tension_tolerance; - } - if (admissible_state) mPlasticityStatus = PlasticityStatus::ELASTIC; - return admissible_state; + if (!::IsAdmissibleStressState(mCoulombYieldSurface, rTrialStressState)) return false; + + if (mTensionCutOff && !::IsAdmissibleStressState(*mTensionCutOff, rTrialStressState)) + return false; + + mPlasticityStatus = PlasticityStatus::ELASTIC; + return true; } template diff --git a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json index 7a52c0191a0d..750e18b6c9ba 100644 --- a/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json +++ b/applications/GeoMechanicsApplication/tests/building_pit/mohr_coulomb/MaterialParameters.json @@ -155,8 +155,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -188,8 +187,7 @@ "MINIMUM_RELATIVE_PERMEABILITY": 1.0e-04, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 2.0 } } @@ -298,8 +296,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0e+08, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD", @@ -322,8 +319,7 @@ "INTERFACE_SHEAR_STIFFNESS": 2.0e+08, "GEO_COHESION": 0.0, "GEO_FRICTION_ANGLE": 32.0, - "GEO_ENABLE_TENSION_CUT_OFF": true, - "GEO_TENSILE_STRENGTH": 0.0, + "GEO_ENABLE_TENSION_CUT_OFF": false, "GEO_DILATANCY_ANGLE": 2.0, "BIOT_COEFFICIENT": 1.0, "GEO_DRAINAGE_TYPE": "CONSTANT_PW_FIELD",