2 #ifndef DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH
3 #define DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH
5 #include <dune/common/typetraits.hh>
6 #include <dune/common/nullptr.hh>
12 template<
typename M_,
typename RowCache,
typename ColCache>
22 typename RowCache::LocalFunctionSpace::Traits::GridFunctionSpace,
23 typename Container::TestGridFunctionSpace
25 "The RowCache passed to LocalView must belong to the underlying GFSV"
30 typename ColCache::LocalFunctionSpace::Traits::GridFunctionSpace,
31 typename Container::TrialGridFunctionSpace
33 "The ColCache passed to LocalView must belong to the underlying GFSU"
38 typedef typename Container::field_type
E;
46 typedef typename RowCache::LocalFunctionSpace
LFSV;
47 typedef typename ColCache::LocalFunctionSpace
LFSU;
50 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
53 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
89 void bind(
const RowCache& row_cache,
const ColCache& col_cache)
108 template<
typename LC>
109 void read(LC& local_container)
const
111 for (size_type i = 0; i <
N(); ++i)
112 for (size_type j = 0; j <
M(); ++j)
118 const ElementType&
operator()(size_type i, size_type j)
const
123 const ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
const
128 const ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
const
133 const ElementType&
operator()(
const RowContainerIndex& i, size_type j)
const
138 const ElementType&
operator()(size_type i,
const ColContainerIndex& j)
const
157 template<
typename M_,
typename RowCache,
typename ColCache>
173 typedef typename RowCache::LocalFunctionSpace
LFSV;
174 typedef typename ColCache::LocalFunctionSpace
LFSU;
177 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
180 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
189 using BaseT::operator();
201 template<
typename LC>
202 void write(
const LC& local_container)
204 for (size_type i = 0; i <
N(); ++i)
205 for (size_type j = 0; j <
M(); ++j)
209 template<
typename LC>
210 void add(
const LC& local_container)
212 for (size_type i = 0; i <
N(); ++i)
213 for (size_type j = 0; j <
M(); ++j)
224 ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
229 ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
234 ElementType&
operator()(
const RowContainerIndex& i, size_type j)
239 ElementType&
operator()(size_type i,
const ColContainerIndex& j)
244 void add(size_type i, size_type j,
const ElementType& v)
249 void add(
const RowDOFIndex& i,
const ColDOFIndex& j,
const ElementType& v)
254 void add(
const RowContainerIndex& i,
const ColContainerIndex& j,
const ElementType& v)
259 void add(
const RowContainerIndex& i, size_type j,
const ElementType& v)
264 void add(size_type i,
const ColContainerIndex& j,
const ElementType& v)
280 #endif // DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:174
remove_const< M_ >::type Container
Definition: uncachedmatrixview.hh:18
const RowCache * _row_cache
Definition: uncachedmatrixview.hh:151
void read(LC &local_container) const
Definition: uncachedmatrixview.hh:109
Container::field_type E
Definition: uncachedmatrixview.hh:26
E ElementType
Definition: uncachedmatrixview.hh:41
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:43
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:53
void add(const RowContainerIndex &i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:254
ElementType & operator()(size_type i, size_type j)
Definition: uncachedmatrixview.hh:219
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:177
void add(size_type i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:244
const RowIndexCache & rowIndexCache() const
Definition: uncachedmatrixview.hh:67
void add(const RowContainerIndex &i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:259
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:170
Container::ElementType ElementType
Definition: uncachedmatrixview.hh:167
Definition: uncachedmatrixview.hh:158
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:176
void add(size_type i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:264
size_type N() const
Definition: uncachedmatrixview.hh:98
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:171
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:49
Container::size_type size_type
Definition: uncachedmatrixview.hh:168
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
void write(const LC &local_container)
Definition: uncachedmatrixview.hh:202
void add(const RowDOFIndex &i, const ColDOFIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:249
ElementType & operator()(const RowContainerIndex &i, size_type j)
Definition: uncachedmatrixview.hh:234
const Container & container() const
Definition: uncachedmatrixview.hh:143
void detach()
Definition: uncachedmatrixview.hh:84
Container & container()
Definition: uncachedmatrixview.hh:269
void add(const LC &local_container)
Definition: uncachedmatrixview.hh:210
UncachedMatrixView(Container &container)
Definition: uncachedmatrixview.hh:194
ConstUncachedMatrixView()
Definition: uncachedmatrixview.hh:55
void bind(const RowCache &row_cache, const ColCache &col_cache)
Definition: uncachedmatrixview.hh:89
void commit()
Definition: uncachedmatrixview.hh:198
Definition: uncachedmatrixview.hh:13
const ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j) const
Definition: uncachedmatrixview.hh:123
RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:46
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:180
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:47
ConstUncachedMatrixView(M_ &container)
Definition: uncachedmatrixview.hh:61
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:44
const ElementType & operator()(const RowContainerIndex &i, size_type j) const
Definition: uncachedmatrixview.hh:133
const ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:128
Definition: adaptivity.hh:27
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:50
ElementType & operator()(size_type i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:239
void attach(M_ &container)
Definition: uncachedmatrixview.hh:79
const ElementType & operator()(size_type i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:138
const ColIndexCache & colIndexCache() const
Definition: uncachedmatrixview.hh:73
M_ * _container
Definition: uncachedmatrixview.hh:150
UncachedMatrixView()
Definition: uncachedmatrixview.hh:191
ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j)
Definition: uncachedmatrixview.hh:224
const ElementType & operator()(size_type i, size_type j) const
Definition: uncachedmatrixview.hh:118
const ColCache * _col_cache
Definition: uncachedmatrixview.hh:152
M_ Container
Definition: uncachedmatrixview.hh:166
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:179
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:52
RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:173
Container::size_type size_type
Definition: uncachedmatrixview.hh:39
size_type M() const
Definition: uncachedmatrixview.hh:103
void unbind()
Definition: uncachedmatrixview.hh:95
ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:229