Linear Elastic model (Automatic Differentiation)
This material is intended for demonstration purposes, to illustrate how to use the capabilities of the AD Material.
Theory
The constitutive law is given in total form as
relating the nominal stress tensor \(\sig\) to the linearized strain tensor \(\eps\) with the fourth order stiffness tensor \(\Cel\). For the given definitions it is important to note, that the Voigt notation is used. The stiffness tensor can be specified for isotropic material behavior as follows:
Isotropic Behavior
Number of independent material parameters: 2
with
Implementation
-
class ADLinearElastic : public MarmotMaterialHypoElasticAD
Inheritance diagram for Marmot::Materials::ADLinearElastic:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"1" [label="Marmot::Materials::ADLinearElastic" tooltip="Marmot::Materials::ADLinearElastic" fillcolor="#BFBFBF"]
"5" [label="MarmotMaterial" tooltip="MarmotMaterial"]
"3" [label="MarmotMaterialHypoElastic" tooltip="MarmotMaterialHypoElastic"]
"2" [label="MarmotMaterialHypoElasticAD" tooltip="MarmotMaterialHypoElasticAD"]
"4" [label="MarmotMaterialMechanical" tooltip="MarmotMaterialMechanical"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"3" -> "4" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-9e22e38758e9ea8fb724300074c6b9bbfa00bfb4.png)
Collaboration diagram for Marmot::Materials::ADLinearElastic:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"1" [label="Marmot::Materials::ADLinearElastic" tooltip="Marmot::Materials::ADLinearElastic" fillcolor="#BFBFBF"]
"5" [label="MarmotMaterial" tooltip="MarmotMaterial"]
"3" [label="MarmotMaterialHypoElastic" tooltip="MarmotMaterialHypoElastic"]
"2" [label="MarmotMaterialHypoElasticAD" tooltip="MarmotMaterialHypoElasticAD"]
"4" [label="MarmotMaterialMechanical" tooltip="MarmotMaterialMechanical"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"3" -> "4" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-9e22e38758e9ea8fb724300074c6b9bbfa00bfb4.png)
Implementation of a isotropic linear elastic material for 3D stress states using automatic differentiation.
Public Functions
-
ADLinearElastic(const double *materialProperties, int nMaterialProperties, int materialNumber)
Public Members
-
const double &E
Young’s modulus for isotropic materials.
-
const double &nu
Poisson’s ratio for isotropic materials.
Protected Functions
-
virtual void computeStressAD(autodiff::dual *stress, const autodiff::dual *dStrain, const double *timeOld, const double dT, double &pNewDT)
Compute the Cauchy stress tensor \(\boldsymbol{\sigma}\) given an increment of the linearized strain tensor \(\Delta\boldsymbol{\varepsilon}\).
Dual numbers are used for both the Cauchy stress tensor and the linearized strain increment, such that the algorithmic tangent operator \(\frac{\partial\boldsymbol{\sigma}^{(n+1)}}{\partial\boldsymbol{\varepsilon}^{(n+1)}}\) can be obtained by means of automatic differentiation.
- Parameters:
stress – [inout] Cauchy stress tensor
dStrain – [in] linearized strain increment
timeOld – [in] Old (pseudo-)time
dT – [in] (Pseudo-)time increment from the old (pseudo-)time to the current (pseudo-)time
pNewDT – [inout] Suggestion for a new time increment
-
inline virtual StateView getStateView(const std::string &result)
Access material state variables by name.
- Parameters:
stateName – [in] Name of the requested state variable.
- Returns:
A view into the state variable array.
-
inline virtual int getNumberOfRequiredStateVars()
- Returns:
Number of state variables required by the material.
-
ADLinearElastic(const double *materialProperties, int nMaterialProperties, int materialNumber)