DistributedVector Class Reference

#include <DistributedVector.hpp>

Collaboration diagram for DistributedVector:
Collaboration graph
[legend]

List of all members.

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
DistributedVectorFactoryGetFactory ()
doubleoperator[] (unsigned globalIndex) throw (DistributedVectorException)
void Restore ()
Iterator Begin ()
Iterator End ()
doubleoperator[] (Iterator index) throw (DistributedVectorException)

Private Attributes

unsigned mLo
unsigned mHi
unsigned mProblemSize
unsigned mSizeMultiplier
Vec mVec
doublempVec
DistributedVectorFactorympFactory

Friends

class TestDistributedVector

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
vec PETSc vector of which this class shall be a portion
pFactory pointer to the DistributedVectorFactory used to create this vector

Definition at line 37 of file DistributedVector.cpp.

References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), DistributedVectorFactory::GetProblemSize(), mHi, mLo, mProblemSize, mpVec, and mSizeMultiplier.


Member Function Documentation

DistributedVector::Iterator DistributedVector::Begin (  ) 
Returns:
iterator pointing to the first element of the distributed vector on this process

Definition at line 93 of file DistributedVector.cpp.

References DistributedVector::Iterator::Global, DistributedVector::Iterator::Local, and mLo.

Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), ExtendedBidomainProblem< DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AdaptiveBidomainProblem::InitializeSolutionOnAdaptedMesh(), ExtendedBidomainProblem< DIM >::load(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), ParallelColumnDataWriter::PutVectorStripe(), ExtendedBidomainProblem< DIM >::save(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >::SetupLinearSystem(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainTissue< SPACE_DIM >::SolveCellSystems(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep(), and ExtendedBidomainProblem< DIM >::WriteOneStep().

DistributedVector::Iterator DistributedVector::End (  ) 
Returns:
iterator pointing to one past the last element of the distributed vector on this process

Definition at line 101 of file DistributedVector.cpp.

References DistributedVector::Iterator::Global, DistributedVector::Iterator::Local, mHi, and mLo.

Referenced by AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::CheckCompatibilityCondition(), ExtendedBidomainProblem< DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractExtendedBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::GenerateNullBasis(), AdaptiveBidomainProblem::InitializeSolutionOnAdaptedMesh(), ExtendedBidomainProblem< DIM >::load(), AbstractCardiacProblem< ELEMENT_DIM, ELEMENT_DIM, 1 >::load(), ParallelColumnDataWriter::PutVectorStripe(), ExtendedBidomainProblem< DIM >::save(), OperatorSplittingMonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), MonodomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainSolver< ELEM_DIM, SPACE_DIM >::SetupLinearSystem(), BidomainSolver< ELEMENT_DIM, SPACE_DIM >::SetupLinearSystem(), ExtendedBidomainTissue< SPACE_DIM >::SolveCellSystems(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep(), and ExtendedBidomainProblem< DIM >::WriteOneStep().

DistributedVectorFactory* DistributedVector::GetFactory (  )  [inline]
Returns:
the factory used to create this vector.

Definition at line 120 of file DistributedVector.hpp.

References mpFactory.

Referenced by DistributedVector::Stripe::Stripe().

unsigned DistributedVector::GetHigh (  )  const [inline]
Returns:
mHi - The next index above the top one owned by the process.

Definition at line 104 of file DistributedVector.hpp.

References mHi.

Referenced by DistributedVector::Chunk::Chunk(), and DistributedVector::Stripe::Stripe().

unsigned DistributedVector::GetLow (  )  const [inline]
Returns:
mLo - The lowest index owned by the process.

Definition at line 112 of file DistributedVector.hpp.

References mLo.

Referenced by DistributedVector::Chunk::Chunk(), and DistributedVector::Stripe::Stripe().

bool DistributedVector::IsGlobalIndexLocal ( unsigned  globalIndex  ) 

Test if the given global index is owned by the current process, i.e. is local to it.

Parameters:
globalIndex 

Definition at line 32 of file DistributedVector.cpp.

References mHi, and mLo.

Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToNonlinearResidual().

double & DistributedVector::operator[] ( Iterator  index  )  throw (DistributedVectorException)
Parameters:
index 
Returns:
value of distributed vector pointed to by index. Do not use if stride>1.

Definition at line 66 of file DistributedVector.cpp.

double & DistributedVector::operator[] ( unsigned  globalIndex  )  throw (DistributedVectorException)
Parameters:
globalIndex 
Returns:
value of distributed vector at globalIndex Do not use if stride>1. For use in tests. Will throw a DistributedVectorException if the specified element is not on this process.

Definition at line 56 of file DistributedVector.cpp.

void DistributedVector::Restore (  ) 

Member Data Documentation

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().

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 79 of file DistributedVector.hpp.

Referenced by GetFactory().

The problem size, i.e. the length of the vector of unknowns.

Definition at line 62 of file DistributedVector.hpp.

Referenced by DistributedVector().

The local part of the underlying PETSc vector.

Definition at line 73 of file DistributedVector.hpp.

Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), Restore(), and DistributedVector::Stripe::Stripe().

How much bigger this vector is than the problem size.

Definition at line 67 of file DistributedVector.hpp.

Referenced by DistributedVector::Chunk::Chunk(), DistributedVector(), and DistributedVector::Stripe::Stripe().

The underlying PETSc vector.

Definition at line 70 of file DistributedVector.hpp.

Referenced by Restore().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:04:25 2011 for Chaste by  doxygen 1.6.3