Skip to content

Commit a2a9874

Browse files
Update lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl
Co-authored-by: Aayush Sabharwal <[email protected]>
1 parent 777b85a commit a2a9874

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/SCCNonlinearSolve/src/SCCNonlinearSolve.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ function CommonSolve.solve(prob::SciMLBase.SCCNonlinearProblem, alg; kwargs...)
99
u = reduce(vcat,[prob.u0 for prob in prob.probs])
1010
resid = copy(u)
1111

12-
earlyexit = false
1312
lasti = 1
1413
for i in 1:numscc
1514
prob.explictfuns![i](prob.probs[i].p[1],sols)
1615
sol = SciMLBase.solve(prob.probs[i], alg; kwargs...)
1716
_sol = SciMLBase.build_solution(prob.probs[i], nothing, sol.u, sol.resid, retcode = sol.retcode)
1817
sols[i] = _sol
19-
18+
lasti = i
2019
if !SciMLBase.successful_retcode(_sol)
21-
earlyexit = true
22-
lasti = i
2320
break
2421
end
2522
end
@@ -28,11 +25,7 @@ function CommonSolve.solve(prob::SciMLBase.SCCNonlinearProblem, alg; kwargs...)
2825
u .= reduce(vcat,sols)
2926
resid .= reduce(vcat,getproperty.(sols,:resid))
3027

31-
if earlyexit
3228
retcode = sols[lasti].retcode
33-
else
34-
retcode = SciMLBase.ReturnCode.Success
35-
end
3629

3730
SciMLBase.build_solution(prob, alg, u, resid; retcode, original = sols)
3831
end

0 commit comments

Comments
 (0)