75 addValues(subVec.data(), rowIndices.size(), rowIndices.data());
85 setValues(subVec.data(), rowIndices.size(), rowIndices.data());
105 "trying to access to memory without required called to getLocalData()."
109 "out-of-bounds index " << globalIndex <<
" while range of vector is ( low-high " <<
m_lo <<
","
126 "out-of-bounds index " << globalIndex <<
" while range of vector is ( low-high " <<
m_lo <<
","
182 int *sizes =
nullptr;
191 int *displ =
nullptr;
197 displ[i] = displ[i - 1] + sizes[i - 1];
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
Eigen::Matrix< CepsScalar, Eigen::Dynamic, 1 > CepsMathDynamic1D
Dynamic 1D array, eigen format.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
CepsIndex CepsGlobalIndex
Many uses. Has to be signed for PETSc.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsInt CepsIndex
Index rowid etc.
DistributedVector operator-(const DistributedVector &lhs, const DistributedVector &rhs)
vector-vector
DistributedVector operator*(const DistributedVector &lhs, const CepsReal &scalar)
vector*scalar
DistributedVector operator+(const DistributedVector &lhs, const DistributedVector &rhs)
Addition of vectors.
Sparse matrix distributed between process.
Structure to hold spatially dependant data and distribute it between process.
CepsMathScalar * m_localData
void insertSubVector(const CepsMathDynamic1D &subVector, const CepsVector< CepsGlobalIndex > &rowIndices)
Insert (i.e. set) a vector in a distributed vector.
CepsString getUnit() const
Units of data.
virtual CepsMathScalar & operator[](CepsGlobalIndex globalIndex)
Direct access to the values of a vector.
virtual void getLocalData()
Enables direct access to the stored local values.
CepsBool m_isAssembled
Whether this vector is assembled or not.
CepsGlobalIndex m_lo
Index of first owned row.
void addSubVector(const CepsMathDynamic1D &subVector, const CepsVector< CepsGlobalIndex > &rowIndices)
Adds a vector in a distributed vector.
CepsString m_unit
Unit of the data.
void addValues(const CepsMathScalar *values, CepsInt n, const CepsGlobalIndex *indices)
Add multiple values to already existing values.
void duplicate(DistributedVector &dest, CepsBool copyValues) const
Shares the non-zero structure, and optionally values.
CepsGlobalIndex m_hi
Index of row right after last owned row.
void fillFromVector(const CepsVector< CepsMathScalar > &data)
Fills the distributed vector with data stored in a vector on process 0.
virtual void releaseLocalData()
Release the pointer on the local data.
CepsBool isAssembled() const
true if vector has been assembled
void setUnit(const CepsString &u)
Units of data.
virtual void mult(const DistributedMatrix &A, const DistributedVector &x)
Sets current vector to result of product A*x.
CepsInt m_localSize
Local size of vector.
DistributedVector & operator=(const DistributedVector &v)
Assignment operator.
void setValues(const CepsMathScalar *values, CepsInt n, const CepsGlobalIndex *indices)
Sets n multiple values.
void checkNanOrInf(CepsString message="")
Stops if there are coefficients that are nan or inf.
CepsString toString(_Tp value)
Convert a given value to a string (input has to be compatible with std::to_string)
void destroyTabular(_Type &)
Destroy[delete] any type.
MPI_Comm getCommunicator()
Get the communicator.
CepsUInt getGridSize()
Returns the number of process on the computing grid.
void checkNanOrInf(CepsReal v, CepsString message="")
Stops if value is NaN or infty.
CepsBool isMaster()
Is calling process the master ?