Skip to content

Commit df1fd74

Browse files
committed
pass resid from solve!
1 parent d5ed597 commit df1fd74

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/solve.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@ function SciMLBase.solve(prob::NonlinearProblem,
22
alg::AbstractNonlinearSolveAlgorithm, args...;
33
kwargs...)
44
solver = init(prob, alg, args...; kwargs...)
5-
sol = solve!(solver)
5+
sol, resid = solve!(solver)
66
if typeof(sol) <: NewtonSolution
7-
resid = zero(prob.u0)
8-
if isinplace(prob)
9-
prob.f(resid,sol.u,prob.p)
10-
else
11-
resid = prob.f(sol.u,prob.p)
12-
end
137
return SciMLBase.build_solution(prob, alg, sol.u, resid;retcode=:Success)
148
end
159
end
@@ -76,7 +70,7 @@ function SciMLBase.solve!(solver::AbstractImmutableNonlinearSolver)
7670
@set! solver.retcode = MAXITERS_EXCEED
7771
end
7872
sol = get_solution(solver)
79-
return sol
73+
return sol, solver.fu
8074
end
8175

8276
"""

0 commit comments

Comments
 (0)