4#ifndef DUNE_PK2DLOCALCOEFFICIENTS_HH
5#define DUNE_PK2DLOCALCOEFFICIENTS_HH
10#include <dune/localfunctions/common/localkey.hh>
21 template<
unsigned int k>
24 enum {N = (k+1)*(k+2)/2};
38 for (
int i = 0; i < 3; ++i)
39 flip[i] = variant & (1<<i);
40 for (
int i=0; i<N; i++)
41 if (li[i].codim()==1 && flip[li[i].subEntity()])
42 li[i].index(k-2-li[i].index());
54 template<
class VertexMap>
59 flip[0] = vertexmap[0] > vertexmap[1];
60 flip[1] = vertexmap[0] > vertexmap[2];
61 flip[2] = vertexmap[1] > vertexmap[2];
62 for (std::size_t i=0; i<N; i++)
63 if (li[i].codim()==1 && flip[li[i].subEntity()])
64 li[i].index(k-2-li[i].index());
80 std::vector<LocalKey> li;
91 for (
unsigned int j=0; j<=k; j++)
92 for (
unsigned int i=0; i<=k-j; i++)
96 li[n++] = LocalKey(0,2,0);
101 li[n++] = LocalKey(1,2,0);
106 li[n++] = LocalKey(2,2,0);
111 li[n++] = LocalKey(0,1,i-1);
116 li[n++] = LocalKey(1,1,j-1);
121 li[n++] = LocalKey(2,1,j-1);
124 li[n++] = LocalKey(0,0,c++);
Describe position of one degree of freedom.
Definition: localkey.hh:21
Layout map for P0 elements.
Definition: pk2dlocalcoefficients.hh:23
Pk2DLocalCoefficients()
Standard constructor.
Definition: pk2dlocalcoefficients.hh:28
std::size_t size() const
number of coefficients
Definition: pk2dlocalcoefficients.hh:68
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition: pk2dlocalcoefficients.hh:74
Pk2DLocalCoefficients(const VertexMap &vertexmap)
Definition: pk2dlocalcoefficients.hh:55
Pk2DLocalCoefficients(int variant)
constructor for eight variants with order on edges flipped
Definition: pk2dlocalcoefficients.hh:34
Dune namespace.
Definition: alignedallocator.hh:10