Overview of TFEL, MFront and MTest

The TFEL project is an open-source collaborative development of the French Alternative Energies and Atomic Energy Commission (CEA) and Électricité de France (EDF) in the framework of the PLEIADES plateform (see Marelle et al. (2016)). TFEL provides mathematical libraries which are the basis of the MFront code generator and the MTest solver (see (Helfer, Proix, and Fandeur 2015; Helfer et al. 2015)).

MFront translates a set of closely related domain specific languages into plain C++ on top of the TFEL library. Those languages are meant to be easy to use and learn by researchers and engineers and cover three kinds of material knowledge:

Authors of MFront paid particular attention to the robustness, reliability and numerical efficiency of the generated code, in particular for mechanical behaviours: various benchmarks show that MFront implementations are competitive with native implementations available in the Cast3M CEA (2016), Code_Aster EDF (2016), Europlexus CEA and JRC (2016), Abaqus/Standard , Abaqus/Explicit (Dassault Systèmes 2016; Deloison and Congourdeau 2016) and Cyrano3 Petry and Helfer (2015) solvers.

Portability is also a very important issue: a behaviour written in MFront shall be usable in a solvers for which an interface exists. For example, for finite strain analysis, each solver has chosen a specific definition of the consistent tangent operator. MFront will convert the operator provided by the user, who is free to choose the most convenient operator to ease the implementation effort, into the one expected by the solver. The conversion paths currently available are depicted on Figure  1.

Figure 1: “Relation between tangent operators”
Figure 1: “Relation between tangent operators”

MTest is a tool created to perform unit-testings on the mechanical behaviours generated by MFront.

How to get TFEL and MFront

TFEL is distributed with the Code_Aster finite element solver (see EDF (2016)), the Salome-Meca plateform (see also EDF (2016)) and the Material Ageing Plateform (MAP), which is available for all members of the Material Ageing Institute (MAI) (see (Latourte et al. 2013; MAI 2016)).

Sources of TFEL can be downloaded from its website (see CEA and EDF (2016)). Binaries for the Windows operating system which are built upon versions of the Cast3M finite element solver are also available.


From a user point of view, TFEL 3.0 brings many game-changing features which are described hereafter:

Figure 2: Phase field modelling of the nuclear fuel pellet fragmentation during the reactor start-up (see Helfer et al. (2017) for details)
Figure 2: Phase field modelling of the nuclear fuel pellet fragmentation during the reactor start-up (see Helfer et al. (2017) for details)

Many improvements for mechanical behaviours have also been made, which won’t be detailed in this paper:

New interfaces


Europlexus (EPX) is a simulation software dedicated to the analysis of fast transient phenomena involving structures and fluids in interaction. The program is co-owned by the French Alternative Energies and Atomic Energy Commission (CEA) and the Joint Research Centre of the European Commission (EC/JRC). Its development is carried out through a Consortium involving the co-owners and so-called major partners who are granted a complete access to the source code and development tools (see CEA and JRC (2016)).

The ability to call external libraries generated by MFront has been introduced in the current developpement version of EPX. When loading a MFront behaviour, Europlexus automatically retrieves various helpfull information about the mechanical behaviour:

This information allows to check that the material declaration is consistent and reduces the inputs provided by the user to the bare minimal. A similar technique is used in Code_Aster and MTest when calling MFront generated behaviours.

Supported features

The following features are currently available:

Finite strain strategies

Small strain behaviours can be embedded through finite strain strategies: currently, MFront provides (see (EDF 2013; Miehe, Apel, and Lambrecht 2002)):

In both cases, the strain measure is computed before calling the behaviour and the stress tensor resulting from the behaviour integration is interpreted as the dual of this strain measure. This stress tensor is then converted into the Cauchy stress tensor for computing the nodal forces.


Figure 3: Impact of two bars
Figure 3: Impact of two bars

Figure  3 shows a simple test simulating the impact of two bars.

Table 1: Example of comparison of the computation times for the test depicted on Figure  3 for various behaviours describing istropic plasticity with linear isotropic hardening.
Behaviour Computational times
native 174s
MFront FiniteRotationSmallStrain 232s
MFront ImplicitSimoMieheElastoPlasticity 250s
MFront MieheApelLambrechtLogarithmicStrain 528s

This tests show that, for simple behaviours describing isotropic plasticty, MFront behaviours seems a bit less efficient than Fortran built-in implementations, as reported on Table  1. However, it shall be stated that the behaviours tested are not strictly equivalent (native behaviours are based on objective stress rates while MFront ones are hyperelastoplastic). MFront computational times can be improved by keeping some intermediate results for one step to the next to the expense of memory usage.

This interface is fully described here: http://tfel.sourceforge.net/epx.html

Acknowledgements This work was accomplished within the framework of the “dynamique rapide” project, financially supported by the CEA and EDF.

Abaqus/Standard, Abaqus/Explicit and CalculiX

The Abaqus Unified FEA product suite provides:

MFront provides an interface for these two solvers and strives to allow the user restart a computation while switching from one solver to the other: a feature which is not easy to implement as these solvers use different conventions and, by default, different kinematics assumptions.

The Abaqus/Standard interface can also be used to extend the CalculiX finite element solver (see Dhondt and Wittig (2016)).

Calling MFront behaviours from Abaqus/Standard or Abaqus/Explicit

Calling a behaviour from Abaqus/Standard or Abaqus/Explicit is a two steps process:

Features supported

For every behaviour, example of input file are automatically generated.

The MFront interface for the Abaqus/Standard solver supports orthotropic and isotropic, small and finite strain behaviours. For isotropic behaviours written in the small strain framework, internal state variables are automatically and properly rotated in finite strain analyses.

Concerning Abaqus/Explicit, we support orthotropic and isotropic finite strain behaviours.

In both cases, we offer three finite strain strategies to use small strain behaviours implementations in finite strain:


In Abaqus/Standard, our tests show that the performances of MFront generated behaviours are on par with native behaviours (even slightly better in some cases): those results were quite surprising because we expected the manual handling of the external libraries at the Gauss point level to be a performance bottleneck.

Figure 4: Simulation of a Punching test
Figure 4: Simulation of a Punching test
Table 2: Comparison of computational times for a simple isotropic plasticity behaviour with linear kinematic hardening applied to the punching test depicted on Figure  4.
Implementation Computational times
Native 638s
VUMAT (Fortran) 762s
MFront 788s

In Abaqus/Explicit, we found that our implementations are about \(20\,\%\) slower than the native ones on the simulation of the punching test depicted on Figure  4 for an isotropic plastic behaviour with linear isotropic hardening. However, our implementations are nearly equivalent to VUMAT implementations described in Abaqus Inc. (2005) (see Table  2). This difference can have several explanations:

Additional documentations

A dedicated page has been created describing the current features of these interfaces, the potential pitfalls, and the choices that were made to support some behaviours, for example orthotropic finite strain behaviours: http://tfel.sourceforge.net/abaqus.html

A specific talk of the Second MFront User Day has been dedicated to those interfaces (see Deloison and Congourdeau (2016)).

Behaviour bricks

Behaviour bricks allow the use of predefined parts of a behaviour.

For example, the StandardElasticity brick handles:

This brick works with isotropic of orthotropic small-strain behaviours implemented using the Implicit domain specific language.

The use of bricks leads to much smaller, more robust and more portable implementations of mechanical behaviours. The user can focus on the specific parts of the behaviour. Listing  1 shows how a implicit implementation with analytical jacobian of the Norton behaviours can now be written in about 25 lines of codes (without the blank and comment lines).

Listing 1: Implicit implementation of the Norton behaviour

@DSL Implicit;
@Behaviour ImplicitNorton;
@ModellingHypotheses {".+"};
@Brick   StandardElasticity;
@Epsilon 1.e-16;

@ElasticMaterialProperties {150e9,0.3};

@StateVariable strain p;

@Parameter A = 8.e-67;
@Parameter E = 8.2;

  const auto seq  = sigmaeq(sig);
    const auto n    = 3*deviator(sig)/(2*seq);
    const auto tmp  = A*pow(seq,E-1);
    const auto df_dseq = E*tmp;
    feel += dp*n;
    fp   -= tmp*seq*dt;
    // jacobian
    dfeel_ddeel += (2*mu*theta*dp/seq)*(Stensor4::M()-(n^n));
    dfeel_ddp    = n;
    dfp_ddeel    = -2*mu*theta*df_dseq*dt*n;
} // end of @Integrator

