Improve specializations of Hybrid::size()
1 unresolved thread
1 unresolved thread
Compare changes
Files
2@@ -173,6 +173,7 @@ int main()
@@ -208,6 +209,10 @@ int main()
@@ -215,7 +220,14 @@ int main()
The interfaces tested subsequently for Hybrid::size(const T& t)
are now
std::tuple_size<T>::value
(e.g. needed for std::tuple
),T::size()
(e.g. needed for Dune::TupleVector
),T::N()
(e.g. needed for Dune::MultiTypeBlockMatrix
),t.N()
(e.g. needed for Dune::Matrix
),t.size()
(e.g. needed for std::vector
).Unfortunately the matrix interface is rather inconsistent.
While Dune::DenseMatrix
provides a dyanmic size()
method, the dynamic dense matrix
Dune::Matrix
does not. The only consistent interface to get the number of rows is the
N()
method which exists in dynamic (e.g. Dune::Matrix
) and constexpr static
(e.g. Dune::MultiTypeBlockMatrix
) flavour.
Hence to support matrices consistently, we must add support for those cases, too.
For the static constexpr N()
, this was made neccessary, because of the removal of
static consexpr Dune::MultiTypeBlockMatrix::size()
. The dynamic case should be
added for consistency to also support Dune::Matrix
and Dune::BCRSMatrix
.
As a by-product, this allows to get rid of the FieldMatrix
specialization.
Support for the N()
cases was removed from the MR and left to future discussion.
This MR now removes an obsolete special case for FieldVector
, extends the test to cover
this case, and fixes the documentation.