AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
PetscVector< DofMap > Class Template Reference

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.
 
PetscVectoroperator= (PetscVector &&other)
 Move assignment operator.
 
PetscVectoroperator= (PetscVector const &other)
 Copy assignment operator.
 
BaseVector const & vector () const
 Return the data-vector vector_.
 
BaseVectorvector ()
 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)
 

Detailed Description

template<class DofMap>
class AMDiS::PetscVector< DofMap >

The basic container that stores a base vector data.

Member Function Documentation

◆ scatter()

void scatter ( IndexRange const &  localInd,
LocalValues const &  localVal,
MaskRange const &  mask,
Assign   
)
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.


The documentation for this class was generated from the following file: