AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
FiniteElementType.hpp
1#pragma once
2
3#include <dune/typetree/nodetags.hh>
4
5#include <amdis/common/Tags.hpp>
6
7namespace AMDiS
8{
9 namespace Impl
10 {
11 template <class Node, class NodeTag>
12 struct FiniteElementTypeImpl
13 {
14 using type = tag::unknown;
15 };
16 }
17
18 template <class Node>
19 using FiniteElementType =
20 Impl::FiniteElementTypeImpl<Node, typename Node::NodeTag>;
21
22 template <class Node>
23 using FiniteElementType_t = typename FiniteElementType<Node>::type;
24
25 namespace Impl
26 {
27 // Leaf node
28 template <class Node>
29 struct FiniteElementTypeImpl<Node, Dune::TypeTree::LeafNodeTag>
30 {
31 using type = typename Node::FiniteElement;
32 };
33
34 // Power node
35 template <class Node>
36 struct FiniteElementTypeImpl<Node, Dune::TypeTree::PowerNodeTag>
37 {
38 using ChildNode = typename Node::template Child<0>::type;
39 using type = FiniteElementType_t<ChildNode>;
40 };
41
42 // Composite node
43 template <class Node>
44 struct FiniteElementTypeImpl<Node, Dune::TypeTree::CompositeNodeTag>
45 {
46 using type = tag::unknown; // no common FiniteElement type
47 };
48
49 } // end namespace Impl
50} // end namespace AMDiS