-
Notifications
You must be signed in to change notification settings - Fork 161
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
Implement the Fast Diagonalization Method for Q_k, DQ_k and RTCF_k (FDMPC) #2024
Conversation
…roductElement of more than two elements, undo changes in variant
Removing the numpy import will potentially affect a lot of users, but this should be very easy to fix. The application libraries can be imported, but numpy might potentially be missing in some of their tests. |
I am confused by this:
At least on my firedrake. |
Ah, |
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 had mostly minor comments.
I do not claim that I fully understand all the intricacies in this code. I think the core idea is the following:
- There exists a basis for Q_k (etc...) in which certain bilinear forms are actually sparse (as sparse as the Q_1 thing approximately, so we can assemble them as sparse matrices)
- This preconditioner works by applying the change of basis (which can be done dimension-by-dimension in a O(p^{d+1}) way from standard GLL to this special basis, call it
T_sp
- In the special basis you assemble the operator taking care to maintain the sparsity, this can now be sent to PETSc (call this operator
A_sp
)
So the action of the preconditioner is something like:
y <- T_sp^T A_sp^-1 T_sp x
You have to do a lot of work by hand here to construct A_sp correctly (mostly) including making certain approximations on coefficients in the form. I think (though do not know) that if you implemented the fancy 1D basis in FIAT, it should be possible to deliver T_sp
as the interpolation between two finat elements (and this should now have good complexity).
The main work in A_sp
is that you're having to do all of the assembly by hand, because we can't deliver you an element kernel that maintains sparsity, and even if we could do that, can't deliver the insertion in a sparsity-preserving way.
It would be interesting (not for this PR) to think about what would be required to do this.
Yes, I would be very keen to implement this idea. Furthermore we need to figure out a way to take the transpose, which would be very useful for p-MG. |
803688c
to
64b1606
Compare
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.
Very minor issues.
FDMPC
is a preconditioner for tensor-product elements that changes the shape functions so that the H^1 Riesz map is diagonalized in the interior of a Cartesian cell, and assembles a global sparse matrix on which other preconditioners, such asASMStarPC
, can be applied.Other relevant fixes and features coming with this PR:
ASMExtrudedStarPC
: works for uniform extrusions, variable layers are not supported.pmg.py
causedimport numpy as np
on every script which hadfrom firedrake import *
along with many other imports. These imports are dropped by specifying__all__
inpmg.py
.constant=True
as the basis.StandaloneInterpolationMatrix
andMixedInterpolationMatrix
were defined as restriction matrices before this PR.