Abstract interface for linear solvers. More...
#include <LinearSolverInterface.hpp>
Classes | |
struct | LinearSolverReport |
Struct for reporting data about the solution process back to the caller. More... | |
Public Member Functions | |
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... | |
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 |
Solve a linear system, with a matrix given in compressed sparse row format. More... | |
virtual void | setTolerance (const double tol)=0 |
Set tolerance for the linear solver. More... | |
virtual double | getTolerance () const =0 |
Get tolerance for the linear solver. More... | |
Abstract interface for linear solvers.
|
pure virtual |
Get tolerance for the linear solver.
[out] | tolerance | value |
Implemented in Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, and Opm::LinearSolverUmfpack.
|
pure virtual |
Set tolerance for the linear solver.
[in] | tol | tolerance value |
Implemented in Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, and Opm::LinearSolverUmfpack.
LinearSolverInterface::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.
[in] | A | matrix in CSR format |
[in] | rhs | array of length A->m containing the right hand side |
[in,out] | solution | array 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. |
|
pure virtual |
Solve a linear system, with a matrix given in compressed sparse row format.
[in] | size | # of rows in matrix |
[in] | nonzeros | # of nonzeros elements in matrix |
[in] | ia | array of length (size + 1) containing start and end indices for each row |
[in] | ja | array of length nonzeros containing column numbers for the nonzero elements |
[in] | sa | array of length nonzeros containing the values of the nonzero elements |
[in] | rhs | array of length size containing the right hand side |
[in,out] | solution | array of length size to which the solution will be written, may also be used as initial guess by iterative solvers. |
Implemented in Opm::LinearSolverFactory, Opm::LinearSolverIstl, Opm::LinearSolverPetsc, and Opm::LinearSolverUmfpack.