From 8d91fbbfee93d0b611094e9ecb6ba456b849ffb0 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 17 Mar 2020 19:58:56 +0100 Subject: [PATCH] [typetraits][matrix] Add trait for MultiTypeBlockMatrix * use forward declare to remove includes --- dumux/common/typetraits/matrix.hh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/dumux/common/typetraits/matrix.hh b/dumux/common/typetraits/matrix.hh index 630d17946b..dd531bec35 100644 --- a/dumux/common/typetraits/matrix.hh +++ b/dumux/common/typetraits/matrix.hh @@ -26,16 +26,30 @@ #include <type_traits> -#include <dune/istl/bcrsmatrix.hh> +// Forward declare to avoid includes +namespace Dune { +template <class A, class B> +class BCRSMatrix; -namespace Dumux { +template <class FirstRow, class ... Args> +class MultiTypeBlockMatrix; +} // end namespace Dune -//! Helper type to determine whether a given type is a Dune::BCRSMatrix -template<class T> struct isBCRSMatrix : public std::false_type {}; +namespace Dumux { //! Helper type to determine whether a given type is a Dune::BCRSMatrix template<class T> -struct isBCRSMatrix<Dune::BCRSMatrix<T> > : public std::true_type {}; +struct isBCRSMatrix : public std::false_type {}; + +template<class B> +struct isBCRSMatrix<Dune::BCRSMatrix<B>> : public std::true_type {}; + +//! Helper type to determine whether a given type is a Dune::MultiTypeBlockMatrix +template<class... Args> +struct isMultiTypeBlockMatrix : public std::false_type {}; + +template<class... Args> +struct isMultiTypeBlockMatrix<Dune::MultiTypeBlockMatrix<Args...>> : public std::true_type {}; } // end namespace Dumux -- GitLab