|
opm-simulators
|
Class for setting up ISTL linear solvers for TPSA. More...
#include <ISTLSolverTPSA.hpp>
Public Member Functions | |
| ISTLSolverTPSA (const Simulator &simulator) | |
| Constructor. | |
| void | initialize () |
| Setup linear solver object based on runtime/default parameters. | |
| void | initPrepare (const Matrix &M, Vector &b) |
| Prepare matix and rhs vector for linear solve. | |
| void | prepare (const Matrix &M, Vector &b) override |
| Prepare the solver with the given matrix and right-hand side vector. | |
| void | prepare (const SparseMatrixAdapter &M, Vector &b) override |
| Prepare the solver with the given matrix and right-hand side vector. | |
| void | prepareFlexibleSolver () |
| Prepare linear solver. | |
| bool | solve (Vector &x) override |
| Solve the system of equations Ax = b. | |
| void | resetSolveCount () |
| Reset number of solver calls to zero. | |
| void | eraseMatrix () override |
| Signals that the memory for the matrix internally in the solver could be erased. | |
| void | setActiveSolver (int) override |
| Set the active solver by its index. | |
| int | numAvailableSolvers () const override |
| Get the number of available solvers. | |
| void | setResidual (Vector &) override |
| Set the residual vector. | |
| void | setMatrix (const SparseMatrixAdapter &) override |
| Set the matrix for the solver. | |
| void | getResidual (Vector &b) const override |
| Get the residual vector. | |
| int | getSolveCount () const override |
| Get the count of how many times the solver has been called. | |
| int | iterations () const override |
| Get the number of iterations used in the last solve. | |
| const CommunicationType * | comm () const override |
| Get the communication object used by the solver. | |
| Public Member Functions inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapterTPSA >, GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > > | |
| virtual void | prepare (const Matrix &M, GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > &b)=0 |
| Prepare the solver with the given matrix and right-hand side vector. | |
| virtual void | setResidual (GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > &b)=0 |
| Set the residual vector. | |
| virtual void | getResidual (GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > &b) const=0 |
| Get the residual vector. | |
| virtual void | setMatrix (const GetPropType< TypeTag, Properties::SparseMatrixAdapterTPSA > &M)=0 |
| Set the matrix for the solver. | |
| virtual bool | solve (GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > &x)=0 |
| Solve the system of equations Ax = b. | |
Static Public Member Functions | |
| static void | registerParameters () |
| Register runtime/default parameters for linear solver. | |
Protected Member Functions | |
| bool | isParallel () const |
| Check for parallel session. | |
| bool | checkConvergence (const Dune::InverseOperatorResult &result) const |
| Check for linear solver convergence. | |
| Matrix & | getMatrix () |
| Get reference to system matrix object. | |
| const Matrix & | getMatrix () const |
| Get reference to system matrix object. | |
Protected Attributes | |
| const Simulator & | simulator_ |
| std::any | parallelInformation_ |
| int | solveCount_ |
| int | iterations_ |
| detail::FlexibleSolverInfo< Matrix, Vector, CommunicationType > | flexibleSolver_ |
| TpsaLinearSolverParameters | parameters_ |
| PropertyTree | prm_ |
| Matrix * | matrix_ |
| Vector * | rhs_ |
| std::shared_ptr< CommunicationType > | comm_ |
| std::vector< int > | overlapRows_ |
Additional Inherited Members | |
| Public Types inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapterTPSA >, GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > > | |
| using | CommunicationType |
| using | Matrix |
| Static Protected Member Functions inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapterTPSA >, GetPropType< TypeTag, Properties::GlobalEqVectorTPSA > > | |
| static bool | checkConvergence (const Dune::InverseOperatorResult &result, const FlowLinearSolverParameters ¶meters) |
| Check the convergence of the linear solver. | |
Class for setting up ISTL linear solvers for TPSA.
Implements AbstractISTLSolver interface for TPSA linear solvers.
|
inline |
Constructor.
| simulator | Simulator object |
|
inlineprotected |
Check for linear solver convergence.
| result | Linear solver result container |
|
inlineoverridevirtual |
Get the communication object used by the solver.
This method returns a pointer to the communication object used by the solver.
|
inlineoverridevirtual |
Signals that the memory for the matrix internally in the solver could be erased.
|
inlineprotected |
Get reference to system matrix object.
|
inlineprotected |
Get reference to system matrix object.
|
inlineoverride |
Get the residual vector.
This method retrieves the current residual vector from the solver.
| b | The vector to store the residual. |
|
inlineoverridevirtual |
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.
|
inline |
Prepare matix and rhs vector for linear solve.
| M | System matrix |
| b | Right-hand side vector |
|
inlineprotected |
Check for parallel session.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Get the number of available solvers.
|
inlineoverride |
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. |
|
inlineoverride |
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. |
|
inline |
Prepare linear solver.
Create linear solver using FlexibleSolverInfo struct from ISTLSolver.hpp, or update preconditioner if solver has been created
|
inlineoverridevirtual |
Set the active solver by its index.
| num | The index of the solver to set as active. |
|
inlineoverride |
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. |
|
inlineoverride |
Set the residual vector.
This method sets the residual vector for the solver.
| b | The residual vector to set. |
|
inlineoverride |
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: