dune-pdelab  2.5-dev
ap/pk1d.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 
4 // Pk in one dimension with k as runtime variable
5 
6 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
7 #define DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
8 
11 
12 namespace Dune {
13 
14  namespace PDELab {
15 
23  template<class D, class R>
25  : public Dune::PDELab::SimpleLocalFiniteElementMap<Pk1dLocalFiniteElement<D,R>,1>
26  {
27  public:
28 
29  Pk1dLocalFiniteElementMap (std::size_t k)
31  , _k(k)
32  {}
33 
34  static constexpr bool fixedSize()
35  {
36  return true;
37  }
38 
39  bool hasDOFs(int codim) const
40  {
41  switch (codim)
42  {
43  case 0:
44  return _k != 1;
45  case 1:
46  return _k > 0;
47  }
48  return false;
49  }
50 
51  std::size_t size(GeometryType gt) const
52  {
53  if (gt.isVertex())
54  return _k > 0 ? 1 : 0;
55  if (gt.isLine())
56  return _k > 0 ? _k - 1 : 1;
57  return 0;
58  }
59 
60  std::size_t maxLocalSize() const
61  {
62  return _k + 1;
63  }
64 
65  private:
66  const std::size_t _k;
67  };
68  }
69 }
70 #endif // DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
Define the Pk Lagrange basis functions in 1d on the reference interval.
Definition: pk1d.hh:29
std::size_t size(GeometryType gt) const
Definition: ap/pk1d.hh:51
static constexpr bool fixedSize()
Definition: ap/pk1d.hh:34
bool hasDOFs(int codim) const
Definition: ap/pk1d.hh:39
std::size_t maxLocalSize() const
Definition: ap/pk1d.hh:60
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Pk1dLocalFiniteElementMap(std::size_t k)
Definition: ap/pk1d.hh:29
FiniteElementMap for the Pk basis in 1d.
Definition: ap/pk1d.hh:24
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:111