3#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASFORTINMARINI_CUBE_LOCALCOEFFICIENTS_HH
4#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASFORTINMARINI_CUBE_LOCALCOEFFICIENTS_HH
13#include <dune/localfunctions/common/localkey.hh>
31 template<
class D,
class R,
unsigned int dim,
unsigned int order>
34 static constexpr unsigned int interiorDofs = dim*
binomial(dim+order-2, order-2);
35 static constexpr unsigned int faceDofs =
binomial(dim+order-2, order-1);
37 static constexpr std::size_t numFaces = 2*dim;
38 static constexpr std::size_t numDofs = numFaces*faceDofs + interiorDofs;
44 for (
auto j : range(numFaces))
45 for (
auto i : range(faceDofs))
46 li[j*faceDofs + i] =
LocalKey(j, 1, i);
48 for (
auto i : range(interiorDofs))
49 li[numFaces*faceDofs + i] =
LocalKey(0, 0, i);
53 std::size_t
size ()
const {
return numDofs; }
59 std::vector<LocalKey> li;
62 template<
class D,
class R,
unsigned int dim,
unsigned int order>
63 constexpr unsigned int BDFMCubeLocalCoefficients<D, R, dim, order>::interiorDofs;
65 template<
class D,
class R,
unsigned int dim,
unsigned int order>
66 constexpr unsigned int BDFMCubeLocalCoefficients<D, R, dim, order>::faceDofs;
68 template<
class D,
class R,
unsigned int dim,
unsigned int order>
69 constexpr std::size_t BDFMCubeLocalCoefficients<D, R, dim, order>::numFaces;
76 template<
class D,
class R,
unsigned int dim>
77 class BDFMCubeLocalCoefficients<D, R, dim, 0>
79 static_assert( AlwaysFalse<D>::value,
80 "`BDFMCubeLocalCoefficients` not defined for order 0." );
Layout map for Brezzi-Douglas-Fortin-Marini elements on cubes.
Definition: localcoefficients.hh:33
BDFMCubeLocalCoefficients()
Standard constructor.
Definition: localcoefficients.hh:42
std::size_t size() const
number of coefficients
Definition: localcoefficients.hh:53
auto localKey(std::size_t i) const -> const LocalKey &
geth i'th index
Definition: localcoefficients.hh:56
Describe position of one degree of freedom.
Definition: localkey.hh:23
Traits for type conversions and type information.
Some useful basic math stuff.
Dune namespace.
Definition: alignedallocator.hh:13
static constexpr T binomial(const T &n, const T &k) noexcept
calculate the binomial coefficient n over k as a constexpr
Definition: math.hh:131
Utilities for reduction like operations on ranges.