PetscLinearSolver Class Reference

Linear system solver. More...

#include <PetscLinearSolver.h>

List of all members.

Public Member Functions

 PetscLinearSolver ()
void LinearSolver (int matrixSize, real **valueAMatrix, int **columnAMatrix, int totalColumn, real *rhs, real *Sol, PCType preCond, KSPType KrylovM, real tol, int &zeroInitialGuess)
 Linear system solver.
int finalize ()
 ~PetscLinearSolver ()


Detailed Description

Linear system solver.

This class use PETSC to solve the linear system A x = b, which results from the pressure Poisson equation. A is the matrix, x is the soultion of pressure, and b is the source terms. Note that A is represented by a sparse matrix for efficiency. The performace of the solver is mainly determined by this part, because the Poisson equation is the most expensive part to solve.

Include "petscksp.h" so that we can use KSP solvers. Note that this file automatically includes:

petsc.h - base PETSc routines, petscvec.h - vectors , petscsys.h - system routines , petscmat.h - matrices, petscis.h - index sets , petscksp.h - Krylov subspace methods, petscviewer.h - viewers , petscpc.h - preconditioners,


Constructor & Destructor Documentation

PetscLinearSolver::PetscLinearSolver (  ) 

constructor

PetscLinearSolver::~PetscLinearSolver (  ) 

destructor


Member Function Documentation

void PetscLinearSolver::LinearSolver ( int  matrixSize,
real **  valueAMatrix,
int **  columnAMatrix,
int  totalColumn,
real *  rhs,
real *  Sol,
PCType  preCond,
KSPType  KrylovM,
real  tol,
int &  zeroInitialGuess 
)

Linear system solver.

This class use PETSC to solve the linear system A x = b, which results from the pressure Poisson equation. A is the matrix, x is the soultion of pressure, and b is the source terms. Note that A is represented by a sparse matrix for efficiency. The performace of the solver is mainly determined by this part, because the Poisson equation is the most expensive part to solve.

Concepts: KSP^solving a system of linear equations: AMatrix x = rhs

Processors: 1

Parameters:
matrixSize  matrix size
valueAMatrix  matrix elements
columnAMatrix  matrix index
totalColumn  total number of columns
rhs  mright hand side of the matrix
Sol  solution of the linear system
preCond  preconditioner for PETSC
KrylovM  Krylov method
tol  tolerance
zeroInitialGuess  if use zero as the initial guess for pressure

int PetscLinearSolver::finalize (  ) 

clean up the memory assigned for PETSC


The documentation for this class was generated from the following files:

Generated on Tue May 18 21:30:43 2010 by  doxygen 1.5.6