-
Notifications
You must be signed in to change notification settings - Fork 21
Add diagonal() to KroneckerStencilMatrix #537
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
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
…atch to MultipatchDiscreteDeRham
yguclu
left a comment
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.
Good job @jowezarek!
I have just a couple of comments
yguclu
left a comment
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.
Looks good to me!
We add a `diagonal(self, inverse=False, sqrt=False, out=None)` method to the class `KroneckerStencilMatrix`. Additionally, we fix the `diagonal` method of `StencilDiagonalMatrix`, both making it run in general, and also allowing for the kwarg `sqrt` which had been missing until now. This method comes in handy for the computation of the yet to be implemented LST preconditioners. For the computation of these, we compute 1D mass matrices which are the building blocks of 2D or 3D logical mass matrices. Additionally, we compute the diagonal of said 2D or 3D logical mass matrix. Thus, instead of having to assemble the entire 2D or 3D mass matrix, we can build them as `KroneckerStencilMatrices`, which is much cheaper, and then obtain the diagonal. This feature reduces the runtime of a yet to be implemented LST preconditioner test from 2 minutes down to 20 seconds. A very fast test for this new method is included in this PR.
We add a
diagonal(self, inverse=False, sqrt=False, out=None)method to the classKroneckerStencilMatrix.Additionally, we fix the
diagonalmethod ofStencilDiagonalMatrix, both making it run in general, and also allowing for the kwargsqrtwhich had been missing until now.This method comes in handy for the computation of the yet to be implemented LST preconditioners.
For the computation of these, we compute 1D mass matrices which are the building blocks of 2D or 3D logical mass matrices. Additionally, we compute the diagonal of said 2D or 3D logical mass matrix.
Thus, instead of having to assemble the entire 2D or 3D mass matrix, we can build them as
KroneckerStencilMatrices, which is much cheaper, and then obtain the diagonal.This feature reduces the runtime of a yet to be implemented LST preconditioner test from 2 minutes down to 20 seconds.
A very fast test for this new method is included in this PR.