Skip to content

Stop k-eigenvalue inner sweeps at round-off - #1

Merged
bwhewe-13 merged 4 commits into
masterfrom
cg-sweep-floor
Oct 15, 2026
Merged

bwhewe-13 merged 4 commits into
masterfrom
cg-sweep-floor

Conversation

@bwhewe-13

Copy link
Copy Markdown
Owner

The k-eigenvalue inner loops exit when the sweep-to-sweep change drops below epsilon * 1e-3 (CG uses min(epsilon * 1e-2, 1e-9)). With a tight epsilon on a fine mesh that target is below what round-off allows, so the change levels off and every outer iteration runs all max_inner sweeps. On the 247k-cell IAEA quad mesh at epsilon=1e-12 this was over 10 minutes per outer; with the fix it is about 40 seconds.

detail::SweepFloor stops 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: TestRoundOffFloor in test_cg_ab.py runs every k solver path (structured CG/GS, unstructured CG/GS on straight and skewed meshes, 1-D) at epsilon=1e-16 and 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).

@codecov-commenter

Copy link
Copy Markdown

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.
@bwhewe-13
bwhewe-13 merged commit af2ed02 into master Oct 15, 2026
15 checks passed
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