dune-pdelab  2.4-dev
qkfem.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_FINITEELEMENTMAP_QKFEM_HH
5 #define DUNE_PDELAB_FINITEELEMENTMAP_QKFEM_HH
6 
7 #include <cstddef>
8 
9 #include <dune/localfunctions/lagrange/qk.hh>
11 
12 namespace Dune {
13  namespace PDELab {
14 
17  template<typename GV, typename D, typename R, std::size_t k>
19  : public SimpleLocalFiniteElementMap< Dune::QkLocalFiniteElement<D,R,GV::dimension,k> >
20  {
21 
22  public:
23 
25  {}
26 
27  bool fixedSize() const
28  {
29  return true;
30  }
31 
32  std::size_t size(GeometryType gt) const
33  {
34  switch (k)
35  {
36  case 1:
37  return gt.isVertex() ? 1 : 0;
38  case 2:
39  {
40  if (GV::dimension != 2 && GV::dimension != 3)
41  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3");
42  // Q1 simply attaches a single DOF to each subentity
43  return 1;
44  }
45  default:
46  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap is only implemented for k <= 2");
47  }
48  }
49 
50  std::size_t maxLocalSize() const
51  {
52  std::size_t r = 1;
53  for (std::size_t i = 0; i < GV::dimension; ++i)
54  r *= (k + 1);
55  return r;
56  }
57 
58  };
59 
60  }
61 }
62 
63 #endif // DUNE_PDELAB_FINITEELEMENTMAP_QKFEM_HH
std::size_t maxLocalSize() const
Definition: qkfem.hh:50
QkLocalFiniteElementMap(const GV &gv)
Definition: qkfem.hh:24
Definition: adaptivity.hh:27
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:107
std::size_t size(GeometryType gt) const
Definition: qkfem.hh:32
bool fixedSize() const
Definition: qkfem.hh:27