7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
10#include <dune/common/exceptions.hh>
11#include <dune/common/math.hh>
37template<
typename GV,
int k,
typename R=
double>
48template<
typename GV,
int k,
typename R=
double>
54 static constexpr bool useDynamicOrder = (k<0);
56 static MCMGLayout dofLayout(
int order)
58 return [
order](Dune::GeometryType type,
size_t dimGrid) {
59 if (type.dim() == dimGrid)
63 if (type.isTriangle())
65 if (type.isQuadrilateral())
67 if (type.isTetrahedron())
71 if (type.isHexahedron())
75 DUNE_THROW(Dune::NotImplemented,
"Using LagrangeDGPreBasis with non-supported GeometryType");
88 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerEdge = k+1;
89 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerTriangle = (k+1)*(k+2)/2;
90 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerQuad = (k+1)*(k+1);
91 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
92 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
93 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
94 [[deprecated(
"This constant will be removed after Dune 2.11")]]
const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
106 : Base(gv, dofLayout(k))
118 : Base(gv, dofLayout(
order))
130 template<
class Node,
class It>
134 for(
auto i : Dune::range(node.
size()))
136 *it = {{ (
size_type)(elementOffset+i) }};
145 return (useDynamicOrder) ?
order_ : k;
165template<std::
size_t order,
typename R=
double>
168 return [](
const auto& gridView) {
181template<
typename R=
double>
184 return [order](
const auto& gridView) {
205template<
typename GV,
int k=-1,
typename R=
double>
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition lagrangedgbasis.hh:166
DefaultGlobalBasis< LagrangeDGPreBasis< GV, k, R > > LagrangeDGBasis
Basis of a scalar k-th-order Lagrangean-DG finite element space.
Definition lagrangedgbasis.hh:206
Definition monomialset.hh:19
Definition monomialset.hh:19
LagrangeNode< GV, k, R > LagrangeDGNode
Definition lagrangedgbasis.hh:38
Definition argyrisbasis.hh:926
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:53
Definition lagrangebasis.hh:379
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:427
PreBasis implementation for a Lagrangean-DG finite element space.
Definition lagrangedgbasis.hh:51
Node makeNode() const
Create tree node.
Definition lagrangedgbasis.hh:125
LagrangeDGPreBasis(const GridView &gv, unsigned int order)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:116
static const int dofsPerPrism
Definition lagrangedgbasis.hh:92
LagrangeDGNode< GV, k, R > Node
Definition lagrangedgbasis.hh:96
static const int dofsPerQuad
Definition lagrangedgbasis.hh:90
static const int dofsPerTriangle
Definition lagrangedgbasis.hh:89
typename Base::size_type size_type
Definition lagrangedgbasis.hh:85
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangedgbasis.hh:143
static const int dofsPerPyramid
Definition lagrangedgbasis.hh:94
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:104
static const int dofsPerHexahedron
Definition lagrangedgbasis.hh:93
It indices(const Node &node, It it) const
Definition lagrangedgbasis.hh:131
static const int dofsPerEdge
Definition lagrangedgbasis.hh:88
unsigned int order_
Definition lagrangedgbasis.hh:150
static const int dofsPerTetrahedron
Definition lagrangedgbasis.hh:91
GV GridView
The grid view that the FE space is defined on.
Definition lagrangedgbasis.hh:84
A generic MixIn class for PreBasis with flat indices computed from a mapper.
Definition leafprebasismappermixin.hh:62
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_
Definition leafprebasismappermixin.hh:133
std::size_t size_type
Type used for index digits.
Definition leafprebasismappermixin.hh:71
size_type size() const
Obtain the number of basis function in the local node.
Definition nodes.hh:162