Skip to main content

Crate rustfront

Crate rustfront 

Source
Expand description

Evaluate MFront material behaviours (constitutive laws) at a material point, from Rust.

MFront compiles material behaviours (elasticity, plasticity, creep, …) into shared libraries. For behaviours generated with MFront’s generic interface (mfront --obuild --interface=generic Norton.mfront), this crate loads the library, reads the description the behaviour exports (gradients, material properties, internal state variables, …) and integrates it at one material point. It talks to the library directly, in pure Rust: no C or C++ build dependency.

The data of an integration follow MGIS’s layout, that of the function MFront generates: a BehaviourData, as MGIS’s BehaviourDataView, holds the time step, the tangent operator and the two states, InitialState and FinalState, and Behaviour::integrate computes what the IntegrationOptions ask. The arrays of a material point are borrowed from the caller, who can keep the values of all its points in contiguous storage. Symmetric tensors are stored in TFEL’s convention: xx, yy, zz, √2·xy, √2·xz, √2·yz; the voigt module converts them, and the tangent operator, to and from the standard Voigt notation.

Only loading is unsafe, because opening a library runs its code: once Behaviour::load has checked what the library declares, integrating is safe. Loading is also when the parameters and the out of bounds policy, static variables of the library, are set: see Settings.

Point-wise models (@DSL DefaultModel, …) are loaded and integrated like behaviours, as Behaviour: they have no gradient, their outputs are internal state variables and their inputs external state variables. The material properties (@DSL MaterialLaw) are evaluated by MaterialProperty.

Finite strain behaviours (@DSL DefaultFiniteStrain, or a strain measure such as @StrainMeasure Hencky) take the deformation gradient, an unsymmetric tensor, and compute the stress measure and the tangent operator Settings chooses: StressMeasure, FiniteStrainTangentOperator.

An orthotropic behaviour integrates in its material frame: its gradients are rotated to it, its thermodynamic forces and tangent operator back to the global frame, by Behaviour::rotate, with a Rotation.

A cohesive zone model takes the opening displacement and computes the cohesive force, two vectors whose first component is normal to the interface. Description::behaviour_type tells the kinds apart.

Status: small strain, finite strain and general behaviours, cohesive zone models, isotropic or orthotropic, point-wise models and material properties, generated by TFEL 5.1.0 or later.

Modules§

voigt
Conversions between TFEL’s storage of symmetric tensors and the standard Voigt notation. Nothing here allocates.

Structs§

Behaviour
A behaviour loaded from a library generated by MFront with the generic interface, for one modelling hypothesis.
BehaviourData
The data of an integration at one material point, borrowed from the caller, as MGIS’s BehaviourDataView: Behaviour::integrate reads them and writes the results in place.
Bounds
The bounds of a variable, as MFront’s @Bounds and @PhysicalBounds give them, both included: None for no bound on that side.
Description
What the behaviour declares about itself, read from the library by Behaviour::load.
Evaluation
A value computed by MaterialProperty::evaluate.
FinalState
The state at the end of the time step, borrowed from the caller, as MGIS’s StateView: the caller gives the gradients, the mass density, the material properties and the external state variables, the behaviour writes the thermodynamic forces, the internal state variables and the energies it computes (Description::computes_stored_energy).
InitialState
The state at the beginning of the time step, borrowed from the caller, as MGIS’s InitialStateView.
IntegrationOptions
The options of an integration, as MGIS’s BehaviourIntegrationOptions.
MaterialProperty
A material property loaded from a library generated by MFront with the generic interface.
MaterialPropertyDescription
What a material property declares about itself, read from the library by MaterialProperty::load.
Parameter
A parameter of the behaviour: a value fixed in the library, which Settings can change at load.
Rotation
A rotation matrix R whose columns are the axes of the material frame, expressed in the global frame: the components of a symmetric tensor T in the material frame are those of Rᵀ·T·R, as for MTest’s @RotationMatrix.
Settings
What Behaviour::load changes in the library: the values of parameters, and the out of bounds policy; and, for a finite strain behaviour, the stress and the tangent operator to compute.
Variable
A variable of the behaviour, and where its components sit in the array that holds it.
Variables
The variables stored one after the other in one array (gradients, material properties, internal state variables, …).

Enums§

BehaviourType
The kind of behaviour, which fixes what its gradients and thermodynamic forces are.
Error
Everything that can go wrong when loading a behaviour, a model or a material property, and when integrating or evaluating it. name is the name of the behaviour, model or material property.
FiniteStrainTangentOperator
The tangent operator a finite strain behaviour computes.
Frame
The frame crate::Behaviour::rotate rotates values to.
Hypothesis
A modelling hypothesis of MFront.
IntegrationType
What an integration computes, as MGIS’s IntegrationType, the code the behaviour reads in K[0].
Kinematic
The kinematic of a behaviour, as MFront declares it (_BehaviourKinematic).
OutOfBoundsPolicy
What a behaviour or material property does when a variable leaves the bounds its author gave. Physical bounds are always enforced.
ParameterValue
The value of a parameter, of one of the three types MFront supports.
Rotated
What crate::Behaviour::rotate rotates.
Status
How a successful integration went, as the value MGIS’s integrate returns, its failure being an Error::IntegrationFailed.
StressMeasure
The stress a finite strain behaviour computes, in the thermodynamic forces.
Symmetry
The material symmetry of the behaviour.
VariableType
The kind of a variable. With the hypothesis, it fixes the number of components of the variable.