From a2a98748803587057e996f2c7fe40b70536575fa Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 15 Nov 2024 08:46:15 -0100 Subject: [PATCH] Update lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl Co-authored-by: Aayush Sabharwal --- lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl b/lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl index 9fd7ce2f6..248a516a0 100644 --- a/lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl +++ b/lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl @@ -9,17 +9,14 @@ function CommonSolve.solve(prob::SciMLBase.SCCNonlinearProblem, alg; kwargs...) u = reduce(vcat,[prob.u0 for prob in prob.probs]) resid = copy(u) - earlyexit = false lasti = 1 for i in 1:numscc prob.explictfuns![i](prob.probs[i].p[1],sols) sol = SciMLBase.solve(prob.probs[i], alg; kwargs...) _sol = SciMLBase.build_solution(prob.probs[i], nothing, sol.u, sol.resid, retcode = sol.retcode) sols[i] = _sol - + lasti = i if !SciMLBase.successful_retcode(_sol) - earlyexit = true - lasti = i break end end @@ -28,11 +25,7 @@ function CommonSolve.solve(prob::SciMLBase.SCCNonlinearProblem, alg; kwargs...) u .= reduce(vcat,sols) resid .= reduce(vcat,getproperty.(sols,:resid)) - if earlyexit retcode = sols[lasti].retcode - else - retcode = SciMLBase.ReturnCode.Success - end SciMLBase.build_solution(prob, alg, u, resid; retcode, original = sols) end