Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
DistributedVector::Chunk Class Reference

#include <DistributedVector.hpp>

+ Collaboration diagram for DistributedVector::Chunk:

Public Member Functions

 Chunk (DistributedVector parallelVec, unsigned chunk)
 
doubleoperator[] (unsigned globalIndex)
 
doubleoperator[] (Iterator index)
 

Private Attributes

unsigned mOffset
 
doublempVec
 
unsigned mLo
 
unsigned mHi
 

Detailed Description

Provide access to a particular chunk of a chunked vector.

A chunked vector has multiple types of information encoded within a single vector, with a layout like [x_1, x_2, ..., x_n, y_1, y_2, ... y_n]. This class provides easy access to, for example, the x values.

Definition at line 263 of file DistributedVector.hpp.

Constructor & Destructor Documentation

◆ Chunk()

DistributedVector::Chunk::Chunk ( DistributedVector  parallelVec,
unsigned  chunk 
)
inline

Constructor.

Parameters
parallelVecchunked vector
chunknumber of this chunk within the vector starting from 0

Definition at line 277 of file DistributedVector.hpp.

References DistributedVector::GetHigh(), DistributedVector::GetLow(), mHi, mLo, mOffset, DistributedVector::mpVec, mpVec, and DistributedVector::mSizeMultiplier.

Member Function Documentation

◆ operator[]() [1/2]

double & DistributedVector::Chunk::operator[] ( Iterator  index)
inline
Parameters
index
Returns
value of striped distributed vector pointed to by index.

Definition at line 308 of file DistributedVector.hpp.

References mOffset, and mpVec.

◆ operator[]() [2/2]

double & DistributedVector::Chunk::operator[] ( unsigned  globalIndex)
inline

Access a particular element of the chunk if on this processor. For use in tests. Will throw a DistributedVectorException if the specified element is not on this process.

Parameters
globalIndexindex within the chunk
Returns
value of striped vector

Definition at line 294 of file DistributedVector.hpp.

References mHi, mLo, mOffset, and mpVec.

Member Data Documentation

◆ mHi

unsigned DistributedVector::Chunk::mHi
private

One above the last entry owned by the current processor.

Definition at line 268 of file DistributedVector.hpp.

Referenced by Chunk(), and operator[]().

◆ mLo

unsigned DistributedVector::Chunk::mLo
private

The first entry owned by the current processor.

Definition at line 267 of file DistributedVector.hpp.

Referenced by Chunk(), and operator[]().

◆ mOffset

unsigned DistributedVector::Chunk::mOffset
private

The start of this chunk within the locally-owned part of the vector.

Definition at line 265 of file DistributedVector.hpp.

Referenced by Chunk(), operator[](), and operator[]().

◆ mpVec

double* DistributedVector::Chunk::mpVec
private

The local part of the underlying PETSc vector.

Definition at line 266 of file DistributedVector.hpp.

Referenced by Chunk(), operator[](), and operator[]().


The documentation for this class was generated from the following file: