|
opm-simulators
|
Abstract interface for ISTL solvers. More...
#include <AbstractISTLSolver.hpp>
Public Types | |
| using | CommunicationType = Dune::Communication<int> |
| using | SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter> |
| using | Vector = GetPropType<TypeTag, Properties::GlobalEqVector> |
| using | Matrix = typename SparseMatrixAdapter::IstlMatrix |
Public Member Functions | |
| virtual void | eraseMatrix ()=0 |
| Signals that the memory for the matrix internally in the solver could be erased. | |
| virtual void | setActiveSolver (int num)=0 |
| Set the active solver by its index. | |
| virtual int | numAvailableSolvers () const =0 |
| Get the number of available solvers. | |
| virtual void | prepare (const Matrix &M, Vector &b)=0 |
| Prepare the solver with the given matrix and right-hand side vector. | |
| virtual void | prepare (const SparseMatrixAdapter &M, Vector &b)=0 |
| Prepare the solver with the given sparse matrix and right-hand side vector. | |
| virtual void | setResidual (Vector &b)=0 |
| Set the residual vector. | |
| virtual void | getResidual (Vector &b) const =0 |
| Get the residual vector. | |
| virtual void | setMatrix (const SparseMatrixAdapter &M)=0 |
| Set the matrix for the solver. | |
| virtual bool | solve (Vector &x)=0 |
| Solve the system of equations Ax = b. | |
| virtual int | iterations () const =0 |
| Get the number of iterations used in the last solve. | |
| virtual const CommunicationType * | comm () const =0 |
| Get the communication object used by the solver. | |
| virtual int | getSolveCount () const =0 |
| Get the count of how many times the solver has been called. | |
Static Protected Member Functions | |
| static bool | checkConvergence (const Dune::InverseOperatorResult &result, const FlowLinearSolverParameters ¶meters) |
| Check the convergence of the linear solver. | |
Abstract interface for ISTL solvers.
This class defines the interface for ISTL solvers used in OPM. It provides methods for preparing the solver, setting and getting residuals, solving the system, and managing communication.
|
inlinestaticprotected |
Check the convergence of the linear solver.
This method checks if the linear solver has converged based on the result and parameters.
| result | The result of the linear solver. |
| parameters | The parameters used for the linear solver. |
|
pure virtual |
Get the communication object used by the solver.
This method returns a pointer to the communication object used by the solver.
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Signals that the memory for the matrix internally in the solver could be erased.
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Get the residual vector.
This method retrieves the current residual vector from the solver.
| b | The vector to store the residual. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, Opm::ISTLSolverGpuBridge< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Get the count of how many times the solver has been called.
This method returns the number of times the solve() method has been called.
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Get the number of iterations used in the last solve.
This method returns the number of iterations that the solver performed during the last call to solve().
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Get the number of available solvers.
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Prepare the solver with the given matrix and right-hand side vector.
This method initializes the solver with the provided matrix and vector, preparing it for solving the system of equations.
| M | The matrix representing the system of equations. |
| b | The right-hand side vector. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, Opm::ISTLSolverGpuBridge< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Prepare the solver with the given sparse matrix and right-hand side vector.
This method initializes the solver with the provided sparse matrix and vector, preparing it for solving the system of equations.
| M | The sparse matrix representing the system of equations. |
| b | The right-hand side vector. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Set the active solver by its index.
| num | The index of the solver to set as active. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Set the matrix for the solver.
This method sets the matrix that the solver will use to solve the system of equations.
| M | The sparse matrix adapter containing the matrix data. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, Opm::ISTLSolverGpuBridge< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Set the residual vector.
This method sets the residual vector for the solver.
| b | The residual vector to set. |
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, Opm::ISTLSolverGpuBridge< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.
|
pure virtual |
Solve the system of equations Ax = b.
This method solves the linear system represented by the matrix A and the right-hand side vector b, storing the solution in vector x.
| x | The vector to store the solution. |
Before this function is called, the following function calls should have been made:
Implemented in Opm::gpuistl::ISTLSolverGPUISTL< TypeTag >, Opm::ISTLSolver< TypeTag >, Opm::ISTLSolverGpuBridge< TypeTag >, and Opm::ISTLSolverRuntimeOptionProxy< TypeTag >.