Skip to content

Commit 056c378

Browse files
committed
Fix linear elastic with default state
1 parent 89803fa commit 056c378

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/Elastic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function LinearElastic{:cubicsymmetry}(; C1111, C1122, C1212)
8686
return LinearElastic{T, :cubicsymmetry, 3}(C, SVector(C1111, C1122, C1212))
8787
end
8888

89-
function MMB.material_response(m::LinearElastic, ϵ::SymmetricTensor{2,3}, old=NoMaterialState(), args...)
89+
function MMB.material_response(m::LinearElastic, ϵ::SymmetricTensor{2,3}, old=initial_material_state(m), args...)
9090
σ = calculate_stress(m, ϵ)
9191
return σ, m.C, old
9292
end

src/Plastic.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,17 @@ struct PlasticCache{TN,TR} <: AbstractMaterialCache
120120
resid::TR # Cache used in residual function if needed, otherwise nothing
121121
end
122122

123-
function get_newton_cache(m::Plastic, residual_cache)
123+
function get_newton_cache(m::Plastic)
124124
T = MMB.get_vector_eltype(m)
125125
s = initial_material_state(m)
126126
ϵ = zero(SymmetricTensor{2,3})
127127
x = initial_guess(m, s, ϵ)
128128
xv = Vector{T}(undef, get_vector_length(x))
129-
rf!(r_vector, x_vector) = vector_residual!((x)->residual(x, m, old, ϵ, zero(T), residual_cache), r_vector, x_vector, x)
130129
return NewtonCache(xv)
131130
end
132131

133132
function MMB.allocate_material_cache(m::Plastic)
134-
return PlasticCache(get_newton_cache(m, nothing), nothing)
133+
return PlasticCache(get_newton_cache(m), nothing)
135134
end
136135

137136
function elastic_response(m::Plastic, ϵ::SymmetricTensor{2,3}, old::AbstractMaterialState, Δt=nothing)

0 commit comments

Comments
 (0)