3#include <dune/istl/bvector.hh>
4#include <dune/functions/backends/istlvectorbackend.hh>
6#include <amdis/Output.hpp>
7#include <amdis/common/FakeContainer.hpp>
8#include <amdis/linearalgebra/VectorBase.hpp>
9#include <amdis/typetree/MultiIndex.hpp>
13 template <
class T,
class =
void>
16 using type = Dune::FieldVector<T,1>;
33 using BaseVector = Dune::BlockVector<typename BlockVectorType<T>::type>;
50 Dune::disableCopyMove<ISTLBlockVector,Comm> = 0>
70 return vector_.size();
75 template <
class Basis>
76 void init(Basis
const& basis,
bool clear)
78 Dune::Functions::istlVectorBackend(vector_).resize(basis);
84 template <
class MultiIndex>
87 return Dune::Functions::istlVectorBackend(vector_)[idx];
91 template <
class MultiIndex>
94 return Dune::Functions::istlVectorBackend(vector_)[idx];
103 vector_.axpy(alpha, x.vector_);
111 vector_ += x.vector_;
137 struct ForEach<ISTLBlockVector<T>> : ForEach<VectorBase<ISTLBlockVector<T>>> {};
140 struct Transform<ISTLBlockVector<T>> : Transform<VectorBase<ISTLBlockVector<T>>> {};
143 struct InnerProduct<ISTLBlockVector<T>> : InnerProduct<VectorBase<ISTLBlockVector<T>>> {};
Definition VectorBackend.hpp:28
value_type & at(MultiIndex const &idx)
Access the entry idx of the vector_ with write-access.
Definition VectorBackend.hpp:85
ISTLBlockVector(Comm const &)
Constructor. Constructs new BaseVector.
Definition VectorBackend.hpp:51
value_type const & at(MultiIndex const &idx) const
Access the entry idx of the vector_ with read-access.
Definition VectorBackend.hpp:92
Self & axpy(const value_type &alpha, const Self &x)
Implements *this = *this + alpha * x.
Definition VectorBackend.hpp:101
void scale(const value_type &alpha)
scale all entries by the factor alpha
Definition VectorBackend.hpp:122
typename BaseVector::size_type size_type
The index/size - type.
Definition VectorBackend.hpp:45
typename block_type::field_type field_type
The underlying field type.
Definition VectorBackend.hpp:42
Self & aypx(const value_type &alpha, const Self &x)
Implements *this = alpha * (*this) + x.
Definition VectorBackend.hpp:108
Dune::BlockVector< typename BlockVectorType< T >::type > BaseVector
The vector type of the underlying base vector.
Definition VectorBackend.hpp:33
void init(Basis const &basis, bool clear)
Resize the vector_ to the size given by the sizeProvider.
Definition VectorBackend.hpp:76
BaseVector & vector()
Return the data-vector vector.
Definition VectorBackend.hpp:62
BaseVector const & vector() const
Return the data-vector vector.
Definition VectorBackend.hpp:56
void set(const value_type &alpha)
Set all entries to alpha.
Definition VectorBackend.hpp:116
std::size_t size() const
Return the current size of the vector_.
Definition VectorBackend.hpp:68
typename BaseVector::block_type block_type
The type of the elements of the DOFVector.
Definition VectorBackend.hpp:36
T value_type
The type of the elements of the DOFVector.
Definition VectorBackend.hpp:39
CRTP base class for flat vector backends.
Definition VectorBase.hpp:19
Definition VectorBackend.hpp:15