diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh index 7cecddb393dd1a99ad68550a434e23cf251f2bec..3806a813b43caaf3fc6903035a72d5420486ad42 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 FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<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 ce268ddb33bd483c8fa0d9c775e7e5004005c33f..19ed0f36cc6dbcb463aea8f45f90be668f47c09e 100644 --- a/dune/istl/bdmatrix.hh +++ b/dune/istl/bdmatrix.hh @@ -7,7 +7,6 @@ #include <memory> -#include <dune/common/ftraits.hh> #include <dune/common/rangeutilities.hh> #include <dune/common/scalarmatrixview.hh> @@ -37,7 +36,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<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 f4dc981a85a4f96f3fcc950f2c03ba690f89c6da..2bd2a6ea12cda95289f7e32a00fe24bfddeff0e9 100644 --- a/dune/istl/btdmatrix.hh +++ b/dune/istl/btdmatrix.hh @@ -6,7 +6,6 @@ #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> @@ -35,7 +34,7 @@ namespace Dune { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<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 6aa3582730a4fe24aea3411f2ed25109717262b2..28597e59ffc3c485fd1128cb6c9e188939a47b12 100644 --- a/dune/istl/bvector.hh +++ b/dune/istl/bvector.hh @@ -40,11 +40,32 @@ 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 [[deprecated("Use FieldTraits instead.")]] = FieldTraits<B>; + using BlockTraits = BlockTraitsImp<B,IsNumber<B>::value>; /** \brief An unmanaged vector of blocks. @@ -65,7 +86,7 @@ namespace Imp { public: //===== type definitions and constants - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -156,7 +177,7 @@ namespace Imp { template<class OtherB, class OtherST> auto operator* (const block_vector_unmanaged<OtherB,OtherST>& y) const { - typedef typename PromotionTraits<field_type,typename FieldTraits<OtherB>::field_type>::PromotedType PromotedType; + typedef typename PromotionTraits<field_type,typename BlockTraits<OtherB>::field_type>::PromotedType PromotedType; PromotedType sum(0); #ifdef DUNE_ISTL_WITH_CHECKING if (this->n!=y.N()) DUNE_THROW(ISTLError,"vector size mismatch"); @@ -177,7 +198,7 @@ namespace Imp { template<class OtherB, class OtherST> auto dot(const block_vector_unmanaged<OtherB,OtherST>& y) const { - typedef typename PromotionTraits<field_type,typename FieldTraits<OtherB>::field_type>::PromotedType PromotedType; + typedef typename PromotionTraits<field_type,typename BlockTraits<OtherB>::field_type>::PromotedType PromotedType; PromotedType sum(0); #ifdef DUNE_ISTL_WITH_CHECKING if (this->n!=y.N()) DUNE_THROW(ISTLError,"vector size mismatch"); @@ -374,7 +395,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -602,7 +623,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -725,7 +746,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<B>::field_type; //! export the type representing the components typedef B block_type; @@ -976,7 +997,7 @@ namespace Imp { //===== type definitions and constants //! export the type representing the field - using field_type = typename FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<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 dc86fb100bc5171587b0ec37600b42a264ea1163..2aff17648313356e96570b53e5b2413be8be50e7 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 FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<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 FieldTraits<T>::field_type; + using field_type = typename Imp::BlockTraits<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 05289d58cb34d5cc335071566d377f542e03c125..5c2d7825515880fd4841e8c74c1364bfab6cadea 100644 --- a/dune/istl/matrixmarket.hh +++ b/dune/istl/matrixmarket.hh @@ -23,7 +23,6 @@ #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> @@ -180,7 +179,7 @@ namespace Dune static void print(std::ostream& os) { os<<"%%MatrixMarket matrix coordinate "; - os<<mm_numeric_type<Simd::Scalar<typename FieldTraits<T>::field_type>>::str()<<" general"<<std::endl; + os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<T>::field_type>>::str()<<" general"<<std::endl; } }; @@ -190,7 +189,7 @@ namespace Dune static void print(std::ostream& os) { os<<"%%MatrixMarket matrix array "; - os<<mm_numeric_type<Simd::Scalar<typename FieldTraits<B>::field_type>>::str()<<" general"<<std::endl; + os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<B>::field_type>>::str()<<" general"<<std::endl; } }; diff --git a/dune/istl/vbvector.hh b/dune/istl/vbvector.hh index 89dd0962e918e931208b8d3821d081b4191468d7..681df8c85e6ed24ce8a58dff2919edda5cb85678 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 FieldTraits<B>::field_type; + using field_type = typename Imp::BlockTraits<B>::field_type; //! export the allocator type typedef A allocator_type;