1#ifndef CHITECH_PARALLELVECTOR_H
2#define CHITECH_PARALLELVECTOR_H
30 MPI_Comm communicator);
40 virtual std::unique_ptr<ParallelVector>
MakeCopy()
const = 0;
44 virtual std::unique_ptr<ParallelVector>
MakeClone()
const = 0;
48 virtual double*
Data() = 0;
52 virtual const double*
Data()
const = 0;
87 virtual void Set(
double value) = 0;
93 virtual void Set(
const std::vector<double>& local_vector) = 0;
99 virtual void BlockSet(
const std::vector<double>& y,
100 int64_t local_offset,
101 int64_t num_values) = 0;
116 int64_t local_offset,
117 int64_t num_values) = 0;
124 int64_t local_offset,
125 int64_t num_values) = 0;
142 virtual void SetValues(
const std::vector<int64_t>& global_ids,
143 const std::vector<double>& values,
const uint64_t global_size_
virtual const double * Data() const =0
virtual void Set(const std::vector< double > &local_vector)=0
virtual double operator[](int64_t local_id) const =0
virtual void CopyLocalValues(const ParallelVector &y)=0
virtual double * Data()=0
virtual double & operator[](int64_t local_id)=0
virtual double ComputeNorm(chi_math::NormType norm_type) const =0
virtual void Scale(double a)=0
virtual void CopyLocalValues(Vec y)=0
virtual void AXPlusY(double a, const ParallelVector &y)=0
virtual void CommunicateGhostEntries()
virtual void PlusAY(const ParallelVector &y, double a)=0
virtual std::vector< double > MakeLocalVector()=0
Return a vector containing the locally owned data.
ParallelVector(uint64_t local_size, uint64_t global_size, MPI_Comm communicator)
virtual void SetValues(const std::vector< int64_t > &global_ids, const std::vector< double > &values, VecOpType op_type)=0
virtual void BlockCopyLocalValues(Vec y, int64_t y_offset, int64_t local_offset, int64_t num_values)=0
virtual ~ParallelVector()=default
virtual void operator+=(const ParallelVector &y)=0
virtual void Assemble()=0
virtual void Shift(double a)=0
virtual void Set(double value)=0
const uint64_t local_size_
uint64_t GlobalSize() const
Return the global size of the parallel vector.
virtual std::unique_ptr< ParallelVector > MakeCopy() const =0
virtual void BlockSet(const std::vector< double > &y, int64_t local_offset, int64_t num_values)=0
virtual std::string PrintStr() const =0
Print the local vectors to stings.
uint64_t LocalSize() const
Return the size of the locally owned portion of the parallel vector.
virtual std::unique_ptr< ParallelVector > MakeClone() const =0
virtual void SetValue(int64_t global_id, double value, VecOpType op_type)=0
virtual void BlockCopyLocalValues(const ParallelVector &y, int64_t y_offset, int64_t local_offset, int64_t num_values)=0