7#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
8#include <amdis/functions/BasisMapping.hpp>
9#include <amdis/functions/BlockedBasis.hpp>
10#include <amdis/functions/FlatBasis.hpp>
15 template <
class RowBasis,
class ColBasis>
19 static_assert(std::is_same_v<FlatBasis_t<RowBasis>,RowBasis>);
20 static_assert(std::is_same_v<FlatBasis_t<ColBasis>,ColBasis>);
23 using RowBlockedBasis = BlockedBasis_t<RowBasis>;
26 using ColBlockedBasis = BlockedBasis_t<ColBasis>;
30 std::vector<typename RowBlockedBasis::MultiIndex>>;
32 std::vector<typename ColBlockedBasis::MultiIndex>>;
36 std::shared_ptr<ColBasis>
const& colBasis)
37 : rowMapping_(rowBasis, std::make_shared<RowBlockedBasis>(blockedBasis(*rowBasis)))
38 , colMapping_(colBasis, std::make_shared<ColBlockedBasis>(blockedBasis(*colBasis)))
46 template <
class Index>
47 typename RowBlockedBasis::MultiIndex
const&
row(Index
const& index)
const
49 return rowMapping_(index);
53 template <
class Index>
54 typename ColBlockedBasis::MultiIndex
const&
col(Index
const& index)
const
56 return colMapping_(index);
72 RowMapping rowMapping_;
73 ColMapping colMapping_;
80 template <
class Basis>
84 static_assert(std::is_same_v<FlatBasis_t<Basis>,Basis>);
87 using BBasis = BlockedBasis_t<Basis>;
89 std::vector<typename BBasis::MultiIndex>>;
93 : mapping_(basis, std::make_shared<BBasis>(blockedBasis(*basis)))
101 template <
class Index>
102 typename BBasis::MultiIndex
const&
row(Index
const& index)
const
104 return mapping_(index);
108 template <
class Index>
109 typename BBasis::MultiIndex
const&
col(Index
const& index)
const
111 return mapping_(index);
117 return mapping_.sizeInfo();
123 return mapping_.sizeInfo();
TargetBasis const & sizeInfo() const
Return the target basis as a size info object.
Definition BasisMapping.hpp:91
BBasis::MultiIndex const & col(Index const &index) const
Map the index in the flat basis into a multi-index in the blocked basis.
Definition BlockedBasisMapping.hpp:109
decltype(auto) rowSizeInfo() const
Get the size info (typically the basis itself) for the mapping.
Definition BlockedBasisMapping.hpp:115
BBasis::MultiIndex const & row(Index const &index) const
Map the index in the flat basis into a multi-index in the blocked basis.
Definition BlockedBasisMapping.hpp:102
decltype(auto) colSizeInfo() const
Get the size info (typically the basis itself) for the mapping.
Definition BlockedBasisMapping.hpp:121
Mapping of a pair of flat bases to the corresponding outer-level blocked bases.
Definition BlockedBasisMapping.hpp:17
decltype(auto) rowSizeInfo() const
Get the size info (typically the basis itself) for the row-mapping.
Definition BlockedBasisMapping.hpp:60
ColBlockedBasis::MultiIndex const & col(Index const &index) const
Map the index in the flat col-basis into a multi-index in the blocked col-basis.
Definition BlockedBasisMapping.hpp:54
decltype(auto) colSizeInfo() const
Get the size info (typically the basis itself) for the col-mapping.
Definition BlockedBasisMapping.hpp:66
RowBlockedBasis::MultiIndex const & row(Index const &index) const
Map the index in the flat row-basis into a multi-index in the blocked row-basis.
Definition BlockedBasisMapping.hpp:47