From c631eb6d1c84bb55458c22bbe5c9706790de9306 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sat, 9 May 2026 18:46:11 +0300 Subject: [PATCH] test(materials): assert J2 yield after radial return for PerfectPlasticity Add a focused regression that `compute_stress` lands on the von Mises surface when the trial state lies outside yield, using the returned backstress state. - SPDX header refresh for the file. --- test/materials/test_plasticity_integration.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/materials/test_plasticity_integration.jl b/test/materials/test_plasticity_integration.jl index ee25e00..ea74ff7 100644 --- a/test/materials/test_plasticity_integration.jl +++ b/test/materials/test_plasticity_integration.jl @@ -1,5 +1,5 @@ -# This file is a part of JuliaFEM. -# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md +# SPDX-FileCopyrightText: 2015-2026 Jukka Aho +# SPDX-License-Identifier: MIT using Test using JuliaFEM @@ -135,6 +135,15 @@ using Tensors @test norm(σ) < mat.σ_y # Below yield end + @testset "J2 yield surface after radial return (‖dev(σ−α)‖_vm ≈ σᵧ)" begin + mat = PerfectPlasticity(E = 210e9, ν = 0.3, σ_y = 250e6, H = 2.1e9) + ε = SymmetricTensor{2,3}((0.02, -0.005, 0.0, 0.0, 0.0, 0.0)) + σ, _, st = compute_stress(mat, ε, NamedTuple(), 0.0) + s = dev(σ - st.α) + seq = sqrt(3 / 2 * (s ⊡ s)) + @test seq ≈ mat.σ_y rtol = 1e-5 atol = 1.0 + end + @testset "Plastic response (above yield)" begin # Test that material yields when stress exceeds yield mat = PerfectPlasticity(E=210e9, ν=0.3, σ_y=250e6, H=1e9)