3#ifndef DUNE_PK3DLOCALCOEFFICIENTS_HH
4#define DUNE_PK3DLOCALCOEFFICIENTS_HH
10#include <dune/localfunctions/common/localkey.hh>
21 template<
unsigned int k>
24 enum {N = (k+1)*(k+2)*(k+3)/6};
30 const unsigned int vertexmap[4] = {0, 1, 2, 3};
31 generate_local_keys(vertexmap);
42 generate_local_keys(vertexmap);
58 std::vector<LocalKey> li;
60 void generate_local_keys(
const unsigned int vertexmap[4])
67 unsigned int subindex[16];
68 unsigned int codim_count[4] = {0};
69 for (
unsigned int m = 1; m < 16; ++m)
71 unsigned int codim = !(m&1) + !(m&2) + !(m&4) + !(m&8);
72 subindex[m] = codim_count[codim]++;
75 int a1 = (3*k + 12)*k + 11;
77 unsigned int dof_count[16] = {0};
79 for (i[3] = 0; i[3] <= k; ++i[3])
80 for (i[2] = 0; i[2] <= k - i[3]; ++i[2])
81 for (i[1] = 0; i[1] <= k - i[2] - i[3]; ++i[1])
83 i[0] = k - i[1] - i[2] - i[3];
85 unsigned int entity = 0;
86 unsigned int codim = 0;
87 for (
unsigned int m = 0; m < 4; ++m)
89 j[m] = i[vertexmap[m]];
90 entity += !!j[m] << m;
93 int local_index = j[3]*(a1 + (a2 + j[3])*j[3])/6
94 + j[2]*(2*(k - j[3]) + 3 - j[2])/2 + j[1];
95 li[local_index] = LocalKey(subindex[entity], codim, dof_count[entity]++);
Describe position of one degree of freedom.
Definition: localkey.hh:21
Please doc me!
Definition: pk3dlocalcoefficients.hh:23
std::size_t size() const
number of coefficients
Definition: pk3dlocalcoefficients.hh:46
Pk3DLocalCoefficients()
Standard constructor.
Definition: pk3dlocalcoefficients.hh:28
Pk3DLocalCoefficients(const unsigned int vertexmap[4])
Definition: pk3dlocalcoefficients.hh:40
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition: pk3dlocalcoefficients.hh:52
Dune namespace.
Definition: alignedallocator.hh:10