1#ifndef GHOSTED_PARALLEL_VECTOR_H
2#define GHOSTED_PARALLEL_VECTOR_H
19 const uint64_t global_size,
20 const std::vector<int64_t>& ghost_ids,
21 const MPI_Comm communicator = MPI_COMM_WORLD)
23 ghost_comm_(local_size, global_size, ghost_ids, communicator)
32 ghost_comm.Communicator()),
52 std::unique_ptr<ParallelVector>
MakeCopy()
const override;
53 std::unique_ptr<ParallelVector>
MakeClone()
const override;
const std::vector< int64_t > & GhostIndices() const
Return the ghost indices associated with the local vector.
uint64_t NumGhosts() const
Return the number of ghosts associated with the local vector.
GhostedParallelSTLVector(const uint64_t local_size, const uint64_t global_size, const std::vector< int64_t > &ghost_ids, const MPI_Comm communicator=MPI_COMM_WORLD)
std::unique_ptr< ParallelVector > MakeClone() const override
void CommunicateGhostEntries() override
int64_t MapGhostToLocal(const int64_t ghost_id) const
Map a global ghost id to its respective local id.
double GetGlobalValue(int64_t global_id) const
std::unique_ptr< ParallelVector > MakeCopy() const override
GhostedParallelSTLVector(const VectorGhostCommunicator &ghost_comm)
Initialize a ghosted parallel vector from a ghost communicator.
GhostedParallelSTLVector(const GhostedParallelSTLVector &other)
std::vector< double > MakeGhostedLocalVector() const
Return a vector containing the locally owned data and ghost data.
uint64_t LocalSizeWithGhosts() const
Return the total size of the local vector, including ghosts.
VectorGhostCommunicator ghost_comm_
GhostedParallelSTLVector(GhostedParallelSTLVector &&other) noexcept
ParallelSTLVector(uint64_t local_size, uint64_t global_size, MPI_Comm communicator)
std::vector< double > values_
const uint64_t local_size_
uint64_t GlobalSize() const
Return the global size of the parallel vector.
uint64_t LocalSize() const
Return the size of the locally owned portion of the parallel vector.
int64_t MapGhostToLocal(int64_t ghost_id) const
const std::vector< int64_t > & GhostIndices() const
uint64_t NumGhosts() const
void CommunicateGhostEntries(std::vector< double > &ghosted_vector) const