From 98d08b6bc9f2b501866ce6d4ee7d96064ed12578 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sat, 9 May 2026 17:35:41 +0300 Subject: [PATCH] refactor(materials): dedupe PerfectPlasticity fourth-order helper Stop defining `symmetric_identity_tensor` inside `perfect_plasticity.jl` now that `materials/symmetric_fourth_identity.jl` provides the shared definition. - Remove `include(\"abstract_material.jl\")`. - Delete the local `symmetric_identity_tensor` implementation (call sites keep resolving against the earlier include in `JuliaFEM.jl`). --- src/materials/perfect_plasticity.jl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/materials/perfect_plasticity.jl b/src/materials/perfect_plasticity.jl index fae41e5..a1b14e6 100644 --- a/src/materials/perfect_plasticity.jl +++ b/src/materials/perfect_plasticity.jl @@ -7,9 +7,6 @@ Classical von Mises plasticity with radial return mapping algorithm. using Tensors using LinearAlgebra -# Load abstract types -include("abstract_material.jl") - # PlasticityState struct removed - now using compositional NamedTuple # State is represented as: (ε_p=SymmetricTensor{2,3}, α=SymmetricTensor{2,3}, κ=Float64) # This compositional design is inferred automatically from material traits @@ -163,14 +160,3 @@ function compute_stress(material::PerfectPlasticity, return σ, 𝔻, state_new end - -""" - symmetric_identity_tensor() - -Fourth-order symmetric identity tensor: 𝕀 = ½(δᵢₖδⱼₗ + δᵢₗδⱼₖ) -""" -@inline function symmetric_identity_tensor() - # Construct 4th order identity with major and minor symmetry - return SymmetricTensor{4,3}((i, j, k, l) -> - (i == k && j == l ? 0.5 : 0.0) + (i == l && j == k ? 0.5 : 0.0)) -end