[assembly][newton] reimplement partial reassembly
Transfer the partial reassembly functionality to the current structure.
On the topmost level, the NewtonSolver
uses the functionality
in the methods solve
, newtonUpdate
and assembleLinearSystem
by calls to new methods assemblerResetColors_
,
assemblerNewtonUpdate_
and assembleLinearSystem_
. In these
new methods, new member functions of the FVAssembler
are called:
resetColors
, updateDistanceFromLastLinearization
and
computeColors
as well as assembleJacobianAndResidual
with a
second argument. Use SFINAE and enable_if
such that not all
assemblers are required to implement the extended interface.
The FVAssembler
forwards the work to a new class
PartialReassembler
. This class also holds the required data.
After each Newton iteration, the PartialReassembler
colors the
geometrical degrees of freedom depending on the shift of the
primary variables from the last time that the derivatives have been
calculated. For green-colored entities, the entries in the Jacobian
are kept, while for the other entities, they are recalculated.
Use an enum class EntityColor
for the coloring, enable read
access to the color of an entity via the Assembler.
Implement the functionality for Box and TPFA. The correspnding local assemblers have to be adapted such that no calculations are performed for green elements.
Still missing (while also not present in Dumux 2.x):
-
Parametrize the thresholds in the NewtonSolver
-
Throw if called with mpfa
Fixes #379 (closed).