From 0e097d7753a73d26fb95b90035890160a3184205 Mon Sep 17 00:00:00 2001 From: Elias Date: Fri, 9 Jul 2021 17:16:49 +0200 Subject: [PATCH 1/3] extra output and new material model --- src/FiniteStrain/largedef_plastic.jl | 187 +++++++++++++++++++++++++++ src/MaterialModels.jl | 18 +++ 2 files changed, 205 insertions(+) create mode 100644 src/FiniteStrain/largedef_plastic.jl diff --git a/src/FiniteStrain/largedef_plastic.jl b/src/FiniteStrain/largedef_plastic.jl new file mode 100644 index 0000000..c1f4604 --- /dev/null +++ b/src/FiniteStrain/largedef_plastic.jl @@ -0,0 +1,187 @@ +export MatHyperElasticPlastic, MatHyperElasticPlasticState + +""" + MatHyperElasticPlastic <: AbstractMaterial + +Hyper elastic plastic material for large deformations +""" +struct MatHyperElasticPlastic{M <: AbstractMaterial} <: AbstractMaterial + density::Float64 + elastic_material::M #Elastic material, Yeoh or Neo-hook + τ₀::Float64 #Yield stress + H::Float64 #Hardening +end + +struct MatHyperElasticPlasticState <: AbstractMaterialState + ϵᵖ::Float64 #Plastic strain + Fᵖ::Tensor{2,3,Float64,9} #Plastic deformation grad + ν::Tensor{2,3,Float64,9} +end + +struct MatHyperElasticPlasticExtras <: AbstractExtras + D ::Float64 #Dissipation + ∂D ::SymmetricTensor{2,3,Float64,6} +end + +# # # # # # # +# Constructors +# # # # # # # + +function init_material_state(::MatHyperElasticPlastic) + Fᵖ = one(Tensor{2,3,Float64}) + ν = zero(Tensor{2,3,Float64}) + return MatHyperElasticPlasticState(0.0, Fᵖ, ν) +end + +function MatHyperElasticPlastic(; + elastic_material::HyperElasticMaterial, + τ₀ ::T, + H ::T, + density ::T = NaN, + ) where T + + return MatHyperElasticPlastic(density, elastic_material, τ₀, H) +end + +# # # # # # # +# Drivers +# # # # # # # + +function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T}, state::MatHyperElasticPlasticState, compute_dissipation::Bool) where {dim,T} + emat, τ₀, H = (mp.elastic_material, mp.τ₀, mp.H) + + I = one(C) + Iᵈᵉᵛ = otimesu(I,I) - 1/3*otimes(I,I) + + ϵᵖ = state.ϵᵖ + Fᵖ = state.Fᵖ + ν = state.ν + + dγ = 0.0 + + phi, Mᵈᵉᵛ, Cᵉ, S̃, ∂S̃∂Cₑ = hyper_yield_function(C, state.Fᵖ, state.ϵᵖ, emat, τ₀, H) + dFᵖdC = zero(Tensor{4,dim,T}) + dΔγdC = zero(Tensor{2,dim,T}) + dgdC = zero(Tensor{2,dim,T}) + g = 0.0 + + if phi > 0 #Plastic step + #Setup newton varibles + TOL = 1e-9 + newton_error, counter = TOL + 1, 0 + dγ = 0.0 + + local ∂ϕ∂Mᵈᵉᵛ, ∂Mᵈᵉᵛ∂M, ∂M∂Cₑ, dϕdΔγ, ∂ϕ∂M, ∂M∂S̃ + while true; counter +=1 + + Fᵖ = state.Fᵖ - dγ*state.Fᵖ⋅state.ν + ϵᵖ = state.ϵᵖ + dγ + + R, Mᵈᵉᵛ, Cₑ, S̃, ∂S̃∂Cₑ = _hyper_yield_function(C, Fᵖ, ϵᵖ, emat, τ₀, H) + + #Numerical diff + #h = 1e-6 + #J = (yield_function(C, state.Fᵖ - (dγ+h)*state.Fᵖ⋅state.ν, state.ϵᵖ + (dγ+h), μ, λ, τ₀, H)[1] - yield_function(C, state.Fᵖ - dγ*state.Fᵖ⋅state.ν, state.ϵᵖ + dγ, μ, λ, τ₀, H)[1]) / h + + ∂ϕ∂M = sqrt(3/2) * (Mᵈᵉᵛ/norm(Mᵈᵉᵛ)) #⊡ Iᵈᵉᵛ # state.ν# + ∂M∂Cₑ = otimesu(I, S̃) + ∂Cₑ∂Fᵖ = otimesl(I, transpose(Fᵖ)⋅C) + otimesu(transpose(Fᵖ)⋅C, I) + ∂Fᵖ∂Δγ = -state.Fᵖ⋅state.ν + ∂M∂S̃ = otimesu(Cₑ, I) + + dϕdΔγ = ∂ϕ∂M ⊡ ((∂M∂Cₑ + ∂M∂S̃ ⊡ ∂S̃∂Cₑ) ⊡ ∂Cₑ∂Fᵖ ⊡ ∂Fᵖ∂Δγ) - H + + ddγ = dϕdΔγ\-R + dγ += ddγ + + newton_error = norm(R) + + if newton_error < TOL + break + end + + if counter > 6 + #@warn("Could not find equilibrium in material") + break + end + end + + ∂Cₑ∂C = otimesu(transpose(Fᵖ),transpose(Fᵖ)) + ∂ϕ∂C = ∂ϕ∂M ⊡ ((∂M∂Cₑ + ∂M∂S̃ ⊡ ∂S̃∂Cₑ) ⊡ ∂Cₑ∂C) + dΔγdC = -inv(dϕdΔγ) * ∂ϕ∂C + dFᵖdC = -(state.Fᵖ⋅state.ν) ⊗ dΔγdC + + end + + + ν = norm(Mᵈᵉᵛ)==0.0 ? zero(Mᵈᵉᵛ) : sqrt(3/2)*Mᵈᵉᵛ/(norm(Mᵈᵉᵛ)) + + S = (Fᵖ ⋅ S̃ ⋅ transpose(Fᵖ)) + + ∂S∂Fᵖ = otimesu(I, (Fᵖ ⋅ S̃)) + otimesl((Fᵖ ⋅ S̃), I) + ∂S∂S̃ = otimesu(Fᵖ,Fᵖ) + ∂Cₑ∂Fᵖ = otimesl(I, transpose(Fᵖ) ⋅ C) + otimesu(transpose(Fᵖ) ⋅ C, I) + ∂Cₑ∂C = otimesu(transpose(Fᵖ),transpose(Fᵖ)) + dCₑdC = ∂Cₑ∂C + ∂Cₑ∂Fᵖ ⊡ dFᵖdC + dSdC = ∂S∂Fᵖ ⊡ dFᵖdC + ∂S∂S̃ ⊡ ∂S̃∂Cₑ ⊡ dCₑdC + + g = 0.0, + dgdC = zero(SymmetricTensor{2,3,T,6}) + if compute_dissipation + if phi > 0.0 + M = Cᵉ ⋅ S̃ + g, dgdC = _compute_dissipation(M, ν, dγ, dCₑdC, ∂S̃∂Cₑ, dΔγdC, ∂M∂Cₑ, ∂M∂S̃, Iᵈᵉᵛ, I) + end + end + + return symmetric(S), dSdC, ϵᵖ, ν, Fᵖ, g, dgdC +end + +function _hyper_yield_function(C::SymmetricTensor, Fᵖ::Tensor, ϵᵖ::T, emat::MatNeoHook, τ₀::Float64, H::Float64) where T + Cᵉ = symmetric(transpose(Fᵖ)⋅C⋅Fᵖ) + + S̃, ∂S̃∂Cₑ = _constitutive_driver(emat, Cᵉ) + + #Mandel stress + Mbar = Cᵉ⋅S̃ + Mᵈᵉᵛ = dev(Mbar) + + yield_func = sqrt(3/2)*norm(Mᵈᵉᵛ) - (τ₀ + H*ϵᵖ) + + return yield_func, Mᵈᵉᵛ, Cᵉ, S̃, ∂S̃∂Cₑ +end + +function _compute_dissipation(M, ν, Δγ, dCₑdC, ∂S̃∂Cₑ, dΔγdC, ∂M∂Cₑ, ∂M∂S̃, Iᵈᵉᵛ, I) + + Mᵈᵉᵛ = dev(M) + + ∂g∂M = ν * Δγ + ∂g∂ν = M * Δγ + ∂g∂Δγ = M ⊡ ν + + ∂ν∂Mᵈᵉᵛ = √(3/2) * (1/norm(Mᵈᵉᵛ)) * (Iᵈᵉᵛ - (Mᵈᵉᵛ ⊗ Mᵈᵉᵛ)/(norm(Mᵈᵉᵛ)^2) ) + ∂Mᵈᵉᵛ∂M = Iᵈᵉᵛ + dMdC = (∂M∂Cₑ + ∂M∂S̃ ⊡ ∂S̃∂Cₑ) ⊡ dCₑdC + + g = M ⊡ ν*Δγ + dgdC = (∂g∂M + ∂g∂ν ⊡ ∂ν∂Mᵈᵉᵛ ⊡ ∂Mᵈᵉᵛ∂M) ⊡ dMdC + ∂g∂Δγ * dΔγdC + + return g, dgdC +end + +function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0 + ; nothing, options::Dict{Symbol, Any} = Dict{Symbol, Any}()) + + S, ∂S∂C, ϵᵖ, ν, Fᵖ, _, _ = _compute_2nd_PK(mp, C, state, false) + + return S, ∂S∂C, MatHyperElasticPlasticState(ϵᵖ, Fᵖ, ν) +end + + +function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0, ::Symbol + ; nothing, ::Dict{Symbol, Any} = Dict{Symbol, Any}()) + + S, ∂S∂C, ϵᵖ, ν, Fᵖ, g, dgdC = _compute_2nd_PK(mp, C, state, true) + + return S, ∂S∂C, MatHyperElasticPlasticState(ϵᵖ, Fᵖ, ν), MatHyperElasticPlasticExtras(g, dgdC) +end diff --git a/src/MaterialModels.jl b/src/MaterialModels.jl index ca375f5..35b42c9 100644 --- a/src/MaterialModels.jl +++ b/src/MaterialModels.jl @@ -27,6 +27,14 @@ Store state variables here. For now, this should **not** be mutable, a new objec abstract type AbstractMaterialState end abstract type AbstractResiduals end +""" + AbstractExtras + +Outputs from the material routine in addition to what is usual or strictly necessary (stress, tangent and state) +""" +abstract type AbstractExtras end +struct EmptyExtras <: AbstractExtras end + """ material_response(m::AbstractMaterial, Δε::SymmetricTensor{2,3}, state::AbstractMaterialState, Δt; cache, options) @@ -40,6 +48,16 @@ This function signature must be the same for all material models, even if they d """ function material_response end +""" + material_response(m::AbstractMaterial, Δε::SymmetricTensor{2,3}, state::AbstractMaterialState, Δt, ::Symbol; cache, options) + +Fallback for materials that has no extra outputs +""" +function material_response(m::AbstractMaterial, strain, state::AbstractMaterialState, Δt, ::Symbol; cache, options) + stress, tangent, state = material_response(m, strain, state, Δt; cache=cache, options=options) + return stress, tangent, state, EmptyExtras() +end + """ initial_material_state(::AbstractMaterial) From a2d298ba91e12c08d3f6179fe1712f078a428a4e Mon Sep 17 00:00:00 2001 From: Elias Date: Tue, 24 Aug 2021 19:26:32 +0200 Subject: [PATCH 2/3] add some docs and tests --- src/FiniteStrain/largedef_plastic.jl | 84 ++++++++++++++----- src/MaterialModels.jl | 2 + test/jld2_files/MatHyperElasticPlastic1.jld2 | Bin 0 -> 22783 bytes test/runtests.jl | 3 +- test/test_largedef_plastic.jl | 73 ++++++++++++++++ 5 files changed, 140 insertions(+), 22 deletions(-) create mode 100644 test/jld2_files/MatHyperElasticPlastic1.jld2 create mode 100644 test/test_largedef_plastic.jl diff --git a/src/FiniteStrain/largedef_plastic.jl b/src/FiniteStrain/largedef_plastic.jl index c1f4604..912d27f 100644 --- a/src/FiniteStrain/largedef_plastic.jl +++ b/src/FiniteStrain/largedef_plastic.jl @@ -1,15 +1,23 @@ export MatHyperElasticPlastic, MatHyperElasticPlasticState """ - MatHyperElasticPlastic <: AbstractMaterial + MatHyperElasticPlastic(elastic_material, σ_y, H) -Hyper elastic plastic material for large deformations +Large strain plasticity model with kinematic hardening. + +# Arguments +- `elastic_material::AbstractMaterial`: Hyperelastic material, for exampel NeoHook +- `σ_y:` yield limit +- `H:` hardening modulus + +# Reference +J.C. Simo, 1998, Numerical analysis and simulation of plasticity """ struct MatHyperElasticPlastic{M <: AbstractMaterial} <: AbstractMaterial - density::Float64 elastic_material::M #Elastic material, Yeoh or Neo-hook - τ₀::Float64 #Yield stress + σ_y::Float64 #Yield stress H::Float64 #Hardening + density::Float64 end struct MatHyperElasticPlasticState <: AbstractMaterialState @@ -27,20 +35,20 @@ end # Constructors # # # # # # # -function init_material_state(::MatHyperElasticPlastic) +function initial_material_state(::MatHyperElasticPlastic) Fᵖ = one(Tensor{2,3,Float64}) ν = zero(Tensor{2,3,Float64}) return MatHyperElasticPlasticState(0.0, Fᵖ, ν) end function MatHyperElasticPlastic(; - elastic_material::HyperElasticMaterial, - τ₀ ::T, + elastic_material::AbstractMaterial, + σ_y ::T, H ::T, density ::T = NaN, ) where T - return MatHyperElasticPlastic(density, elastic_material, τ₀, H) + return MatHyperElasticPlastic(elastic_material, σ_y, H, density) end # # # # # # # @@ -48,7 +56,7 @@ end # # # # # # # function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T}, state::MatHyperElasticPlasticState, compute_dissipation::Bool) where {dim,T} - emat, τ₀, H = (mp.elastic_material, mp.τ₀, mp.H) + emat, σ_y, H = (mp.elastic_material, mp.σ_y, mp.H) I = one(C) Iᵈᵉᵛ = otimesu(I,I) - 1/3*otimes(I,I) @@ -59,7 +67,7 @@ function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T} dγ = 0.0 - phi, Mᵈᵉᵛ, Cᵉ, S̃, ∂S̃∂Cₑ = hyper_yield_function(C, state.Fᵖ, state.ϵᵖ, emat, τ₀, H) + phi, Mᵈᵉᵛ, Cᵉ, S̃, ∂S̃∂Cₑ = _hyper_yield_function(C, state.Fᵖ, state.ϵᵖ, emat, σ_y, H) dFᵖdC = zero(Tensor{4,dim,T}) dΔγdC = zero(Tensor{2,dim,T}) dgdC = zero(Tensor{2,dim,T}) @@ -77,11 +85,11 @@ function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T} Fᵖ = state.Fᵖ - dγ*state.Fᵖ⋅state.ν ϵᵖ = state.ϵᵖ + dγ - R, Mᵈᵉᵛ, Cₑ, S̃, ∂S̃∂Cₑ = _hyper_yield_function(C, Fᵖ, ϵᵖ, emat, τ₀, H) + R, Mᵈᵉᵛ, Cₑ, S̃, ∂S̃∂Cₑ = _hyper_yield_function(C, Fᵖ, ϵᵖ, emat, σ_y, H) #Numerical diff #h = 1e-6 - #J = (yield_function(C, state.Fᵖ - (dγ+h)*state.Fᵖ⋅state.ν, state.ϵᵖ + (dγ+h), μ, λ, τ₀, H)[1] - yield_function(C, state.Fᵖ - dγ*state.Fᵖ⋅state.ν, state.ϵᵖ + dγ, μ, λ, τ₀, H)[1]) / h + #J = (yield_function(C, state.Fᵖ - (dγ+h)*state.Fᵖ⋅state.ν, state.ϵᵖ + (dγ+h), μ, λ, σ_y, H)[1] - yield_function(C, state.Fᵖ - dγ*state.Fᵖ⋅state.ν, state.ϵᵖ + dγ, μ, λ, σ_y, H)[1]) / h ∂ϕ∂M = sqrt(3/2) * (Mᵈᵉᵛ/norm(Mᵈᵉᵛ)) #⊡ Iᵈᵉᵛ # state.ν# ∂M∂Cₑ = otimesu(I, S̃) @@ -115,7 +123,6 @@ function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T} ν = norm(Mᵈᵉᵛ)==0.0 ? zero(Mᵈᵉᵛ) : sqrt(3/2)*Mᵈᵉᵛ/(norm(Mᵈᵉᵛ)) - S = (Fᵖ ⋅ S̃ ⋅ transpose(Fᵖ)) ∂S∂Fᵖ = otimesu(I, (Fᵖ ⋅ S̃)) + otimesl((Fᵖ ⋅ S̃), I) @@ -125,7 +132,7 @@ function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T} dCₑdC = ∂Cₑ∂C + ∂Cₑ∂Fᵖ ⊡ dFᵖdC dSdC = ∂S∂Fᵖ ⊡ dFᵖdC + ∂S∂S̃ ⊡ ∂S̃∂Cₑ ⊡ dCₑdC - g = 0.0, + g = 0.0 dgdC = zero(SymmetricTensor{2,3,T,6}) if compute_dissipation if phi > 0.0 @@ -137,16 +144,16 @@ function _compute_2nd_PK(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,dim,T} return symmetric(S), dSdC, ϵᵖ, ν, Fᵖ, g, dgdC end -function _hyper_yield_function(C::SymmetricTensor, Fᵖ::Tensor, ϵᵖ::T, emat::MatNeoHook, τ₀::Float64, H::Float64) where T +function _hyper_yield_function(C::SymmetricTensor, Fᵖ::Tensor, ϵᵖ::T, emat::AbstractMaterial, σ_y::Float64, H::Float64) where T Cᵉ = symmetric(transpose(Fᵖ)⋅C⋅Fᵖ) - S̃, ∂S̃∂Cₑ = _constitutive_driver(emat, Cᵉ) + S̃, ∂S̃∂Cₑ = material_response(emat, Cᵉ) #Mandel stress Mbar = Cᵉ⋅S̃ Mᵈᵉᵛ = dev(Mbar) - yield_func = sqrt(3/2)*norm(Mᵈᵉᵛ) - (τ₀ + H*ϵᵖ) + yield_func = sqrt(3/2)*norm(Mᵈᵉᵛ) - (σ_y + H*ϵᵖ) return yield_func, Mᵈᵉᵛ, Cᵉ, S̃, ∂S̃∂Cₑ end @@ -169,17 +176,52 @@ function _compute_dissipation(M, ν, Δγ, dCₑdC, ∂S̃∂Cₑ, dΔγdC, ∂M return g, dgdC end -function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0 - ; nothing, options::Dict{Symbol, Any} = Dict{Symbol, Any}()) +""" + material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0; ) + +The material model assumes a multiplicative split of the deformation gradient + +```math +\\boldsymbol{F} = \\boldsymbol{F}_e \\boldsymbol{F}_p +``` +The yield function is of von Mises type is formulated in terms of the Mandel stress, \$\\boldsymbol{M}\$ + +```math +\\phi = \\sqrt{\\frac{3}{2}} \\left| \\boldsymbol{M}_{\\text{dev}} \\right| - \\sigma_y - H \\varepsilon_p +``` + +The evolution equation of associative type for the plastic velocity gradient is + +```math +\\boldsymbol{L}_p = \\dot \\boldsymbol{F}_p \\boldsymbol{F}_p^{-1} = \\dot \\gamma \\frac{\\partial \\phi}{\\partial \\boldsymbol{M}} = \\dot \\gamma \\boldsymbol{\\nu} +``` + +As an simplification for the local backward Euler integration in the material routine, it is assumed that +\$ \\boldsymbol{\\nu} = ^n\\boldsymbol{\\nu} \$. This reduces the system of equations to only one equation +(namely the yield function). + +""" +function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0; + cache=nothing, options=nothing) where T S, ∂S∂C, ϵᵖ, ν, Fᵖ, _, _ = _compute_2nd_PK(mp, C, state, false) return S, ∂S∂C, MatHyperElasticPlasticState(ϵᵖ, Fᵖ, ν) end +""" + material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt, extras::Symbol; ) + +In addition to returning the stress, tangent and state, it also return extra data related to the amount +of dissipation energy, according to: -function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt=0.0, ::Symbol - ; nothing, ::Dict{Symbol, Any} = Dict{Symbol, Any}()) +```math +D = \\dot \\boldsymbol{M} : \\boldsymbol{L}_p (\\geq 0) +``` + +""" +function material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2,3,T,6}, state::MatHyperElasticPlasticState, Δt, ::Symbol + ; cache=nothing, options=nothing) where T S, ∂S∂C, ϵᵖ, ν, Fᵖ, g, dgdC = _compute_2nd_PK(mp, C, state, true) diff --git a/src/MaterialModels.jl b/src/MaterialModels.jl index 35b42c9..e4945de 100644 --- a/src/MaterialModels.jl +++ b/src/MaterialModels.jl @@ -86,6 +86,7 @@ function update_cache! end include("LinearElastic.jl") include("Plastic.jl") +include("FiniteStrain/largedef_plastic.jl") include("CrystalViscoPlastic/slipsystems.jl") include("CrystalViscoPlastic/CrystalViscoPlastic.jl") include("CrystalViscoPlastic/CrystalViscoPlasticRed.jl") @@ -103,6 +104,7 @@ export material_response export AbstractMaterial export LinearElastic, Plastic export LinearElasticState, PlasticState +export MatHyperElasticPlastic, MatHyperElasticPlasticState export OneD, UniaxialStrain, UniaxialStress, PlaneStrain, PlaneStress export NeoHook, Yeoh, StVenant diff --git a/test/jld2_files/MatHyperElasticPlastic1.jld2 b/test/jld2_files/MatHyperElasticPlastic1.jld2 new file mode 100644 index 0000000000000000000000000000000000000000..fce11b55f061c3181ad2d9649b938e9a6c824cae GIT binary patch literal 22783 zcmeI430RcX8pjU<%7B0y`MVrzZ~9bRC_X6t9Vl&xqG_N=X|LpV3k?CNV8NDP^Qa8>kD^5lu6ti7wC> zs0~OPq|+Gn0SQSNn&^(riR1cPR$zKmWG7Ge+U_c~nh=#Tg{QdU6y5J-#Xh{&eQEco z$X+V)wsU(T8EJD3B_rcUBoY!<&53wZrKSI!=zl`gBsD&bvJAS2h<6zE$ULNk5aJO* z$8)Me+=&YrCa=5!8DmouiL*)$AYXDap7j5hvY?j|RQVhqjZ563mCrjr-#xmdg**nm zoLGA~f_y!nl9m`KukDxQQRL`IvIHwUV&qt7=66@zivOk2smXFDdbu#}p-6>yN=}K- zFzRJjCB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PVOAr>o)D#dD-9JFZ=bD&lh?3D$WTXI^QgTLxb}c^XL8O4-U<@ zgSN#nJ~%Y`U0K{~^L5W+De>fK|F_N7`an1Bx2@7;!Tiy`)x*4#4{7}#6sZoCtXqKApUs)LP}De|f1~oIeO}&%pVE@g@hHUytAX 0.0 + @test extras.D > 0.0 + +end + + +function get_MatHyperElasticPlastic_loading() + strain1 = range(0.0, 0.002, length=5) + strain2 = range(0.002, 0.001, length=5) + strain3 = range(0.001, 0.007, length=5) + + _x = [strain1[1:end]..., strain2[1:end]..., strain3[1:end]...] + _F = [Tensor{2,3}((x + 1.0, x/10, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)) for x in _x] + C = [tdot(F) for F in _F] + + return C +end + +@testset "MatHyperElasticPlastic jld2" begin + + E=200e3 + ν=0.3 + m = MatHyperElasticPlastic( + elastic_material = MaterialModels.NeoHook( + μ = E / (2(1 + ν)), + λ = (E * ν) / ((1 + ν) * (1 - 2ν)) + ), + σ_y = 200.0, + H = 50.0, + ) + loading = get_MatHyperElasticPlastic_loading() + check_jld2(m, loading, "MatHyperElasticPlastic1")#, debug_print=true, OVERWRITE_JLD2=true) +end \ No newline at end of file From b1d29d57d8da16f92573ae8c4bc9ecf3a5b5525d Mon Sep 17 00:00:00 2001 From: Elias Date: Wed, 25 Aug 2021 12:53:03 +0200 Subject: [PATCH 3/3] add docs --- docs/make.jl | 3 ++- docs/src/materials/LargeDefPlastic.md | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 docs/src/materials/LargeDefPlastic.md diff --git a/docs/make.jl b/docs/make.jl index 28b4a39..b4baa9f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,7 +8,8 @@ makedocs( "Interface" => "interface.md", "Materials" => [ "materials/LinearElastic.md", - "materials/Plastic.md" + "materials/Plastic.md", + "materials/LargeDefPlastic.md" ] ] ) diff --git a/docs/src/materials/LargeDefPlastic.md b/docs/src/materials/LargeDefPlastic.md new file mode 100644 index 0000000..6a22a10 --- /dev/null +++ b/docs/src/materials/LargeDefPlastic.md @@ -0,0 +1,6 @@ +# LargeDefPlastic +```@docs +MatHyperElasticPlastic +material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2, 3, T, 6}, state::MatHyperElasticPlasticState) where T +material_response(mp::MatHyperElasticPlastic, C::SymmetricTensor{2, 3, T, 6}, state::MatHyperElasticPlasticState, Δt, ::Symbol; kwargs...) where T +``` \ No newline at end of file