3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
7#include <dune/common/exceptions.hh>
8#include <dune/common/math.hh>
33template<
typename GV,
int k>
36template<
typename GV,
int k>
39 static const int dim = GV::dimension;
133 DUNE_THROW(Dune::NotImplemented,
"No size method for " << dim <<
"d grids available yet!");
137 template<
class SizePrefix>
140 assert(prefix.size() == 0 || prefix.size() == 1);
141 return (prefix.size() == 0) ?
size() : 0;
155 template<
typename It>
158 const auto& gridIndexSet =
gridView().indexSet();
159 const auto& element = node.
element();
162 if constexpr (dim==1)
163 offset =
dofsPerEdge*gridIndexSet.subIndex(element,0,0);
164 else if constexpr (dim==2)
166 if (element.type().isTriangle())
168 else if (element.type().isQuadrilateral())
171 DUNE_THROW(Dune::NotImplemented,
"2d elements have to be triangles or quadrilaterals");
173 else if constexpr (dim==3)
175 if (element.type().isTetrahedron())
177 else if (element.type().isPrism())
179 else if (element.type().isHexahedron())
181 else if (element.type().isPyramid())
184 DUNE_THROW(Dune::NotImplemented,
"3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
187 DUNE_THROW(Dune::NotImplemented,
"No index method for " << dim <<
"d grids available yet!");
188 for (
size_type i = 0, end = node.
size() ; i < end ; ++i, ++it)
210namespace BasisFactory {
219template<std::
size_t k>
222 return [](
const auto& gridView) {
242template<
typename GV,
int k>
auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition: powerbasis.hh:369
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition: lagrangedgbasis.hh:220
Definition: polynomial.hh:10
Global basis for given pre-basis.
Definition: defaultglobalbasis.hh:46
Definition: lagrangebasis.hh:387
const Element & element() const
Return current element, throw if unbound.
Definition: lagrangebasis.hh:439
Definition: lagrangedgbasis.hh:38
size_type size() const
Definition: lagrangedgbasis.hh:115
It indices(const Node &node, It it) const
Definition: lagrangedgbasis.hh:156
size_type maxNodeSize() const
Definition: lagrangedgbasis.hh:150
static constexpr size_type multiIndexBufferSize
Definition: lagrangedgbasis.hh:62
unsigned int order() const
Polynomial order used in the local Lagrange finite-elements.
Definition: lagrangedgbasis.hh:194
void update(const GridView &gv)
Definition: lagrangedgbasis.hh:102
size_t hexahedronOffset_
Definition: lagrangedgbasis.hh:205
Node makeNode() const
Create tree node.
Definition: lagrangedgbasis.hh:110
static constexpr size_type maxMultiIndexSize
Definition: lagrangedgbasis.hh:60
static const int dofsPerHexahedron
Definition: lagrangedgbasis.hh:54
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition: lagrangedgbasis.hh:65
size_t pyramidOffset_
Definition: lagrangedgbasis.hh:203
static const int dofsPerTetrahedron
Definition: lagrangedgbasis.hh:52
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition: lagrangedgbasis.hh:138
GV GridView
The grid view that the FE space is defined on.
Definition: lagrangedgbasis.hh:44
void initializeIndices()
Definition: lagrangedgbasis.hh:70
size_t quadrilateralOffset_
Definition: lagrangedgbasis.hh:202
static const int dofsPerEdge
Definition: lagrangedgbasis.hh:49
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: lagrangedgbasis.hh:97
static const int dofsPerQuad
Definition: lagrangedgbasis.hh:51
static const int dofsPerTriangle
Definition: lagrangedgbasis.hh:50
static const int dofsPerPyramid
Definition: lagrangedgbasis.hh:55
GridView gridView_
Definition: lagrangedgbasis.hh:200
static constexpr size_type minMultiIndexSize
Definition: lagrangedgbasis.hh:61
std::size_t size_type
Definition: lagrangedgbasis.hh:45
size_type dimension() const
Definition: lagrangedgbasis.hh:145
size_t prismOffset_
Definition: lagrangedgbasis.hh:204
static const int dofsPerPrism
Definition: lagrangedgbasis.hh:53
size_type size() const
Definition: nodes.hh:142