18 #ifndef VECTOR_MPI_HH_ 19 #define VECTOR_MPI_HH_ 67 void resize(
unsigned int local_size);
91 const VectorData &
data()
const 124 { VecGhostUpdateBegin(
data_petsc_, INSERT_VALUES, SCATTER_FORWARD);}
128 { VecGhostUpdateEnd(
data_petsc_, INSERT_VALUES, SCATTER_FORWARD);}
132 { VecGhostUpdateBegin(
data_petsc_, ADD_VALUES, SCATTER_REVERSE);}
136 { VecGhostUpdateEnd(
data_petsc_, ADD_VALUES, SCATTER_REVERSE);}
unsigned int size() const
Return size of output data.
MPI_Comm communicator_
communicator
void ghost_to_local_end()
ghost_to_local_{begin,end} updates the local values by adding ghost values from neighbouring processo...
void local_to_ghost_begin()
local_to_ghost_{begin,end} updates the ghost values on neighbouring processors from local values ...
std::vector< double > VectorData
void chkerr(unsigned int ierr)
Replacement of new/delete operator in the spirit of xmalloc.
VectorDataPtr data_ptr()
Getter for shared pointer of output data.
double & operator[](unsigned int idx)
double & operator[](unsigned int idx) const
const VectorData & data() const
VectorMPI(MPI_Comm comm=PETSC_COMM_SELF)
void copy_from(VectorMPI &other)
Global macros to enhance readability and debugging, general constants.
VectorDataPtr data_ptr_
shared pointer to vector of data
Vec data_petsc_
stored vector of data in PETSC format
void resize(unsigned int local_size)
Vec & petsc_vec()
Getter for PETSC vector of output data (e.g. can be used by scatters).
void local_to_ghost_end()
local_to_ghost_{begin,end} updates the ghost values on neighbouring processors from local values ...
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
void swap(VectorMPI &other)
Swaps the current vector data with the other vector data.
void set_subvec(const LocDofVec &loc_indices, const arma::vec &values)
void duplicate_from(VectorMPI other)
For the current vector, it creates the same parallel structure as the other vector has...
arma::vec get_subvec(const LocDofVec &loc_indices)
void ghost_to_local_begin()
ghost_to_local_{begin,end} updates the local values by adding ghost values from neighbouring processo...
std::shared_ptr< VectorData > VectorDataPtr
arma::Col< Idx > LocDofVec
static VectorMPI sequential(unsigned int size)