-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add a uniform coarsening algorithm for coarse grid generation. #979
Conversation
I mentioned this in the meeting before: When I hear the description of this functionality, I think "uniform". In my view, selection usually refers to finding a single element, or a small number of elements. The operations you are doing is a coarsening, so how about |
Naming it Yes, this should allow us to implement a simple 1D Geometric Multigrid. |
These two might be different enough that we could put them into different types? FixedCoarsening and UniformCoarsening? |
Yes, we could technically put them in two separate classes. I guess at some point we will have a lot of separate classes. But I guess that might be okay if they have different algorithms. Currently, this is just picking some nodes, but we could technically have different averaging strategies. This could be as simple as having a sum-normalized per row for the restriction and prolongation matrices to more involved averaging strategies based on diagonal and off-diagonal fine matrix element weights |
I was thinking that our AMGX implementation does two things: a heavy edge matching to compute the fine-to-coarse mapping, and a uniform averaging scheme. Maybe it might make sense to look at what hypre is doing here? I think they have some averaging schemes specific to certain coarsening algorithms, but also generic ones? Anyways, this is only long-term thinking, not directly related to this PR, I am fine with the approach :) |
Yes, I think generation of the restriction and prolongation matrices can be de-coupled from the coarsening strategy itself in some cases. I don't have a clear solution for that now (interface wise), but it might be something we should look at in the future. |
the multigridLevel is the general thing. I do not put it as the coarsening method and the interpolator methods directly. The coarsening method might generate different information such that not all interpolator can rely on it. The MultigridLevel Factory can has option for intepolator but it should be decided by the coarsening method. |
3cf7648
to
b77685c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #979 +/- ##
===========================================
+ Coverage 91.77% 92.28% +0.51%
===========================================
Files 499 486 -13
Lines 42972 40358 -2614
===========================================
- Hits 39439 37246 -2193
+ Misses 3533 3112 -421
Continue to review full report at Codecov.
|
c81f200
to
0e30d47
Compare
SonarCloud Quality Gate failed. |
|
||
auto prolong_op = gko::as<csr_type>(share(restrict_op->transpose())); | ||
|
||
// TODO: Can be done with submatrix index_set. |
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 don't think that's true in the general case - the operation you need is more akin to a row_gather with arbitrary permutation than submatrix. That might also relate to your TODO on ordering?
0e30d47
to
911740a
Compare
Error: The following files need to be formatted:
You can find a formatting patch under Artifacts here or run |
Note: This PR changes the Ginkgo ABI:
For details check the full ABI diff under Artifacts here |
Closing stale PR |
This PR adds a new class to generate coarse matrices which can be useful for multigrid and other multi-level methods in general.
Two main methods to generate coarse matrices are provided:
A user specified coarse row array.(Separate class and separate PR)TODO:
Due to missing device kernels for creation of submatrix with IndexSet, the creation of the submatrix from the index set will be in a separate PR.