Opm::LinearSolverInterface Class Referenceabstract

Abstract interface for linear solvers. More...

#include <LinearSolverInterface.hpp>

Inheritance diagram for Opm::LinearSolverInterface:
Inheritance graph

Classes

struct  LinearSolverReport
 

Public Member Functions

virtual ~LinearSolverInterface ()
 Virtual destructor. More...
 
LinearSolverReport solve (const CSRMatrix *A, const double *rhs, double *solution) const
 
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 &add=boost::any()) const =0
 
virtual void setTolerance (const double tol)=0
 
virtual double getTolerance () const =0
 

Detailed Description

Abstract interface for linear solvers.

Constructor & Destructor Documentation

◆ ~LinearSolverInterface()

virtual Opm::LinearSolverInterface::~LinearSolverInterface ( )
virtual

Virtual destructor.

Member Function Documentation

◆ getTolerance()

virtual double Opm::LinearSolverInterface::getTolerance ( ) const
pure virtual

Get tolerance for the linear solver.

Parameters
[out]tolerancevalue

Implemented in Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, and Opm::LinearSolverUmfpack.

◆ setTolerance()

virtual void Opm::LinearSolverInterface::setTolerance ( const double  tol)
pure virtual

Set tolerance for the linear solver.

Parameters
[in]toltolerance value

Implemented in Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, and Opm::LinearSolverUmfpack.

◆ solve() [1/2]

LinearSolverReport Opm::LinearSolverInterface::solve ( const CSRMatrix A,
const double *  rhs,
double *  solution 
) const

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

Parameters
[in]Amatrix in CSR format
[in]rhsarray of length A->m containing the right hand side
[in,out]solutionarray of length A->m to which the solution will be written, may also be used as initial guess by iterative solvers. Note: this method is a convenience method that calls the virtual solve() method.

◆ solve() [2/2]

virtual LinearSolverReport Opm::LinearSolverInterface::solve ( const int  size,
const int  nonzeros,
const int *  ia,
const int *  ja,
const double *  sa,
const double *  rhs,
double *  solution,
const boost::any &  add = boost::any() 
) const
pure 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.

Implemented in Opm::LinearSolverPetsc, Opm::LinearSolverFactory, Opm::LinearSolverUmfpack, Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, Opm::LinearSolverUmfpack, and Opm::LinearSolverIstl.


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