7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
11#include <dune/common/exceptions.hh>
12#include <dune/common/math.hh>
38template<
typename GV,
int k>
41template<
typename GV,
int k>
45 static const int dim = GV::dimension;
135 DUNE_THROW(Dune::NotImplemented,
"No size method for " << dim <<
"d grids available yet!");
140 return Dune::power(k+1,
int(GV::dimension));
143 template<
typename It>
146 const auto& gridIndexSet =
gridView().indexSet();
147 const auto& element = node.
element();
150 if constexpr (dim==1)
151 offset =
dofsPerEdge*gridIndexSet.subIndex(element,0,0);
152 else if constexpr (dim==2)
154 if (element.type().isTriangle())
156 else if (element.type().isQuadrilateral())
159 DUNE_THROW(Dune::NotImplemented,
"2d elements have to be triangles or quadrilaterals");
161 else if constexpr (dim==3)
163 if (element.type().isTetrahedron())
165 else if (element.type().isPrism())
167 else if (element.type().isHexahedron())
169 else if (element.type().isPyramid())
172 DUNE_THROW(Dune::NotImplemented,
"3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
175 DUNE_THROW(Dune::NotImplemented,
"No index method for " << dim <<
"d grids available yet!");
176 for (
size_type i = 0, end = node.
size() ; i < end ; ++i, ++it)
198namespace BasisFactory {
207template<std::
size_t k>
210 return [](
const auto& gridView) {
230template<
typename GV,
int k>
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition lagrangedgbasis.hh:208
Definition polynomial.hh:17
Global basis for given pre-basis.
Definition defaultglobalbasis.hh:50
Definition lagrangebasis.hh:375
const Element & element() const
Return current element, throw if unbound.
Definition lagrangebasis.hh:427
Definition lagrangedgbasis.hh:44
It indices(const Node &node, It it) const
Definition lagrangedgbasis.hh:144
size_type maxNodeSize() const
Definition lagrangedgbasis.hh:138
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition lagrangedgbasis.hh:182
void update(const GridView &gv)
Definition lagrangedgbasis.hh:104
size_t hexahedronOffset_
Definition lagrangedgbasis.hh:193
Node makeNode() const
Create tree node.
Definition lagrangedgbasis.hh:112
static const int dofsPerHexahedron
Definition lagrangedgbasis.hh:60
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition lagrangedgbasis.hh:67
size_t pyramidOffset_
Definition lagrangedgbasis.hh:191
static const int dofsPerTetrahedron
Definition lagrangedgbasis.hh:58
GV GridView
The grid view that the FE space is defined on.
Definition lagrangedgbasis.hh:50
void initializeIndices()
Definition lagrangedgbasis.hh:72
size_t quadrilateralOffset_
Definition lagrangedgbasis.hh:190
static const int dofsPerEdge
Definition lagrangedgbasis.hh:55
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition lagrangedgbasis.hh:99
static const int dofsPerQuad
Definition lagrangedgbasis.hh:57
static const int dofsPerTriangle
Definition lagrangedgbasis.hh:56
static const int dofsPerPyramid
Definition lagrangedgbasis.hh:61
GridView gridView_
Definition lagrangedgbasis.hh:188
std::size_t size_type
Definition lagrangedgbasis.hh:51
size_type dimension() const
Definition lagrangedgbasis.hh:117
size_t prismOffset_
Definition lagrangedgbasis.hh:192
static const int dofsPerPrism
Definition lagrangedgbasis.hh:59
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36
size_type size() const
Definition nodes.hh:147