morphogen.io.mfront

MFront sources of morphoGen’s behaviours (TFEL, https://thelfer.github.io/tfel).

mfront_source() writes a nonlinear material of morphoGen as an MFront behaviour, for the codes that integrate MFront behaviours through its interfaces (AMITEX_FFTP and Cast3M with umat, Abaqus with abaqus, Code_Aster, MGIS: see morphogen.homogenization.mfront); the values of the material are constants of the source:

  • von Mises elasto-(visco)plasticity (Plasticity): the brick StandardElastoViscoPlasticity of MFront: Hooke’s law, the Norton flow of the von Mises criterion (Plastic, rate-independent, without viscosity), linear and Voce isotropic hardening (R0 + H p + sum Q (1 - exp(-b p))), Armstrong-Frederick and Prager kinematic hardening (X = 2/3 C a, da = deps_p - D a dp); in finite strains, in the space of the logarithmic strain (@StrainMeasure Hencky), as morphoGen’s finite strains. Hill’s criterion makes it an orthotropic behaviour (the criterion Hill of the brick, with TFEL’s F … N from Z-set’s coefficients: morphogen.homogenization.zmat), in the axes of the sample;

  • porous plasticity (PorousPlasticity): where MFront’s brick is exactly morphoGen’s porous plasticity (_porous_brick()), the criterion of Gurson-Tvergaard-Needleman: the same brick with its porous criterion GursonTvergaardNeedleman1982 (q_1, q_2, q_3; the effective porosity f or Tvergaard & Needleman’s coalescence, MFront’s f_c and f_r, f_r the porosity of morphoGen’s slope of f* when q3 is not q1²) and the porosity in its implicit system (porosity_evolution, standard implicit scheme: morphoGen’s backward Euler, ε̇p = (1 - f) ṗ ∂σ*/∂σ, ḟ = (1 - f) tr ε̇p + A ṗ), Plastic or Norton flows with the isotropic hardening of von Mises, morphoGen’s constant nucleation from p = 0 (MFront’s power law of exponent 0, "PowerLaw (strain)"); its porosity is f0 until the matrix flows (the source sets it while p = 0: the natural state of its internal variables is zero, as those of morphoGen’s other exports). Small and finite strains (Hencky), thermal expansion as von Mises. The bounds of the porosity differ: morphoGen keeps f* below 0.995 / q1, the brick its porosity below 0.985 of its upper bound (1, or f_r) and breaks the material (zero stress) beyond 0.984 of it. The others (Rousselier’s criterion, the elliptic one, the effective porosities of other tables and the coalescence with q3 > q1², Chu & Needleman’s Gaussian and the exponential nucleation, the thresholds of the nucleation, kinematic hardening: _porous_brick() says why the brick differs) hold morphoGen’s own integration of a point (porous_update, the C port of its kernel, with its row of parameters and its internal variables: _porous_kernel()), in small strains or in the space of the logarithmic strain (@StrainMeasure Hencky), its consistent tangent the operator;

  • Méric-Cailletaud crystal plasticity (CrystalPlasticity), in small strains: an implicit scheme of morphoGen’s equations (its Jacobian by finite differences), the elasticity of the crystal as orthotropic constants in its axes (@ComputeStiffnessTensor: E1, E2, E3, nu12, nu23, nu13, G12, G23, G13, MFront’s order), morphoGen’s slip systems as their Schmid tensors in TFEL’s components (11, 22, 33, then sqrt(2) times 12, 13, 23: not morphoGen’s order, 23, 31, 12), the parameters of each system and the interaction matrix. The behaviour is orthotropic: the solver gives the axes of each grain (MGIS through morphoGen turns the strains to them; the umat interface takes them from the coefficients V1, V2; Abaqus from *ORIENTATION); in finite strains, morphoGen’s own integration of a point (its kernel in the source);

  • in finite strains, the elastic materials too: Hencky’s elasticity (the stress conjugate to the logarithmic strain linear in it, @StrainMeasure Hencky), isotropic or in the axes of the crystal;

  • the learned laws (a material whose learned names a trained model: morphogen.learning.mfront): the trained parameters as constants and morphoGen’s C++ port of the model (the perceptron, the potential, the recurrent network and its state, the standard model and its internal variables), in small strains or in finite strains (@StrainMeasure Hencky for the laws of the logarithmic strain, GreenLagrange for the others), their thermal strain that of morphoGen’s learned laws, orthotropic in the axes of their material.

The interfaces of the other codes compute the logarithmic strain of the Hencky laws from the deformation gradients (the function umat<behaviour>_malls of the umat interface: umat_function()). Abaqus gives the axes of the orthotropic laws in finite strains through their first six state variables (@AbaqusOrthotropyManagementPolicy MFront, which the other interfaces ignore). mfront_state_size() gives the number of internal state variables of a behaviour (those of the umat and abaqus interfaces in three dimensions, without these axes).

Thermal expansion is exported in small strains: thermal_expansion of the Hooke potential of the brick (von Mises; Hill’s criterion also takes three principal values in the axes of the sample), @ComputeThermalExpansion of the crystals (one coefficient, or three principal values in the axes of the crystal), morphoGen’s thermal strain alpha (T + dT - 293.15) in the sources of its porous kernel. Its reference temperatures are MFront’s, 293.15 K, the natural temperature of morphoGen’s MFront behaviours (MGIS gets 293.15 + dT): MFront’s alpha (T - 293.15) is morphoGen’s alpha dT. Finite strains: MFront’s coefficient is a mean one (its Hencky brick stretches by 1 + alpha dT), morphoGen’s that of the logarithmic strain alpha dT: the brick gets the mean coefficient (exp(alpha theta) - 1) / theta (_mean_expansion()); the crystals, Hencky’s elasticity, the porous kernels and the learned laws of finite strains, morphoGen’s own sources, compute its logarithmic thermal strain themselves. The Abaqus inputs start their nodes at 293.15 K when a material expands (their steps give absolute temperatures); MFront’s abaqus interface has no stress-free expansion in finite strains, so they refuse the brick’s expanding laws of finite strains (mfront_brick(); morphoGen’s own sources compute their thermal strain and pass). The AMITEX_FFTP exports refuse every expanding phase written as an MFront law: their loadings carry no change of temperature.

morphogen.io.mfront.ABAQUS_AXES = '@AbaqusOrthotropyManagementPolicy[abaqus] MFront;'

The axes of the orthotropic laws of finite strains in their first six state variables, in Abaqus (the only orthotropy of its interface in finite strains; others ignore it)

morphogen.io.mfront.identifier(name: str) → str[source]

An identifier for the names of MFront behaviours, from the name of a file or of an export: its letters and digits only (the dispatcher of MFront’s laws in Abaqus splits the names of the materials, ABAQUSBEHAVIOUR_<behaviour>_3D, at their underscores).

morphogen.io.mfront.orthotropic_constants(stiffness) → list[float][source]

The engineering constants of an orthotropic stiffness (6 x 6, morphoGen’s Voigt order 11, 22, 33, 23, 31, 12 with engineering strains) in MFront’s order: E1, E2, E3, nu12, nu23, nu13, G12, G23, G13 (nu_ij = -eps_j / eps_i under sigma_i).

morphogen.io.mfront.mfront_state_size(material, kinematics: str = 'small') → int[source]

The number of internal state variables of the MFront behaviour of a material (see mfront_source()) in three dimensions: the elastic strain (6), then the back strains of the kinematic terms (6 each) and the cumulated plastic strain (von Mises), the porosity, the cumulated plastic strain of the matrix, the rupture of the brick and, with a nucleation, the nucleated porosity (porous plasticity of the brick), or the slips, cumulated slips and kinematic variables of the systems and the cumulated plastic strain (crystals); in finite strains, the internal variables of morphoGen’s kernel and the cumulated plastic strain (crystals), none (elasticity). The porous kernels: the elastic strain (6, small strains only), the internal variables of morphoGen’s kernel (10, and 6 per backstress), the cumulated plastic strain and the porosity. The learned laws: the state of the recurrent network, the internal variables of the standard model (none for the perceptron and the potential).

morphogen.io.mfront.mfront_brick(material, kinematics: str = 'small') → bool[source]

Whether the source of a material is MFront’s brick StandardElastoViscoPlasticity (von Mises, Hill’s criterion, the porous plasticity that it matches), whose thermal expansion is MFront’s stress-free one (thermal_expansion of its Hooke potential), or one of morphoGen’s own sources (crystals, Hencky’s elasticity, the porous kernels, the learned laws), which compute their thermal strain.

morphogen.io.mfront.mfront_symmetry(material, kinematics: str = 'small') → str[source]

isotropic (von Mises, isotropic elasticity) or orthotropic (crystals, anisotropic elasticity and Hill’s criterion: the solver gives their axes, those of the sample for Hill’s criterion) behaviour of a material; a learned law is orthotropic in the axes of its material (oriented), isotropic in those of the sample.

morphogen.io.mfront.mfront_strain_measure(material, kinematics: str = 'small') → str | None[source]

The strain measure of the source of a material (mfront_source()): Hencky’s for elasticity, von Mises and porous plasticity in finite strains, none for the others (small strains, and crystals in finite strains, whose kernel takes the deformation gradient); a learned law in finite strains, Hencky’s (a law of the logarithmic strain) or Green-Lagrange’s.

morphogen.io.mfront.umat_function(behaviour: str, strain_measure: str | None = None) → str[source]

The function of a behaviour in the library of the umat interface (Cast3M, AMITEX): umat<behaviour> (in lower case), and for the strain measures of finite strains that of the strategy of the interface (_malls: Hencky’s logarithmic strain, _frst: Green-Lagrange’s).

class morphogen.io.mfront.UserBehaviour(source: Path, name: str, orthotropic: bool, properties: tuple[str, ...], internal_variables: int, strain_measure: str | None = None, abaqus_axes: bool = False)[source]

Bases: object

The MFront behaviour of a material (its mfront key) as the exports to other codes need it: its source, name and symmetry, the names of its material properties in the order of their declaration, the number of its internal state variables, its strain measure (finite strains: Hencky, GreenLagrange; None: the deformation gradient) and whether Abaqus gives its axes through its first six state variables (@AbaqusOrthotropyManagementPolicy MFront).

morphogen.io.mfront.user_behaviour(material, kinematics: str = 'small') → UserBehaviour[source]

The behaviour of an MFront material for the exports (UserBehaviour), as MGIS describes it (its source compiled with the generic interface, which needs MGIS and MFront): a behaviour of the kinematics of the export (finite strains: written in the deformation gradient, or with Hencky’s or Green-Lagrange’s strain measure) without external state variables but the temperature, given by its source (the exports compile it for their interface).

morphogen.io.mfront.write_parameters(directory, behaviour: str, parameters) → Path | None[source]

<behaviour>-parameters.txt: the values of the parameters of an MFront behaviour, which its compiled code reads from the working directory of the run (none: no file).

morphogen.io.mfront.mfront_source(material, name: str, *, kinematics: str = 'small') → str[source]

The MFront source of the behaviour name of a material (see the module): von Mises plasticity, porous plasticity (the brick, or morphoGen’s kernel), crystal plasticity and the learned laws (morphogen.learning.mfront) in small or finite strains, and in finite strains Hencky’s elasticity of the elastic materials.

morphogen.io.mfront.write_mfront(material, path, *, name: str | None = None, kinematics: str = 'small') → Path[source]

Write the MFront source of a material (mfront_source()); the name of the behaviour is the stem of path by default.