13#ifndef KASKADE_DUNE_INTERFACE_HH_
14#define KASKADE_DUNE_INTERFACE_HH_
18#include <boost/mpl/plus.hpp>
31 static constexpr int dim = 0;
35 template <
class T,
bool enable>
41 template <
class T,
bool enable>
51 static_assert(!HasDimension<Type>::value && !HasDim<Type>::value,
"Type must provide one of the integral static constexpr members \'dimension\' (DUNE) or \'dim\' (Kaskade7)!");
53 static constexpr int value = std::conditional<
54 HasDimension<Type>::value && HasDim<Type>::value,
69 template <
class LocalType>
70 static typename LocalType::field_type
hasFieldType(
typename LocalType::field_type);
72 template <
class LocalType>
75 template <
class LocalType>
76 static typename LocalType::Scalar
hasScalar(
typename LocalType::Scalar);
78 template <
class LocalType>
81 template <
class LocalType,
bool hasScalar_,
bool hasFieldType_>
struct ExtractScalar;
83 template <
class LocalType,
bool hasFieldType_>
86 typedef typename LocalType::Scalar
type;
89 template <
class LocalType>
92 typedef typename LocalType::field_type
type;
96 !std::is_same<decltype(hasScalar<Type>(0)),
TypeNotFound>::value,
97 !std::is_same<
decltype(hasFieldType<Type>(0)),
TypeNotFound>::value
100 static_assert(!std::is_same<type,TypeNotFound>::value,
"No scalar type found. Type must provide one of the nested types \'field_type\' (DUNE) or \'Scalar\' (Kaskade7)!");
109 template <
class Type>
#define KASKADE_CREATE_MEMBER_NAME_CHECK(VARIABLE_NAME, NAME)
typename GetScalar< Type >::type ScalarType
Extracts the scalar field type from linear algebra data types.
static constexpr int dimension
static constexpr int value
static constexpr int value
Get dimension as nested integral static constexpr.
static constexpr int value
Get scalar type from Dune (-> field_type) or Kaskade (-> Scalar) member.
!std ::is_same< decltype(hasFieldType< Type >(0)), TypeNotFound >::value ::type type
static TypeNotFound hasScalar(...)
static LocalType::field_type hasFieldType(typename LocalType::field_type)
static LocalType::Scalar hasScalar(typename LocalType::Scalar)
static TypeNotFound hasFieldType(...)
Checks if type is a function or member function.