There are many different pre-defined constitutive material formulations available, including definitions for linear-elasticity, small-strain plasticity, hyperelasticity or pseudo-elasticity. The generation of user materials may be simplified when using frameworks for user-defined functions, like hyperelasticity (with automatic differentiation) or a small-strain based framework with state variables. However, the most general case is given by a framework with functions for the evaluation of stress and elasticity tensors in terms of the deformation gradient.
A user-defined material definition with given functions for the (first Piola-Kirchhoff) stress tensor \(\boldsymbol{P}\), optional constraints on additional fields (e.g. \(p\) and \(J\)), updated state variables \(\boldsymbol{\zeta}\) as well as the according fourth-order elasticity tensor \(\mathbb{A}\) and the linearizations of the constraint equations.
A constitutive material definition, or so-called umat (user material), is a
class with methods for evaluating gradients and hessians of the strain energy
density function with respect to the defined fields in the field container, where
the gradient of the first (displacement) field is passed as the deformation
gradient. For all following fields, the field values (no gradients) are provided. An
attribute x=[np.zeros(statevars_shape)] has to be added to the class to define
the shape of optional state variables. For reasons of performance, FElupe passes the
field gradients and values all at once, e.g. the deformation gradient is of shape
(3,3,q,c), where q refers to the number of quadrature points per cell and
c to the number of cells. These last two axes are the so-called trailing axes.
Math-functions from felupe.math all support the operation
on trailing axes. The constitutive material definition class should be inherited
from ConstitutiveMaterial in order to provide force-stretch curves
for elementary deformations.
Examples
Take this code-block as a template for a two-field \((\boldsymbol{u}, p)\)
formulation with the old displacement gradient as a state variable:
importnumpyasnpimportfelupeasfem# math-functions which support trailing axesfromfelupe.mathimportdet,dya,identity,transpose,invclassMyMaterialFormulation(fem.ConstitutiveMaterial):def__init__(self):# provide the shape of state variables without trailing axes# values are ignored - state variables are always initiated with zerosself.x=[np.zeros((3,3))]defgradient(self,x):"Gradients of the strain energy density function."# extract variablesF,p,statevars=x[0],x[1],x[-1]# user codedWdF=None# first Piola-Kirchhoff stress tensordWdp=None# update state variables# example: the displacement gradientstatevars_new=F-identity(F)return[dWdF,dWdp,statevars_new]defhessian(self,x,**kwargs):"Hessians of the strain energy density function."# extract variablesF,p,statevars=x[0],x[1],x[-1]# user coded2WdFdF=None# fourth-order elasticity tensord2WdFdp=Noned2Wdpdp=None# upper-triangle items of the hessianreturn[d2WdFdF,d2WdFdp,d2Wdpdp]umat=MyMaterialFormulation()
Optimize the material parameters by a least-squares fit on experimental
stretch-stress data.
Parameters:
ux (array of shape (2, ...) or None, optional) – Experimental uniaxial stretch and force-per-undeformed-area data (default is
None).
ps (array of shape (2, ...) or None, optional) – Experimental planar-shear stretch and force-per-undeformed-area data
(default is None).
bx (array of shape (2, ...) or None, optional) – Experimental biaxial stretch and force-per-undeformed-area data (default is
None).
incompressible (bool, optional) – A flag to enforce incompressible deformations (default is False).
relative (bool, optional) – A flag to optimize relative instead of absolute residuals, i.e.
(predicted-observed)/observed instead of predicted-observed
(default is False).
Return a plot with normal force per undeformed area vs. stretch curves for
the elementary homogeneous deformations uniaxial tension/compression, planar
shear and biaxial tension of a given isotropic material formulation.
Parameters:
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Save a screenshot with normal force per undeformed area vs. stretch curves
for the elementary homogeneous deformations uniaxial tension/compression, planar
shear and biaxial tension of a given isotropic material formulation.
Parameters:
filename (str, optional) – The filename of the screenshot (default is “umat.png”).
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the
elementary homogeneous deformations uniaxial tension/compression, planar shear
and biaxial tension of a given isotropic material formulation.
Parameters:
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
A class-decorator for a constitutive material definition.
Parameters:
Material (object) – A class with methods for the gradient and the hessian of the strain energy
density function per unit undeformed volume w.r.t. the deformation gradient
tensor.
name (str or None, optional) – The name of the derived class object. If None, the name is taken from
Material (default is None).
A user-defined material definition with given functions for the (first
Piola-Kirchhoff) stress tensor \(\boldsymbol{P}\), optional constraints on
additional fields (e.g. \(p\) and \(J\)), updated state variables
\(\boldsymbol{\zeta}\) as well as the according fourth-order elasticity tensor
\(\mathbb{A}\) and the linearizations of the constraint equations. Both
functions take a list of the 3x3 deformation gradient \(\boldsymbol{F}\) and
optional vector of state variables \(\boldsymbol{\zeta}_n\) as the first input
argument. The stress-function must return the updated state variables
\(\boldsymbol{\zeta}\).
Parameters:
stress (callable) – A constitutive material definition which returns a list containting the (first
Piola-Kirchhoff) stress tensor, optional additional constraints as well as the
state variables. The state variables must always be included even if they are
None. See template code-blocks for the required function signature.
elasticity (callable) – A constitutive material definition which returns a list containing the fourth-
order elasticity tensor as the jacobian of the (first Piola-Kirchhoff) stress
tensor w.r.t. the deformation gradient, optional linearizations of the
additional constraints. The state variables must not be returned. See template
code-blocks for the required function signature.
nstatevars (int, optional) – Number of internal state variable components (default is 0). State variable
components must always be concatenated into a 1d-array.
Notes
Note
The first item in the list of the input arguments always contains the
gradient of the (displacement) field \(\boldsymbol{u}\) w.r.t. the
undeformed coordinates \(\boldsymbol{X}\). The identity matrix
\(\boldsymbol{1}\) is added to this gradient, i.e. the first item of the
list x contains the deformation gradient \(\boldsymbol{F} =
\boldsymbol{1} + \frac{\partial \boldsymbol{u}}{\partial \boldsymbol{X}}\). All
other fields are provided as interpolated values (no gradients evaluated).
For \((\boldsymbol{u})\) single-field formulations, the callables for
stress and elasticity must return the gradient and hessian of the strain
energy density function \(\psi(\boldsymbol{F})\) w.r.t. the deformation
gradient tensor \(\boldsymbol{F}\).
defstress(x,**kwargs):"First Piola-Kirchhoff stress tensor."# extract variablesF,statevars=x[0],x[-1]# user code for (first Piola-Kirchhoff) stress tensorP=None# update state variablesstatevars_new=Nonereturn[P,statevars_new]defelasticity(x,**kwargs):"Fourth-order elasticity tensor."# extract variablesF,statevars=x[0],x[-1]# user code for fourth-order elasticity tensor# according to the (first Piola-Kirchhoff) stress tensordPdF=Nonereturn[dPdF]umat=Material(stress,elasticity,**kwargs)
For \((\boldsymbol{u}, p, J)\) mixed-field formulations, the callables for
stress and elasticity must return the gradients and hessians of the
(augmented) strain energy density function w.r.t. the deformation gradient and the
other fields.
For \((\boldsymbol{u}, p, J)\) mixed-field formulations, take this code-block as
template:
defgradient(x,**kwargs):"Gradients of the strain energy density function."# extract variablesF,p,J,statevars=x[0],x[1],x[2],x[-1]# user codedWdF=None# first Piola-Kirchhoff stress tensordWdp=NonedWdJ=None# update state variablesstatevars_new=Nonereturn[dWdF,dWdp,dWdJ,statevars_new]defhessian(x,**kwargs):"Hessians of the strain energy density function."# extract variablesF,p,J,statevars=x[0],x[1],x[2],x[-1]# user coded2WdFdF=None# fourth-order elasticity tensord2WdFdp=Noned2WdFdJ=Noned2Wdpdp=Noned2WdpdJ=Noned2WdJdJ=None# upper-triangle items of the hessianreturn[d2WdFdF,d2WdFdp,d2WdFdJ,d2Wdpdp,d2WdpdJ,d2WdJdJ]umat=Material(gradient,hessian,**kwargs)
Examples
The compressible isotropic hyperelastic Neo-Hookean material formulation is given
by the strain energy density function
Return the evaluated gradient of the strain energy density function.
Parameters:
x (list of ndarray) – The list with input arguments. These contain the extracted fields of a
FieldContainer along with the old vector of state
variables, [*field.extract(),statevars_old].
Returns:
A list with the evaluated gradient(s) of the strain energy density function
and the updated vector of state variables.
Return the evaluated upper-triangle components of the hessian(s) of the
strain energy density function.
Parameters:
x (list of ndarray) – The list with input arguments. These contain the extracted fields of a
FieldContainer along with the old vector of state
variables, [*field.extract(),statevars_old].
Returns:
A list with the evaluated upper-triangle components of the hessian(s) of the
strain energy density function.
Optimize the material parameters by a least-squares fit on experimental
stretch-stress data.
Parameters:
ux (array of shape (2, ...) or None, optional) – Experimental uniaxial stretch and force-per-undeformed-area data (default is
None).
ps (array of shape (2, ...) or None, optional) – Experimental planar-shear stretch and force-per-undeformed-area data
(default is None).
bx (array of shape (2, ...) or None, optional) – Experimental biaxial stretch and force-per-undeformed-area data (default is
None).
incompressible (bool, optional) – A flag to enforce incompressible deformations (default is False).
relative (bool, optional) – A flag to optimize relative instead of absolute residuals, i.e.
(predicted-observed)/observed instead of predicted-observed
(default is False).
Return a plot with normal force per undeformed area vs. stretch curves for
the elementary homogeneous deformations uniaxial tension/compression, planar
shear and biaxial tension of a given isotropic material formulation.
Parameters:
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Save a screenshot with normal force per undeformed area vs. stretch curves
for the elementary homogeneous deformations uniaxial tension/compression, planar
shear and biaxial tension of a given isotropic material formulation.
Parameters:
filename (str, optional) – The filename of the screenshot (default is “umat.png”).
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the
elementary homogeneous deformations uniaxial tension/compression, planar shear
and biaxial tension of a given isotropic material formulation.
Parameters:
incompressible (bool, optional) – A flag to enforce views on incompressible deformations (default is False).
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.
Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.