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>,GV::dimension>
20  {
21 
22  public:
23 
24  static_assert(
25  (k == 1) or (GV::dimension == 2 or GV::dimension == 3),
26  "QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3"
27  );
28 
29  static_assert(
30  k == 1 or k == 2,
31  "QkLocalFiniteElementMap is only implemented for k = 1,2"
32  );
33 
35  {}
36 
37  static constexpr bool fixedSize()
38  {
39  return true;
40  }
41 
42  static constexpr bool hasDOFs(int codim)
43  {
44  switch(k)
45  {
46  case 1:
47  return codim == GV::dimension;
48  case 2:
49  return true;
50  default:
51  return false;
52  }
53  }
54 
55  static constexpr std::size_t size(GeometryType gt)
56  {
57  switch (k)
58  {
59  case 1:
60  return gt == GeometryTypes::vertex ? 1 : 0;
61  case 2:
62  // Q1 simply attaches a single DOF to each subentity
63  return 1;
64  default:
65  return 0;
66  }
67  }
68 
69  static constexpr std::size_t maxLocalSize()
70  {
71  std::size_t r = 1;
72  for (std::size_t i = 0; i < GV::dimension; ++i)
73  r *= (k + 1);
74  return r;
75  }
76 
77  };
78 
79  }
80 }
81 
82 #endif // DUNE_PDELAB_FINITEELEMENTMAP_QKFEM_HH
Dune::PDELab::QkLocalFiniteElementMap
Definition: qkfem.hh:18
Dune
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Dune::PDELab::QkLocalFiniteElementMap::QkLocalFiniteElementMap
QkLocalFiniteElementMap(const GV &gv)
Definition: qkfem.hh:34
Dune::PDELab::QkLocalFiniteElementMap::size
static constexpr std::size_t size(GeometryType gt)
Definition: qkfem.hh:55
Dune::PDELab::QkLocalFiniteElementMap::maxLocalSize
static constexpr std::size_t maxLocalSize()
Definition: qkfem.hh:69
Dune::PDELab::SimpleLocalFiniteElementMap
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:111
Dune::PDELab::QkLocalFiniteElementMap::fixedSize
static constexpr bool fixedSize()
Definition: qkfem.hh:37
finiteelementmap.hh
Dune::PDELab::QkLocalFiniteElementMap::hasDOFs
static constexpr bool hasDOFs(int codim)
Definition: qkfem.hh:42