3 #ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
7 #include <dune/common/exceptions.hh>
34 template<
typename GV,
int k>
37 template<
typename GV,
int k,
class MI>
41 template<
typename GV,
int k,
class MI>
44 static const int dim = GV::dimension;
152 DUNE_THROW(Dune::NotImplemented,
"No size method for " << dim <<
"d grids available yet!");
158 assert(prefix.size() == 0 || prefix.size() == 1);
159 return (prefix.size() == 0) ?
size() : 0;
170 return StaticPower<(k+1),GV::dimension>::
power;
184 template<
typename GV,
int k,
class MI>
188 static const int dim = GV::dimension;
230 template<
typename It>
247 if (element.type().isTriangle())
252 else if (element.type().isQuadrilateral())
258 DUNE_THROW(Dune::NotImplemented,
"2d elements have to be triangles or quadrilaterals");
262 if (element.type().isTetrahedron())
267 else if (element.type().isPrism())
272 else if (element.type().isHexahedron())
277 else if (element.type().isPyramid())
283 DUNE_THROW(Dune::NotImplemented,
"3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
286 DUNE_THROW(Dune::NotImplemented,
"No index method for " << dim <<
"d grids available yet!");
300 namespace BasisFactory {
304 template<std::
size_t k>
305 class LagrangeDGPreBasisFactory
308 static const std::size_t requiredMultiIndexSize = 1;
310 template<
class MultiIndex,
class Gr
idView>
311 auto makePreBasis(
const GridView& gridView)
const
329 template<std::
size_t k>
332 return Imp::LagrangeDGPreBasisFactory<k>();
350 template<
typename GV,
int k>
auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &ims)
Create a pre-basis factory that can build a PowerPreBasis.
Definition: powerbasis.hh:483
auto lagrangeDG()
Create a pre-basis factory that can create a LagrangeDG pre-basis.
Definition: lagrangedgbasis.hh:330
Definition: polynomial.hh:10
Global basis for given pre-basis.
Definition: defaultglobalbasis.hh:47
Definition: lagrangebasis.hh:295
const Element & element() const
Return current element, throw if unbound.
Definition: lagrangebasis.hh:351
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition: lagrangebasis.hh:360
Definition: lagrangedgbasis.hh:186
void unbind()
Unbind the view.
Definition: lagrangedgbasis.hh:217
const PreBasis * preBasis_
Definition: lagrangedgbasis.hh:292
const Node * node_
Definition: lagrangedgbasis.hh:294
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: lagrangedgbasis.hh:195
std::size_t size_type
Definition: lagrangedgbasis.hh:192
LagrangeDGNodeIndexSet(const PreBasis &preBasis)
Definition: lagrangedgbasis.hh:201
It indices(It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition: lagrangedgbasis.hh:231
void bind(const Node &node)
Bind the view to a grid element.
Definition: lagrangedgbasis.hh:210
size_type size() const
Size of subtree rooted in this node (element-local)
Definition: lagrangedgbasis.hh:224
Definition: lagrangedgbasis.hh:43
size_t pyramidOffset_
Definition: lagrangedgbasis.hh:177
static const int dofsPerPyramid
Definition: lagrangedgbasis.hh:60
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: lagrangedgbasis.hh:105
Node makeNode() const
Create tree node.
Definition: lagrangedgbasis.hh:118
size_type maxNodeSize() const
Definition: lagrangedgbasis.hh:168
GridView gridView_
Definition: lagrangedgbasis.hh:174
GV GridView
The grid view that the FE space is defined on.
Definition: lagrangedgbasis.hh:49
size_type dimension() const
Definition: lagrangedgbasis.hh:163
Dune::ReservedVector< size_type, 1 > SizePrefix
Definition: lagrangedgbasis.hh:70
static const int dofsPerHexahedron
Definition: lagrangedgbasis.hh:59
static const int dofsPerEdge
Definition: lagrangedgbasis.hh:54
std::size_t size_type
Definition: lagrangedgbasis.hh:50
static const int dofsPerQuad
Definition: lagrangedgbasis.hh:56
size_t hexahedronOffset_
Definition: lagrangedgbasis.hh:179
static const int dofsPerPrism
Definition: lagrangedgbasis.hh:58
void update(const GridView &gv)
Definition: lagrangedgbasis.hh:110
static const int dofsPerTriangle
Definition: lagrangedgbasis.hh:55
LagrangeDGPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition: lagrangedgbasis.hh:73
IndexSet makeIndexSet() const
Create tree node index set.
Definition: lagrangedgbasis.hh:129
size_type size(const SizePrefix prefix) const
Return number possible values for next position in multi index.
Definition: lagrangedgbasis.hh:156
size_type size() const
Definition: lagrangedgbasis.hh:134
static const int dofsPerTetrahedron
Definition: lagrangedgbasis.hh:57
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: lagrangedgbasis.hh:68
size_t prismOffset_
Definition: lagrangedgbasis.hh:178
size_t quadrilateralOffset_
Definition: lagrangedgbasis.hh:176
void initializeIndices()
Definition: lagrangedgbasis.hh:78