3#include <dune/functions/functionspacebases/basistags.hh>
4#include <dune/functions/functionspacebases/compositebasis.hh>
5#include <dune/functions/functionspacebases/dynamicpowerbasis.hh>
6#include <dune/functions/functionspacebases/powerbasis.hh>
8#include <amdis/Output.hpp>
24 template <
class PreBasis>
27 using type = PreBasis;
31 static type
create(PB
const& preBasis)
33 return {preBasis.gridView()};
37 static PreBasis
const&
create(PreBasis
const& preBasis)
44 template <
class PreBasis>
45 using FlatPreBasis_t =
typename FlatPreBasis<PreBasis>::type;
48 template <
class PreBasis>
49 decltype(
auto) flatPreBasis(PreBasis
const& preBasis)
66 using type = Dune::Functions::BasisFactory::FlatInterleaved;
71 struct FlatIndexMergingStrategy<Dune::Functions::BasisFactory::BlockedLexicographic>
73 using type = Dune::Functions::BasisFactory::FlatLexicographic;
77 template <
class IMS,
class... SPB>
78 struct FlatPreBasis<Dune::Functions::CompositePreBasis<IMS, SPB...>>
80 using FIMS =
typename FlatIndexMergingStrategy<IMS>::type;
81 using type = Dune::Functions::CompositePreBasis<FIMS, FlatPreBasis_t<SPB>...>;
83 template <
class PreBasis>
84 static type
create(PreBasis
const& preBasis)
86 return create(preBasis, std::index_sequence_for<SPB...>{});
89 template <
class PreBasis, std::size_t... I>
90 static type
create(PreBasis
const& preBasis, std::index_sequence<I...>)
92 test_warning(std::is_same_v<IMS,FIMS>,
"Basis converted into flat index-merging strategy.");
98 template <
class IMS,
class SPB, std::
size_t C>
99 struct FlatPreBasis<Dune::Functions::PowerPreBasis<IMS, SPB, C>>
101 using FIMS =
typename FlatIndexMergingStrategy<IMS>::type;
102 using type = Dune::Functions::PowerPreBasis<FIMS, FlatPreBasis_t<SPB>, C>;
104 template <
class PreBasis>
105 static type
create(PreBasis
const& preBasis)
107 test_warning(std::is_same_v<IMS,FIMS>,
"Basis converted into flat index-merging strategy.");
113 template <
class IMS,
class SPB>
114 struct FlatPreBasis<Dune::Functions::DynamicPowerPreBasis<IMS, SPB>>
116 using FIMS =
typename FlatIndexMergingStrategy<IMS>::type;
117 using type = Dune::Functions::DynamicPowerPreBasis<FIMS, FlatPreBasis_t<SPB>>;
119 template <
class PreBasis>
120 static type
create(PreBasis
const& preBasis)
122 test_warning(std::is_same_v<IMS,FIMS>,
"Basis converted into flat index-merging strategy.");
Define the flat index-merging strategy for a given strategy IMS
Definition FlatPreBasis.hpp:58
Transform a PreBasis into one with flat index-merging strategy.
Definition FlatPreBasis.hpp:26
static PreBasis const & create(PreBasis const &preBasis)
Do not transform the preBasis if already flat.
Definition FlatPreBasis.hpp:37
static type create(PB const &preBasis)
Try to construct the pre-basis using a gridView.
Definition FlatPreBasis.hpp:31