dune-pdelab  2.7-git
p0fem.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_P0FEM_HH
3 #define DUNE_PDELAB_FINITEELEMENTMAP_P0FEM_HH
4 
5 #include <dune/geometry/type.hh>
6 
7 #include<dune/localfunctions/lagrange/p0.hh>
8 #include"finiteelementmap.hh"
9 
10 namespace Dune {
11  namespace PDELab {
12 
15  template<class D, class R, int d>
17  : public SimpleLocalFiniteElementMap<Dune::P0LocalFiniteElement<D,R,d>,d>
18  {
19  public:
20 
21  P0LocalFiniteElementMap (const Dune::GeometryType& type)
22  : SimpleLocalFiniteElementMap<Dune::P0LocalFiniteElement<D,R,d>,d>(Dune::P0LocalFiniteElement<D,R,d>(type))
23  , _gt(type)
24  {
25  }
26 
27  static constexpr bool fixedSize()
28  {
29  return true;
30  }
31 
32  static constexpr bool hasDOFs(int codim)
33  {
34  return codim == 0;
35  }
36 
37  std::size_t size(GeometryType gt) const
38  {
39  return gt == _gt ? 1 : 0;
40  }
41 
42  static constexpr std::size_t maxLocalSize()
43  {
44  return 1;
45  }
46 
47  private:
48  const GeometryType _gt;
49 
50  };
51 
52  }
53 }
54 
55 #endif // DUNE_PDELAB_FINITEELEMENTMAP_P0FEM_HH
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:101
static constexpr bool hasDOFs(int codim)
Definition: p0fem.hh:32
std::size_t size(GeometryType gt) const
Definition: p0fem.hh:37
P0LocalFiniteElementMap(const Dune::GeometryType &type)
Definition: p0fem.hh:21
static constexpr std::size_t maxLocalSize()
Definition: p0fem.hh:42
static constexpr bool fixedSize()
Definition: p0fem.hh:27