dune-pdelab  2.4-dev
monomfem.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 #ifndef DUNE_PDELAB_MONOMFEM_HH
5 #define DUNE_PDELAB_MONOMFEM_HH
6 
7 #include <cstddef>
8 
9 #include <dune/geometry/type.hh>
10 
11 #include<dune/localfunctions/monomial.hh>
12 
13 #include"finiteelementmap.hh"
15 
16 namespace Dune {
17  namespace PDELab {
18 
21  template<class D, class R, int d, int p>
23  : public SimpleLocalFiniteElementMap< Dune::MonomialLocalFiniteElement<D,R,d,p> >
24  {
25  public:
26 
27  MonomLocalFiniteElementMap (const Dune::GeometryType& type)
28  : SimpleLocalFiniteElementMap< Dune::MonomialLocalFiniteElement<D,R,d,p> >(Dune::MonomialLocalFiniteElement<D,R,d,p>(type)), _gt(type)
29  {
30  }
31 
32  bool fixedSize() const
33  {
34  return true;
35  }
36 
37  std::size_t size(GeometryType gt) const
38  {
39  return gt == _gt ? Dune::MonomImp::Size<d,p>::val : 0;
40  }
41 
42  std::size_t maxLocalSize() const
43  {
44  return MonomImp::Size<d,p>::val;
45  }
46 
47  private:
48  const GeometryType _gt;
49 
50  };
51 
53 
60  template<class Geometry, class RF, std::size_t p>
62  : public GeometryFiniteElementMap<
63  MonomialFiniteElementFactory<Geometry, RF, p>
64  >
65  {
66  typedef MonomialFiniteElementFactory<Geometry, RF, p> FEFactory;
68 
69  static FEFactory feFactory;
70 
71  public:
72  MonomFiniteElementMap() : Base(feFactory) { }
73  };
74 
75  template<class GV, class RF, std::size_t p>
76  typename MonomFiniteElementMap<GV, RF, p>::FEFactory
77  MonomFiniteElementMap<GV, RF, p>::feFactory;
78 
79  }
80 }
81 
82 #endif //DUNE_PDELAB_MONOMFEM_HH
MonomLocalFiniteElementMap(const Dune::GeometryType &type)
Definition: monomfem.hh:27
std::size_t size(GeometryType gt) const
Definition: monomfem.hh:37
MonomFiniteElementMap()
Definition: monomfem.hh:72
bool fixedSize() const
Definition: monomfem.hh:32
Definition: adaptivity.hh:27
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:107
Global-valued finite element map for Monom elements.
Definition: monomfem.hh:61
std::size_t maxLocalSize() const
Definition: monomfem.hh:42
Generic finite element map for global finite elements created with a geometry.
Definition: global.hh:19
const P & p
Definition: constraints.hh:146