AMDiS  0.1
The Adaptive Multi-Dimensional Simulation Toolbox
Nodes.hpp
1 #pragma once
2 
3 #include <dune/common/version.hh>
4 
5 namespace AMDiS
6 {
7  // dune version independent extraction of node type from preBasis
8  template <class PB, class TP>
9  using Node_t =
10 #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
11  typename PB::template Node<TP>;
12 #else
13  typename PB::Node;
14 #endif
15 
16  // dune version independent extraction of node indexset type from preBasis
17  template <class PB, class TP>
18  using NodeIndexSet_t =
19 #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
20  typename PB::template IndexSet<TP>;
21 #else
22  typename PB::IndexSet;
23 #endif
24 
25  // dune version independent creation of node from preBasis
26  template <class PB, class TP>
27  auto makeNode(PB const& preBasis, [[maybe_unused]] TP const& treePath)
28  {
29 #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
30  return preBasis.node(treePath);
31 #else
32  return preBasis.makeNode();
33 #endif
34  }
35 
36  // dune version independent creation of node from preBasis
37  template <class PB, class TP>
38  auto makeNodeIndexSet(PB const& preBasis, [[maybe_unused]] TP const& treePath)
39  {
40 #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
41  return preBasis.template indexSet<TP>();
42 #else
43  return preBasis.makeIndexSet();
44 #endif
45  }
46 
47 } // end namespace AMDiS
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6