7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
10#include <dune/common/reservedvector.hh>
11#include <dune/common/typeutilities.hh>
12#include <dune/common/indices.hh>
14#include <dune/common/typetree/nodeconcepts.hh>
51template<
class IMS,
class SPB, std::
size_t C>
72 inline static constexpr std::integral_constant<std::size_t,C>
children = {};
79 template<
class... SFArgs,
83 Base(std::size_t(C), std::forward<SFArgs>(sfArgs)...)
92 for (std::size_t i=0; i<
children(); ++i)
100 return size(Dune::ReservedVector<size_type, Base::multiIndexBufferSize>{});
104 template<
class SizePrefix>
111 template<
class NodeType,
typename It>
112 requires Dune::TypeTree::Concept::UniformInnerTreeNode<NodeType>
127namespace BasisFactory {
140template<std::
size_t k,
class ChildPreBasisFactory,
class IndexMergingStrategy>
143 return [childPreBasisFactory](
const auto& gridView) {
144 auto childPreBasis = childPreBasisFactory(gridView);
159template<std::
size_t k,
class ChildPreBasisFactory>
160[[deprecated(
"Using the method `power` without an explicit index merging strategy"
161 " will change its meaning after the release of dune-functions 2.11."
162 " Previously, the default merging strategy was `BlockedInterleaved`,"
163 " but this will change to `FlatInterleaved`."
164 " Change the call to `power(..., blockedInterleaved())` to retain the old behavior.")]]
165auto power(ChildPreBasisFactory&& childPreBasisFactory)
167 return [childPreBasisFactory](
const auto& gridView) {
168 auto childPreBasis = childPreBasisFactory(gridView);
Lightweight representation of (hierarchical) size and block structure extracted from a basis to descr...
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:410
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:30
Definition monomialset.hh:19
Definition monomialset.hh:19
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
std::size_t size_type
Type used for indices and size information.
Definition dynamicpowerbasis.hh:62
DynamicPowerPreBasis(std::size_t c, SFArgs &&... sfArgs)
Constructor for given child pre-basis objects.
Definition dynamicpowerbasis.hh:82
auto containerDescriptorImpl(Children children) const
Definition dynamicpowerbasis.hh:374
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:139
SubPreBasis subPreBasis_
Definition dynamicpowerbasis.hh:391
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:264
void setChild(Index i, TT &&t)
Definition nodes.hh:317
A pre-basis for power bases.
Definition powerbasis.hh:54
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:69
typename Base::size_type size_type
Type used for indices and size information.
Definition powerbasis.hh:66
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:60
auto containerDescriptor() const
Return the associated container descriptor.
Definition powerbasis.hh:119
PowerBasisNode< typename SubPreBasis::Node, C > Node
Template mapping root tree path to type of created tree node.
Definition powerbasis.hh:63
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects for static size of the power-basis.
Definition powerbasis.hh:82
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:98
Node makeNode() const
Create tree node.
Definition powerbasis.hh:89
static constexpr std::integral_constant< std::size_t, C > children
Number of children provided as an integral constant.
Definition powerbasis.hh:72
It indices(const NodeType &node, It it) const
Maps from subtree index set [0..size-1] to a globally unique multi index in global basis.
Definition powerbasis.hh:113
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:105