36 #include "DistributedVector.hpp"
37 #include "DistributedVectorFactory.hpp"
41 return (
mLo<=globalIndex && globalIndex<
mHi);
49 assert(pFactory != NULL);
58 #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 2) //PETSc 3.2 or later
60 VecGetArrayRead(vec, (
const PetscScalar**)&
mpVec);
63 VecGetArray(vec, &
mpVec);
68 VecGetArray(vec, &
mpVec);
73 VecGetSize(vec, &size);
80 assert(mSizeMultiplier == 1);
81 if (mLo<=globalIndex && globalIndex<mHi)
83 return mpVec[globalIndex - mLo];
90 assert(mSizeMultiplier==1);
91 return mpVec[index.Local];
99 #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 2) //PETSc 3.2 or later
DistributedVector(Vec vec, DistributedVectorFactory *pFactory, bool readOnly=false)
double & operator[](unsigned globalIndex)
bool operator!=(const Iterator &rOther)
bool IsGlobalIndexLocal(unsigned globalIndex)
unsigned GetProblemSize() const