Skip to content

Commit

Permalink
Incorrect RetCode upon termination due to stalling of iterates or rep…
Browse files Browse the repository at this point in the history
…eated shrinking of TR
  • Loading branch information
FHoltorf committed Nov 22, 2023
1 parent 66a0732 commit 000f4db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/SimpleNonlinearSolve/src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ function SciMLBase.__solve(prob::NonlinearProblem,
shrink_counter += 1
if shrink_counter > max_shrink_times
return SciMLBase.build_solution(prob, alg, x, F;
retcode = ReturnCode.Success)
retcode = ReturnCode.ConvergenceFailure)
end
else
shrink_counter = 0
end
if r > η₁
if isapprox(xₖ₊₁, x, atol = atol, rtol = rtol)
return SciMLBase.build_solution(prob, alg, xₖ₊₁, Fₖ₊₁;
retcode = ReturnCode.Success)
retcode = ReturnCode.ConvergenceFailure)
end
# Take the step.
x = xₖ₊₁
Expand Down

0 comments on commit 000f4db

Please sign in to comment.