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
Allow plugins to modify sparsity pattern #1865
Conversation
I think we should be calling |
@tjhei would it work to just call |
I don't think this patch can be correct. We call I think a better way is to find a place to hook into the mechanism that builds the |
@bangerth would the approach suggested above work: call |
I don't think it's that easy. |
I don't understand. Of course This patch computes |
@tjhei I did notice that in some of the failed tests are showing fewer nonzero entries. Interesting. |
This is what I predicted. ;-)
I wouldn't worry about that. I think inner_core is a test where we use a very under-resolved mesh so that it runs fast enough. |
I don't understand. Of course |current_constraints| might be changing and we
haven't specified if it is allowed to change the type of constraint over time
or only the values. But I assume that |current_constraints| computed at t=0 is
more correct to use than |constraints| for |make_sparsity_pattern|.
Yes, we agree.
This patch computes |current_constraints| before using them.
But from what? The patch calls it from setup_dofs(), which is significantly
before we even start a time step. It makes me uncomfortable to call
compute_current_constraints() before we know that everything is set up for the
first time step. I'm not saying that something bad actually happens -- it just
seems logically wrong to do this.
I'm going to add that I think the current place where we call this is also
questionable: We call compute_current_constraints() *before* we call the
update() function on all of the plugins. I think it should actually be after.
I think that this
change not only allows us to add additional constraints (like the pressure
dofs), but will also improve memory usage and performance, because we carry
around plenty of unused sparsity pattern entries for boundary conditions that
are only in |current_constraints|.
That, however, is an interesting point. Have you measured what difference it
makes?
|
I agree, this is a problem. We could delay constructing the sparsity patterns until we need them the first time. Then this setup would actually happen at t=0 and everything is set up correctly by then. I imagine this could be done by inspecting a flag right before we do the assembly. This would allow us to change the type of constraints during a computation too if we wanted to do that in the future. I can prepare a patch if you agree that this is acceptable. |
Of course not. ;-)
|
Yes, I will prepare something but leave this open for now. This way you guys can remind me in case I don't get it done soon. |
addressed in #1875 |
This allows for constraints that can potentially modify the sparsity pattern to be evaluated prior to the creation of the system matrices. This allows for prescribed pressure, for instance, as required for Pull Request #1864 .