#include <LinearSolverFactory.hpp>
|
| LinearSolverFactory () |
| Default constructor. More...
|
|
| LinearSolverFactory (const ParameterGroup ¶m) |
|
virtual | ~LinearSolverFactory () |
| Destructor. 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 |
|
virtual void | setTolerance (const double tol) |
|
virtual double | getTolerance () const |
|
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 |
|
Concrete class encapsulating any available linear solver. For the moment, this means UMFPACK and dune-istl. Since both are optional dependencies, either or both may be unavailable, depending on configuration.
◆ LinearSolverFactory() [1/2]
Opm::LinearSolverFactory::LinearSolverFactory |
( |
| ) |
|
◆ LinearSolverFactory() [2/2]
Opm::LinearSolverFactory::LinearSolverFactory |
( |
const ParameterGroup & |
param | ) |
|
Construct from parameters. The accepted parameters are (default) (allowed values): linsolver ("umfpack") ("umfpack", "istl", "petsc") For the umfpack solver to be available, this class must be compiled with UMFPACK support, as indicated by the variable HAVE_SUITESPARSE_UMFPACK_H in config.h. For the istl solver to be available, this class must be compiled with dune-istl support, as indicated by the variable HAVE_DUNE_ISTL in config.h. For the petsc solver to be available, this class must be compiled with petsc support, as indicated by the variable HAVE_PETSC in config.h. Any further parameters are passed on to the constructors of the actual solver used, see LinearSolverUmfpack, LinearSolverIstl and LinearSolverPetsc for details.
◆ ~LinearSolverFactory()
virtual Opm::LinearSolverFactory::~LinearSolverFactory |
( |
| ) |
|
|
virtual |
◆ getTolerance()
virtual double Opm::LinearSolverFactory::getTolerance |
( |
| ) |
const |
|
virtual |
◆ setTolerance()
virtual void Opm::LinearSolverFactory::setTolerance |
( |
const double |
tol | ) |
|
|
virtual |
◆ solve() [1/3]
Solve a linear system, with a matrix given in compressed sparse row format. - Parameters
-
[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. |
◆ solve() [2/3]
virtual LinearSolverReport Opm::LinearSolverFactory::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 |
|
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] | 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. |
Implements Opm::LinearSolverInterface.
◆ solve() [3/3]
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 |
|
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] | 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. |
Implements Opm::LinearSolverInterface.
The documentation for this class was generated from the following file:
|