dune-pdelab  2.4.1
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  bool hasDOFs(int codim) const
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  std::size_t maxLocalSize() const
43  {
44  return 1;
45  }
46 
47  private:
48  const GeometryType _gt;
49 
50  };
51 
52  }
53 }
54 
55 #endif
Definition: adaptivity.hh:27
std::size_t maxLocalSize() const
Definition: p0fem.hh:42
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:107
bool hasDOFs(int codim) const
Definition: p0fem.hh:32
std::size_t size(GeometryType gt) const
Definition: p0fem.hh:37
P0LocalFiniteElementMap(const Dune::GeometryType &type)
Definition: p0fem.hh:21
bool fixedSize() const
Definition: p0fem.hh:27