2 #ifndef DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH 3 #define DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_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;
88 void bind(
const RowCache& row_cache,
const ColCache& col_cache)
107 template<
typename LC>
108 void read(LC& local_container)
const 110 for (size_type i = 0; i <
N(); ++i)
111 for (size_type j = 0; j <
M(); ++j)
117 const ElementType&
operator()(size_type i, size_type j)
const 124 template<
typename RDI,
typename CDI>
126 (std::is_same<RDI,RowDOFIndex>{} and std::is_same<CDI,ColDOFIndex>{} and not
127 (std::is_same<RDI,RowContainerIndex>{} and std::is_same<CDI,ColContainerIndex>{})),
135 const ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
const 140 const ElementType&
operator()(
const RowContainerIndex& i, size_type j)
const 145 const ElementType&
operator()(size_type i,
const ColContainerIndex& j)
const 164 template<
typename M_,
typename RowCache,
typename ColCache>
180 typedef typename RowCache::LocalFunctionSpace
LFSV;
181 typedef typename ColCache::LocalFunctionSpace
LFSU;
184 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
187 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
189 using BaseT::rowIndexCache;
190 using BaseT::colIndexCache;
196 using BaseT::operator();
208 template<
typename LC>
209 void write(
const LC& local_container)
211 for (size_type i = 0; i <
N(); ++i)
212 for (size_type j = 0; j <
M(); ++j)
216 template<
typename LC>
217 void add(
const LC& local_container)
219 for (size_type i = 0; i <
N(); ++i)
220 for (size_type j = 0; j <
M(); ++j)
233 template<
typename RDI,
typename CDI>
235 (std::is_same<RDI,RowDOFIndex>{} and std::is_same<CDI,ColDOFIndex>{} and not
236 (std::is_same<RDI,RowContainerIndex>{} and std::is_same<CDI,ColContainerIndex>{})),
244 ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
249 ElementType&
operator()(
const RowContainerIndex& i, size_type j)
254 ElementType&
operator()(size_type i,
const ColContainerIndex& j)
259 void add(size_type i, size_type j,
const ElementType& v)
266 template<
typename RDI,
typename CDI>
268 (std::is_same<RDI,RowDOFIndex>{} and std::is_same<CDI,ColDOFIndex>{} and not
269 (std::is_same<RDI,RowContainerIndex>{} and std::is_same<CDI,ColContainerIndex>{}))
271 add(
const RDI& i,
const CDI& j,
const ElementType& v)
276 void add(
const RowContainerIndex& i,
const ColContainerIndex& j,
const ElementType& v)
281 void add(
const RowContainerIndex& i, size_type j,
const ElementType& v)
286 void add(size_type i,
const ColContainerIndex& j,
const ElementType& v)
302 #endif // DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:45
const Container & container() const
Definition: uncachedmatrixview.hh:150
M_ Container
Definition: uncachedmatrixview.hh:173
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:181
Container::size_type size_type
Definition: uncachedmatrixview.hh:38
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:183
ElementType & operator()(const RowContainerIndex &i, size_type j)
Definition: uncachedmatrixview.hh:249
void add(const RowContainerIndex &i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:276
const ElementType & operator()(size_type i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:145
void add(const RowContainerIndex &i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:281
std::enable_if_t<(std::is_same< RDI, RowDOFIndex >{} and std::is_same< CDI, ColDOFIndex >{} and not(std::is_same< RDI, RowContainerIndex >{} and std::is_same< CDI, ColContainerIndex >{})), const ElementType &> operator()(const RDI &i, const CDI &j) const
Definition: uncachedmatrixview.hh:130
Container & container()
Definition: uncachedmatrixview.hh:291
UncachedMatrixView(Container &container)
Definition: uncachedmatrixview.hh:201
const ColCache * _col_cache
Definition: uncachedmatrixview.hh:159
void add(const LC &local_container)
Definition: uncachedmatrixview.hh:217
UncachedMatrixView()
Definition: uncachedmatrixview.hh:198
void read(LC &local_container) const
Definition: uncachedmatrixview.hh:108
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:52
Container::ElementType ElementType
Definition: uncachedmatrixview.hh:174
ElementType & operator()(size_type i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:254
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:51
M_ * _container
Definition: uncachedmatrixview.hh:157
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:177
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
size_type N() const
Definition: uncachedmatrixview.hh:97
const RowCache * _row_cache
Definition: uncachedmatrixview.hh:158
ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:244
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:42
ConstUncachedMatrixView(M_ &container)
Definition: uncachedmatrixview.hh:60
const ElementType & operator()(size_type i, size_type j) const
Definition: uncachedmatrixview.hh:117
void detach()
Definition: uncachedmatrixview.hh:83
Definition: uncachedmatrixview.hh:12
const ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:135
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:184
void bind(const RowCache &row_cache, const ColCache &col_cache)
Definition: uncachedmatrixview.hh:88
Container::size_type size_type
Definition: uncachedmatrixview.hh:175
ConstUncachedMatrixView()
Definition: uncachedmatrixview.hh:54
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:49
const ElementType & operator()(const RowContainerIndex &i, size_type j) const
Definition: uncachedmatrixview.hh:140
std::enable_if_t<(std::is_same< RDI, RowDOFIndex >{} and std::is_same< CDI, ColDOFIndex >{} and not(std::is_same< RDI, RowContainerIndex >{} and std::is_same< CDI, ColContainerIndex >{})) > add(const RDI &i, const CDI &j, const ElementType &v)
Definition: uncachedmatrixview.hh:271
RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:180
void commit()
Definition: uncachedmatrixview.hh:205
void attach(M_ &container)
Definition: uncachedmatrixview.hh:78
void write(const LC &local_container)
Definition: uncachedmatrixview.hh:209
std::enable_if_t<(std::is_same< RDI, RowDOFIndex >{} and std::is_same< CDI, ColDOFIndex >{} and not(std::is_same< RDI, RowContainerIndex >{} and std::is_same< CDI, ColContainerIndex >{})), const ElementType &> operator()(const RDI &i, const CDI &j)
Definition: uncachedmatrixview.hh:239
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:46
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:48
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:186
void unbind()
Definition: uncachedmatrixview.hh:94
void add(size_type i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:286
Container::field_type E
Definition: uncachedmatrixview.hh:25
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:43
const RowIndexCache & rowIndexCache() const
Definition: uncachedmatrixview.hh:66
void add(size_type i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:259
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
const ColIndexCache & colIndexCache() const
Definition: uncachedmatrixview.hh:72
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:187
std::remove_const< M_ >::type Container
Definition: uncachedmatrixview.hh:17
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:178
ElementType & operator()(size_type i, size_type j)
Definition: uncachedmatrixview.hh:226
Definition: uncachedmatrixview.hh:165
E ElementType
Definition: uncachedmatrixview.hh:40
size_type M() const
Definition: uncachedmatrixview.hh:102