Add matrix free solvers and preconditioners
This merge requests adds matrix-free solvers and preconditioners from the exadune project to pdelab.
It was quite a journey to get here and there were a lot of people involved. Thanks to:
- Eike Mueller for the first implementation
- Steffen Muething for his work in EXADune
- Marina Piatkowski for his improvements
- Dominic Kempf for extracting it from EXADune and brushing things up for code generation
Some important notes:
-
The matrix-free SOR preconditioner only works with the fast-DG grid operator. If you try to use it with a regular grid operator you will get an error message from a static assert. There are two solutions to this issue: (1) Copy data and make the fast-DG version slower or (2) Modify the regular assembler. If one of those two things is desirable I would prefer to have a new merge request. This one is quite long as it is.
-
In the nonlinear case the matrix-free preconditioners only work with the new local operator interface for the nonlinear jacobian applies, see #140 (closed) and !489 (merged). If you try to use them with a local operator that only implements the old interface you gets an error message from a static_assert.
-
The matrix-free solvers don't work with the regular StationaryLinearProblemSolver or the regular NewtonMethod. It would be possible to make those classes work for matrix-based and matrix-free solvers but this would require something like !435 (closed) or a bigger rewrite of the solver backends. My current solution is to simply add copies of those two classes. If we merge something like !435 (closed) I will clean this up, but until a clean solution is possible I don't want to waste time with those two classes.
-
The Blockoffdiagonalwrapper was improved and avoids creating local vectors in one place.
-
Besides the canges mentioned in the last two points the whole implementation is quite isolated in a
dune/pdelab/backend/istl/matrixfree
. So far I have not done any performance tests so I might make a follow up merge request to fix some performance bottlenecks.