PetscVector Class Reference

Wrapper of PETSc vector, to store vectors used with PETSc in its native format. More...

#include <petsc.h>

Inherits Vector.

List of all members.

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

Detailed Description

Wrapper of PETSc vector, to store vectors used with PETSc in its native format.


Constructor & Destructor Documentation

PetscVector::PetscVector (  ) 
PetscVector::~PetscVector (  )  [virtual]

Member Function Documentation

void PetscVector::add ( int  n,
int *  idx,
scalar y 
) [virtual]

update subset of the elements

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

Parameters:
[in] idx - indices where to update
[in] y - value

Implements Vector.

void PetscVector::alloc ( int  ndofs  )  [virtual]

allocate memory for storing ndofs elements

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

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

Returns:
the value form the specified index
Parameters:
[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

Parameters:
[in] idx - indices where to update
[in] y - value

Implements Vector.

void PetscVector::zero (  )  [virtual]

Zero the vector.

Implements Vector.


Friends And Related Function Documentation

friend class PetscLinearSolver [friend]

Member Data Documentation

bool PetscVector::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