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;
185 finiteElement_(nullptr),
201 return *finiteElement_;
208 finiteElement_ = &(cache_.get(element_->type()));
209 this->setSize(finiteElement_->size());
221 template<
typename GV,
class MI,
class TP>
224 enum {dim = GV::dimension};
238 nodeFactory_(&nodeFactory)
262 return (
size_type)(node_->finiteElement().size());
268 Dune::LocalKey localKey = node_->finiteElement().localCoefficients().localKey(i);
269 const auto& gridIndexSet = nodeFactory_->gridView().indexSet();
270 const auto& element = node_->element();
272 return {{ (
size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
292 template<
typename GV>
298 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PQ1NODALBASIS_HH Definition: pq1nodalbasis.hh:37
typename GV::template Codim< 0 >::Entity Element
Definition: pq1nodalbasis.hh:180
size_type size() const
Same as size(prefix) with empty prefix.
Definition: pq1nodalbasis.hh:133
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: pq1nodalbasis.hh:75
std::size_t size_type
Definition: nodes.hh:127
IndexSet< TP > indexSet() const
Create tree node index set with given root tree path.
Definition: pq1nodalbasis.hh:127
std::size_t size_type
Definition: pq1nodalbasis.hh:228
Node< TP > node(const TP &tp) const
Create tree node with given root tree path.
Definition: pq1nodalbasis.hh:112
GridView gridView_
Definition: pq1nodalbasis.hh:161
const Element * element_
Definition: pq1nodalbasis.hh:216
typename FiniteElementCache::FiniteElementType FiniteElement
Definition: pq1nodalbasis.hh:181
Dune::ReservedVector< size_type, 2 > SizePrefix
Type used for prefixes handed to the size() method.
Definition: pq1nodalbasis.hh:78
Global basis for given node factory.
Definition: defaultglobalbasis.hh:42
std::size_t size_type
Type used for indices and size information.
Definition: pq1nodalbasis.hh:64
void initializeIndices()
Initialize the global indices.
Definition: pq1nodalbasis.hh:86
MI MultiIndex
Type used for global numbering of the basis vectors.
Definition: pq1nodalbasis.hh:231
void bind(const Element &e)
Bind to element.
Definition: pq1nodalbasis.hh:205
Definition: polynomial.hh:7
PQ1Node(const TreePath &treePath)
Definition: pq1nodalbasis.hh:183
FiniteElementCache cache_
Definition: pq1nodalbasis.hh:214
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition: pq1nodalbasis.hh:149
size_type size() const
Size of subtree rooted in this node (element-local)
Definition: pq1nodalbasis.hh:260
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition: pq1nodalbasis.hh:96
Definition: pq1nodalbasis.hh:34
GV GridView
The grid view that the FE basis is defined on.
Definition: pq1nodalbasis.hh:61
typename NodeFactory::template Node< TP > Node
Definition: pq1nodalbasis.hh:235
const Element & element() const
Return current element, throw if unbound.
Definition: pq1nodalbasis.hh:190
const NodeFactory * nodeFactory_
Definition: pq1nodalbasis.hh:276
size_type size(const SizePrefix prefix) const
Return number of possible values for next position in multi index.
Definition: pq1nodalbasis.hh:139
MultiIndex index(size_type i) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis...
Definition: pq1nodalbasis.hh:266
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition: pq1nodalbasis.hh:90
TP TreePath
Definition: nodes.hh:126
PQ1NodeFactory(const GridView &gv)
Constructor for a given grid view object.
Definition: pq1nodalbasis.hh:81
void unbind()
Unbind the view.
Definition: pq1nodalbasis.hh:253
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
const Node * node_
Definition: pq1nodalbasis.hh:278
Imp::PowerNodeFactoryBuilder< k, IndexMergingStrategy, SubFactoryTag > power(SubFactoryTag &&tag, const IndexMergingStrategy &ims)
Create a factory builder that can build a PowerNodeFactory.
Definition: powerbasis.hh:424
const FiniteElement * finiteElement_
Definition: pq1nodalbasis.hh:215
const FiniteElement & finiteElement() const
Return the LocalFiniteElement for the element we are bound to.
Definition: pq1nodalbasis.hh:199
Factory for a first order PQ-lagrange basis.
Definition: pq1nodalbasis.hh:40
PQ1NodeIndexSet(const NodeFactory &nodeFactory)
Definition: pq1nodalbasis.hh:237