Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

<<<<<<< fix/nlsolver-convergence-check
### Fixed

- `NLSolver` now checks convergence status before returning solution. Previously, when `nlsolve()` failed to converge, the unconverged last iterate was silently returned. Now throws an informative error with iteration count and residual norm. Since PR[#1283](https://github.com/gridap/Gridap.jl/pull/1283). (@Ady0333)
=======
## Fixed

- `NewtonRaphsonSolver` now correctly handles already-converged initial states and reports non-convergence properly. Previously crashed with `@unreachable` when starting residual was ~0. Now checks initial convergence and throws informative error instead of assertion failure. Since PR[#1285](https://github.com/gridap/Gridap.jl/pull/1285).
- `NLSolver` now checks convergence status before returning solution. Previously, when `nlsolve()` failed to converge, the unconverged last iterate was silently returned. Now throws an informative error with iteration count and residual norm. Since PR[#1283](https://github.com/gridap/Gridap.jl/pull/1283).
- Fix a bug where external types were not correctly parsed with generated functions in Polynomials, see Issue[#1286](https://github.com/gridap/Gridap.jl/issues/1286). Since PR[#1287](https://github.com/gridap/Gridap.jl/pull/1287).
>>>>>>> master

## [0.20.4] - 2026-04-23

Expand Down
4 changes: 2 additions & 2 deletions src/Algebra/NLSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function _solve_nr!(x,A,b,dx,ns,nls,op)
if isconv; return; end

if nliter == nls.max_nliters
@unreachable
error("NewtonRaphsonSolver failed to converge in $(nls.max_nliters) iterations. Final residual: $(maximum(abs,b))")
end

# Assemble jacobian (fast in-place version)
Expand All @@ -78,7 +78,7 @@ end

function _check_convergence(nls,b)
m0 = maximum(abs,b)
return (false, m0)
return (m0 < nls.tol, m0)
end

function _check_convergence(nls,b,m0)
Expand Down
Loading