Complex-valued operators for multigrid preconditioning #87
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.
This PR adds the capability, based on #47, to precondition complex-valued linear systems using multigrid based on the actual complex-valued system matrix, rather than its real-valued approximation as is currently implemented. This is possible for the fine level smoothers, not the coarse-level solve, which still always uses the real-valued approximation. Reverting to the previous behavior is controlled with the
PCMatReal
configuration file parameter.This has positive effects on convergence in my testing, reducing iteration counts by ~2x in some cases. This is not for free: The smoother application is now twice as expensive roughly since we are performing matrix-vector products with a complex-valued operator instead of a real one. However, especially in the case where the coarse solver dominates the multigrid V-cycle cost, this can lead to big cost savings.
Another positive benefit is this preconditioning strategy appears to lead to much more accurate repeated linear solves. For the cavity example with impedance BC, here are the first 5 modes with a real-valued preconditioner matrix:
And with this PR:
The total number of linear solver iterations decreased from 1276 to 745.
Another feature added inthis PR is control over the Chebyshev polynomial smoother implementation, allowing users to pick from the standard smoother based on Chebyshev polynomials for the 1st-kind versus the newer 4th-kind variant (see Phillips and Fischer, Optimal Chebyshev smoothers and one-sided V-cycles (2022)). Eigenvalue estimates are also now controlled by parameters which can be modified in the configuration file, which is helpful for debugging.