DUNE PDELab (2.8)

pk1d.hh
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
10#include<dune/localfunctions/lagrange/equidistantpoints.hh>
11
12#include<dune/pdelab/finiteelementmap/finiteelementmap.hh>
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
31 Pk1dLocalFiniteElementMap (std::size_t 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
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:123
FiniteElementMap for the Pk basis in 1d.
Definition: pk1d.hh:28
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:101
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:156
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:470
Convenience header that includes all implementations of Lagrange finite elements.
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)