Commit eea042e
authored
A globalized inner solver (TrustRegion and friends) can reject its trial
step: `step!` returns with the iterate exactly unmoved and the cache not
terminated, having only shrunk its trust region for the next attempt.
The outer convergence test read that zero displacement as a perfect
solve - `ndz < 1e-5` on the first iteration, `eta*ndz = 0 < kappa` on
later ones - and accepted the stage with no correction applied. #4020
surfaces inner caches that *terminated* unsuccessfully; a rejected step
terminates nothing, so it slipped through both branches.
`nlsolve!` now skips the convergence and divergence bookkeeping for an
iteration whose `NonlinearSolveAlg` step left the iterate unmoved
without terminating: no new iterate exists to judge, and a zero `ndz`
would also poison the next iteration's theta. The inner solver retries
with its shrunken radius; if it never moves, the loop runs out and the
step is rejected as unconverged. A cache that terminated at zero
displacement converged exactly (failures already return `Inf` from
`compute_step!`), so that case still counts as convergence.
ROBER with FBDF and a TrustRegion inner solver:
- fixed dt = 1.0 (transient unresolvable): was ReturnCode.Success with
the state frozen at u0; now ConvergenceFailure, matching NewtonRaphson.
- adaptive, default tolerances: relerr 1.7e-2 -> 1.8e-5 (NLNewton 2.1e-5,
NSA NewtonRaphson 4.0e-6). Same for RobustMultiNewton.
- adaptive, reltol=1e-8: relerr 2.4e-8 -> 1.6e-9 (NewtonRaphson 1.3e-9).
NewtonRaphson inner solves are unchanged step-for-step (their iterates
always move or terminate), and NLNewton never enters the predicate.
1 parent 01f7415 commit eea042e
2 files changed
Lines changed: 63 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
3 | 17 | | |
4 | 18 | | |
5 | 19 | | |
| |||
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
73 | 100 | | |
74 | 101 | | |
75 | 102 | | |
| |||
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
0 commit comments