Go to the documentation of this file.
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>
32 template<
typename GV,
typename TP>
35 template<
typename GV,
class MI,
class TP>
38 template<
typename GV,
class MI>
54 template<
typename GV,
class MI>
57 static const int dim = GV::dimension;
142 assert(prefix.size() == 0 || prefix.size() == 1);
143 return (prefix.size() == 0) ?
size() : 0;
155 return 2*GV::dimension;
164 template<
typename GV,
typename TP>
168 static const int dim = GV::dimension;
169 static const int maxSize = 2*dim;
177 using Element =
typename GV::template Codim<0>::Entity;
178 using FiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype, double, dim>;
207 DUNE_THROW(Dune::Exception,
208 "Rannacher-Turek elements do not exist for elements of type " << e.type());
221 template<
typename GV,
class MI,
class TP>
224 enum {dim = GV::dimension};
266 template<
typename It>
271 Dune::LocalKey localKey =
node_->finiteElement().localCoefficients().localKey(i);
273 const auto& element =
node_->element();
275 *it = {{ (
size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
288 namespace BasisBuilder {
292 template<
class Dummy=
void>
293 class RannacherTurekPreBasisFactory
296 static const std::size_t requiredMultiIndexSize = 1;
298 template<
class MultiIndex,
class Gr
idView>
299 auto makePreBasis(
const GridView& gridView)
const
315 template<
class Dummy=
void>
318 return Imp::RannacherTurekPreBasisFactory<void>();
338 template<
typename GV>
344 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PQ1NODALBASIS_HH
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: rannacherturekbasis.hh:231
Definition: polynomial.hh:7
std::size_t size_type
Type used for indices and size information.
Definition: rannacherturekbasis.hh:65
typename GV::template Codim< 0 >::Entity Element
Definition: rannacherturekbasis.hh:177
const Element * element_
Definition: rannacherturekbasis.hh:216
void unbind()
Unbind the view.
Definition: rannacherturekbasis.hh:253
RannacherTurekLocalFiniteElement< typename GV::ctype, double, dim > FiniteElement
Definition: rannacherturekbasis.hh:178
RannacherTurekNodeIndexSet(const PreBasis &preBasis)
Definition: rannacherturekbasis.hh:237
const Element & element() const
Return current element, throw if unbound.
Definition: rannacherturekbasis.hh:187
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition: rannacherturekbasis.hh:153
auto rannacherTurek()
Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
Definition: rannacherturekbasis.hh:316
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition: rannacherturekbasis.hh:147
std::size_t size_type
Definition: rannacherturekbasis.hh:228
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition: rannacherturekbasis.hh:97
void bind(const Node &node)
Bind the view to a grid element.
Definition: rannacherturekbasis.hh:246
RannacherTurekNode(const TreePath &treePath)
Definition: rannacherturekbasis.hh:180
Definition: rannacherturekbasis.hh:36
size_type size() const
Same as size(prefix) with empty prefix.
Definition: rannacherturekbasis.hh:134
const PreBasis * preBasis_
Definition: rannacherturekbasis.hh:281
void bind(const Element &e)
Bind to element.
Definition: rannacherturekbasis.hh:202
Definition: rannacherturekbasis.hh:33
std::size_t size_type
Definition: rannacherturekbasis.hh:175
GV GridView
The grid view that the FE basis is defined on.
Definition: rannacherturekbasis.hh:62
const Node * node_
Definition: rannacherturekbasis.hh:283
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition: rannacherturekbasis.hh:196
TP TreePath
Definition: rannacherturekbasis.hh:176
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: rannacherturekbasis.hh:91
Dune::ReservedVector< size_type, 1 > SizePrefix
Type used for prefixes handed to the size() method.
Definition: rannacherturekbasis.hh:79
Node< TP > node(const TP &tp) const
Create tree node with given root tree path.
Definition: rannacherturekbasis.hh:113
size_type size() const
Size of subtree rooted in this node (element-local)
Definition: rannacherturekbasis.hh:260
RannacherTurekPreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition: rannacherturekbasis.hh:82
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: rannacherturekbasis.hh:76
typename PreBasis::template Node< TP > Node
Definition: rannacherturekbasis.hh:235
const FiniteElement finiteElement_
Definition: rannacherturekbasis.hh:215
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition: rannacherturekbasis.hh:140
GridView gridView_
Definition: rannacherturekbasis.hh:159
IndexSet< TP > indexSet() const
Create tree node index set with given root tree path.
Definition: rannacherturekbasis.hh:128
void initializeIndices()
Initialize the global indices.
Definition: rannacherturekbasis.hh:87
Pre-basis for a Rannacher-Turek basis.
Definition: rannacherturekbasis.hh:39
Global basis for given pre-basis.
Definition: defaultglobalbasis.hh:42
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:267