GetDegree.hpp 1.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <dune/functions/functionspacebases/lagrangedgbasis.hh>
#include <dune/functions/functionspacebases/pqknodalbasis.hh>
#include <dune/functions/functionspacebases/pq1nodalbasis.hh>
#include <dune/functions/functionspacebases/taylorhoodbasis.hh>

#include <dune/amdis/common/Mpl.hpp>

14
namespace AMDiS
15
16
17
18
{
  namespace Impl
  {
    // helper class to extract the polynomial degree of a pqk nodal basis
19
    template <class FeSpace>
20
    struct GetDegree : int_<1> {};
21
22
23
24
25
26
27
28
29
30
31
32
33

    template <class GV, int k>
    struct GetDegree<Dune::Functions::PQkNodalBasis<GV, k> > : int_<k> {};

    template <class GV, int k>
    struct GetDegree<Dune::Functions::LagrangeDGBasis<GV, k> > : int_<k> {};

    template <class GV>
    struct GetDegree<Dune::Functions::PQ1NodalBasis<GV> > : int_<1> {};

    template <class GV>
    struct GetDegree<Dune::Functions::TaylorHoodBasis<GV> > : int_<2> {};

34
  } // end namespace Impl
35

36
37
38
  /// \brief Return the polynomial degree of a given FESpace. Falls back to 1 if unknown.
  template <class FeSpace>
  constexpr int getPolynomialDegree = Impl::GetDegree<FeSpace>::value;
39

40
} // end namespace AMDiS