diff --git a/CHANGELOG.md b/CHANGELOG.md index f7ef202fd67a81e64c019601e94702bf717524ef..d0dceaf50d119c65c53eb2970ed6b6df91bdf0a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,9 @@ - The interface methods `dot()` and `norm()` of ScalarProduct are now `const`. You will have to adjust the method signatures in your own scalar product implementations. +- `MultiTypeBlockVector` now implements the interface method `N()`, which + returns the number of vector entries. + - `MultiTypeBlockVector::count()` is now `const` - `SeqILU` can now be used with SIMD data types. @@ -55,6 +58,9 @@ - The method `getSolverCategory` of `OwnerOverlapCopyCommunication` is deprecated and will be removed after Dune 2.7. Use `category()` instead. +- The method `MultiTypeBlockVector::count()` has been deprecated, because its name + is inconsistent with the name mandated by the `dune-istl` vector interface. + # Release 2.6 - `BDMatrix` objects can now be constructed and assigned from `std::initializer_list`. diff --git a/dune/istl/multitypeblockvector.hh b/dune/istl/multitypeblockvector.hh index c87fdff37fb87384835d6e5b3d3a3b260855028b..b03a7d23732722939d1a51411d7415b5d71d4bbd 100644 --- a/dune/istl/multitypeblockvector.hh +++ b/dune/istl/multitypeblockvector.hh @@ -86,10 +86,17 @@ namespace Dune { return sizeof...(Args); } + /** \brief Number of elements + */ + static constexpr size_type N() + { + return sizeof...(Args); + } + /** * number of elements */ - int count() const + int count() const DUNE_DEPRECATED_MSG("Use method 'N' instead") { return sizeof...(Args); } diff --git a/dune/istl/test/multitypeblockvectortest.cc b/dune/istl/test/multitypeblockvectortest.cc index e207b8eec0adb5aca8474b2b639a8a7dfacdc9d8..3ed1aecebf7b2a1dafef33d8f915b4f3905a2ae7 100644 --- a/dune/istl/test/multitypeblockvectortest.cc +++ b/dune/istl/test/multitypeblockvectortest.cc @@ -33,12 +33,17 @@ void testMultiVector(const MultiTypeBlockVector<Args...>& multiVector) std::cout << multiVector << std::endl; // test method 'count' - std::cout << "multi vector has " << multiVector.count() << " first level blocks" << std::endl; + std::cout << "multi vector has " << multiVector.N() << " first level blocks" << std::endl; static_assert(MultiTypeBlockVector<Args...>::size()==2, "Method MultiTypeBlockVector::size() returned wrong value!"); +DUNE_NO_DEPRECATED_BEGIN if (multiVector.count() != 2) DUNE_THROW(Exception, "Method MultiTypeBlockVector::count returned wrong value!"); +DUNE_NO_DEPRECATED_END + + if (multiVector.N() != 2) + DUNE_THROW(Exception, "Method MultiTypeBlockVector::N returned wrong value!"); // Test copy construction auto multiVector2 = multiVector;