Add utility functions for recursive traversal of matrices and vectors

This allows

recursiveForEachMatrixEntry(matrix, [](auto&& matrix_ij, auto&& i, auto&& j) {
  ...
});

recursiveForEachVectorEntry(vector, [](auto&& vector_i, auto&& i) {
  ...
});

Here the container is traversed hierachically and the row and column multi-indices i and j are instances of Dune::Functions::StaticMultiIndex with appropriate length depending on the nesting depth.

This also allows to simplify/improve/generalize incorporateEssentialConstraints(...) in the examples.

Merge request reports

Loading