From 6b3e7318ce110cda3766ceb7e6edef41928a4293 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Fri, 6 Sep 2024 09:34:03 -0400 Subject: [PATCH] fixes --- Project.toml | 2 +- lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index 809ad81d1a..6769d1500d 100644 --- a/Project.toml +++ b/Project.toml @@ -121,8 +121,8 @@ OrdinaryDiffEqQPRK = "1" OrdinaryDiffEqRKN = "1" OrdinaryDiffEqRosenbrock = "1" OrdinaryDiffEqSDIRK = "1" -OrdinaryDiffEqStabilizedIRK = "1" OrdinaryDiffEqSSPRK = "1" +OrdinaryDiffEqStabilizedIRK = "1" OrdinaryDiffEqStabilizedRK = "1" OrdinaryDiffEqSymplecticRK = "1" OrdinaryDiffEqTsit5 = "1" diff --git a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl index c1c8f67db7..0418045e7f 100644 --- a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl +++ b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl @@ -220,15 +220,9 @@ end reltol = eps(eltype(dz)) end - if is_always_new(nlsolver) || (iter == 1 && new_W) - linres = dolinsolve(integrator, linsolve; A = W, b = _vec(b), linu = _vec(dz), - reltol = reltol) - else - linres = dolinsolve( - integrator, linsolve; A = nothing, b = _vec(b), linu = _vec(dz), - reltol = reltol) - end - + make_new_W = is_always_new(nlsolver) || (iter == 1 && new_W) + linres = dolinsolve(integrator, linsolve; A = make_new_W ? W : nothing, b = _vec(b), + reltol) cache.linsolve = linres.cache if DiffEqBase.has_stats(integrator)