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
Compare MGTransferMatrixFree and MGTransferMF for compute_no_normal_flux_constraints_on_level() #16217
base: master
Are you sure you want to change the base?
Conversation
…lux_constraints_on_level()
I agree, we should make this change now and unify the code.
Please help me to better understand the problem: We get different values in case the Regarding the desired behavior, I would suggest to go with the more robust behavior in terms of solvers. Does it even make sense to compute something for the constrained DoFs, or would any such value likely be problematic because it might get added with other contributions that then need to be addressed by smoothers? My question is motivated by the fact that the transfer matrices are rectangular, so I considered rank-deficient matrices and similar artifacts the common case. In other words, my philosophy was that we should keep all non-zero contributions out of the mg cycle, which would mean that we should ignore the vector entries in constrained DoFs. I could be wrong, and one might in fact be able to have useful information on constrained DoFs, but then we would have to resolve the constraints properly, wouldn't we? |
Exactly.
Yes. At least all tests in
Exactly, this is the reasoning for zeroing constrained values during weighting. However, this is not done in the case of It would be a bit odd that |
I agree, we should not consider constraints on either side. A longer-term desire would be that we should have a way to get rid of all constrained DoFs while solving linear systems with a matrix-free solver (to avoid any kind of ambiguities, because those cases are purely artificial). We would need some preparations for making that work, in particular a way for |
As a note, To apply more complex constraints (e.g., |
This is done because MGConstrainedDoFs only supports 0 constraints (efficiently) and custom constraints (inefficiently). We want to use the former if possible.
Do you mean VectorTools::compute_no_normal_flux_constraints_on_level() or using it in Multigrid? |
019ffe7
to
f1701f8
Compare
@kronbichler With the last PR, I apply the constraints consistently on the fine level (but also on the coarse level during restriction via |
I guess this one can be closed now? |
This PR shows that
MGTransferMatrixFree
andMGTransferMF
have different behaviors in the case that DoFs are constrained by other DoFs (as in the case ofno-normal-flux constrains
). The difference is thatMGTransferMF
zeroes the constrained values during prolongation whileMGTransferMatrixFree
does not. The wouldn't be a problem (if one just ignores these values in the vector). However, restriction is the transposed operation of prolongation; in the case that some values are in the fine vector, this leads to different restricted residuals.In #16167, I could observe that, in the case that constrains are not zeroed, the results are different if the system matrix has zeroes or ones on the diagonal entries related to constrained DoFs.
I noticed this discrepancy while compare times of
MGTransferMatrixFree
andMGTransferMF
. I noticed thatdealii/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h
Lines 2237 to 2286 in 087064a
Q: Since we want to merge both classes. We need to decide which is the correct behavior and make the (incompatible) change now.