Skip to content

Fix GMRES producing NaNs for zero input arrays

Henrik Wustenberg requested to merge hwustenb/nektar:fix/gmres-zero-input into master

Issue/feature addressed

The Arnoldi iteration inside the GMRES solver breaks down when the input array is zero. This issue appeared when using 2.5D IncNavierStokesSolver with trivial modes i.e. zero input to GMRES solve.

Proposed solution

Add a check for zero input array based on the eps computed from the input to detect a zero array via a zero error.

Implementation

Check m_tolerance * m_tolerance against eps in GMRES.

Tests

Test based on IncNavierStokesSolver with 3DH1D problem and GMRES solver where the issue first occurred. A UnitTest would be better, but tricky to construct, see comment below.

Suggested reviewers

Jacques Xing David Moxey

Notes

Please add any other information that could be useful for reviewers.

Checklist

  • Functions and classes, or changes to them, are documented. - [ ] User guide/documentation is updated.
  • Changelog is updated.
  • Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines). - [ ] License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Henrik Wustenberg

Merge request reports