The following bricks are available:

Pipe Modelling in MTest

Most mechanical behaviours available for the cladding are identified on tests where a pipe is submitted to an internal pressure loading.

MTest have been extended to describe various tests on pipes with various axial or radial loadings using a mono-dimensional finite strain framework described in depth in Helfer (2015):

This extension allows a consistent identification of the mechanical behaviour at finite strain.

Table 3: Example of comparison of the computation times for a simple test where a pipe with a Norton behaviour is submitted to internal pressure. The mesh size has been choosen large enough so that MTest computational times become significant
Solver Computational times
MTest (C++) 0.024s
MTest (python) 0.071s
Castem 2015 PASAPAS 5.805s

Being very specialized, this extension leads to computational times significantly lower than with general purpose finite element solver (see Table  3).

New acceleration algorithms in MTest

The Cast3M finite element solver does not use by default a standard Newton-Raphson algorithm which would require the computation of the consistent tangent operator, but relies on a quasi-Newton algorithm using the elastic stiffness. The displacement is corrected by this fixed point iteration: \[ \Delta\,\mathbb{U}^{n+1}=\Delta\,\mathbb{U}^{n}-\mathbb{K}^{-1}_{\mathrm{el}}\,\cdot\,\mathbb{R}\left(\Delta\,\mathbb{U}^{n}\right) \]

The convergence of this algorithm is greatly improved by the use of an acceleration algorithm closed to the one introduced by Anderson (see Anderson (1965)). There is no point in discussing whether this strategy is better than the standard Newton-Raphson algorithm, as the answer is very sensitive to the case treated. However, we can outline that the elastic stiffness is only decomposed once when using the Cast3M strategy.

In MTest, systems solved are so small and the situation treated so simple that the full Newton-Raphson algorithm is always the better option.

However, when the consistent tangent operator is not available, the Cast3M strategy can be used in MTest. As described by I. Ramière (see Ramière and Helfer (2015)), various acceleration algorithms were introduced and tested in MTest.

Figure 5: Convergence of the TMFFT solver with and without acceleration (see Castelier, Gélébart, and Helfer (2016) for details)
Figure 5: Convergence of the TMFFT solver with and without acceleration (see Castelier, Gélébart, and Helfer (2016) for details)

Those algorithms were improved by É. Castelier to accelerate the equilibrium iterations of the TMFFT solver (see Castelier, Gélébart, and Helfer (2016)) for systems with several millions of degrees of freedom (see Figure  5). They are available in MTest with the name UAnderson and FAnderson. The implementations of those algorithms, which require a special care to get accurate and reliable results, are available as autonomous classes which can be used outside MTest.

A stable API to build external tools: application to the mechanical behaviours identification developed in the MAP plateform

With version 3.0.x, MFront and MTest now provide stable API in C++ and Python upon which external tools can be built.

This is illustrated by the recent development by EDF of an identification tool, called c_solver_constitutive_law_0d, in the Material Ageing Plateform (MAP) based on:

This identification tool, co-developed by two departments of EDF R&D (SINETICS and MMC), is a central part of the material knowledge management of the MAP plateform and thus addresses the following issues:

Though relatively young - it has been developed for one year now -, this tool gives quite promising results, as discussed during the MFront users day (see Munier et al. (2016)).

This ambitious project highlights the need for high quality coding standards for TFEL, MFront and MTest. This point is discussed in depth in the following section.

An industrial strength software

The version 3.0.x is based on the C++11 standard. This implied a major code refactoring. In particular, the expression template engine was greatly simplified and is now much more reliable and maintainable.

Systems supported

Version 3.0.x of TFEL/MFront will be available on the following systems:

Various Unix-based systems, including Mac Os X, have been tested at various stages of the development of this version and shall work out of the box.

Compiler support

Version 3.0.x were tested using the following compilers:


