2 #ifndef DUNE_PDELAB_BACKEND_COMMON_ALIASEDMATRIXVIEW_HH 3 #define DUNE_PDELAB_BACKEND_COMMON_ALIASEDMATRIXVIEW_HH 11 template<
typename M_,
typename RowCache,
typename ColCache>
17 typedef typename std::remove_const<M_>::type
Container;
21 typename RowCache::LocalFunctionSpace::Traits::GridFunctionSpace,
22 typename Container::TestGridFunctionSpace
24 "The RowCache passed to LocalView must belong to the underlying GFSV" 29 typename ColCache::LocalFunctionSpace::Traits::GridFunctionSpace,
30 typename Container::TrialGridFunctionSpace
32 "The ColCache passed to LocalView must belong to the underlying GFSU" 37 typedef typename Container::field_type
E;
45 typedef typename RowCache::LocalFunctionSpace
LFSV;
46 typedef typename ColCache::LocalFunctionSpace
LFSU;
49 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
52 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
93 void bind(
const RowCache& row_cache,
const ColCache& col_cache)
117 template<
typename LC>
118 void read(LC& local_container)
const 120 for (size_type i = 0; i <
N(); ++i)
121 for (size_type j = 0; j <
M(); ++j)
125 const ElementType&
operator()(size_type i, size_type j)
const 130 const ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
const 135 const ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
const 140 template<
typename LFSV,
typename LFSU>
141 const ElementType&
operator()(
const LFSV& lfsv, size_type i,
const LFSU& lfsu, size_type j)
const 156 typename std::conditional<
165 template<
typename M_,
typename RowCache,
typename ColCache>
181 typedef typename RowCache::LocalFunctionSpace
LFSV;
182 typedef typename ColCache::LocalFunctionSpace
LFSU;
185 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
188 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
190 using BaseT::rowIndexCache;
191 using BaseT::colIndexCache;
200 using BaseT::operator();
214 template<
typename LC>
215 void write(
const LC& local_container)
217 for (size_type i = 0; i <
N(); ++i)
218 for (size_type j = 0; j <
M(); ++j)
222 template<
typename LC>
223 void add(
const LC& local_container)
225 for (size_type i = 0; i <
N(); ++i)
226 for (size_type j = 0; j <
M(); ++j)
237 ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
242 ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
247 ElementType&
operator()(
const RowContainerIndex& i, size_type j)
252 ElementType&
operator()(size_type i,
const ColContainerIndex& j)
257 template<
typename LFSV,
typename LFSU>
263 template<
typename LFSV,
typename LFSU>
298 #endif // DUNE_PDELAB_BACKEND_COMMON_ALIASEDMATRIXVIEW_HH ConstAliasedMatrixView()
Definition: aliasedmatrixview.hh:57
M_ Container
Definition: aliasedmatrixview.hh:174
weight_type weight()
Definition: aliasedmatrixview.hh:285
ElementType weight_type
Definition: aliasedmatrixview.hh:55
std::conditional< std::is_const< M_ >::value, const ElementType *, ElementType *>::type _data
Definition: aliasedmatrixview.hh:160
AliasedMatrixView()
Definition: aliasedmatrixview.hh:202
size_type N() const
Definition: aliasedmatrixview.hh:107
AliasedMatrixView(Container &container)
Definition: aliasedmatrixview.hh:206
const RowIndexCache & rowIndexCache() const
Definition: aliasedmatrixview.hh:71
void attach(M_ &container)
Definition: aliasedmatrixview.hh:83
const ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j) const
Definition: aliasedmatrixview.hh:130
LFSV::Traits::DOFIndex RowDOFIndex
Definition: aliasedmatrixview.hh:48
const ElementType & operator()(size_type i, size_type j) const
Definition: aliasedmatrixview.hh:125
ElementType & operator()(const RowContainerIndex &i, size_type j)
Definition: aliasedmatrixview.hh:247
void read(LC &local_container) const
Definition: aliasedmatrixview.hh:118
LFSU::Traits::DOFIndex ColDOFIndex
Definition: aliasedmatrixview.hh:187
ColCache::LocalFunctionSpace LFSU
Definition: aliasedmatrixview.hh:182
void unbind()
Definition: aliasedmatrixview.hh:100
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: aliasedmatrixview.hh:52
Definition: aliasedmatrixview.hh:12
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: aliasedmatrixview.hh:185
void bind(const RowCache &row_cache, const ColCache &col_cache)
Definition: aliasedmatrixview.hh:93
LFSV::Traits::DOFIndex RowDOFIndex
Definition: aliasedmatrixview.hh:184
void add(const LC &local_container)
Definition: aliasedmatrixview.hh:223
ElementType & operator()(size_type i, size_type j)
Definition: aliasedmatrixview.hh:232
RowCache RowIndexCache
Definition: aliasedmatrixview.hh:42
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
ColCache ColIndexCache
Definition: aliasedmatrixview.hh:43
const ColIndexCache & colIndexCache() const
Definition: aliasedmatrixview.hh:77
size_type M() const
Definition: aliasedmatrixview.hh:112
Container::ElementType ElementType
Definition: aliasedmatrixview.hh:175
const ColCache * _col_cache
Definition: aliasedmatrixview.hh:155
const Container & container() const
Definition: aliasedmatrixview.hh:146
void commit()
Definition: aliasedmatrixview.hh:211
ElementType value_type
Definition: aliasedmatrixview.hh:54
const RowCache * _row_cache
Definition: aliasedmatrixview.hh:154
ConstAliasedMatrixView(M_ &container)
Definition: aliasedmatrixview.hh:64
void detach()
Definition: aliasedmatrixview.hh:88
RowCache RowIndexCache
Definition: aliasedmatrixview.hh:178
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
RowCache::LocalFunctionSpace LFSV
Definition: aliasedmatrixview.hh:45
ElementType & operator()(size_type i, const ColContainerIndex &j)
Definition: aliasedmatrixview.hh:252
ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j)
Definition: aliasedmatrixview.hh:242
Container & container()
Definition: aliasedmatrixview.hh:275
RowCache::LocalFunctionSpace LFSV
Definition: aliasedmatrixview.hh:181
std::remove_const< M_ >::type Container
Definition: aliasedmatrixview.hh:17
ColCache ColIndexCache
Definition: aliasedmatrixview.hh:179
void setWeight(weight_type weight)
Definition: aliasedmatrixview.hh:280
void write(const LC &local_container)
Definition: aliasedmatrixview.hh:215
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: aliasedmatrixview.hh:188
Container::field_type E
Definition: aliasedmatrixview.hh:25
ElementType * data()
Definition: aliasedmatrixview.hh:269
LFSU::Traits::DOFIndex ColDOFIndex
Definition: aliasedmatrixview.hh:51
Container::size_type size_type
Definition: aliasedmatrixview.hh:176
Container::size_type size_type
Definition: aliasedmatrixview.hh:38
const ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j) const
Definition: aliasedmatrixview.hh:135
void rawAccumulate(const LFSV &lfsv, size_type i, const LFSU &lfsu, size_type j, value_type value)
Definition: aliasedmatrixview.hh:264
const ElementType & operator()(const LFSV &lfsv, size_type i, const LFSU &lfsu, size_type j) const
Definition: aliasedmatrixview.hh:141
void accumulate(const LFSV &lfsv, size_type i, const LFSU &lfsu, size_type j, value_type value)
Definition: aliasedmatrixview.hh:258
ElementType weight_type
Definition: aliasedmatrixview.hh:55
M_ * _container
Definition: aliasedmatrixview.hh:153
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: aliasedmatrixview.hh:49
Definition: aliasedmatrixview.hh:166
E ElementType
Definition: aliasedmatrixview.hh:40
ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j)
Definition: aliasedmatrixview.hh:237
ColCache::LocalFunctionSpace LFSU
Definition: aliasedmatrixview.hh:46