18#include <dune/common/indices.hh>
19#include <dune/functions/functionspacebases/basistags.hh>
20#include <dune/functions/functionspacebases/compositebasis.hh>
21#include <dune/functions/functionspacebases/powerbasis.hh>
38template <
class PreBasis>
46 return type(preBasis.gridView());
50 static const PreBasis&
create(
const PreBasis& preBasis) {
return preBasis; }
54template <
class PreBasis>
68 using type = Dune::Functions::BasisFactory::FlatInterleaved;
75 using type = Dune::Functions::BasisFactory::FlatLexicographic;
79template <
class IMS,
class... SPB>
83 using type = Dune::Functions::CompositePreBasis<FIMS, FlatPreBasis_t<SPB>...>;
85 template <
class PreBasis>
87 return create(preBasis, std::index_sequence_for<SPB...>{});
90 template <
class PreBasis, std::size_t... I>
91 static type create(
const PreBasis& preBasis, std::index_sequence<I...>) {
97template <
class IMS,
class SPB, std::
size_t C>
101 using type = Dune::Functions::PowerPreBasis<FIMS, FlatPreBasis_t<SPB>, C>;
103 template <
class PreBasis>
111template <
class PreBasis>
118 template <
typename Tree>
123 template <
typename Tree>
124 requires(Tree::isLeaf)
125 struct PreBasisInfo<Tree>
127 static constexpr std::size_t size = 0;
128 using NodalSolutionType = double;
131 template <
typename Tree>
132 requires(Tree::isPower)
133 struct PreBasisInfo<Tree>
135 static constexpr std::size_t size = Tree::degree();
136 using NodalSolutionType = Eigen::Vector<double, size>;
139 template <
typename Tree>
140 requires(Tree::isComposite)
141 struct PreBasisInfo<Tree>
143 using ChildTreeType = Tree::template Child<0>::Type;
144 static_assert(not ChildTreeType::isComposite,
"Cannot handle a composite basis within a composite basis.");
146 static constexpr std::size_t size = PreBasisInfo<ChildTreeType>::size;
147 using NodalSolutionType = PreBasisInfo<ChildTreeType>::NodalSolutionType;
decltype(auto) flatPreBasis(const PreBasis &preBasis)
Generator function for a flatted PreBasis.
Definition: flatprebasis.hh:112
Definition: assemblermanipulatorbuildingblocks.hh:22
typename FlatPreBasis< PreBasis >::type FlatPreBasis_t
Type alias for flatted PreBasis.
Definition: flatprebasis.hh:55
Definition: utils/dirichletvalues.hh:36
Transform a PreBasis into one with flat index-merging strategyThis utility takes a pre-basis and conv...
Definition: flatprebasis.hh:40
PreBasis type
Definition: flatprebasis.hh:41
static type create(PB const &preBasis)
Try to construct the pre-basis using a gridView.
Definition: flatprebasis.hh:45
static const PreBasis & create(const PreBasis &preBasis)
Do not transform the preBasis if already flat.
Definition: flatprebasis.hh:50
Define the flat index-merging strategy for a given strategy IMS
Definition: flatprebasis.hh:60
IMS type
Definition: flatprebasis.hh:61
Dune::Functions::BasisFactory::FlatInterleaved type
Definition: flatprebasis.hh:68
Dune::Functions::BasisFactory::FlatLexicographic type
Definition: flatprebasis.hh:75
typename FlatIndexMergingStrategy< IMS >::type FIMS
Definition: flatprebasis.hh:82
Dune::Functions::CompositePreBasis< FIMS, FlatPreBasis_t< SPB >... > type
Definition: flatprebasis.hh:83
static type create(const PreBasis &preBasis)
Definition: flatprebasis.hh:86
static type create(const PreBasis &preBasis, std::index_sequence< I... >)
Definition: flatprebasis.hh:91
static type create(const PreBasis &preBasis)
Definition: flatprebasis.hh:104
Dune::Functions::PowerPreBasis< FIMS, FlatPreBasis_t< SPB >, C > type
Definition: flatprebasis.hh:101
typename FlatIndexMergingStrategy< IMS >::type FIMS
Definition: flatprebasis.hh:100