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>
49template<
class IMS,
class SPB, std::
size_t C>
70 inline static constexpr std::integral_constant<std::size_t,C>
children = {};
77 template<
class... SFArgs,
81 Base(std::size_t(C), std::forward<SFArgs>(sfArgs)...)
90 for (std::size_t i=0; i<
children(); ++i)
98 return size(Dune::ReservedVector<size_type, Base::multiIndexBufferSize>{});
102 template<
class SizePrefix>
109 template<
class NodeType,
typename It,
110 std::enable_if_t<NodeType::isPower, int> = 0>
125namespace BasisFactory {
139template<std::
size_t k,
class ChildPreBasisFactory,
class IndexMergingStrategy>
142 return [childPreBasisFactory](
const auto& gridView) {
143 auto childPreBasis = childPreBasisFactory(gridView);
158template<std::
size_t k,
class ChildPreBasisFactory>
159auto power(ChildPreBasisFactory&& childPreBasisFactory)
161 return [childPreBasisFactory](
const auto& gridView) {
162 auto childPreBasis = childPreBasisFactory(gridView);
170namespace [[deprecated(
"Will be removed after Dune 2.10")]] BasisBuilder {
172 using namespace BasisFactory;
auto power(ChildPreBasisFactory &&childPreBasisFactory, std::size_t k, const IndexMergingStrategy &)
Create a pre-basis factory that can build a PowerPreBasis.
Definition dynamicpowerbasis.hh:409
std::enable_if_t< std::is_constructible_v< T, Args... >, int > enableIfConstructible
Helper to constrain forwarding constructors.
Definition type_traits.hh:31
Definition polynomial.hh:17
Base class for index merging strategies to simplify detection.
Definition basistags.hh:48
A pre-basis for dynamic power bases.
Definition dynamicpowerbasis.hh:48
std::size_t size_type
Type used for indices and size information.
Definition dynamicpowerbasis.hh:60
auto containerDescriptorImpl(Children children) const
Definition dynamicpowerbasis.hh:372
size_type sizeImpl(SizePrefix prefix, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:137
SubPreBasis subPreBasis_
Definition dynamicpowerbasis.hh:389
It indicesImpl(const NodeType &node, It multiIndices, Children children, BasisFactory::FlatInterleaved) const
Definition dynamicpowerbasis.hh:262
A pre-basis for power bases.
Definition powerbasis.hh:52
IMS IndexMergingStrategy
Strategy used to merge the global indices of the child factories.
Definition powerbasis.hh:67
typename Base::size_type size_type
Type used for indices and size information.
Definition powerbasis.hh:64
SPB SubPreBasis
The child pre-basis.
Definition powerbasis.hh:58
auto containerDescriptor() const
Return the associated container descriptor.
Definition powerbasis.hh:117
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:111
PowerPreBasis(SFArgs &&... sfArgs)
Constructor for given child pre-basis objects for static size of the power-basis.
Definition powerbasis.hh:80
size_type size() const
Same as size(prefix) with empty prefix.
Definition powerbasis.hh:96
Node makeNode() const
Create tree node.
Definition powerbasis.hh:87
static constexpr std::integral_constant< std::size_t, C > children
Number of children provided as an integral constant.
Definition powerbasis.hh:70
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition powerbasis.hh:103