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

Concrete class encapsulating any available linear solver. More...

#include <LinearSolverFactory.hpp>

Inheritance diagram for Opm::LinearSolverFactory:
Opm::LinearSolverInterface

Public Member Functions

 LinearSolverFactory ()
 Default constructor.
 
 LinearSolverFactory (const ParameterGroup &param)
 Construct from parameters. More...
 
virtual ~LinearSolverFactory ()
 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 &add=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 linear solver. More...
 
virtual double getTolerance () const
 Get tolerance for the 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 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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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

Get tolerance for the linear solver.

Parameters
[out]tolerancevalue Not used for LinearSolverFactory. Returns -1.

Implements Opm::LinearSolverInterface.

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

Set tolerance for the linear solver.

Parameters
[in]toltolerance value Not used for LinearSolverFactory

Implements Opm::LinearSolverInterface.

LinearSolverInterface::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]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: