From da72c7611543efa339669eda4ce9525fcda00353 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 14 Nov 2024 07:29:21 -0100 Subject: [PATCH 1/2] Do not allow for accepting steps with internal newton with linsolve fail I cannot share the MWE that gives this, but it's at least a clearly missing piece. --- lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl index c1c8f67db7..45ffaea974 100644 --- a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl +++ b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl @@ -229,6 +229,10 @@ end reltol = reltol) end + if !SciMLBase.successful_retcode(linres.retcode) + return convert(eltype(atmp,),Inf) + end + cache.linsolve = linres.cache if DiffEqBase.has_stats(integrator) From fd62717b1231761a9bd7ad0ca47d86d44bd6bbaa Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 14 Nov 2024 10:22:50 -0100 Subject: [PATCH 2/2] do not reject default returns --- lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl index 45ffaea974..994ecea696 100644 --- a/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl +++ b/lib/OrdinaryDiffEqNonlinearSolve/src/newton.jl @@ -229,7 +229,7 @@ end reltol = reltol) end - if !SciMLBase.successful_retcode(linres.retcode) + if !SciMLBase.successful_retcode(linres.retcode) && linres.retcode != SciMLBase.ReturnCode.Default return convert(eltype(atmp,),Inf) end