Differentation of a material
MaterialModelsBase.get_num_tensorcomponents
— Functionget_num_tensorcomponents(::AbstractMaterial)
Returns the number of independent components for the given material.
- If the material works with the small strain tensor and Cauchy stress, return 6 (default)
- If the material works with the deformation gradient and the 1st Piola-Kirchhoff stress, return 9
- If the material is a cohesive material working with vectors, return the number of vector components (e.g. 3)
Defaults to 6 if not overloaded
MaterialModelsBase.get_num_statevars
— Functionget_num_statevars(m::AbstractMaterial)
Return the number of state variables. A tensorial state variable should be counted by how many components it has. E.g. if a state consists of one scalar and one symmetric 2nd order tensor, get_num_statevars
should return 7 (if the space dimension is 3).
Defaults to 0 if not overloaded
MaterialModelsBase.get_num_params
— Functionget_num_params(m::AbstractMaterial)
Return the number of material parameters in m
. No default value implemented.
MaterialModelsBase.get_parameter_type
— Functionget_parameter_type(m::AbstractMaterial)
Return the number type for the scalar material parameters, defaults to Float64
MaterialModelsBase.material2vector!
— Functionmaterial2vector!(v::AbstractVector, m::AbstractMaterial)
Put the material parameters of m
into the vector m
. This is typically used when the parameters should be fitted.
MaterialModelsBase.vector2material
— Functionvector2material(v::AbstractVector, ::MT) where {MT<:AbstractMaterial}
Create a material of type MT
with the parameters according to v
MaterialModelsBase.material2vector
— Functionmaterial2vector(m::AbstractMaterial)
Out-of place version of material2vector!
. Given get_num_params
, this function does not need to be overloaded unless another datatype than Float64 should be used.
MaterialModelsBase.MaterialDerivatives
— TypeMaterialDerivatives(m::AbstractMaterial)
A struct that saves all derivative information using a Matrix{T}
for each derivative, where T=get_parameter_type(m)
. The dimensions are obtained from get_num_tensorcomponents
, get_num_statevars
, and get_num_params
. The values should be updated in differentiate_material!
by direct access of the fields, where σ
is the stress, ϵ
the strain, s
and ⁿs
are the current and old state variables, and p
the material parameter vector.
dσdϵ
dσdⁿs
dσdp
dsdϵ
dsdⁿs
dsdp
MaterialModelsBase.allocate_differentiation_output
— Functionallocate_differentiation_output(::AbstractMaterial)
When calculating the derivatives of a material, it can often be advantageous to have additional information from the solution procedure inside material_response
. This can be obtained via an AbstractExtraOutput
, and allocate_differentiation_output
provides a standard function name for what extra_output::AbstractExtraOutput
that should be allocated in such cases.
Defaults to an NoExtraOutput
if not overloaded.
MaterialModelsBase.differentiate_material!
— Functiondifferentiate_material!(
+Differentiation · MaterialModelsBase.jl Differentation of a material
MaterialModelsBase.get_num_tensorcomponents
— Functionget_num_tensorcomponents(::AbstractMaterial)
Returns the number of independent components for the given material.
- If the material works with the small strain tensor and Cauchy stress, return 6 (default)
- If the material works with the deformation gradient and the 1st Piola-Kirchhoff stress, return 9
- If the material is a cohesive material working with vectors, return the number of vector components (e.g. 3)
Defaults to 6 if not overloaded
sourceMaterialModelsBase.get_num_statevars
— Functionget_num_statevars(m::AbstractMaterial)
Return the number of state variables. A tensorial state variable should be counted by how many components it has. E.g. if a state consists of one scalar and one symmetric 2nd order tensor, get_num_statevars
should return 7 (if the space dimension is 3).
Defaults to 0 if not overloaded
sourceMaterialModelsBase.get_num_params
— Functionget_num_params(m::AbstractMaterial)
Return the number of material parameters in m
. No default value implemented.
sourceMaterialModelsBase.get_parameter_type
— Functionget_parameter_type(m::AbstractMaterial)
Return the number type for the scalar material parameters, defaults to Float64
sourceMaterialModelsBase.material2vector!
— Functionmaterial2vector!(v::AbstractVector, m::AbstractMaterial)
Put the material parameters of m
into the vector m
. This is typically used when the parameters should be fitted.
sourceMaterialModelsBase.vector2material
— Functionvector2material(v::AbstractVector, ::MT) where {MT<:AbstractMaterial}
Create a material of type MT
with the parameters according to v
sourceMaterialModelsBase.material2vector
— Functionmaterial2vector(m::AbstractMaterial)
Out-of place version of material2vector!
. Given get_num_params
, this function does not need to be overloaded unless another datatype than Float64 should be used.
sourceMaterialModelsBase.MaterialDerivatives
— TypeMaterialDerivatives(m::AbstractMaterial)
A struct that saves all derivative information using a Matrix{T}
for each derivative, where T=get_parameter_type(m)
. The dimensions are obtained from get_num_tensorcomponents
, get_num_statevars
, and get_num_params
. The values should be updated in differentiate_material!
by direct access of the fields, where σ
is the stress, ϵ
the strain, s
and ⁿs
are the current and old state variables, and p
the material parameter vector.
dσdϵ
dσdⁿs
dσdp
dsdϵ
dsdⁿs
dsdp
sourceMaterialModelsBase.allocate_differentiation_output
— Functionallocate_differentiation_output(::AbstractMaterial)
When calculating the derivatives of a material, it can often be advantageous to have additional information from the solution procedure inside material_response
. This can be obtained via an AbstractExtraOutput
, and allocate_differentiation_output
provides a standard function name for what extra_output::AbstractExtraOutput
that should be allocated in such cases.
Defaults to an NoExtraOutput
if not overloaded.
sourceMaterialModelsBase.differentiate_material!
— Functiondifferentiate_material!(
diff::MaterialDerivatives,
m::AbstractMaterial,
ϵ::Union{SecondOrderTensor, Vec},
@@ -8,4 +8,4 @@
cache::AbstractMaterialCache
dσdϵ::AbstractTensor,
extra::AbstractExtraOutput
- )
Calculate the derivatives and save them in diff
, see MaterialDerivatives
for a description of the fields in diff
.
sourceSettings
This document was generated with Documenter.jl version 1.1.2 on Saturday 2 December 2023. Using Julia version 1.9.4.
+ )
Calculate the derivatives and save them in diff
, see MaterialDerivatives
for a description of the fields in diff
.