Skip to content

Commit

Permalink
Add instant convergence check back
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Nov 7, 2019
1 parent bcd208f commit 094fdf8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/nlsolve/nlsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function nlsolve!(nlsolver::AbstractNLSolver, integrator)
θ = ndz / ndzprev

# divergence
if θ > 1
if θ > 1.2
nlsolver.status = Divergence
break
end
Expand All @@ -42,10 +42,10 @@ function nlsolve!(nlsolver::AbstractNLSolver, integrator)
apply_step!(nlsolver, integrator)

# check for convergence
#if iter == 1 && ndz < 1e-3
# nlsolver.status = FastConvergence
# break
#end
if iter == 1 && ndz < 1e-5
nlsolver.status = FastConvergence
break
end
iter > 1 &&= θ / (1 - θ))
if η * ndz < κ && (iter > 1 || iszero(ndz) || (isnewton(nlsolver) && !iszero(integrator.success_iter)))
nlsolver.status = η < fast_convergence_cutoff ? FastConvergence : Convergence
Expand Down

0 comments on commit 094fdf8

Please sign in to comment.