Improve VariationalDensityEvolve
Feature request:
At the moment the VariationalDensityEvolve
propagator is the bottleneck of all the variational models in several way :
- It is by far the slowest propagator, mostly due to the update of the mass matrix that as to be done at each Picard iteration.
- It is the most restrictive in term of CFL condition : when doing some test with the
VariationalBarotropicFluid
model, to test the limit time step before the Picard iteration fails, I could call 4 timeVariationalDensityEvolve
with limitdt
before calling onceVariationalMomentumAdvection
with 4dt
. When taking higherdt
it would still beVariationalDensityEvolve
that would not converge.
Expected behavior:
VariationalDensityEvolve
might be faster and more robust.
Proposed solution:
For the performance side, I think we could implement matrix less MassOperator
that would just store the info on the weight and call a kernel when they are called. That would prevent the repeated assembly of the matrix which is time consuming, specially when the matrix is then only called a few time (mostly the matrix is used to solve once a linear system). We could also use this operator as preconditioners as the inverse of a weighted mass matrix might well be approximated by the weighted mass matrix with inverse weight. The same could be applied to BasisProjectionOperator
as there also I assemble matrices that are only use once.
For the robustness I might give a try to a Newton solver, although the assembly of the Jacobian might be to costly. Maybe again matrix less operator could improve that, but the few test I did (on my psydac code) with Newton did not show much improvement of the possible time step. If the same show up also here we would need more investigation on that.