Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
|
#include <DistributedVector.hpp>
Classes | |
class | Chunk |
class | Iterator |
class | Stripe |
Public Member Functions | |
bool | IsGlobalIndexLocal (unsigned globalIndex) |
DistributedVector (Vec vec, DistributedVectorFactory *pFactory, bool readOnly=false) | |
unsigned | GetHigh () const |
unsigned | GetLow () const |
DistributedVectorFactory * | GetFactory () |
double & | operator[] (unsigned globalIndex) |
void | Restore () |
Iterator | Begin () |
Iterator | End () |
double & | operator[] (Iterator index) |
Private Attributes | |
unsigned | mLo |
unsigned | mHi |
unsigned | mProblemSize |
unsigned | mSizeMultiplier |
Vec | mVec |
double * | mpVec |
DistributedVectorFactory * | mpFactory |
bool | mReadOnly |
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 55 of file DistributedVector.hpp.
DistributedVector::DistributedVector | ( | Vec | vec, |
DistributedVectorFactory * | pFactory, | ||
bool | readOnly = false |
||
) |
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 |
readOnly | A suggestion to PETSc that we are not going to change the content of the Vec (Note that it may still be possible to alter the content of the vector in an inconsistent way – the user is responsible for ensuring that this doesn't happen.) * |
pFactory | pointer to the DistributedVectorFactory used to create this vector |
Definition at line 44 of file DistributedVector.cpp.
References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), DistributedVectorFactory::GetProblemSize(), mHi, mLo, mProblemSize, mpVec, mReadOnly, and mSizeMultiplier.
DistributedVector::Iterator DistributedVector::Begin | ( | ) |
Definition at line 124 of file DistributedVector.cpp.
References mLo.
Referenced by AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), ExtendedBidomainProblem< DIM >::CreateInitialCondition(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::CreateInitialCondition(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::load(), ExtendedBidomainProblem< DIM >::load(), ParallelColumnDataWriter::PutVectorStripe(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainPurkinjeSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainTissue< SPACE_DIM >::SolveCellSystems(), AbstractCardiacTissue< SPACE_DIM >::UpdatePurkinjeCaches(), ExtendedBidomainProblem< DIM >::WriteOneStep(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
DistributedVector::Iterator DistributedVector::End | ( | ) |
Definition at line 132 of file DistributedVector.cpp.
Referenced by AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), ExtendedBidomainProblem< DIM >::CreateInitialCondition(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::load(), ExtendedBidomainProblem< DIM >::load(), ParallelColumnDataWriter::PutVectorStripe(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainPurkinjeSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainTissue< SPACE_DIM >::SolveCellSystems(), AbstractCardiacTissue< SPACE_DIM >::UpdatePurkinjeCaches(), ExtendedBidomainProblem< DIM >::WriteOneStep(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
|
inline |
Definition at line 139 of file DistributedVector.hpp.
References mpFactory.
Referenced by DistributedVector::Stripe::Stripe().
|
inline |
Definition at line 123 of file DistributedVector.hpp.
References mHi.
Referenced by DistributedVector::Chunk::Chunk(), and DistributedVector::Stripe::Stripe().
|
inline |
Definition at line 131 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 39 of file DistributedVector.cpp.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToNonlinearResidual().
index |
Definition at line 88 of file DistributedVector.cpp.
References mpVec, and mSizeMultiplier.
globalIndex |
Definition at line 78 of file DistributedVector.cpp.
References mHi, mLo, mpVec, and mSizeMultiplier.
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.
Calling this method when the mReadOnly flag is set results in error (as a reminder that there should be no changes to the data in the original Vec).
Definition at line 94 of file DistributedVector.cpp.
References mpVec, mReadOnly, and mVec.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToNonlinearResidual(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), ExtendedBidomainProblem< DIM >::CreateInitialCondition(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::load(), ExtendedBidomainProblem< DIM >::load(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainPurkinjeSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), and ExtendedBidomainProblem< DIM >::WriteOneStep().
|
friend |
Definition at line 58 of file DistributedVector.hpp.
|
private |
One above the last entry owned by the current processor.
Definition at line 66 of file DistributedVector.hpp.
Referenced by DistributedVector(), End(), GetHigh(), IsGlobalIndexLocal(), and operator[]().
|
private |
The first entry owned by the current processor.
Definition at line 63 of file DistributedVector.hpp.
Referenced by DistributedVector(), Begin(), End(), GetLow(), IsGlobalIndexLocal(), and operator[]().
|
private |
Pointer to the factory that created this DistributedVector. Gives access to local and global sizes
Definition at line 86 of file DistributedVector.hpp.
Referenced by GetFactory().
|
private |
The problem size, i.e. the length of the vector of unknowns.
Definition at line 69 of file DistributedVector.hpp.
Referenced by DistributedVector().
|
private |
The local part of the underlying PETSc vector.
Definition at line 80 of file DistributedVector.hpp.
Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), DistributedVector::Stripe::Stripe(), operator[](), operator[](), and Restore().
|
private |
A hint to PETSc that we only want to read from the vector (and never write). Note that it may still be possible to alter the content of the vector in an inconsistent way – the user is responsible for ensuring that this doesn't happen. The only makes sense with PETSc 3.2 and above.
Definition at line 93 of file DistributedVector.hpp.
Referenced by DistributedVector(), and Restore().
|
private |
How much bigger this vector is than the problem size.
Definition at line 74 of file DistributedVector.hpp.
Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), DistributedVector::Stripe::Stripe(), operator[](), and operator[]().
|
private |
The underlying PETSc vector.
Definition at line 77 of file DistributedVector.hpp.
Referenced by Restore().