6#include <dune/common/fvector.hh>
7#include <dune/common/tuplevector.hh>
8#include <dune/common/typetraits.hh>
10#include <amdis/common/Index.hpp>
11#include <amdis/common/TypeTraits.hpp>
16 struct FieldTraits<TupleVector<T...>>
18 using field_type = std::common_type_t<typename FieldTraits<T>::field_type...>;
19 using real_type = std::common_type_t<typename FieldTraits<T>::real_type...>;
27 template <
class Node,
class R,
class NodeTag>
30 static_assert( Dune::AlwaysFalse<NodeTag>::value,
"Unknown node-type for range definition" );
45 template <
class Node,
class R =
double>
47 typename Impl::RangeTypeImpl<Node, R, typename Node::NodeTag>::type;
53 template <
class Node,
class R>
54 struct RangeTypeImpl<Node, R, Dune::TypeTree::LeafNodeTag>
56 using LocalBasis =
typename Node::FiniteElement::Traits::LocalBasisType;
57 using T =
typename LocalBasis::Traits::RangeType;
58 using type = remove_cvref_t<decltype(std::declval<R>() * std::declval<T>())>;
62 template <
class Node,
class R>
63 struct RangeTypeImpl<Node, R, Dune::TypeTree::PowerNodeTag>
65 using ChildNode =
typename Node::template Child<0>::type;
67 template <
bool childIsLeaf,
class ChildRangeType>
69 using type = Dune::FieldVector<ChildRangeType,
int(Node::degree())>;
73 struct FlatType<true, Dune::FieldVector<T,1>> {
74 using type = Dune::FieldVector<T,
int(Node::degree())>;
77 using type =
typename FlatType<ChildNode::isLeaf, RangeType_t<ChildNode,R>>::type;
81 template <
class Node,
class R>
82 struct RangeTypeImpl<Node, R, Dune::TypeTree::CompositeNodeTag>
84 template <
class Idx>
struct RangeTypeGenerator;
85 template <std::size_t... I>
86 struct RangeTypeGenerator<Indices<I...>>
88 template <std::
size_t J>
89 using ChildNode =
typename Node::template Child<J>::type;
90 using type = Dune::TupleVector<RangeType_t<ChildNode<I>,R>...>;
93 using type =
typename RangeTypeGenerator<std::make_index_sequence<std::size_t(Node::degree())>>::type;