Skip to content

Bring back JFNK on CPUs - #172

Draft
amrueda wants to merge 5 commits into
developfrom
arr/jfnk_is_back_cpu
Draft

amrueda wants to merge 5 commits into
developfrom
arr/jfnk_is_back_cpu

Conversation

@amrueda

@amrueda amrueda commented Dec 3, 2026

Copy link
Copy Markdown
Member

This PR brings back the Jacobian-Free Newton-Krylov (JFNK) solver.
Several bugs were found:

  • Euler runs segfaulted: viscous fluxes were evaluated without gradients.
  • GMRES early exit skipped the last Givens rotation, giving wrong updates.
  • GMRES tolerance was absolute; now max(tol*||b||, tol), as in PETSc.
  • Newton could pass a linear tolerance > 1 (zero GMRES iterations); now capped at 0.1.
  • Finite-difference step ignored the solution size; now Walker-Pernice.
  • Jacobian-vector products were evaluated at t+2dt instead of t+dt.
  • Zero RHS caused a division by zero.
  • GMRES preconditioner crashed on construction (built a second Jacobian) and recomputed F(U) on every call.
  • Non-finite Newton updates were applied; they are now rejected.
  • The default restart length (500) was cut to 30.
  • Block-Jacobi "sparse"/"dense" matrix types were swapped.

The JFNK uniform-flow test passes again and is re-enabled in CI (TODO: check if it's worth keeping it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amrueda amrueda changed the title Arr/jfnk is back cpu Bring back JFNK on CPUs Dec 3, 2026
@amrueda
amrueda marked this pull request as draft December 3, 2026 18:53
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants