3#include <dune/common/indices.hh>
4#include <dune/functions/functionspacebases/basistags.hh>
5#include <dune/functions/functionspacebases/compositebasis.hh>
6#include <dune/functions/functionspacebases/dynamicpowerbasis.hh>
7#include <dune/functions/functionspacebases/powerbasis.hh>
9#include <amdis/functions/FlatPreBasis.hpp>
28 template <
class PreBasis>
31 using type = PreBasis;
34 static type create(PB
const& preBasis)
36 return {preBasis.gridView()};
40 static PreBasis
const&
create(PreBasis
const& preBasis)
47 template <
class PreBasis>
48 using BlockedPreBasis_t =
typename BlockedPreBasis<PreBasis>::type;
51 template <
class PreBasis>
52 decltype(
auto) blockedPreBasis(PreBasis
const& preBasis)
54 return BlockedPreBasis<PreBasis>::create(preBasis);
69 using type = Dune::Functions::BasisFactory::BlockedInterleaved;
74 struct BlockedIndexMergingStrategy<Dune::Functions::BasisFactory::FlatLexicographic>
76 using type = Dune::Functions::BasisFactory::BlockedLexicographic;
80 template <
class IMS,
class... SPB>
81 struct BlockedPreBasis<Dune::Functions::CompositePreBasis<IMS, SPB...>>
83 using BIMS = Dune::Functions::BasisFactory::BlockedLexicographic;
84 using type = Dune::Functions::CompositePreBasis<BIMS, FlatPreBasis_t<SPB>...>;
86 template <
class PreBasis>
87 static type create(PreBasis
const& preBasis)
89 return create(preBasis, std::index_sequence_for<SPB...>{});
92 template <
class PreBasis, std::size_t... I>
93 static type create(PreBasis
const& preBasis, std::index_sequence<I...>)
99 template <
class IMS,
class SPB, std::
size_t C>
100 struct BlockedPreBasis<Dune::Functions::PowerPreBasis<IMS, SPB, C>>
102 using BIMS =
typename BlockedIndexMergingStrategy<IMS>::type;
103 using type = Dune::Functions::PowerPreBasis<BIMS, FlatPreBasis_t<SPB>, C>;
105 template <
class PreBasis>
106 static type create(PreBasis
const& preBasis)
112 template <
class IMS,
class SPB>
113 struct BlockedPreBasis<Dune::Functions::DynamicPowerPreBasis<IMS, SPB>>
115 using BIMS =
typename BlockedIndexMergingStrategy<IMS>::type;
116 using type = Dune::Functions::DynamicPowerPreBasis<BIMS, FlatPreBasis_t<SPB>>;
118 template <
class PreBasis>
119 static type create(PreBasis
const& preBasis)
Define the blocked index-merging strategy for a given strategy IMS
Definition BlockedPreBasis.hpp:61
Transform a PreBasis into one with an outer-level blocked index-merging strategy and all inner nodes ...
Definition BlockedPreBasis.hpp:30
static PreBasis const & create(PreBasis const &preBasis)
Do not transform the preBasis if already blocked.
Definition BlockedPreBasis.hpp:40
static type create(PB const &preBasis)
Try to construct the pre-basis using a gridView.
Definition FlatPreBasis.hpp:31