Dune Core Modules (2.6.0)

pk1dlocalcoefficients.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#ifndef DUNE_PK1DLOCALCOEFFICIENTS_HH
5#define DUNE_PK1DLOCALCOEFFICIENTS_HH
6
7#include <cstddef>
8#include <vector>
9
10#include <dune/localfunctions/common/localkey.hh>
11
12namespace Dune
13{
14
21 template<unsigned int k>
23 {
24 enum {N = k+1};
25
26 public:
29 {
30 fill_default();
31 }
32
34 Pk1DLocalCoefficients (int variant) : li(N)
35 {
36 fill_default();
37 }
38
48 template<class VertexMap>
49 explicit Pk1DLocalCoefficients(const VertexMap &vertexmap) : li(N)
50 {
51 fill_default();
52 }
53
55 std::size_t size () const
56 {
57 return N;
58 }
59
61 const LocalKey& localKey (std::size_t i) const
62 {
63 return li[i];
64 }
65
66 private:
67 std::vector<LocalKey> li;
68
69 void fill_default()
70 {
71 li.resize(N);
72
73 if (N==1) {
74 li[0] = LocalKey(0,0,0);
75 } else {
76 li[0] = LocalKey(0,1,0);
77 for (int i=1; i<N-1; i++)
78 li[i] = LocalKey(0,0,i-1); // element dofs
79 li.back() = LocalKey(1,1,0);
80 }
81 }
82 };
83
84}
85
86#endif
Describe position of one degree of freedom.
Definition: localkey.hh:21
Layout map for Pk elements.
Definition: pk1dlocalcoefficients.hh:23
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition: pk1dlocalcoefficients.hh:61
Pk1DLocalCoefficients(int variant)
constructor for eight variants with order on edges flipped
Definition: pk1dlocalcoefficients.hh:34
std::size_t size() const
number of coefficients
Definition: pk1dlocalcoefficients.hh:55
Pk1DLocalCoefficients(const VertexMap &vertexmap)
Definition: pk1dlocalcoefficients.hh:49
Pk1DLocalCoefficients()
Standard constructor.
Definition: pk1dlocalcoefficients.hh:28
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)