#include <DistributedVector.hpp>
Classes | |
class | Chunk |
class | Iterator |
class | Stripe |
Public Member Functions | |
bool | IsGlobalIndexLocal (unsigned globalIndex) |
DistributedVector (Vec vec, DistributedVectorFactory *pFactory) | |
unsigned | GetHigh () const |
unsigned | GetLow () const |
DistributedVectorFactory * | GetFactory () |
double & | operator[] (unsigned globalIndex) throw (DistributedVectorException) |
void | Restore () |
Iterator | Begin () |
Iterator | End () |
double & | operator[] (Iterator index) throw (DistributedVectorException) |
Private Attributes | |
unsigned | mLo |
unsigned | mHi |
unsigned | mProblemSize |
unsigned | mSizeMultiplier |
Vec | mVec |
double * | mpVec |
DistributedVectorFactory * | mpFactory |
Friends | |
class | TestDistributedVector |
Gives access to the local portion of a PETSc vector via an iterator.
It also provides two nested classes for accessing vectors with particular memory layouts: striped and chunked.
Definition at line 48 of file DistributedVector.hpp.
DistributedVector::DistributedVector | ( | Vec | vec, | |
DistributedVectorFactory * | pFactory | |||
) |
Constructor. This class represents the portion of a distributed PETSc vector on this process.
Note that this class does NOT take over responsibility for destroying the Vec.
vec | PETSc vector of which this class shall be a portion | |
pFactory | pointer to the DistributedVectorFactory used to create this vector |
Definition at line 40 of file DistributedVector.cpp.
References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), DistributedVectorFactory::GetProblemSize(), mHi, mLo, mProblemSize, mpVec, and mSizeMultiplier.
DistributedVector::Iterator DistributedVector::Begin | ( | ) |
Definition at line 103 of file DistributedVector.cpp.
References DistributedVector::Iterator::Global, DistributedVector::Iterator::Local, and mLo.
Referenced by MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainWithBathMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainProblem< DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), ParallelColumnDataWriter::PutVectorStripe(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
DistributedVector::Iterator DistributedVector::End | ( | ) |
Definition at line 111 of file DistributedVector.cpp.
References DistributedVector::Iterator::Global, DistributedVector::Iterator::Local, mHi, and mLo.
Referenced by MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainWithBathMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainProblem< DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), ParallelColumnDataWriter::PutVectorStripe(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
DistributedVectorFactory* DistributedVector::GetFactory | ( | ) | [inline] |
Definition at line 117 of file DistributedVector.hpp.
References mpFactory.
Referenced by DistributedVector::Stripe::Stripe().
unsigned DistributedVector::GetHigh | ( | ) | const [inline] |
Definition at line 101 of file DistributedVector.hpp.
References mHi.
Referenced by DistributedVector::Chunk::Chunk(), and DistributedVector::Stripe::Stripe().
unsigned DistributedVector::GetLow | ( | ) | const [inline] |
Definition at line 109 of file DistributedVector.hpp.
References mLo.
Referenced by DistributedVector::Chunk::Chunk(), and DistributedVector::Stripe::Stripe().
Test if the given global index is owned by the current process, i.e. is local to it.
globalIndex |
Definition at line 35 of file DistributedVector.cpp.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToNonlinearResidual().
double & DistributedVector::operator[] | ( | Iterator | index | ) | throw (DistributedVectorException) |
index |
Definition at line 69 of file DistributedVector.cpp.
double & DistributedVector::operator[] | ( | unsigned | globalIndex | ) | throw (DistributedVectorException) |
globalIndex |
Definition at line 59 of file DistributedVector.cpp.
void DistributedVector::Restore | ( | ) |
Store elements that have been written to back into the PETSc vector. Call after you have finished writing. It appears that you do not need to call this if you only read from the vector.
Definition at line 75 of file DistributedVector.cpp.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToNonlinearResidual(), MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainWithBathMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainProblem< DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
unsigned DistributedVector::mHi [private] |
One above the last entry owned by the current processor.
Definition at line 59 of file DistributedVector.hpp.
Referenced by DistributedVector(), End(), GetHigh(), and IsGlobalIndexLocal().
unsigned DistributedVector::mLo [private] |
The first entry owned by the current processor.
Definition at line 56 of file DistributedVector.hpp.
Referenced by Begin(), DistributedVector(), End(), GetLow(), and IsGlobalIndexLocal().
Pointer to the factory that created this DistributedVector. Gives access to local and global sizes
Definition at line 76 of file DistributedVector.hpp.
Referenced by GetFactory().
unsigned DistributedVector::mProblemSize [private] |
The problem size, i.e. the length of the vector of unknowns.
Definition at line 62 of file DistributedVector.hpp.
Referenced by DistributedVector().
double* DistributedVector::mpVec [private] |
The local part of the underlying PETSc vector.
Definition at line 70 of file DistributedVector.hpp.
Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), Restore(), and DistributedVector::Stripe::Stripe().
unsigned DistributedVector::mSizeMultiplier [private] |
How much bigger this vector is than the problem size.
Definition at line 66 of file DistributedVector.hpp.
Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), and DistributedVector::Stripe::Stripe().
Vec DistributedVector::mVec [private] |
The underlying PETSc vector.
Definition at line 68 of file DistributedVector.hpp.
Referenced by Restore().