-
Notifications
You must be signed in to change notification settings - Fork 99
Add a two-level Schwarz preconditioner #1431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f6c6240
to
58e6482
Compare
58e6482
to
bf971dc
Compare
bf971dc
to
60889dc
Compare
60889dc
to
bf971dc
Compare
bf971dc
to
b795413
Compare
a10beb2
to
8667fa1
Compare
24c6f7d
to
8df491e
Compare
8df491e
to
9101732
Compare
9101732
to
2c5d816
Compare
e988e0e
to
e2714c8
Compare
As a first step, I just added a two-level preconditioner with equal weighting for the local solution and the coarse solution. I think it maybe makes sense to try this out in some applications and then think about arbitrary number of levels, additive/multiplicative etc. |
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Co-authored-by: Yu-Hsiang Tsai <yhmtsai@gmail.com>
f21ade0
to
9d9b829
Compare
|
||
gko::remove_complex<ValueType> cweight = | ||
gko::detail::real_impl(parameters_.coarse_weight); | ||
if (cweight > 0.0 && cweight <= 1.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (cweight > 0.0 && cweight <= 1.0) { | |
if (cweight >= 0.0 && cweight <= 1.0) { |
this->coarse_solver_ = share(parameters_.coarse_solver->generate( | ||
as<Matrix<ValueType, LocalIndexType, GlobalIndexType>>( | ||
coarse))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw an error or assert if coarse_level_ or coarse_solver are nullptr.
Do you need the fallback option?
For example, the problem is small enough or different reason such that multigrid level does not generate proper one.
User seems to easily have a wrong expectation. we do not perform the two-level schwarz.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that is out of scope of what Schwarz should do. I think the user has to ensure that the coarse level has valid inputs. The fallback option will be that there is no coarse level solve.
this->local_solver_->apply(gko::detail::get_local(dense_b), | ||
gko::detail::get_local(dense_x)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to wrap if (this->local_solver) to ensure it is not nullptr
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1431 +/- ##
===========================================
- Coverage 89.57% 89.36% -0.21%
===========================================
Files 824 824
Lines 68815 68983 +168
===========================================
+ Hits 61643 61649 +6
- Misses 7172 7334 +162 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR uses the distributed coarse level generation from PGM to use as a coarse level for the additive Schwarz preconditioner. The only requirement is that the galerkin product generator ($RAP$ ) generate a
multigrid::MultigridLevel
which is a triplet ofrestrict
,prolong
andcoarse
operators. The user additionally also needs to set the solver for the coarse level.TODO
+ [ ] Add options to switch between multiplicative and additive+ [ ] Options for arbitrary number of levels.Possible issues