|
opm-simulators
|
This class solves the fully implicit black-oil system by solving the reduced system (after eliminating well variables) as a block-structured matrix (one block for all cell variables) for a fixed number of cell variables np . More...
#include <ISTLSolver.hpp>
Public Types | |
| using | AssembledLinearOperatorType = Dune::AssembledLinearOperator< Matrix, Vector, Vector > |
| Public Types inherited from Opm::AbstractISTLSolver< TypeTag > | |
| 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 | |
| ISTLSolver (const Simulator &simulator, const FlowLinearSolverParameters ¶meters, bool forceSerial=false) | |
| Construct a system solver. | |
| ISTLSolver (const Simulator &simulator) | |
| Construct a system solver. | |
| void | initialize () |
| void | eraseMatrix () override |
| Signals that the memory for the matrix internally in the solver could be erased. | |
| void | setActiveSolver (const int num) override |
| Set the active solver by its index. | |
| int | numAvailableSolvers () const override |
| Get the number of available solvers. | |
| void | initPrepare (const Matrix &M, Vector &b) |
| void | prepare (const SparseMatrixAdapter &M, Vector &b) override |
| Prepare the solver with the given sparse 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. | |
| int | getSolveCount () const override |
| Get the count of how many times the solver has been called. | |
| void | resetSolveCount () |
| bool | solve (Vector &x) override |
| Solve the system of equations Ax = b. | |
| int | iterations () const override |
| Solve the system of linear equations Ax = b, with A being the combined derivative matrix of the residual and b being the residual itself. | |
| const std::any & | parallelInformation () const |
| const CommunicationType * | comm () const override |
| Get the communication object used by the solver. | |
| void | setDomainIndex (const int index) |
| bool | isNlddLocalSolver () const |
Static Public Member Functions | |
| static void | registerParameters () |
Protected Types | |
| enum | { enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>() } |
| using | GridView = GetPropType<TypeTag, Properties::GridView> |
| using | Scalar = GetPropType<TypeTag, Properties::Scalar> |
| using | SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter> |
| using | Vector = GetPropType<TypeTag, Properties::GlobalEqVector> |
| using | Indices = GetPropType<TypeTag, Properties::Indices> |
| using | WellModel = GetPropType<TypeTag, Properties::WellModel> |
| using | Simulator = GetPropType<TypeTag, Properties::Simulator> |
| using | Matrix = typename SparseMatrixAdapter::IstlMatrix |
| using | ThreadManager = GetPropType<TypeTag, Properties::ThreadManager> |
| using | ElementContext = GetPropType<TypeTag, Properties::ElementContext> |
| using | AbstractSolverType = Dune::InverseOperator<Vector, Vector> |
| using | AbstractOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector> |
| using | AbstractPreconditionerType = Dune::PreconditionerWithUpdate<Vector, Vector> |
| using | WellModelOperator = WellModelAsLinearOperator<WellModel, Vector, Vector> |
| using | ElementMapper = GetPropType<TypeTag, Properties::ElementMapper> |
| using | ElementChunksType = ElementChunks<GridView, Dune::Partitions::All> |
| using | CommunicationType = Dune::Communication<int> |
Protected Member Functions | |
| bool | checkConvergence (const Dune::InverseOperatorResult &result) const |
| bool | isParallel () const |
| void | prepareFlexibleSolver () |
| bool | shouldCreateSolver () const |
| Return true if we should (re)create the whole solver, instead of just calling update() on the preconditioner. | |
| std::function< Vector()> | getWeightsCalculator (const PropertyTree &prm, const Matrix &matrix, std::size_t pressIndex) const |
| Matrix & | getMatrix () |
| const Matrix & | getMatrix () const |
Protected Attributes | |
| const Simulator & | simulator_ |
| int | iterations_ |
| int | solveCount_ |
| std::any | parallelInformation_ |
| Matrix * | matrix_ |
| Vector * | rhs_ |
| int | activeSolverNum_ = 0 |
| std::vector< detail::FlexibleSolverInfo< Matrix, Vector, CommunicationType > > | flexibleSolver_ |
| std::vector< int > | overlapRows_ |
| std::vector< int > | interiorRows_ |
| int | domainIndex_ = -1 |
| bool | useWellConn_ |
| std::vector< FlowLinearSolverParameters > | parameters_ |
| bool | forceSerial_ = false |
| std::vector< PropertyTree > | prm_ |
| std::shared_ptr< CommunicationType > | comm_ |
| std::unique_ptr< ElementChunksType > | element_chunks_ |
Static Protected Attributes | |
| static constexpr std::size_t | pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx |
| static constexpr bool | isIncompatibleWithCprw = enablePolymerMolarWeight |
Additional Inherited Members | |
| Static Protected Member Functions inherited from Opm::AbstractISTLSolver< TypeTag > | |
| static bool | checkConvergence (const Dune::InverseOperatorResult &result, const FlowLinearSolverParameters ¶meters) |
| Check the convergence of the linear solver. | |
This class solves the fully implicit black-oil system by solving the reduced system (after eliminating well variables) as a block-structured matrix (one block for all cell variables) for a fixed number of cell variables np .
|
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.
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
Signals that the memory for the matrix internally in the solver could be erased.
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
Get the residual vector.
This method retrieves the current residual vector from the solver.
| b | The vector to store the residual. |
Implements Opm::AbstractISTLSolver< TypeTag >.
Reimplemented in Opm::ISTLSolverGpuBridge< TypeTag >.
|
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.
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
Solve the system of linear equations Ax = b, with A being the combined derivative matrix of the residual and b being the residual itself.
| [in] | residual | residual object containing A and b. |
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
Get the number of available solvers.
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inline |
|
inlineoverridevirtual |
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. |
Implements Opm::AbstractISTLSolver< TypeTag >.
Reimplemented in Opm::ISTLSolverGpuBridge< TypeTag >.
|
inlineoverridevirtual |
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. |
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
Set the active solver by its index.
| num | The index of the solver to set as active. |
Implements Opm::AbstractISTLSolver< TypeTag >.
|
inlineoverridevirtual |
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. |
Implements Opm::AbstractISTLSolver< TypeTag >.
Reimplemented in Opm::ISTLSolverGpuBridge< TypeTag >.
|
inlineoverridevirtual |
Set the residual vector.
This method sets the residual vector for the solver.
| b | The residual vector to set. |
Implements Opm::AbstractISTLSolver< TypeTag >.
Reimplemented in Opm::ISTLSolverGpuBridge< TypeTag >.
|
inlineoverridevirtual |
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:
Implements Opm::AbstractISTLSolver< TypeTag >.
Reimplemented in Opm::ISTLSolverGpuBridge< TypeTag >.