From 7e1739a9872efda9bf3b5332a0914c1efe9afbd2 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Wed, 19 Nov 2025 10:03:45 +0200 Subject: [PATCH] feat(materials): Declare PerfectPlasticity as StatefulStrainDependent - Add material_behavior(::PerfectPlasticity) = StatefulStrainDependent() - Enables generic integration with state variable handling - Requires displacement field and state for tangent computation - Single line trait declaration, zero code duplication --- src/materials/perfect_plasticity.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/materials/perfect_plasticity.jl b/src/materials/perfect_plasticity.jl index a56abb7..40bd8b4 100644 --- a/src/materials/perfect_plasticity.jl +++ b/src/materials/perfect_plasticity.jl @@ -211,6 +211,9 @@ steel_perfect = PerfectPlasticity(E=200e9, ν=0.3, σ_y=250e6, H=0.0) PerfectPlasticity(; E::Real, ν::Real, σ_y::Real, H::Real) = PerfectPlasticity(Float64(E), Float64(ν), Float64(σ_y), Float64(H)) +# Trait declaration: PerfectPlasticity has strain-dependent tangent and state +material_behavior(::PerfectPlasticity) = StatefulStrainDependent() + """ compute_stress(material::PerfectPlasticity, ε::SymmetricTensor{2,3},