Wrapper of PETSc vector, to store vectors used with PETSc in its native format. More...
#include <petsc.h>
Inherits Vector.
Public Member Functions | |
| PetscVector () | |
| virtual | ~PetscVector () |
| virtual void | alloc (int ndofs) |
| allocate memory for storing ndofs elements | |
| virtual void | free () |
| free the memory | |
| virtual void | finish () |
| virtual scalar | get (int idx) |
| Get the value from a position. | |
| virtual void | extract (scalar *v) const |
| Extract vector values into user-provided array. | |
| virtual void | zero () |
| Zero the vector. | |
| virtual void | set (int idx, scalar y) |
| set the entry on a specified position | |
| virtual void | add (int idx, scalar y) |
| update element on the specified position | |
| virtual void | add (int n, int *idx, scalar *y) |
| update subset of the elements | |
| virtual bool | dump (FILE *file, const char *var_name, EMatrixDumpFormat fmt=DF_MATLAB_SPARSE) |
Protected Attributes | |
| bool | inited |
Friends | |
| class | PetscLinearSolver |
Wrapper of PETSc vector, to store vectors used with PETSc in its native format.
| PetscVector::PetscVector | ( | ) |
| PetscVector::~PetscVector | ( | ) | [virtual] |
| void PetscVector::add | ( | int | n, | |
| int * | idx, | |||
| scalar * | y | |||
| ) | [virtual] |
update subset of the elements
| [in] | n | - number of positions to update |
| [in] | idx | - indices where to update |
| [in] | y | - values |
Implements Vector.
| void PetscVector::add | ( | int | idx, | |
| scalar | y | |||
| ) | [virtual] |
update element on the specified position
| [in] | idx | - indices where to update |
| [in] | y | - value |
Implements Vector.
| void PetscVector::alloc | ( | int | ndofs | ) | [virtual] |
allocate memory for storing ndofs elements
| [in] | ndofs | - number of elements of the vector |
Implements Vector.
| bool PetscVector::dump | ( | FILE * | file, | |
| const char * | var_name, | |||
| EMatrixDumpFormat | fmt = DF_MATLAB_SPARSE | |||
| ) | [virtual] |
Implements Vector.
| void PetscVector::extract | ( | scalar * | v | ) | const [virtual] |
Extract vector values into user-provided array.
| [out] | v | - array which will contain extracted values |
Implements Vector.
| void PetscVector::finish | ( | ) | [virtual] |
Reimplemented from Vector.
| void PetscVector::free | ( | ) | [virtual] |
free the memory
Implements Vector.
| scalar PetscVector::get | ( | int | idx | ) | [virtual] |
Get the value from a position.
| [in] | idx | - index which to obtain the value from |
Implements Vector.
| void PetscVector::set | ( | int | idx, | |
| scalar | y | |||
| ) | [virtual] |
set the entry on a specified position
| [in] | idx | - indices where to update |
| [in] | y | - value |
Implements Vector.
| void PetscVector::zero | ( | ) | [virtual] |
Zero the vector.
Implements Vector.
friend class PetscLinearSolver [friend] |
bool PetscVector::inited [protected] |
1.6.3