morphogen.learning.mfront¶
MFront sources of the learned laws: a material whose learned names a trained model
(LearnedBehaviour) becomes an MFront behaviour, for
the codes that MFront serves (AMITEX_FFTP and Cast3M through its umat interface,
Abaqus, Code_Aster, MGIS), as morphogen.io.mfront writes morphoGen’s own
behaviours: mfront_source(), morphogen mfront and the
AMITEX and Abaqus exports take the learned materials like the others.
The trained parameters are constants of the source (their shortest decimal forms, which
read back to the bit) and the forward pass of the model and its consistent tangent are
morphoGen’s C++ port of the models (learned.cpp:
FeedForward, Potential, the gated recurrent unit of
Recurrent and the Newton solve of the incremental
potential of Standard, line by line), in a behaviour
of the Default DSL:
small strains: the strain and the stress of the model;
finite strains: the laws of the logarithmic strain (
strain="logarithmic") with@StrainMeasure Hencky, whose strain is1/2 ln Cand stress theTconjugate to it, the veryTof the model (MFront turns it to the Cauchy stress and its tangentdT/dHto the operator of the interface); the laws of the Green-Lagrange strain with@StrainMeasure GreenLagrange(Eand the second Piola-Kirchhoff stress);the state of the recurrent network (its
hiddenvalues) and the internal variables of the standard model: an array of auxiliary state variables (LearnedState), zero at the natural state as in morphoGen; the strain at the start of a step, which the recurrent network takes, is MFront’s (eto), the strain that morphoGen keeps in its internal variables;thermal expansion: the stress-free thermal strain
alpha (T + dT - 293.15)of the material (its tensor in the axes of the material) taken out of the strain the model sees, that of the Hencky points in finite strains (1/2 ln C - alpha dT), asmorphogen.learning.behaviourdoes; MFront’s reference temperature, 293.15 K, is morphoGen’s natural state. A law of the Green-Lagrange strain that expands is refused (its split of the Hencky points,E_m = (exp(2 H_m) - I) / 2, is not written);orientations: a law in the axes of its material (
oriented, the default) is an orthotropic behaviour (@OrthotropicBehaviour), which the solver gives in the axes of each grain (MGIS through morphoGen turns the strains, the umat interface takes the axes V1, V2, Abaqus its*ORIENTATION; in finite strains, the first six state variables in Abaqus); a law in the axes of the sample is isotropic (not turned). A law in the axes of the sample with an anisotropic expansion, which the orientations of the grains would turn, is refused.
Order of the components at each interface: TFEL’s symmetric tensors (11, 22, 33, then
sqrt(2) times 12, 13, 23) in the behaviour (eto, sig, Dt); morphoGen’s
Voigt order (11, 22, 33, 23, 31, 12, the engineering shears of the strains) in the model
and its C++ port: the strain goes to the model as e[VOIGT[i]] = c_i eto[i], the stress
comes back as sig[i] = c_i s[VOIGT[i]] and the tangent as Dt(i, j) = c_i c_j
K[VOIGT[i]][VOIGT[j]], VOIGT = (0, 1, 2, 5, 4, 3) and c = (1, 1, 1, sqrt(2),
sqrt(2), sqrt(2)), as in the sources of morphoGen’s porous kernel.
The tangents: symmetric for the potential and the standard model
(@ProvidesSymmetricTangentOperator), not for the perceptron and the recurrent network
(@ProvidesTangentOperator). MGIS through morphoGen reads that declaration (in the
header MFront generates, morphogen.homogenization.mfront.declared_symmetric()): its
solvers symmetrize the tangents of the first for the conjugate gradients and pass those
of the others whole, to GMRES in the volume elements and to Newton’s method at a material
point, as they do for morphoGen’s own learned points. A step of the standard model that
stops without converging keeps the last iterate of Newton’s method, as morphoGen’s points
do; a stress or a tangent that is not finite fails the integration.
- morphogen.learning.mfront.MEASURES = {'green-lagrange': 'GreenLagrange', 'logarithmic': 'Hencky'}¶
The strain measures of the learned laws in finite strains, by the option
strainof their models
- morphogen.learning.mfront.learned_model(material, kinematics: str = 'small')[source]¶
The model of the learned law of a material, checked for an MFront source of the kinematics: trained on data of its measure (small strains, or the Green-Lagrange measures in finite strains), its expansion one that the source takes (a law of the Green-Lagrange strain does not expand; a law in the axes of the sample has an isotropic expansion).
- morphogen.learning.mfront.learned_strain_measure(material, kinematics: str = 'small') str | None[source]¶
The strain measure of the MFront source of a learned material: none in small strains;
Hencky(a law of the logarithmic strain) orGreenLagrangein finite strains.
- morphogen.learning.mfront.learned_source(material, name: str, *, kinematics: str = 'small') str[source]¶
The MFront source of the behaviour
nameof a material with a learned law (see the module): its model’s parameters as constants, its forward pass and tangent by morphoGen’s C++ port, in small strains or in finite strains (Hencky’s measure for the laws of the logarithmic strain, Green-Lagrange’s for the others).