AMDiS 2.10
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

 PetscVector (DofMap const &dofMap)
 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 Basis >
void init (Basis 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 forEachLocal (Func &&f) const
 Perform the f(value) on the local elements of this vector.
 
template<class Func >
void forEachLocal (Func &&f)
 Perform the f(value) on the local elements of this vector.
 
void set (PetscScalar value)
 Set all entries to value, including the ghost entries.
 
void setZero ()
 Zero all entries, including the ghost entries.
 
MPI_Comm comm () const
 

Static Public Member Functions

template<class Operation , class... VecIns>
static void transformLocal (PetscVector &vecOut, Operation op, VecIns const &... vecIn)
 Perform the valueOut = op(valueIn...) on the local elements of [vecOut] and [vecIn...].
 
template<class T , class BinOp1 , class BinOp2 >
static T innerProductLocal (PetscVector const &in1, PetscVector const &in2, T init, BinOp1 op1, BinOp2 op2)
 Perform the op1(init, op2(value1, value2)) on the local elements of [in1] and [in2].
 

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.

References PetscVector< DofMap >::scatter().

Referenced by PetscVector< DofMap >::scatter().


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