Repository navigation
Stop k-eigenvalue inner sweeps at round-off - #1
Merged
Merged
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
…off the change can alternate instead of rising.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The k-eigenvalue inner loops exit when the sweep-to-sweep change drops below
epsilon * 1e-3(CG usesmin(epsilon * 1e-2, 1e-9)). With a tightepsilonon a fine mesh that target is below what round-off allows, so the change levels off and every outer iteration runs allmax_innersweeps. On the 247k-cell IAEA quad mesh atepsilon=1e-12this was over 10 minutes per outer; with the fix it is about 40 seconds.detail::SweepFloorstops the sweeps once the change has stopped shrinking while already under 1e-6. The CG and 1-D loops stop after one non-decreasing sweep, the 2-D Gauss-Seidel loops after three since their change wobbles a bit more on the way down. The fixed-source and time-dependent convergence checks are left alone.Tests:
TestRoundOffFloorintest_cg_ab.pyruns every k solver path (structured CG/GS, unstructured CG/GS on straight and skewed meshes, 1-D) atepsilon=1e-16and checks there is no inner-solve warning. Before the fix the CG cases and skewed GS failed. Full suite passes, and k is unchanged to 12 digits at normal tolerances (IAEA CG at 1.25 cm, skewed IAEA triangles with GS, compared against 1.0.2).