All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Opm::LinearSolverPetsc Class Reference

Concrete class encapsulating some Petsc linear solvers. More...

#include <LinearSolverPetsc.hpp>

Inheritance diagram for Opm::LinearSolverPetsc:
Opm::LinearSolverInterface

Public Member Functions

 LinearSolverPetsc ()
 Default constructor. More...
 
 LinearSolverPetsc (const ParameterGroup &param)
 Construct from parameters Accepted parameters are, with defaults, listed in the default constructor. More...
 
virtual ~LinearSolverPetsc ()
 Destructor.
 
virtual LinearSolverReport solve (const int size, const int nonzeros, const int *ia, const int *ja, const double *sa, const double *rhs, double *solution, const boost::any &) const
 Solve a linear system, with a matrix given in compressed sparse row format. More...
 
virtual void setTolerance (const double tol)
 Set tolerance for the residual in dune istl linear solver. More...
 
virtual double getTolerance () const
 Get tolerance ofthe linear solver. More...
 
- Public Member Functions inherited from Opm::LinearSolverInterface
virtual ~LinearSolverInterface ()
 Virtual destructor.
 
LinearSolverReport solve (const CSRMatrix *A, const double *rhs, double *solution) const
 Solve a linear system, with a matrix given in compressed sparse row format. More...
 

Detailed Description

Concrete class encapsulating some Petsc linear solvers.

Constructor & Destructor Documentation

Opm::LinearSolverPetsc::LinearSolverPetsc ( )

Default constructor.

Declared, but not implemented. Petsc can only be created through the ParameterGroup constructor, everything else is an error. This way the error is caught compile time and not rune time, which is nice as it is a static error.

Opm::LinearSolverPetsc::LinearSolverPetsc ( const ParameterGroup param)

Construct from parameters Accepted parameters are, with defaults, listed in the default constructor.

Member Function Documentation

double Opm::LinearSolverPetsc::getTolerance ( ) const
virtual

Get tolerance ofthe linear solver.

Parameters
[out]tolerancevalue

Implements Opm::LinearSolverInterface.

void Opm::LinearSolverPetsc::setTolerance ( const double  tol)
virtual

Set tolerance for the residual in dune istl linear solver.

Parameters
[in]toltolerance value

Implements Opm::LinearSolverInterface.

LinearSolverInterface::LinearSolverReport Opm::LinearSolverPetsc::solve ( const int  size,
const int  nonzeros,
const int *  ia,
const int *  ja,
const double *  sa,
const double *  rhs,
double *  solution,
const boost::any &   
) const
virtual

Solve a linear system, with a matrix given in compressed sparse row format.

Parameters
[in]size# of rows in matrix
[in]nonzeros# of nonzeros elements in matrix
[in]iaarray of length (size + 1) containing start and end indices for each row
[in]jaarray of length nonzeros containing column numbers for the nonzero elements
[in]saarray of length nonzeros containing the values of the nonzero elements
[in]rhsarray of length size containing the right hand side
[in,out]solutionarray of length size to which the solution will be written, may also be used as initial guess by iterative solvers.

Implements Opm::LinearSolverInterface.


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