Skip to content
Snippets Groups Projects

WIP: Helper method to compute the matrix blocklevel

Closed Oliver Sander requested to merge deprecate-blocklevel into master

The following is only a prototype to probe whether the general idea is well-received by the dune-istl community. See the end of the text for a few things that need to be improved.

All ISTL vectors and matrices have to export the 'blocklevel' integer. It is used to determine the nesting depth of a given vector or matrix.

As it turns out, the vector blocklevel field is never actually used within dune-istl. The matrix blocklevel is used a few times. However, with C++11 and beyond it is quite easy to compute the vector and matrix nestings depths without requiring the blocklevel field from each and every vector and matrix implementation.

This patch adds a little helper method matrixBlockLevel that computes the nesting depth of a given matrix type. The method is contained in the Imp namespace, to keep it out of the official dune-istl API. That is a decision to be debated, however.

Before merging, the following details should be improved:

  • The new method uses if constexpr, which is not allowed in the Dune core yet.
  • It uses MatrixType::block_type. A more general implementation would use the return type of operator[].operator[] here.

Merge request reports

Pipeline #19110 failed

Pipeline failed for 0db085df on deprecate-blocklevel

Closed by Oliver SanderOliver Sander 4 years ago (Apr 11, 2020 5:19am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading