2025-11-15 18:39:20 +02:00
|
|
|
|
# This file is a part of JuliaFEM.
|
|
|
|
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
Material model API definitions.
|
|
|
|
|
|
|
|
|
|
|
|
This file defines material-specific abstract types and interfaces.
|
|
|
|
|
|
Must be included after core api.jl.
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# MATERIAL MODEL ABSTRACTIONS
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
AbstractMaterial
|
|
|
|
|
|
|
|
|
|
|
|
Abstract type for all material models.
|
|
|
|
|
|
|
2025-12-15 03:17:44 +02:00
|
|
|
|
All material models must implement `compute_stress(material, ε, state_old, Δt)`.
|
2025-11-15 18:39:20 +02:00
|
|
|
|
"""
|
|
|
|
|
|
abstract type AbstractMaterial end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
AbstractElasticMaterial <: AbstractMaterial
|
|
|
|
|
|
|
|
|
|
|
|
Stateless elastic materials (no history variables).
|
|
|
|
|
|
"""
|
|
|
|
|
|
abstract type AbstractElasticMaterial <: AbstractMaterial end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
AbstractPlasticMaterial <: AbstractMaterial
|
|
|
|
|
|
|
|
|
|
|
|
Stateful plastic materials (history-dependent).
|
|
|
|
|
|
"""
|
|
|
|
|
|
abstract type AbstractPlasticMaterial <: AbstractMaterial end
|
|
|
|
|
|
|
2025-11-20 16:56:37 +02:00
|
|
|
|
"""
|
|
|
|
|
|
AbstractMaterialState
|
|
|
|
|
|
|
|
|
|
|
|
Abstract type for material internal state at integration points.
|
|
|
|
|
|
|
2025-12-15 03:17:44 +02:00
|
|
|
|
Concrete types must be immutable for thread safety.
|
2025-11-20 16:56:37 +02:00
|
|
|
|
"""
|
|
|
|
|
|
abstract type AbstractMaterialState end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
EmptyState <: AbstractMaterialState
|
|
|
|
|
|
|
2025-12-15 03:17:44 +02:00
|
|
|
|
Empty material state for stateless materials.
|
2025-11-20 16:56:37 +02:00
|
|
|
|
"""
|
|
|
|
|
|
struct EmptyState <: AbstractMaterialState end
|
|
|
|
|
|
|
|
|
|
|
|
# Zero constructor for Base.zero compatibility
|
|
|
|
|
|
Base.zero(::Type{EmptyState}) = EmptyState()
|
|
|
|
|
|
|
2025-11-19 10:03:44 +02:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# MATERIAL BEHAVIOR TRAITS
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
MaterialBehavior
|
|
|
|
|
|
|
|
|
|
|
|
Abstract type for material behavior traits.
|
|
|
|
|
|
"""
|
|
|
|
|
|
abstract type MaterialBehavior end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
StatelessConstantTangent <: MaterialBehavior
|
|
|
|
|
|
|
|
|
|
|
|
Material with constant tangent modulus (independent of strain).
|
|
|
|
|
|
"""
|
|
|
|
|
|
struct StatelessConstantTangent <: MaterialBehavior end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
StatelessStrainDependent <: MaterialBehavior
|
|
|
|
|
|
|
|
|
|
|
|
Material with strain-dependent tangent modulus (no internal state).
|
|
|
|
|
|
"""
|
|
|
|
|
|
struct StatelessStrainDependent <: MaterialBehavior end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
StatefulStrainDependent <: MaterialBehavior
|
|
|
|
|
|
|
|
|
|
|
|
Material with strain-dependent tangent and internal state variables.
|
|
|
|
|
|
"""
|
|
|
|
|
|
struct StatefulStrainDependent <: MaterialBehavior end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
material_behavior(material::AbstractMaterial) -> MaterialBehavior
|
|
|
|
|
|
|
|
|
|
|
|
Trait function declaring what computational requirements a material has.
|
|
|
|
|
|
"""
|
|
|
|
|
|
function material_behavior end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
needs_deformation(material::AbstractMaterial) -> Bool
|
|
|
|
|
|
|
|
|
|
|
|
Query whether material needs displacement field for tangent computation.
|
|
|
|
|
|
"""
|
|
|
|
|
|
needs_deformation(mat::AbstractMaterial) = !(material_behavior(mat) isa StatelessConstantTangent)
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
needs_state(material::AbstractMaterial) -> Bool
|
|
|
|
|
|
|
|
|
|
|
|
Query whether material has internal state variables.
|
|
|
|
|
|
"""
|
|
|
|
|
|
needs_state(mat::AbstractMaterial) = material_behavior(mat) isa StatefulStrainDependent
|
|
|
|
|
|
|
2025-11-20 16:56:37 +02:00
|
|
|
|
"""
|
|
|
|
|
|
state_type(::Type{<:AbstractMaterial}) -> Type{<:AbstractMaterialState}
|
|
|
|
|
|
|
|
|
|
|
|
Return the concrete state type for a given material type.
|
|
|
|
|
|
"""
|
|
|
|
|
|
state_type(::Type{<:AbstractMaterial}) = EmptyState
|
|
|
|
|
|
|
2025-11-15 18:39:20 +02:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# MATERIAL MODEL FUNCTIONS
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
2025-11-19 10:03:44 +02:00
|
|
|
|
compute_stress(material::AbstractMaterial, ε, state_old, Δt)
|
2025-11-15 18:39:20 +02:00
|
|
|
|
-> (σ, 𝔻, state_new)
|
|
|
|
|
|
|
|
|
|
|
|
Compute stress, tangent, and updated state for a material model.
|
|
|
|
|
|
"""
|
|
|
|
|
|
function compute_stress end
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
elasticity_tensor(material::AbstractElasticMaterial) -> Tensor{4,3}
|
|
|
|
|
|
|
|
|
|
|
|
Compute 4th-order elasticity tensor for an elastic material.
|
|
|
|
|
|
"""
|
|
|
|
|
|
function elasticity_tensor end
|