Go to the documentation of this file.
3 #ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PQ1NODALBASIS_HH
4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PQ1NODALBASIS_HH
7 #include <dune/common/exceptions.hh>
9 #include <dune/localfunctions/lagrange/pqkfactory.hh>
11 #include <dune/typetree/leafnode.hh>
33 template<
typename GV,
typename TP>
36 template<
typename GV,
class MI,
class TP>
39 template<
typename GV,
class MI>
53 template<
typename GV,
class MI>
56 static const int dim = GV::dimension;
141 if (prefix.size() == 0)
143 if (prefix.size() == 1)
145 DUNE_THROW(RangeError,
"Method size() can only be called for prefixes of length up to one");
166 template<
typename GV,
typename TP>
170 static const int dim = GV::dimension;
174 using FiniteElementCache =
typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, 1>;
180 using Element =
typename GV::template Codim<0>::Entity;
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(),dim)) }};
297 template<
typename GV>
303 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PQ1NODALBASIS_HH
size_type size() const
Size of subtree rooted in this node (element-local)
Definition: pq1nodalbasis.hh:260
Definition: polynomial.hh:7
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition: pq1nodalbasis.hh:199
PQ1NodeIndexSet(const PreBasis &preBasis)
Definition: pq1nodalbasis.hh:237
GridView gridView_
Definition: pq1nodalbasis.hh:161
Node< TP > node(const TP &tp) const
Create tree node with given root tree path.
Definition: pq1nodalbasis.hh:112
const Element & element() const
Return current element, throw if unbound.
Definition: pq1nodalbasis.hh:190
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: pq1nodalbasis.hh:75
const FiniteElement * finiteElement_
Definition: pq1nodalbasis.hh:215
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition: pq1nodalbasis.hh:139
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: pq1nodalbasis.hh:231
typename FiniteElementCache::FiniteElementType FiniteElement
Definition: pq1nodalbasis.hh:181
Definition: pq1nodalbasis.hh:37
Dune::ReservedVector< size_type, 2 > SizePrefix
Type used for prefixes handed to the size() method.
Definition: pq1nodalbasis.hh:78
FiniteElementCache cache_
Definition: pq1nodalbasis.hh:214
const PreBasis * preBasis_
Definition: pq1nodalbasis.hh:281
Definition: pq1nodalbasis.hh:34
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition: pq1nodalbasis.hh:149
typename GV::template Codim< 0 >::Entity Element
Definition: pq1nodalbasis.hh:180
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: pq1nodalbasis.hh:90
typename PreBasis::template Node< TP > Node
Definition: pq1nodalbasis.hh:235
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition: pq1nodalbasis.hh:155
void bind(const Node &node)
Bind the view to a grid element.
Definition: pq1nodalbasis.hh:246
PQ1Node(const TreePath &treePath)
Definition: pq1nodalbasis.hh:183
TP TreePath
Definition: pq1nodalbasis.hh:179
IndexSet< TP > indexSet() const
Create tree node index set with given root tree path.
Definition: pq1nodalbasis.hh:127
It indices(It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition: pq1nodalbasis.hh:267
void unbind()
Unbind the view.
Definition: pq1nodalbasis.hh:253
PQ1PreBasis(const GridView &gv)
Constructor for a given grid view object.
Definition: pq1nodalbasis.hh:81
void bind(const Element &e)
Bind to element.
Definition: pq1nodalbasis.hh:205
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition: pq1nodalbasis.hh:96
std::size_t size_type
Definition: pq1nodalbasis.hh:228
const Element * element_
Definition: pq1nodalbasis.hh:216
std::size_t size_type
Type used for indices and size information.
Definition: pq1nodalbasis.hh:64
size_type size() const
Same as size(prefix) with empty prefix.
Definition: pq1nodalbasis.hh:133
Pre-basis for a first order PQ-lagrange basis.
Definition: pq1nodalbasis.hh:40
const Node * node_
Definition: pq1nodalbasis.hh:283
std::size_t size_type
Definition: pq1nodalbasis.hh:178
GV GridView
The grid view that the FE basis is defined on.
Definition: pq1nodalbasis.hh:61
auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &ims)
Create a pre-basis factory that can build a PowerPreBasis.
Definition: powerbasis.hh:493
Global basis for given pre-basis.
Definition: defaultglobalbasis.hh:42
void initializeIndices()
Initialize the global indices.
Definition: pq1nodalbasis.hh:86