dune-pdelab  2.5-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  bool hasDOFs(int codim) const
33  {
34  switch(k)
35  {
36  case 1:
37  return codim == GV::dimension;
38  case 2:
39  if (GV::dimension != 2 && GV::dimension != 3)
40  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3");
41  return 1;
42  default:
43  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap is only implemented for k <= 2");
44  }
45  }
46 
47  std::size_t size(GeometryType gt) const
48  {
49  switch (k)
50  {
51  case 1:
52  return gt.isVertex() ? 1 : 0;
53  case 2:
54  {
55  if (GV::dimension != 2 && GV::dimension != 3)
56  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3");
57  // Q1 simply attaches a single DOF to each subentity
58  return 1;
59  }
60  default:
61  DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap is only implemented for k <= 2");
62  }
63  }
64 
65  std::size_t maxLocalSize() const
66  {
67  std::size_t r = 1;
68  for (std::size_t i = 0; i < GV::dimension; ++i)
69  r *= (k + 1);
70  return r;
71  }
72 
73  };
74 
75  }
76 }
77 
78 #endif // DUNE_PDELAB_FINITEELEMENTMAP_QKFEM_HH
bool fixedSize() const
Definition: qkfem.hh:27
QkLocalFiniteElementMap(const GV &gv)
Definition: qkfem.hh:24
std::size_t size(GeometryType gt) const
Definition: qkfem.hh:47
bool hasDOFs(int codim) const
Definition: qkfem.hh:32
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:95
std::size_t maxLocalSize() const
Definition: qkfem.hh:65
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27