dune-pdelab  2.4-dev
p0fem.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_P0FEM_HH
3 #define DUNE_PDELAB_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> >
18  {
19  public:
20 
21  P0LocalFiniteElementMap (const Dune::GeometryType& type)
22  : SimpleLocalFiniteElementMap< Dune::P0LocalFiniteElement<D,R,d> >(Dune::P0LocalFiniteElement<D,R,d>(type))
23  , _gt(type)
24  {
25  }
26 
27  bool fixedSize() const
28  {
29  return true;
30  }
31 
32  std::size_t size(GeometryType gt) const
33  {
34  return gt == _gt ? 1 : 0;
35  }
36 
37  std::size_t maxLocalSize() const
38  {
39  return 1;
40  }
41 
42  private:
43  const GeometryType _gt;
44 
45  };
46 
47  }
48 }
49 
50 #endif
bool fixedSize() const
Definition: p0fem.hh:27
std::size_t size(GeometryType gt) const
Definition: p0fem.hh:32
P0LocalFiniteElementMap(const Dune::GeometryType &type)
Definition: p0fem.hh:21
Definition: adaptivity.hh:27
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:107
std::size_t maxLocalSize() const
Definition: p0fem.hh:37