3 #ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
6 #include <dune/common/exceptions.hh>
8 #include <dune/localfunctions/rannacherturek.hh>
10 #include <dune/typetree/leafnode.hh>
33 class RannacherTurekNode;
35 template<
typename GV,
class MI>
36 class RannacherTurekNodeIndexSet;
38 template<
typename GV,
class MI>
39 class RannacherTurekPreBasis;
54 template<
typename GV,
class MI>
57 static const int dim = GV::dimension;
128 assert(prefix.size() == 0 || prefix.size() == 1);
129 return (prefix.size() == 0) ?
size() : 0;
141 return 2*GV::dimension;
150 template<
typename GV>
154 static const int dim = GV::dimension;
155 static const int maxSize = 2*dim;
160 using Element =
typename GV::template Codim<0>::Entity;
161 using FiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype, double, dim>;
189 DUNE_THROW(Dune::Exception,
190 "Rannacher-Turek elements do not exist for elements of type " << e.type());
203 template<
typename GV,
class MI>
206 enum {dim = GV::dimension};
248 template<
typename It>
257 *it = {{ (
size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
270 namespace BasisFactory {
274 template<
class Dummy=
void>
275 class RannacherTurekPreBasisFactory
278 static const std::size_t requiredMultiIndexSize = 1;
280 template<
class MultiIndex,
class Gr
idView>
281 auto makePreBasis(
const GridView& gridView)
const
297 template<
class Dummy=
void>
300 return Imp::RannacherTurekPreBasisFactory<void>();
319 template<
typename GV>
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition: rannacherturekbasis.hh:298
Definition: polynomial.hh:10
Global basis for given pre-basis.
Definition: defaultglobalbasis.hh:47
std::size_t size_type
Definition: nodes.hh:125
void setSize(const size_type size)
Definition: nodes.hh:160
Definition: rannacherturekbasis.hh:153
void bind(const Element &e)
Bind to element.
Definition: rannacherturekbasis.hh:184
RannacherTurekLocalFiniteElement< typename GV::ctype, double, dim > FiniteElement
Definition: rannacherturekbasis.hh:161
const Element & element() const
Return current element, throw if unbound.
Definition: rannacherturekbasis.hh:169
const FiniteElement finiteElement_
Definition: rannacherturekbasis.hh:197
typename GV::template Codim< 0 >::Entity Element
Definition: rannacherturekbasis.hh:160
RannacherTurekNode()
Definition: rannacherturekbasis.hh:163
const Element * element_
Definition: rannacherturekbasis.hh:198
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition: rannacherturekbasis.hh:178
Definition: rannacherturekbasis.hh:205
It indices(It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition: rannacherturekbasis.hh:249
const PreBasis * preBasis_
Definition: rannacherturekbasis.hh:263
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: rannacherturekbasis.hh:213
size_type size() const
Size of subtree rooted in this node (element-local)
Definition: rannacherturekbasis.hh:242
std::size_t size_type
Definition: rannacherturekbasis.hh:210
void bind(const Node &node)
Bind the view to a grid element.
Definition: rannacherturekbasis.hh:228
const Node * node_
Definition: rannacherturekbasis.hh:265
void unbind()
Unbind the view.
Definition: rannacherturekbasis.hh:235
RannacherTurekNodeIndexSet(const PreBasis &preBasis)
Definition: rannacherturekbasis.hh:219
Pre-basis for a Rannacher-Turek basis.
Definition: rannacherturekbasis.hh:56
Dune::ReservedVector< size_type, 1 > SizePrefix
Type used for prefixes handed to the size() method.
Definition: rannacherturekbasis.hh:77
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition: rannacherturekbasis.hh:139
IndexSet makeIndexSet() const
Create tree node index set.
Definition: rannacherturekbasis.hh:114
std::size_t size_type
Type used for indices and size information.
Definition: rannacherturekbasis.hh:65
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: rannacherturekbasis.hh:89
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition: rannacherturekbasis.hh:133
GV GridView
The grid view that the FE basis is defined on.
Definition: rannacherturekbasis.hh:62
size_type size() const
Same as size(prefix) with empty prefix.
Definition: rannacherturekbasis.hh:120
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: rannacherturekbasis.hh:74
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition: rannacherturekbasis.hh:126
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition: rannacherturekbasis.hh:95
Node makeNode() const
Create tree node.
Definition: rannacherturekbasis.hh:103
GridView gridView_
Definition: rannacherturekbasis.hh:145
void initializeIndices()
Initialize the global indices.
Definition: rannacherturekbasis.hh:85
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition: rannacherturekbasis.hh:80