Add Preconditioned Conjugate Gradient Method#188
Open
julianlitz wants to merge 9 commits intomainfrom
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
- Coverage 95.28% 94.91% -0.38%
==========================================
Files 94 94
Lines 9316 9517 +201
==========================================
+ Hits 8877 9033 +156
- Misses 439 484 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Add Preconditioned Conjugate Gradient (PCG)
Rather than running GMGPolar as a standalone iterative solver, we can exploit it as a preconditioner for CG.
Each PCG iteration approximates the action of
A^{-1}by running a cheap FMG approximation followed by one multigrid cycle. Good enough to serve as a preconditioner, but much cheaper than iterating GMGPolar to full convergence.The non-extrapolated operator A is used as the preconditioner M, even when solving the extrapolated system (see Litz et al.). The extrapolated operator
A_excannot serve as preconditioner because its right-hand side requires evaluating a source term function, whereas PCG only has access to a discretized residual vector at each iteration. This was validated on the paper_v2_conjugate_gradient branch.The implementation is tightly integrated with the existing solver, so the additional memory cost is just two vectors. The three PCG work vectors (r, z, A*p) are aliased onto storage that already exists (level.rhs(), level.solution(), level.residual()), and only the solution x and search direction p require fresh allocations.
When combined with extrapolation, the PCG solver converges in up to 4× fewer iterations than standalone GMGPolar and runs up to 2× faster end-to-end. A significant gain for a minimal implementation cost.
Merge Request - GuideLine Checklist
Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.
Checks by code author:
Always to be checked:
If functions were changed or functionality was added:
If new functionality was added:
If new third party software is used:
If new mathematical methods or epidemiological terms are used:
Checks by code reviewer(s):