Wrapper of PETSc matrix, to store matrices used with PETSc in its native format. More...
#include <petsc.h>
Inherits SparseMatrix.
Public Member Functions | |
| PetscMatrix () | |
| virtual | ~PetscMatrix () |
| virtual void | alloc () |
| allocate the memory for stiffness matrix and right-hand side | |
| virtual void | free () |
| free the memory associated with stiffness matrix and right-hand side | |
| virtual void | finish () |
| virtual scalar | get (int m, int n) |
| Get the value from a position. | |
| virtual void | zero () |
| Zero the matrix. | |
| virtual void | add (int m, int n, scalar v) |
| update the stiffness matrix | |
| virtual void | add (int m, int n, scalar **mat, int *rows, int *cols) |
| update the stiffness matrix | |
| virtual bool | dump (FILE *file, const char *var_name, EMatrixDumpFormat fmt=DF_MATLAB_SPARSE) |
| dumping matrix and right-hand side | |
| virtual int | get_matrix_size () const |
| virtual double | get_fill_in () const |
Protected Attributes | |
| bool | inited |
Friends | |
| class | PetscLinearSolver |
Wrapper of PETSc matrix, to store matrices used with PETSc in its native format.
| PetscMatrix::PetscMatrix | ( | ) |
| PetscMatrix::~PetscMatrix | ( | ) | [virtual] |
| void PetscMatrix::add | ( | int | m, | |
| int | n, | |||
| scalar ** | mat, | |||
| int * | rows, | |||
| int * | cols | |||
| ) | [virtual] |
update the stiffness matrix
| [in] | m | - number of rows of given block |
| [in] | n | - number of columns of given block |
| [in] | matrix | - block of values |
| [in] | rows | - array with row indexes |
| [in] | cols | - array with column indexes |
Implements Matrix.
| void PetscMatrix::add | ( | int | m, | |
| int | n, | |||
| scalar | v | |||
| ) | [virtual] |
update the stiffness matrix
| [in] | m | - the row where to update |
| [in] | n | - the column where to update |
| [in] | v | - value |
Implements Matrix.
| void PetscMatrix::alloc | ( | ) | [virtual] |
allocate the memory for stiffness matrix and right-hand side
Implements Matrix.
| bool PetscMatrix::dump | ( | FILE * | file, | |
| const char * | var_name, | |||
| EMatrixDumpFormat | = DF_MATLAB_SPARSE | |||
| ) | [virtual] |
dumping matrix and right-hand side
Implements Matrix.
| void PetscMatrix::finish | ( | ) | [virtual] |
Reimplemented from SparseMatrix.
| void PetscMatrix::free | ( | ) | [virtual] |
free the memory associated with stiffness matrix and right-hand side
Implements Matrix.
| scalar PetscMatrix::get | ( | int | m, | |
| int | n | |||
| ) | [virtual] |
Get the value from a position.
| [in] | m | - the number of row |
| [in] | n | - the number of column |
Implements Matrix.
| double PetscMatrix::get_fill_in | ( | ) | const [virtual] |
Implements SparseMatrix.
| int PetscMatrix::get_matrix_size | ( | ) | const [virtual] |
Implements Matrix.
| void PetscMatrix::zero | ( | ) | [virtual] |
Zero the matrix.
Implements Matrix.
friend class PetscLinearSolver [friend] |
bool PetscMatrix::inited [protected] |
1.6.3