Implement a Mohr Coulomb plasticity model - #2130
Conversation
AI assisted vibe coding based on GPT 5.6 sol, implementing the material from Clausen et al., Computers and Structures 85(2007)
There was a problem hiding this comment.
Pull request overview
This PR introduces a new finite-strain, logarithmic-strain-based Mohr–Coulomb plasticity material (MAT_Struct_MohrCoulomb) into 4C, wires it into the material registry/factory, and adds unit/integration coverage plus developer documentation.
Changes:
- Add
Mat::PlasticMohrCoulombmaterial implementation (state, return mapping, outputs, pack/unpack) and parameter type. - Register the new material type in enums, factory creation, and input validation (legacy valid-materials spec).
- Add constitutive unit tests and two one-element structure regression tests, plus developer-guide documentation.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/mat/4C_mat_plasticmohrcoulomb.hpp |
Declares new Mohr–Coulomb material + parameter/type plumbing. |
src/mat/4C_mat_plasticmohrcoulomb.cpp |
Implements return mapping, state update, outputs, and serialization. |
src/mat/4C_mat_material_factory.cpp |
Adds factory hook to construct Mohr–Coulomb parameters/material. |
src/global_legacy_module/4C_global_legacy_module_validmaterials.cpp |
Adds YAML/input-spec definition & validators for MAT_Struct_MohrCoulomb. |
src/core/legacy_enum_definitions/4C_legacy_enum_definitions_materials.hpp |
Adds new m_plmohrcoulomb enum value. |
src/core/legacy_enum_definitions/4C_legacy_enum_definitions_materials.cpp |
Maps enum to input keyword string. |
unittests/mat/4C_mohrcoulomb_test.cpp |
Adds constitutive-level tests (elastic/plastic returns, tangent, outputs, pack/unpack). |
tests/input_files/mat_mohrcoulomb_return_to_apex.4C.yaml |
Adds 1-element structure regression test for apex return. |
tests/input_files/mat_mohrcoulomb_return_to_compression_edge.4C.yaml |
Adds 1-element structure regression test for compression-edge return. |
tests/list_of_tests.cmake |
Registers the two new regression tests. |
doc/documentation/src/developer_guide/mohr_coulomb_material.rst |
Adds developer-guide documentation for the new material. |
doc/documentation/src/developer_guide/development_parts.rst |
Adds the new doc page to the developer-guide toctree. |
| void Mat::PlasticMohrCoulomb::evaluate(const Core::LinAlg::Tensor<double, 3, 3>* defgrad, | ||
| const Core::LinAlg::SymmetricTensor<double, 3, 3>& glstrain, | ||
| const Teuchos::ParameterList& params, const EvaluationContext<3>& context, | ||
| Core::LinAlg::SymmetricTensor<double, 3, 3>& stress, | ||
| Core::LinAlg::SymmetricTensor<double, 3, 3, 3, 3>& cmat, int gp, int eleGID) | ||
| { | ||
| FOUR_C_ASSERT_ALWAYS(defgrad != nullptr, "Mohr-Coulomb requires the deformation gradient."); | ||
| const double determinant_deformation_gradient = Core::LinAlg::det(*defgrad); | ||
| FOUR_C_ASSERT_ALWAYS(determinant_deformation_gradient > 0.0, | ||
| "Mohr-Coulomb requires a positive deformation-gradient determinant, got {}.", | ||
| determinant_deformation_gradient); |
| const int problem_instance = Global::Problem::instance()->materials()->get_read_from_problem(); | ||
| Core::Mat::PAR::Parameter* material = | ||
| Global::Problem::instance(problem_instance)->materials()->parameter_by_id(material_id); | ||
| if (material->type() != material_type()) | ||
| FOUR_C_THROW("Packed material type {} does not match Mohr-Coulomb type {}.", material->type(), | ||
| material_type()); | ||
| params_ = static_cast<Mat::PAR::PlasticMohrCoulomb*>(material); |
| double scalar_output(const std::string& name) | ||
| { | ||
| Core::LinAlg::SerialDenseMatrix data(1, 1); | ||
| EXPECT_TRUE(material_->evaluate_output_data(name, data)); | ||
| return data(0, 0); |
|
Hi @ischeider, the test results look fine to me, although for soil the MC is normally used in the context of small strain. I would suggest trying some structural tests to test the reliability of the implementation. The first one is the slope stability (sent to you separately via email). Other than that, one could test the non-associativity by setting dilatancy angle=1 (this situation typically occurs in soil investigation reports when the friction angle < 30). |
Description and Context
I implemented a Mohr-Coulomb plasticity model into 4C. It has a possibly non-associated flow rule and the typical parameters
COHESION, FRICTION_ANGLE, DILATANCY_ANGLE. In addition, there might be a linear or saturating hardening. of the cohesion.The main implementation was done by openAI GPT 5.6 sol, with little interaction, some review and correction by me.
One main point is that the LLM automatically delivers some documentation and puts it into the developer guide. For now I left it there, so that we can discuss, whether this is useful or not (it is in my opinion), and whether it's the right place for it (I guess not).