A vast amount of documentation has been written for TFEL and MFront, mostly in French: (see http://tfel.sourceforge.net/publications.html).

With version \(3.0\), we followed the example of the CMake software and introduced the ability to query documentation from the command line for MFront and MTest which now provide the following options:

The documentations of the keywords are now written in English and displayed using pandoc markdown language.

Code quality

Code quality is an important matter in the development of TFEL and MFront. As an example, one may consider the number of code defects measured by the Coverity analysis tool: this indicator shows that the code is nearly as good as great open-source projects such as Python and much lower that what is considered as well developed industrial projects.

Many static analysis tools (Coverty, PVS-Studio, cppcheck, clang-tidy) were used to improve the overall quality of the code.

A myriad of tests

TFEL and MFront use a test-driven development scheme: each new functionality has at least one associated test. The current version is delivered with more than \(3\,300\) tests, each of them containing various units-tests.

Solved Tickets

Tickets #31

To be consistent with the MTest input file keywords, the following methods have been added to the MTest class of themtest python module:

Tickets #32

The python interface did not allow to initialize the values of the driving variables (deformation, deformation gradient or displacement jump) or the thermodynamic forces (Cauchy stress or cohesive force).

The setDrivingVariablesInitialValues and the setThermodynamicForcesInitialValues methods were added the MTest class of themtest python module to solve this issue.

To be consistent with the MTest input file keywords, the following methods have also been added to the MTest class of themtest python module:


This paper have highlighted the improvements made in the version 3.0 of TFEL, MFront and MTest. Mechanical behaviours can be written even more easily than in previous versions and performances are competitive with built-in behaviour implementation of most mechanical solvers. Being mostly developed for implicit solvers, we were pleased to see that performances obtained in explicit solvers such as Europlexus and Abaqus/Explicit are quite decent.

The MFront users’ community is steadily increasing outside the nuclear industry and the french mechanical community: its use now encompasses a wide range of materials and applications. Creation of new interfaces is relatively easy, extensive testing is time consuming. Every new user is thus welcomed, even with a solver which is not currently supported yet, and everybody’s contribution in the improvement of TFEL and MFront is much appreciated.

Acknowledgements This research was conducted in the framework of the PLEIADES project, which was supported financially by the CEA (Commissariat à l’Énergie Atomique et aux Énergies Alternatives), EDF (Électricité de France) and AREVA and in the framework of the 3M project hold within EDF R&D.


Abaqus Inc. 2005. “Writing a Vumat.” 2005. http://imechanica.org/files/appendix3-vumat.pdf.

Anderson, Donald G. 1965. “Iterative Procedures for Nonlinear Integral Equations.” J. ACM 12 (4):547–60. https://doi.org/10.1145/321296.321305.

Argaud, Jean-Philippe, Bertrand Bouriquet, Aimery Assire, and Stéphane Gervais. 2014. “Reconstruction by Data Assimilation of the Inner Temperature Field from Outer Measurements in a Thick Pipe.” arXiv:1404.7324 [Physics], April. http://arxiv.org/abs/1404.7324.

Castelier, Étienne, Lionel Gélébart, and Thomas Helfer. 2016. “Using Anderson Algorithm to Accelerate fft Based Methods.” In. Greece.

CEA. 2016. “Site Cast3M.” http://www-cast3m.cea.fr/.

CEA, and EDF. 2016. “MFront Web Site.” http://www.tfel.sourceforge.net/.

CEA, and JRC. 2016. “Europlexus Web Site.” 2016. http://www-epx.cea.fr/index.php/what-is-epx.

Dassault Systèmes. 2016. “Abaqus Web Site.” 2016. http://www.3ds.com/products-services/simulia/products/abaqus/.

Deloison, Dominique, and Fabrice Congourdeau. 2016. “Testing and Validation of the MFront Interface for ABAQUS.” EDF Lab Saclay. https://github.com/thelfer/tfel-doc/blob/master/MFrontUserDays/SecondUserDay/deloison-abaqus.pdf.

Dhondt, Guido, and Klaus Wittig. 2016. “Calculix: A Free Software Three-Dimensional Structural Finite Element Program.” 2016. http://www.calculix.de/.

EDF. 2013. “Loi de Comportement Hyperélastique : Matériau Presque Incompressible.” Référence du Code Aster R5.03.19. EDF-R&D/MITI/MMN. http://www.code-aster.org.

EDF. 2016. “Site Du Code_Aster.” http://www.code-aster.org.

Helfer, Thomas. 2015. “Extension of Monodimensional Fuel Performance Codes to Finite Strain Analysis Using a Lagrangian Logarithmic Strain Framework.” Nuclear Engineering and Design 288 (July):75–81. https://doi.org/10.1016/j.nucengdes.2015.02.010.

Helfer, Thomas, Benoît Bary, Tran Thang Dang, Olivier Fandeur, and Bruno Michel. 2017. “Modélisation Par Champ de Phase de La Fissuration Des Matériaux Fragiles: Aspects Numériques et Applications Au Combustible Nucléaire Oxyde.” In. Giens, France: CSMA.

Helfer, Thomas, Bruno Michel, Jean-Michel Proix, Maxime Salvo, Jérôme Sercombe, and Michel Casella. 2015. “Introducing the Open-Source Mfront Code Generator: Application to Mechanical Behaviours and Material Knowledge Management Within the PLEIADES Fuel Element Modelling Platform.” Computers & Mathematics with Applications. https://doi.org/10.1016/j.camwa.2015.06.027.

Helfer, Thomas, Jean-Michel Proix, and Olivier Fandeur. 2015. “Implantation de Lois de Comportement Mécanique à L’aide de MFront : Simplicité, Efficacité, Robustesse et Portabilité.” In. Giens, France: CSMA.

Hure, J., S. El Shawish, L. Cizelj, and B. Tanguy. 2016. “Intergranular Stress Distributions in Polycrystalline Aggregates of Irradiated Stainless Steel.” Journal of Nuclear Materials 476 (August):231–42. https://doi.org/10.1016/j.jnucmat.2016.04.017.

Latourte, Felix, Charles Toulemonde, Jean-François Rit, Julien Sanahuja, Nicolas Rupin, Jerome Ferrari, Hadrien Perron, et al. 2013. “The Materials Ageing Plateform: Towards a Toolbox to Perform a Wide Range of Research Studies on the Behavior of Industrial Materials.” In PhotoMechanics 2013, Clé USB. Montpellier, France. https://hal.archives-ouvertes.fr/hal-00836332.

MAI. 2016. “The Material Ageing Institute Web Site.” 2016. http://www.themai.org/.

Marelle, Vincent, Patrick Goldbronn, Stéphane Bernaud, Étienne Castelier, Jérôme Julien, Katherine Nkonga, Laurence Noirot, and Isabelle Ramière. 2016. “New Developments in ALCYONE 2.0 Fuel Performance Code.” In. Boise, USA.

Michel, Bruno, Thomas Helfer, Isabelle Ramière, and Coralie Esnoul. 2016. “3D Continuum Damage Approach for Simulation of Crack Initiation and Growth in Ceramic Materials.” Key Engineering Materials 713. https://doi.org/10.4028/www.scientific.net/KEM.713.155.

Michel, Bruno, Jérôme Sercombe, Gilles Thouvenin, and Rémy Chatelet. 2008. “3D Fuel Cracking Modelling in Pellet Cladding Mechanical Interaction.” Engineering Fracture Mechanics 75 (11):3581–98. https://doi.org/10.1016/j.engfracmech.2006.12.014.

Miehe, C., N. Apel, and M. Lambrecht. 2002. “Anisotropic Additive Plasticity in the Logarithmic Strain Space: Modular Kinematic Formulation and Implementation Based on Incremental Minimization Principles for Standard Materials.” Computer Methods in Applied Mechanics and Engineering 191 (47–48):5383–5425. https://doi.org/10.1016/S0045-7825(02)00438-3.

Munier, Rémi, Lucie Berthon, Jean Philippe Argaud, Charles Toulemonde, François Curtit, and Jean-François Rit. 2016. “Identification de Paramètres de Loi de Comportement.” EDF Lab Saclay. https://github.com/thelfer/tfel-doc/blob/master/MFrontUserDays/SecondUserDay/munier-identification.pptx.

Petry, Charles, and Thomas Helfer. 2015. “Advanced Mechanical Resolution in CYRANO3 Fuel Performance Code Using MFront Generation Tool.” In LWR Fuel Performance Meeting/TopFuel/WRFPM. Zurich, Switzerland.

Ramière, Isabelle, and Thomas Helfer. 2015. “Iterative Residual-Based Vector Methods to Accelerate Fixed Point Iterations.” Computers and Mathematics with Applications.