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/static_assert.hh>
7 #include <dune/common/nullptr.hh>
13 template<
typename M_,
typename RowCache,
typename ColCache>
23 typename RowCache::LocalFunctionSpace::Traits::GridFunctionSpace,
24 typename Container::TestGridFunctionSpace
26 "The RowCache passed to LocalView must belong to the underlying GFSV"
31 typename ColCache::LocalFunctionSpace::Traits::GridFunctionSpace,
32 typename Container::TrialGridFunctionSpace
34 "The ColCache passed to LocalView must belong to the underlying GFSU"
39 typedef typename Container::field_type
E;
47 typedef typename RowCache::LocalFunctionSpace
LFSV;
48 typedef typename ColCache::LocalFunctionSpace
LFSU;
51 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
54 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
90 void bind(
const RowCache& row_cache,
const ColCache& col_cache)
109 template<
typename LC>
110 void read(LC& local_container)
const
112 for (size_type i = 0; i <
N(); ++i)
113 for (size_type j = 0; j <
M(); ++j)
119 const ElementType&
operator()(size_type i, size_type j)
const
124 const ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
const
129 const ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
const
134 const ElementType&
operator()(
const RowContainerIndex& i, size_type j)
const
139 const ElementType&
operator()(size_type i,
const ColContainerIndex& j)
const
158 template<
typename M_,
typename RowCache,
typename ColCache>
174 typedef typename RowCache::LocalFunctionSpace
LFSV;
175 typedef typename ColCache::LocalFunctionSpace
LFSU;
178 typedef typename LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
RowContainerIndex;
181 typedef typename LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex
ColContainerIndex;
190 using BaseT::operator();
202 template<
typename LC>
203 void write(
const LC& local_container)
205 for (size_type i = 0; i <
N(); ++i)
206 for (size_type j = 0; j <
M(); ++j)
210 template<
typename LC>
211 void add(
const LC& local_container)
213 for (size_type i = 0; i <
N(); ++i)
214 for (size_type j = 0; j <
M(); ++j)
225 ElementType&
operator()(
const RowDOFIndex& i,
const ColDOFIndex& j)
230 ElementType&
operator()(
const RowContainerIndex& i,
const ColContainerIndex& j)
235 ElementType&
operator()(
const RowContainerIndex& i, size_type j)
240 ElementType&
operator()(size_type i,
const ColContainerIndex& j)
245 void add(size_type i, size_type j,
const ElementType& v)
250 void add(
const RowDOFIndex& i,
const ColDOFIndex& j,
const ElementType& v)
255 void add(
const RowContainerIndex& i,
const ColContainerIndex& j,
const ElementType& v)
260 void add(
const RowContainerIndex& i, size_type j,
const ElementType& v)
265 void add(size_type i,
const ColContainerIndex& j,
const ElementType& v)
281 #endif // DUNE_PDELAB_BACKEND_COMMON_UNCACHEDMATRIXVIEW_HH
const RowIndexCache & rowIndexCache() const
Definition: uncachedmatrixview.hh:68
ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j)
Definition: uncachedmatrixview.hh:225
const ElementType & operator()(const RowContainerIndex &i, size_type j) const
Definition: uncachedmatrixview.hh:134
Container & container()
Definition: uncachedmatrixview.hh:270
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:54
void attach(M_ &container)
Definition: uncachedmatrixview.hh:80
void commit()
Definition: uncachedmatrixview.hh:199
E ElementType
Definition: uncachedmatrixview.hh:42
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:53
LFSU::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex ColContainerIndex
Definition: uncachedmatrixview.hh:181
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:44
void bind(const RowCache &row_cache, const ColCache &col_cache)
Definition: uncachedmatrixview.hh:90
void add(const RowContainerIndex &i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:255
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:50
Container::size_type size_type
Definition: uncachedmatrixview.hh:169
ElementType & operator()(const RowContainerIndex &i, size_type j)
Definition: uncachedmatrixview.hh:235
ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:230
void add(const RowContainerIndex &i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:260
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:175
Definition: adaptivity.hh:26
const ElementType & operator()(const RowDOFIndex &i, const ColDOFIndex &j) const
Definition: uncachedmatrixview.hh:124
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:172
Container::ElementType ElementType
Definition: uncachedmatrixview.hh:168
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:51
M_ Container
Definition: uncachedmatrixview.hh:167
const Container & container() const
Definition: uncachedmatrixview.hh:144
const ElementType & operator()(size_type i, size_type j) const
Definition: uncachedmatrixview.hh:119
const ColIndexCache & colIndexCache() const
Definition: uncachedmatrixview.hh:74
void unbind()
Definition: uncachedmatrixview.hh:96
M_ * _container
Definition: uncachedmatrixview.hh:151
const ColCache * _col_cache
Definition: uncachedmatrixview.hh:153
void write(const LC &local_container)
Definition: uncachedmatrixview.hh:203
Definition: uncachedmatrixview.hh:14
remove_const< M_ >::type Container
Definition: uncachedmatrixview.hh:19
void add(size_type i, size_type j, const ElementType &v)
Definition: uncachedmatrixview.hh:245
Container::size_type size_type
Definition: uncachedmatrixview.hh:40
void add(const LC &local_container)
Definition: uncachedmatrixview.hh:211
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:47
RowCache RowIndexCache
Definition: uncachedmatrixview.hh:171
LFSU::Traits::DOFIndex ColDOFIndex
Definition: uncachedmatrixview.hh:180
ConstUncachedMatrixView()
Definition: uncachedmatrixview.hh:56
dune_static_assert((is_same< typename RowCache::LocalFunctionSpace::Traits::GridFunctionSpace, typename Container::TestGridFunctionSpace >::value),"The RowCache passed to LocalView must belong to the underlying GFSV")
void read(LC &local_container) const
Definition: uncachedmatrixview.hh:110
Definition: uncachedmatrixview.hh:159
ColCache::LocalFunctionSpace LFSU
Definition: uncachedmatrixview.hh:48
const RowCache * _row_cache
Definition: uncachedmatrixview.hh:152
ConstUncachedMatrixView(M_ &container)
Definition: uncachedmatrixview.hh:62
size_type M() const
Definition: uncachedmatrixview.hh:104
void add(const RowDOFIndex &i, const ColDOFIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:250
const ElementType & operator()(size_type i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:139
ElementType & operator()(size_type i, const ColContainerIndex &j)
Definition: uncachedmatrixview.hh:240
LFSV::Traits::DOFIndex RowDOFIndex
Definition: uncachedmatrixview.hh:177
RowCache::LocalFunctionSpace LFSV
Definition: uncachedmatrixview.hh:174
LFSV::Traits::GridFunctionSpace::Ordering::Traits::ContainerIndex RowContainerIndex
Definition: uncachedmatrixview.hh:178
size_type N() const
Definition: uncachedmatrixview.hh:99
void detach()
Definition: uncachedmatrixview.hh:85
ColCache ColIndexCache
Definition: uncachedmatrixview.hh:45
UncachedMatrixView(Container &container)
Definition: uncachedmatrixview.hh:195
Container::field_type E
Definition: uncachedmatrixview.hh:39
UncachedMatrixView()
Definition: uncachedmatrixview.hh:192
ElementType & operator()(size_type i, size_type j)
Definition: uncachedmatrixview.hh:220
const ElementType & operator()(const RowContainerIndex &i, const ColContainerIndex &j) const
Definition: uncachedmatrixview.hh:129
void add(size_type i, const ColContainerIndex &j, const ElementType &v)
Definition: uncachedmatrixview.hh:265