Nodes.hpp 1.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <dune/common/version.hh>

namespace AMDiS
{
  // dune version independent extraction of node type from preBasis
  template <class PB, class TP>
  using Node_t =
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
    typename PB::template Node<TP>;
#else
    typename PB::Node;
#endif

  // dune version independent extraction of node indexset type from preBasis
  template <class PB, class TP>
  using NodeIndexSet_t =
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
    typename PB::template IndexSet<TP>;
#else
    typename PB::IndexSet;
#endif

  // dune version independent creation of node from preBasis
  template <class PB, class TP>
27
  auto makeNode(PB const& preBasis, [[maybe_unused]] TP const& treePath)
28
29
30
31
32
33
34
35
  {
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
    return preBasis.node(treePath);
#else
    return preBasis.makeNode();
#endif
  }

36
37
  // dune version independent creation of node from preBasis
  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
43
44
45
46
#else
    return preBasis.makeIndexSet();
#endif
  }

47
} // end namespace AMDiS