The basic container that stores a base vector data. More...
#include <VectorBackend.hpp>
Public Types | |
using | BaseVector = ::Vec |
The type of the base vector. | |
using | value_type = PetscScalar |
The type of the elements of the DOFVector. | |
using | size_type = PetscInt |
The index/size - type. | |
Public Member Functions | |
template<class Basis > | |
PetscVector (Basis const &basis) | |
Constructor. Constructs new BaseVector. | |
PetscVector (PetscVector &&other) | |
Move constructor. | |
PetscVector (PetscVector const &other) | |
Copy constructor. | |
~PetscVector () | |
Destructor. | |
PetscVector & | operator= (PetscVector &&other) |
Move assignment operator. | |
PetscVector & | operator= (PetscVector const &other) |
Copy assignment operator. | |
BaseVector const & | vector () const |
Return the data-vector vector_. | |
BaseVector & | vector () |
Return the data-vector vector_. | |
std::size_t | localSize () const |
Return the number of entries in the local part of the vector. | |
std::size_t | globalSize () const |
Return the number of entries in the global vector. | |
template<class SizeInfo > | |
void | init (SizeInfo const &, bool clear) |
Resize the vector_ to the size s . | |
void | finish () |
Finish assembly. Must be called before vector can be used in a KSP. | |
void | synchronize () |
Update the ghost regions with values from the owning process. | |
template<class MultiIndex > | |
PetscScalar | at (MultiIndex const &idx) const |
Access the entry i of the vector with read-only-access. | |
template<class MultiIndex , class Assign > | |
void | insert (MultiIndex const &dof, PetscScalar value, Assign) |
Access the entry i of the vector with write-access. | |
template<class IndexRange , class OutputIterator > | |
void | gather (IndexRange const &localInd, OutputIterator buffer) const |
Collect all values from this vector to indices given by localInd and store it into the output buffer. | |
template<class IndexRange , class LocalValues , class MaskRange , class Assign > | |
void | scatter (IndexRange const &localInd, LocalValues const &localVal, MaskRange const &mask, Assign) |
Store all values given by localVal with indices localInd in the vector. More... | |
template<class IndexRange , class Func > | |
void | forEach (IndexRange const &localInd, Func &&f) const |
Apply the functor f to each vector entry to local index in localInd range. | |
template<class Func > | |
void | forEach (Func &&f) |
template<class Func > | |
void | forEach (Func &&f) const |
void | set (PetscScalar value) |
Set all entries to value , including the ghost entries. | |
void | setZero () |
Zero all entries, including the ghost entries. | |
Friends | |
void | swap (PetscVector &lhs, PetscVector &rhs) |
The basic container that stores a base vector data.
|
inline |
Store all values given by localVal
with indices localInd
in the vector.
Store only those values with mask != 0. Use an assign mode for the storage. It is not allowed to switch the assign mode before calling VecAssemblyBegin and VecAssemblyEnd.