-
Notifications
You must be signed in to change notification settings - Fork 35
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
Block jacobi preconditioner #254
base: master
Are you sure you want to change the base?
Conversation
Principally, I like the idea that the preconditioner takes care of the data, just as the Jacobi preconditioner takes care of the diagonal. So see whether this design has downsides, I need to go through the changes in detail. I will add questions as comments to the code changes. |
} | ||
|
||
private: | ||
Operator const & underlying_operator; | ||
BlockMatrix block_matrix; |
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.
Here, it looks like the BlockJacobiPreconditioner
always uses a matrix-based implementation technique. In case a matrix-free application of the inverse block "matrices" is chosen, block_matrix
is probably not used. We should make sure how to make this intuitively understandable when looking at the implementation of BlockJacobiPreconditioner
.
@@ -521,20 +530,51 @@ OperatorBase<dim, Number, n_components>::add_block_diagonal_matrices(BlockMatrix | |||
template<int dim, typename Number, int n_components> | |||
void | |||
OperatorBase<dim, Number, n_components>::apply_block_diagonal_matrix_based( |
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.
Shouldn't this function, and the other one below for the inverse block matrices, be implemented as a free function? So we need to discuss: Why is OperatorBase
executing this function? With the changes of this PR, isn't it unsatisfactory that this is still done by OperatorBase
?
} | ||
|
||
virtual void | ||
apply_inverse_block_diagonal(const BlockMatrix & block_matrix, |
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.
here, a similar comment applies as for the BlockJacobiPreconditioner
.
I think the present PR moves the matrix-based and the matrix-free implementation of Block-Jacobi operations further away from each other than they are currently. From the matrix-based perspective, storing the block matrices outside the operator makes definitely sense. From the matrix-free perspective, the operations are very close to what A difference to the Jacobi preconditioner is that we always store the diagonal, even if we use a matrix-free implementation framework. This is different for block-Jacobi. Currently, I ask myself whether it makes sense to unify the matrix-based and matrix-free Block-Jacobi operations in a common data structure, say |
89a1987
to
76b6e3a
Compare
This PR makes the
BlockJacobiPreconditioner
more consistent with theJacobiPreconditioner
and the AMG preconditioners. The block matrices should not be owned by theOperatorBase
but by the Preconditioner.The second commit makes separate loops over cells and faces possible in parallel. We should discuss if we want to enable this option as it uses some knowledge about internal datastructures in
MatrixFree
.A marked this as a draft because I want some feedback before I put more work into this.