dune-pdelab 2.7-git
Loading...
Searching...
No Matches
finiteelementmap/pk1d.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// Pk in one dimension with k as runtime variable
5
6#ifndef DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
7#define DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
8
9#include<dune/localfunctions/lagrange.hh>
10#include<dune/localfunctions/lagrange/equidistantpoints.hh>
11
13
14namespace Dune {
15
16 namespace PDELab {
17
25 template<class D, class R>
27 : public Dune::PDELab::SimpleLocalFiniteElementMap<LagrangeLocalFiniteElement<EquidistantPointSet,1,D,R>,1>
28 {
29 public:
30
32 : Dune::PDELab::SimpleLocalFiniteElementMap<LagrangeLocalFiniteElement<EquidistantPointSet,1,D,R>,1>(LagrangeLocalFiniteElement<EquidistantPointSet,1,D,R>(GeometryTypes::cube(1),k))
33 , _k(k)
34 {}
35
36 static constexpr bool fixedSize()
37 {
38 return true;
39 }
40
41 bool hasDOFs(int codim) const
42 {
43 switch (codim)
44 {
45 case 0:
46 return _k != 1;
47 case 1:
48 return _k > 0;
49 }
50 return false;
51 }
52
53 std::size_t size(GeometryType gt) const
54 {
55 if (gt.isVertex())
56 return _k > 0 ? 1 : 0;
57 if (gt.isLine())
58 return _k > 0 ? _k - 1 : 1;
59 return 0;
60 }
61
62 std::size_t maxLocalSize() const
63 {
64 return _k + 1;
65 }
66
67 private:
68 const std::size_t _k;
69 };
70 }
71}
72#endif // DUNE_PDELAB_FINITEELEMENTMAP_PK1D_HH
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:101
FiniteElementMap for the Pk basis in 1d.
Definition: finiteelementmap/pk1d.hh:28
static constexpr bool fixedSize()
Definition: finiteelementmap/pk1d.hh:36
bool hasDOFs(int codim) const
Definition: finiteelementmap/pk1d.hh:41
Pk1dLocalFiniteElementMap(std::size_t k)
Definition: finiteelementmap/pk1d.hh:31
std::size_t maxLocalSize() const
Definition: finiteelementmap/pk1d.hh:62
std::size_t size(GeometryType gt) const
Definition: finiteelementmap/pk1d.hh:53