From f96296ff1121713f04be09a054748369669e672a Mon Sep 17 00:00:00 2001 From: Knut Andreas Meyer Date: Tue, 28 May 2024 13:17:45 +0200 Subject: [PATCH] Update to new Newton version --- Project.toml | 4 ++-- src/FiniteStrainPlastic.jl | 4 ++-- src/Plastic.jl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index d5ff42a..c8ba15f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MechanicalMaterialModels" uuid = "b3282f9b-607f-4337-ab95-e5488ab5652c" authors = ["Knut Andreas Meyer and contributors"] -version = "0.1.3" +version = "0.2.0" [deps] ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" @@ -15,7 +15,7 @@ Tensors = "48a634ad-e948-5137-8d70-aa71f2a747f4" julia = "1.8" Tensors = "1.16.1" MaterialModelsBase = "0.2" -Newton = "0.1.5" +Newton = "0.2" [extras] FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" diff --git a/src/FiniteStrainPlastic.jl b/src/FiniteStrainPlastic.jl index 91d3a3b..cc7b8db 100644 --- a/src/FiniteStrainPlastic.jl +++ b/src/FiniteStrainPlastic.jl @@ -103,7 +103,7 @@ function MMB.allocate_material_cache(m::FiniteStrainPlastic) x = initial_guess(m, s, F) xv = Vector{T}(undef, Tensors.n_components(typeof(x))) rf!(r_vector, x_vector) = vector_residual!((x)->residual(x, m, old, F, zero(T)), r_vector, x_vector, x) - return NewtonCache(xv, rf!) + return NewtonCache(xv) end function mandel_stress(m_el::AbstractHyperElastic, Fe::Tensor{2,3}) @@ -125,7 +125,7 @@ function MMB.material_response(m::FiniteStrainPlastic, F::Tensor{2,3}, old::Fini else x0 = initial_guess(m, old, M) rf(x) = tomandel(SVector, residual(frommandel(typeof(x0), x), m, old, F, Δt)) - x_vector, ∂R∂X, converged = newtonsolve(tomandel(SVector, x0), rf) + x_vector, ∂R∂X, converged = newtonsolve(rf, tomandel(SVector, x0)) if converged x_sol = frommandel(typeof(x0), x_vector) diff --git a/src/Plastic.jl b/src/Plastic.jl index 823a5ee..9df9409 100644 --- a/src/Plastic.jl +++ b/src/Plastic.jl @@ -129,7 +129,7 @@ function get_newton_cache(m::Plastic, residual_cache) x = initial_guess(m, s, ϵ) xv = Vector{T}(undef, Tensors.n_components(typeof(x))) rf!(r_vector, x_vector) = vector_residual!((x)->residual(x, m, old, ϵ, zero(T), residual_cache), r_vector, x_vector, x) - return NewtonCache(xv, rf!) + return NewtonCache(xv) end function MMB.allocate_material_cache(m::Plastic) @@ -154,7 +154,7 @@ function MMB.material_response(m::Plastic, ϵ::SymmetricTensor{2,3}, old::Plasti rf!(r_vector, x_vector) = vector_residual!(xx->residual(xx, m, old, ϵ, Δt, cache.resid), r_vector, x_vector, x) x_vector = getx(cache.newton) tomandel!(x_vector, x) - x_vector, dRdx, converged = newtonsolve(x_vector, rf!, cache.newton) + x_vector, dRdx, converged = newtonsolve(rf!, x_vector, cache.newton) if converged x_sol = frommandel(PlasticResidual{NKin,NIso}, x_vector) check_solution(x_sol)