3#include <dune/functions/functionspacebases/basistags.hh>
4#include <dune/functions/functionspacebases/compositebasis.hh>
5#include <dune/functions/functionspacebases/powerbasis.hh>
7#include <amdis/Output.hpp>
23 template <
class PreBasis>
26 using type = PreBasis;
30 static type
create(PB
const& preBasis)
32 return {preBasis.gridView()};
36 static PreBasis
const&
create(PreBasis
const& preBasis)
43 template <
class PreBasis>
44 using FlatPreBasis_t =
typename FlatPreBasis<PreBasis>::type;
47 template <
class PreBasis>
48 decltype(
auto) flatPreBasis(PreBasis
const& preBasis)
65 using type = Dune::Functions::BasisFactory::FlatInterleaved;
70 struct FlatIndexMergingStrategy<Dune::Functions::BasisFactory::BlockedLexicographic>
72 using type = Dune::Functions::BasisFactory::FlatLexicographic;
76 template <
class IMS,
class... SPB>
77 struct FlatPreBasis<Dune::Functions::CompositePreBasis<IMS, SPB...>>
79 using FIMS =
typename FlatIndexMergingStrategy<IMS>::type;
80 using type = Dune::Functions::CompositePreBasis<FIMS, FlatPreBasis_t<SPB>...>;
82 template <
class PreBasis>
83 static type
create(PreBasis
const& preBasis)
85 return create(preBasis, std::index_sequence_for<SPB...>{});
88 template <
class PreBasis, std::size_t... I>
89 static type
create(PreBasis
const& preBasis, std::index_sequence<I...>)
91 test_warning(std::is_same_v<IMS,FIMS>,
"Basis converted into flat index-merging strategy.");
97 template <
class IMS,
class SPB, std::
size_t C>
98 struct FlatPreBasis<Dune::Functions::PowerPreBasis<IMS, SPB, C>>
100 using FIMS =
typename FlatIndexMergingStrategy<IMS>::type;
101 using type = Dune::Functions::PowerPreBasis<FIMS, FlatPreBasis_t<SPB>, C>;
103 template <
class PreBasis>
104 static type
create(PreBasis
const& preBasis)
106 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:57
Transform a PreBasis into one with flat index-merging strategy.
Definition: FlatPreBasis.hpp:25
static PreBasis const & create(PreBasis const &preBasis)
Do not transform the preBasis if already flat.
Definition: FlatPreBasis.hpp:36
static type create(PB const &preBasis)
Try to construct the pre-basis using a gridView.
Definition: FlatPreBasis.hpp:30