Error when compiling Mohr-Coulomb MFront file examples from MFront gallery


I am interested in doing simulations using the Mohr-Coulomb criterion. I followed this tutorial 1 which implements von-Mises criterion with MFront. Here, I successfully compiled the MFront file and ran the sample problem. Now, I moving on to Mohr-Coulomb criterion with this tutorial 2. There are two code blocks that I saved into MFront files. The first one was in the section " Simplification of the MFront file : use of TFEL/Material/MohrCoulombYieldCriterion.hxx file" and other one is in the section " Simplification of the MFront file : use of the StandardElastoViscoPlasticity brick". Both return this error when compiling:

In file included from ~/codes/tfel/master/install-661d98cec3cd9c6059b31210be1dbe72e447f11d/include/TFEL/Material/MohrCoulombYieldCriterion.hxx:169,
from …/include/TFEL/Material/MohrCoulomAbboSloan3BehaviourData.hxx:40,
from …/include/TFEL/Material/MohrCoulomAbboSloan3.hxx:33,
from MohrCoulomAbboSloan3-generic.cxx:27:
~/codes/tfel/master/install-661d98cec3cd9c6059b31210be1dbe72e447f11d/include/TFEL/Material/MohrCoulombYieldCriterion.ixx: In lambda function:
~/codes/tfel/master/install-661d98cec3cd9c6059b31210be1dbe72e447f11d/include/TFEL/Material/MohrCoulombYieldCriterion.ixx:110:56: error: ‘sin_angle’ was not declared in this scope
110 | const auto term2 = sign * p.sin_lodeT + isqrt3 * sin_angle * p.cos_lodeT;
| ^~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [Makefile.mfront:36: MohrCoulomAbboSloan3-generic.o] Error 1
callMake: can’t build target ‘all’
libraries building went wrong
Command was: make -C src -f Makefile.mfront all -s

Anyone who had the same problem? Any solution?


EDIT: I stitched the codes in the “Implementation” section of tutorial 2 to create the most explicit Mfront file without the simplifications in the next sections. I compiled it successfully but I have to include “@Parameter pi = 3.14159265359;” and “constexpr auto local_zero_tolerance = real(1e-14);” as they were missing.

Hi, this question is related to MFront. I suggest you post it here instead:

Will do. Thanks.

While I have you here, may I ask if my goal is doable in FEniCS with MFront? I would like to do soil modeling in FEniCS and your tutorial with a von Mises model is the closest I can base my project. My background is not in solid/continuum mechanics so I do not have the foresight if this will be a success.

Yes, as soon as you have a working MFront behaviour you will be able to use it using mgis.fenics. See the different demos here: Documented demos coupling FEniCS with MFront — Numerical tours of continuum mechanics using FEniCS master documentation

1 Like