diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh index 3806a813b43caaf3fc6903035a72d5420486ad42..7cecddb393dd1a99ad68550a434e23cf251f2bec 100644 --- a/dune/istl/bcrsmatrix.hh +++ b/dune/istl/bcrsmatrix.hh @@ -485,7 +485,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; diff --git a/dune/istl/bdmatrix.hh b/dune/istl/bdmatrix.hh index 19ed0f36cc6dbcb463aea8f45f90be668f47c09e..ce268ddb33bd483c8fa0d9c775e7e5004005c33f 100644 --- a/dune/istl/bdmatrix.hh +++ b/dune/istl/bdmatrix.hh @@ -7,6 +7,7 @@ #include <memory> +#include <dune/common/ftraits.hh> #include <dune/common/rangeutilities.hh> #include <dune/common/scalarmatrixview.hh> @@ -36,7 +37,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; diff --git a/dune/istl/btdmatrix.hh b/dune/istl/btdmatrix.hh index 2bd2a6ea12cda95289f7e32a00fe24bfddeff0e9..f4dc981a85a4f96f3fcc950f2c03ba690f89c6da 100644 --- a/dune/istl/btdmatrix.hh +++ b/dune/istl/btdmatrix.hh @@ -6,6 +6,7 @@ #define DUNE_ISTL_BTDMATRIX_HH #include <dune/common/fmatrix.hh> +#include <dune/common/ftraits.hh> #include <dune/common/scalarvectorview.hh> #include <dune/common/scalarmatrixview.hh> #include <dune/istl/bcrsmatrix.hh> @@ -34,7 +35,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh index 28597e59ffc3c485fd1128cb6c9e188939a47b12..6aa3582730a4fe24aea3411f2ed25109717262b2 100644 --- a/dune/istl/bvector.hh +++ b/dune/istl/bvector.hh @@ -40,32 +40,11 @@ namespace Dune { /** \brief Everything in this namespace is internal to dune-istl, and may change without warning */ namespace Imp { - /** \brief Define some derived types transparently for number types and dune-istl vector types - * - * This is the actual implementation. Calling code should use BlockTraits instead. - * \tparam isNumber Whether B is a number type (true) or a dune-istl matrix or vector type (false) - */ - template <class B, bool isNumber> - class BlockTraitsImp; - - template <class B> - class BlockTraitsImp<B,true> - { - public: - using field_type = B; - }; - - template <class B> - class BlockTraitsImp<B,false> - { - public: - using field_type = typename B::field_type; - }; - /** \brief Define some derived types transparently for number types and dune-istl matrix/vector types + * \deprecated */ template <class B> - using BlockTraits = BlockTraitsImp<B,IsNumber<B>::value>; + using BlockTraits [[deprecated("Use FieldTraits instead.")]] = FieldTraits<B>; /** \brief An unmanaged vector of blocks. @@ -86,7 +65,7 @@ namespace Imp { public: //===== type definitions and constants - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -177,7 +156,7 @@ namespace Imp { template<class OtherB, class OtherST> auto operator* (const block_vector_unmanaged<OtherB,OtherST>& y) const { - typedef typename PromotionTraits<field_type,typename BlockTraits<OtherB>::field_type>::PromotedType PromotedType; + typedef typename PromotionTraits<field_type,typename FieldTraits<OtherB>::field_type>::PromotedType PromotedType; PromotedType sum(0); #ifdef DUNE_ISTL_WITH_CHECKING if (this->n!=y.N()) DUNE_THROW(ISTLError,"vector size mismatch"); @@ -198,7 +177,7 @@ namespace Imp { template<class OtherB, class OtherST> auto dot(const block_vector_unmanaged<OtherB,OtherST>& y) const { - typedef typename PromotionTraits<field_type,typename BlockTraits<OtherB>::field_type>::PromotedType PromotedType; + typedef typename PromotionTraits<field_type,typename FieldTraits<OtherB>::field_type>::PromotedType PromotedType; PromotedType sum(0); #ifdef DUNE_ISTL_WITH_CHECKING if (this->n!=y.N()) DUNE_THROW(ISTLError,"vector size mismatch"); @@ -395,7 +374,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -623,7 +602,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -746,7 +725,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -997,7 +976,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the type representing the components typedef B block_type; diff --git a/dune/istl/matrix.hh b/dune/istl/matrix.hh index 2aff17648313356e96570b53e5b2413be8be50e7..dc86fb100bc5171587b0ec37600b42a264ea1163 100644 --- a/dune/istl/matrix.hh +++ b/dune/istl/matrix.hh @@ -47,7 +47,7 @@ namespace MatrixImp //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the allocator type typedef A allocator_type; @@ -562,7 +562,7 @@ namespace MatrixImp public: /** \brief Export the type representing the underlying field */ - using field_type = typename Imp::BlockTraits<T>::field_type; + using field_type = typename FieldTraits<T>::field_type; /** \brief Export the type representing the components */ typedef T block_type; diff --git a/dune/istl/matrixmarket.hh b/dune/istl/matrixmarket.hh index 5c2d7825515880fd4841e8c74c1364bfab6cadea..05289d58cb34d5cc335071566d377f542e03c125 100644 --- a/dune/istl/matrixmarket.hh +++ b/dune/istl/matrixmarket.hh @@ -23,6 +23,7 @@ #include <dune/common/exceptions.hh> #include <dune/common/fmatrix.hh> +#include <dune/common/ftraits.hh> #include <dune/common/fvector.hh> #include <dune/common/hybridutilities.hh> #include <dune/common/stdstreams.hh> @@ -179,7 +180,7 @@ namespace Dune static void print(std::ostream& os) { os<<"%%MatrixMarket matrix coordinate "; - os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<T>::field_type>>::str()<<" general"<<std::endl; + os<<mm_numeric_type<Simd::Scalar<typename FieldTraits<T>::field_type>>::str()<<" general"<<std::endl; } }; @@ -189,7 +190,7 @@ namespace Dune static void print(std::ostream& os) { os<<"%%MatrixMarket matrix array "; - os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<B>::field_type>>::str()<<" general"<<std::endl; + os<<mm_numeric_type<Simd::Scalar<typename FieldTraits<B>::field_type>>::str()<<" general"<<std::endl; } }; diff --git a/dune/istl/vbvector.hh b/dune/istl/vbvector.hh index 681df8c85e6ed24ce8a58dff2919edda5cb85678..89dd0962e918e931208b8d3821d081b4191468d7 100644 --- a/dune/istl/vbvector.hh +++ b/dune/istl/vbvector.hh @@ -53,7 +53,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename Imp::BlockTraits<B>::field_type; + using field_type = typename FieldTraits<B>::field_type; //! export the allocator type typedef A allocator_type;