12#include "libmesh/petsc_vector.h"
13#include "libmesh/id_types.h"
14#include "libmesh/libmesh_common.h"
44 PetscScalar
operator()(
const numeric_index_type i)
const;
60 mooseAssert(
readable(),
"Not readable");
A class which helps with repeated reading from a petsc vector.
PetscScalar operator()(const numeric_index_type i) const
Access a value in the petsc vector.
void restore()
Restore the array, usually upon going out of scope.
const PetscScalar * _raw_value
The raw values in the vector.
bool readable() const
Check if this vector is readable.
~PetscVectorReader()
Destructor to make sure the vector is restored every time this goes out of scope.
PetscVector< Number > & _vec
Reference to the petsc vector whose values shall be read.
numeric_index_type map_global_to_local_index(const numeric_index_type i) const
dof_id_type numeric_index_type