The MFrontGenericInterfaceSupport project

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. The MFrontGenericInterfaceSupport project Thomas Helfer, Jérémy Bleyer, Tero Frondelius, Ivan Yashchuk, Thomas Nagel, Dmitri Naumov


Introduction
The ability to easily integrate user-defined constitutive equations plays a major role in the versatility of (mechanical) solvers1 .
Constitutive equations describe how the internal state variables of a material evolve with changing external conditions or mechanical loading.Those state variables can describe many microstructural aspects of the material (grain size, dislocation density, hardening state, etc.) or be phenomenological in nature (equivalent plastic strain).The knowledge of those internal state variables allows the computation of local thermodynamic forces which affect the material equilibrium at the structural scale.Due to the large number of phenomena that can be described in this manner, such as plasticity, viscoplasticity, or damage, computational mechanics is one of the most demanding domains for advanced constitutive equations.
At each time step, the constitutive equations must be integrated to obtain the state of the material at the end of the time step.As most phenomena are nonlinear, an iterative scheme is required at the equilibrium scale to find the local loading of the material: the integration of the constitutive equations is thus therefore called several times with different estimates of the loading of the material.Algorithmic efficiency at the constitutive level is therefore a key aspect for the overall efficiency of a code.
The MFront open-source code generator has been designed to simplify the implementation of the integration of the constitutive equations over a time step, to minimize errors during implementation, to facilitate the portability of constitutive equations between solvers, and to help achieve a reproducible and efficient code (CEA & EDF, 2019;Helfer et al., 2015).For that purpose, MFront uses a source file with a syntax very close to a physical/engineering description of the constitutive model, and generates C++ code specific to many well-established (mostly thermo-mechanical) solvers through dedicated interfaces and compiles them into shared libraries.For example, MFront provides interfaces for Cast3M, code_aster, Europlexus, Abaqus/Standard, Abaqus/Explicit, CalculiX, etc.
To further facilitate this cross-software integration, MFront recently introduced a so-called generic interface.This paper describes the MFrontGenericInterfaceSupport project, which is denoted MGIS in the following.MGIS aims at proving tools (functions, classes, bindings to various programming languages) to handle behaviours2 generated using MFron t's generic interface (Helfer, 2019a).Those tools alleviate the work required by solver developers.Permissive licences have been chosen to allow integration in open-source and proprietary codes.This paper is divided into three parts: 1.A brief overview of MGIS.

Overview
The aims of the MFrontGenericInterfaceSupport project are twofold: 1.At the pre-processing state MGIS shall provide the possibility of retrieving metadata about a particular behaviour and performing proper memory allocation.At the postprocessing stage, easy access to internal state variables is desired.2. During computations, MGIS shall simplify the integration of the behaviour at integration points3 and the update of the internal state variables from one time step to the next.

Preprocessing and post-processing stages
When dealing with user-defined behaviours, most solvers, including Abaqus/Standard for example, delegates part of the work to the user.The user must: 1. Describe the behaviour in the input.
2. Take care of the consistency of the behaviour with the hypothesis made during the computation (e.g. a finite strain behaviour must be used in a finite strain analysis based on the appropriate deformation and stress measures as well as reference configurations).
In the authors' experience, this is error-prone in particular for inexperienced users and may lead to spurious or even worse inexact results.For example, when material properties such as the Young Modulus or the Poission ratio, are required by the behaviour, those are generally defined in the solver input file by an array of values and potential checks are limited to the size of the array.An user may thus invert two material properties.If those two material properties have the same order of magnitudes, computations might lead to a physically consistent result, despite this result being false.
MGIS introduces a very different approach: the user only declares the shared library, the behaviour and the modelling hypothesis (tridimensional, plane strain, etc.).With this information, the library retrieves various metadata which fully describe how to interact with the behaviour.The solver using MGIS can then check if the behaviour is consistent with the computations to be performed and checks that the data provided by the user are correct.The metadata can also be used to allocate the memory required to store the state of the material at each integration point.MGIS' design allows the following types of storage: • An MGIS data structure per integration point.This is the most frequent choice.The memory is automatically allocated by MGIS.• An MGIS data structure that stores the states of an arbitrary number of integration points.MGIS can allocate the memory associated with the state of all specified integration points or borrow memory allocated by the solver.
For post-processing, MGIS provides a set of functions to retrieve information about the state of the material.For example, one can retrieve the value of a state variable from the described data structures.

Computation stage
MGIS provides a function to integrate the constitutive equations at one integration point or on a set of integration points4 .The integration of the constitutive equations at different integration points are usually independent of each other; in other words, in most models the constitutive behaviour is local.Thus, when handling a set of integration points, MGIS can parallelize the integration calls using a granularity chosen by the solver.

Main language and available bindings
MGIS is written in C++-11.The C++ API is described in another report, see Helfer (2019b).
The following bindings are currently available: • python.
• C. Extensions to finite strain elastoplasticity have been recently added as shown in Figure 1 which models a tensile test on a notched bar5 .
The OGS framework is targeting applications in the environmental geosciences, e.g., in the fields of contaminant hydrology, water resources and waste management, geotechnical applications, geothermal energy systems and energy storage.To simplify the implementation of new constitutive models for solids developed with MFront, OGS-6 relies on the C bindings of MGIS. Figure 2 shows the results of a φ − c reduction approach to slope stability analysis.The soil is modelled by a non-associated plastic behaviour based on the Mohr-Coulomb yield criterion (Abbo & Sloan, 1995;Zienkiewicz & Pande, 1977).The implementation presented in Nagel et al. (2017) was extended by a tension cut-off.The image on the left shows the norm of the displacement vector for a low top load.The failure kinematics are clearly visible.The image on the right shows the equivalent plastic strain for a setting with an increased top load.It can be seen that the failure mechanism becomes more complex with an additional slip surface forming beneath the load.
For example TFEL and MGIS cross-compiled binary dependencies are automatically downloaded and extracted.Lastly, Figure 4. shows a simple 3D geometry example using JuliaFEM and MFrontInterface together.

Conclusions
This paper introduces the MFrontGenericInterfaceSupport library which considerably eases the integration of MFront-generated behaviours in any solver.In particular, the library provides a way of retrieving the metadata associated with a behaviour, data structures to store the physical information and functions to perform the behaviour integration over a time step.Examples of usage in various open-source solvers (FEniCS, OpenGeoSys, JuliaFEM) have been provided.
The models implemented for one code can easily be used in another without the need for reimplementation.This offers great benefits for code quality assurance.Since the constitutive integration is handled by MFront, this step of the computation is equally efficient across the different solver platforms.
2. A description of the various bindings available.3. Some examples of usage in various open-source solvers: FEniCS, OpenGeoSys and JuliaFEM.

Figure 1 :
Figure 1: Large strain elasto-plastic modelling of a notched bar.

Figure 2 :
Figure 2: Slope stability analysis with strength reduction performed in OpenGeoSys.The image on the left shows the norm of the displacement vector for a low top load.The image on the right shows the equivalent plastic strain for a setting with an increased top load.

Figure 3 :
Figure 3: Block diagram showing the software layers involved in using MFront behaviours in JuliaF EM.

Figure 4 :
Figure 4: Simple isotropic plasticity modelling of a 3D beam in JuliaFEM with MFrontInterface.