Order.hpp 714 Bytes
Newer Older
1
2
#pragma once

3
4
5
#include <amdis/Output.hpp>
#include <amdis/common/Math.hpp>
#include <amdis/common/Apply.hpp>
6
7
8

namespace AMDiS
{
9
10
11
12
  /// Polynomial order of local basis-node
  template <class N,
    class = typename N::NodeTag>
  int order(N const& node)
13
  {
14
15
16
17
18
    if constexpr (N::isLeaf)
      return node.finiteElement().localBasis().order();
    else if constexpr (N::isPower)
      return order(node.child(0u));
    else if constexpr (N::isComposite)
19
      return Ranges::applyIndices<N::degree()>([&](auto... ii) {
20
21
22
23
24
25
        return Math::max(order(node.child(ii))...);
      });
    else {
      warning("Unknown basis-node type. Assuming polynomial degree 1.");
      return 1;
    }
26
27
28
  }

} // end namespace AMDiS