PetscMatrix Class Reference

Wrapper of PETSc matrix, to store matrices used with PETSc in its native format. More...

#include <petsc.h>

Inherits SparseMatrix.

List of all members.

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

Detailed Description

Wrapper of PETSc matrix, to store matrices used with PETSc in its native format.


Constructor & Destructor Documentation

PetscMatrix::PetscMatrix (  ) 
PetscMatrix::~PetscMatrix (  )  [virtual]

Member Function Documentation

void PetscMatrix::add ( int  m,
int  n,
scalar **  mat,
int *  rows,
int *  cols 
) [virtual]

update the stiffness matrix

Parameters:
[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

Parameters:
[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.

Returns:
the value from the specified position
Parameters:
[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.


Friends And Related Function Documentation

friend class PetscLinearSolver [friend]

Member Data Documentation

bool PetscMatrix::inited [protected]

The documentation for this class was generated from the following files:
Generated on Fri Sep 3 09:22:20 2010 for Hermes3D Library: Real Version by  doxygen 1.6.3