Opm::LinearSolverIstl Class Reference

Concrete class encapsulating some dune-istl linear solvers. More...

#include <LinearSolverIstl.hpp>

Inheritance diagram for Opm::LinearSolverIstl:
Opm::LinearSolverInterface

Public Member Functions

 LinearSolverIstl ()
 Default constructor. More...
 
 LinearSolverIstl (const ParameterGroup &param)
 Construct from parameters Accepted parameters are, with defaults, listed in the default constructor. More...
 
virtual ~LinearSolverIstl ()
 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 &comm=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...
 
template<class O , class S , class C >
LinearSolverInterface::LinearSolverReport solveSystem (O &opA, double *solution, const double *rhs, S &sp, const C &comm, int maxit) const
 
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...
 
- 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 dune-istl linear solvers.

Constructor & Destructor Documentation

◆ LinearSolverIstl() [1/2]

Opm::LinearSolverIstl::LinearSolverIstl ( )

Default constructor.

All parameters controlling the solver are defaulted: linsolver_residual_tolerance 1e-8 linsolver_verbosity 0 linsolver_type 1 ( = CG_AMG), alternatives are: CG_ILU0 = 0, CG_AMG = 1, BiCGStab_ILU0 = 2 FastAMG=3, KAMG=4 }; linsolver_save_system false linsolver_save_filename <empty string>=""> linsolver_max_iterations 0 (unlimited=5000) linsolver_residual_tolerance 1e-8 linsolver_smooth_steps 2 linsolver_prolongate_factor 1.6 linsolver_verbosity 0

◆ LinearSolverIstl() [2/2]

Opm::LinearSolverIstl::LinearSolverIstl ( const ParameterGroup param)

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

Member Function Documentation

◆ getTolerance()

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

Get tolerance ofthe linear solver.

Parameters
[out]tolerancevalue

Implements Opm::LinearSolverInterface.

◆ setTolerance()

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

Set tolerance for the residual in dune istl linear solver.

Parameters
[in]toltolerance value

Implements Opm::LinearSolverInterface.

◆ solve() [1/3]

LinearSolverInterface::LinearSolverReport Opm::LinearSolverInterface::solve

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/3]

virtual LinearSolverReport Opm::LinearSolverInterface::solve

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.

◆ solve() [3/3]

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