A class which helps with repeated reading from a petsc vector. More...
#include <PetscVectorReader.h>
Public Member Functions | |
PetscVectorReader (PetscVector< Number > &vec) | |
Construct using a pets vector. More... | |
PetscVectorReader (NumericVector< Number > &vec) | |
Construct using a numeric vector. More... | |
~PetscVectorReader () | |
Destructor to make sure the vector is restored every time this goes out of scope. More... | |
void | restore () |
Restore the array, usually upon going out of scope. More... | |
PetscScalar | operator() (const numeric_index_type i) const |
Access a value in the petsc vector. More... | |
Private Member Functions | |
bool | readable () const |
Check if this vector is readable. More... | |
Private Attributes | |
PetscVector< Number > & | _vec |
Reference to the petsc vector whose values shall be read. More... | |
const PetscScalar * | _raw_value |
The raw values in the vector. More... | |
A class which helps with repeated reading from a petsc vector.
Its main purpose is to avoid unnecessary calls to the get_array() function in the wrapper.
Definition at line 27 of file PetscVectorReader.h.
PetscVectorReader::PetscVectorReader | ( | PetscVector< Number > & | vec | ) |
Construct using a pets vector.
PetscVectorReader::PetscVectorReader | ( | NumericVector< Number > & | vec | ) |
Construct using a numeric vector.
PetscVectorReader::~PetscVectorReader | ( | ) |
Destructor to make sure the vector is restored every time this goes out of scope.
Definition at line 22 of file PetscVectorReader.C.
|
inline |
Access a value in the petsc vector.
Definition at line 58 of file PetscVectorReader.h.
|
inlineprivate |
Check if this vector is readable.
Definition at line 48 of file PetscVectorReader.h.
Referenced by operator()().
void PetscVectorReader::restore | ( | ) |
Restore the array, usually upon going out of scope.
Definition at line 25 of file PetscVectorReader.C.
|
private |
The raw values in the vector.
Definition at line 54 of file PetscVectorReader.h.
Referenced by operator()(), and readable().
|
private |
Reference to the petsc vector whose values shall be read.
Definition at line 51 of file PetscVectorReader.h.
Referenced by operator()().