Commit eaeab2a
committed
Detect linear-solver non-convergence in KSPSolver::solve
KSPSolver::solve always returned true, even if the KSP diverged (max iterations,
breakdown, or a failed/singular preconditioner factorization). That silently fed
a bad linear step to the hand-written Newton-Raphson solver. Now query
KSPGetConvergedReason after the solve: on a negative reason, warn and return
false. Converged solves are unchanged (no warning, returns true), so existing
results are bit-identical; the SNES path is unaffected (SNES already reports
SNES_DIVERGED_LINEAR_SOLVE itself).1 parent edd515c commit eaeab2a
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
| |||
0 commit comments