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> >
26  {
27  public:
28  Pk1dLocalFiniteElementMap (std::size_t k)
30  , _k(k)
31  {}
32 
33  bool fixedSize() const
34  {
35  return true;
36  }
37 
38  bool hasDOFs(int codim) const
39  {
40  switch (codim)
41  {
42  case 0:
43  return _k != 1;
44  case 1:
45  return _k > 0;
46  }
47  return false;
48  }
49 
50  std::size_t size(GeometryType gt) const
51  {
52  if (gt.isVertex())
53  return _k > 0 ? 1 : 0;
54  if (gt.isLine())
55  return _k > 0 ? _k - 1 : 1;
56  return 0;
57  }
58 
59  std::size_t maxLocalSize() const
60  {
61  return _k + 1;
62  }
63 
64  private:
65  const std::size_t _k;
66  };
67  }
68 }
69 #endif // DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
Define the Pk Lagrange basis functions in 1d on the reference interval.
Definition: pk1d.hh:26
Pk1dLocalFiniteElementMap(std::size_t k)
Definition: ap/pk1d.hh:28
std::size_t size(GeometryType gt) const
Definition: ap/pk1d.hh:50
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:95
std::size_t maxLocalSize() const
Definition: ap/pk1d.hh:59
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
bool fixedSize() const
Definition: ap/pk1d.hh:33
FiniteElementMap for the Pk basis in 1d.
Definition: ap/pk1d.hh:24
bool hasDOFs(int codim) const
Definition: ap/pk1d.hh:38