|
opm-simulators
|
ISTL solver for GPU using the GPU ISTL backend. More...
#include <ISTLSolverGPUISTL.hpp>
Public Types | |
| using | SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter> |
| using | Vector = GetPropType<TypeTag, Properties::GlobalEqVector> |
| using | Simulator = GetPropType<TypeTag, Properties::Simulator> |
| using | ElementMapper = GetPropType<TypeTag, Properties::ElementMapper> |
| using | Matrix = typename SparseMatrixAdapter::IstlMatrix |
| using | ThreadManager = GetPropType<TypeTag, Properties::ThreadManager> |
| using | GridView = GetPropType<TypeTag, Properties::GridView> |
| using | ElementContext = GetPropType<TypeTag, Properties::ElementContext> |
| using | ElementChunksType = Opm::ElementChunks<GridView, Dune::Partitions::All> |
| using | real_type = typename Vector::field_type |
| using | GPUMatrix = Opm::gpuistl::GpuSparseMatrixWrapper<real_type> |
| using | GPUVector = Opm::gpuistl::GpuVector<real_type> |
| using | GPUVectorInt = Opm::gpuistl::GpuVector<int> |
| using | CommunicationType = Dune::Communication<int> |
| using | SolverType = Opm::gpuistl::detail::FlexibleSolverWrapper<GPUMatrix, GPUVector, CommunicationType> |
| Public Types inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapter >, GetPropType< TypeTag, Properties::GlobalEqVector > > | |
| using | CommunicationType |
| using | Matrix |
Public Member Functions | |
| ISTLSolverGPUISTL (const Simulator &simulator, const FlowLinearSolverParameters ¶meters, bool forceSerial=false) | |
| Construct a system solver. | |
| ISTLSolverGPUISTL (const Simulator &simulator) | |
| Construct a system solver. | |
| void | eraseMatrix () override |
| Signals that the memory for the matrix internally in the solver could be erased. | |
| void | setActiveSolver (int num) override |
| Set the active solver by its index. | |
| int | numAvailableSolvers () const override |
| Get the number of available solvers. | |
| void | prepare (const SparseMatrixAdapter &M, Vector &b) override |
| Prepare the solver with the given matrix and right-hand side vector. | |
| void | prepare (const Matrix &M, Vector &b) override |
| Prepare the solver with the given matrix and right-hand side vector. | |
| void | setResidual (Vector &) override |
| Set the residual vector. | |
| void | getResidual (Vector &b) const override |
| Get the residual vector. | |
| void | setMatrix (const SparseMatrixAdapter &) override |
| Set the matrix for the solver. | |
| bool | solve (Vector &x) override |
| Solve the system of linear equations Ax = b. | |
| int | iterations () const override |
| const CommunicationType * | comm () const override |
| Get the communication object used by the solver. | |
| bool | isParallel () const |
| Check if we are running in parallel mode. | |
| int | getSolveCount () const override |
| Get the count of how many times the solver has been called. | |
| Public Member Functions inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapter >, GetPropType< TypeTag, Properties::GlobalEqVector > > | |
| virtual void | prepare (const Matrix &M, GetPropType< TypeTag, Properties::GlobalEqVector > &b)=0 |
| Prepare the solver with the given matrix and right-hand side vector. | |
| virtual void | setResidual (GetPropType< TypeTag, Properties::GlobalEqVector > &b)=0 |
| Set the residual vector. | |
| virtual void | getResidual (GetPropType< TypeTag, Properties::GlobalEqVector > &b) const=0 |
| Get the residual vector. | |
| virtual void | setMatrix (const SparseMatrixAdapter &M)=0 |
| Set the matrix for the solver. | |
| virtual bool | solve (GetPropType< TypeTag, Properties::GlobalEqVector > &x)=0 |
| Solve the system of equations Ax = b. | |
Static Public Attributes | |
| static constexpr std::size_t | pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx |
Additional Inherited Members | |
| Static Protected Member Functions inherited from Opm::AbstractISTLSolver< GetPropType< TypeTag, Properties::SparseMatrixAdapter >, GetPropType< TypeTag, Properties::GlobalEqVector > > | |
| static bool | checkConvergence (const Dune::InverseOperatorResult &result, const FlowLinearSolverParameters ¶meters) |
| Check the convergence of the linear solver. | |
ISTL solver for GPU using the GPU ISTL backend.
This class implements the AbstractISTLSolver interface and provides methods to prepare the solver, set and get residuals, solve the system, and manage communication.
| TypeTag | The type tag for the properties used in this solver. |
|
inline |
Construct a system solver.
| [in] | simulator | The opm-models simulator object |
| [in] | parameters | Explicit parameters for solver setup, do not read them from command line parameters. |
| [in] | forceSerial | If true, will set up a serial linear solver only, local to the current rank, instead of creating a parallel (MPI distributed) linear solver. |
|
inlineexplicit |
Construct a system solver.
| [in] | simulator | The opm-models simulator object |
|
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.
|
inlineoverride |
Get the residual vector.
This method retrieves the current residual vector from the solver. It copies the data from the internal GPU vector to the provided vector.
| 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 |
Check if we are running in parallel mode.
|
inlineoverridevirtual |
Returns the actual number of iterations used in the last solve.
|
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 right-hand side vector. It updates the internal GPU matrix and right-hand side vector.
| M | The matrix to be used in the solver. |
| 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 right-hand side vector. It updates the internal GPU matrix and right-hand side vector.
| M | The matrix to be used in the solver. |
| b | The right-hand side vector. |
|
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 linear 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, prepare() should have been called with a valid matrix and right-hand side vector.