#include <ISTLSolver.hpp>

Inheritance diagram for Opm::ISTLSolver< TypeTag >:
Inheritance graph

Public Types

using AssembledLinearOperatorType = Dune::AssembledLinearOperator< Matrix, Vector, Vector >
 

Public Member Functions

 ISTLSolver (const Simulator &simulator, const FlowLinearSolverParameters &parameters, bool forceSerial=false)
 
 ISTLSolver (const Simulator &simulator)
 
void initialize ()
 
void eraseMatrix ()
 
void setActiveSolver (const int num)
 
int numAvailableSolvers ()
 
void initPrepare (const Matrix &M, Vector &b)
 
void prepare (const SparseMatrixAdapter &M, Vector &b)
 
void prepare (const Matrix &M, Vector &b)
 
void setResidual (Vector &)
 
void getResidual (Vector &b) const
 
void setMatrix (const SparseMatrixAdapter &)
 
int getSolveCount () const
 
void resetSolveCount ()
 
bool solve (Vector &x)
 
int iterations () const
 
const std::any & parallelInformation () const
 
const CommunicationTypecomm () const
 

Static Public Member Functions

static void registerParameters ()
 

Protected Types

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 CommunicationType = Dune::OwnerOverlapCopyCommunication< int, int >
 
using Comm = Dune::OwnerOverlapCopyCommunication< int, int >
 

Protected Member Functions

void checkConvergence (const Dune::InverseOperatorResult &result) const
 
bool isParallel () const
 
void prepareFlexibleSolver ()
 
bool shouldCreateSolver () const
 
std::function< Vector()> getWeightsCalculator (const PropertyTree &prm, const Matrix &matrix, std::size_t pressIndex) const
 
MatrixgetMatrix ()
 
const MatrixgetMatrix () const
 

Protected Attributes

const Simulatorsimulator_
 
int iterations_
 
int solveCount_
 
bool converged_
 
std::any parallelInformation_
 
Matrixmatrix_
 
Vectorrhs_
 
int activeSolverNum_ = 0
 
std::vector< detail::FlexibleSolverInfo< Matrix, Vector, CommunicationType > > flexibleSolver_
 
std::vector< int > overlapRows_
 
std::vector< int > interiorRows_
 
bool useWellConn_
 
std::vector< FlowLinearSolverParametersparameters_
 
bool forceSerial_ = false
 
std::vector< PropertyTreeprm_
 
std::shared_ptr< CommunicationTypecomm_
 

Static Protected Attributes

static constexpr std::size_t pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx
 

Detailed Description

template<class TypeTag>
class Opm::ISTLSolver< TypeTag >

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 .

Member Typedef Documentation

◆ AbstractOperatorType

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::AbstractOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
protected

◆ AbstractPreconditionerType

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::AbstractPreconditionerType = Dune::PreconditionerWithUpdate<Vector, Vector>
protected

◆ AbstractSolverType

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::AbstractSolverType = Dune::InverseOperator<Vector, Vector>
protected

◆ AssembledLinearOperatorType

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::AssembledLinearOperatorType = Dune::AssembledLinearOperator< Matrix, Vector, Vector >

◆ Comm

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Comm = Dune::OwnerOverlapCopyCommunication<int, int>
protected

◆ CommunicationType

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::CommunicationType = Dune::OwnerOverlapCopyCommunication<int,int>
protected

◆ ElementContext

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::ElementContext = GetPropType<TypeTag, Properties::ElementContext>
protected

◆ ElementMapper

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
protected

◆ GridView

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::GridView = GetPropType<TypeTag, Properties::GridView>
protected

◆ Indices

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Indices = GetPropType<TypeTag, Properties::Indices>
protected

◆ Matrix

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Matrix = typename SparseMatrixAdapter::IstlMatrix
protected

◆ Scalar

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Scalar = GetPropType<TypeTag, Properties::Scalar>
protected

◆ Simulator

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Simulator = GetPropType<TypeTag, Properties::Simulator>
protected

◆ SparseMatrixAdapter

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
protected

◆ ThreadManager

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>
protected

◆ Vector

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::Vector = GetPropType<TypeTag, Properties::GlobalEqVector>
protected

◆ WellModel

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::WellModel = GetPropType<TypeTag, Properties::WellModel>
protected

◆ WellModelOperator

template<class TypeTag >
using Opm::ISTLSolver< TypeTag >::WellModelOperator = WellModelAsLinearOperator<WellModel, Vector, Vector>
protected

Constructor & Destructor Documentation

◆ ISTLSolver() [1/2]

template<class TypeTag >
Opm::ISTLSolver< TypeTag >::ISTLSolver ( const Simulator simulator,
const FlowLinearSolverParameters parameters,
bool  forceSerial = false 
)
inline

Construct a system solver.

Parameters
[in]simulatorThe opm-models simulator object
[in]parametersExplicit parameters for solver setup, do not read them from command line parameters.
[in]forceSerialIf true, will set up a serial linear solver only, local to the current rank, instead of creating a parallel (MPI distributed) linear solver.

References Opm::ISTLSolver< TypeTag >::initialize().

◆ ISTLSolver() [2/2]

template<class TypeTag >
Opm::ISTLSolver< TypeTag >::ISTLSolver ( const Simulator simulator)
inlineexplicit

Construct a system solver.

Parameters
[in]simulatorThe opm-models simulator object

References Opm::ISTLSolver< TypeTag >::initialize(), Opm::ISTLSolver< TypeTag >::parameters_, and Opm::ISTLSolver< TypeTag >::simulator_.

Member Function Documentation

◆ checkConvergence()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::checkConvergence ( const Dune::InverseOperatorResult &  result) const
inlineprotected

◆ comm()

template<class TypeTag >
const CommunicationType * Opm::ISTLSolver< TypeTag >::comm ( ) const
inline

◆ eraseMatrix()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::eraseMatrix ( )
inline

◆ getMatrix() [1/2]

◆ getMatrix() [2/2]

template<class TypeTag >
const Matrix & Opm::ISTLSolver< TypeTag >::getMatrix ( ) const
inlineprotected

◆ getResidual()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::getResidual ( Vector b) const
inline

◆ getSolveCount()

template<class TypeTag >
int Opm::ISTLSolver< TypeTag >::getSolveCount ( ) const
inline

◆ getWeightsCalculator()

template<class TypeTag >
std::function< Vector()> Opm::ISTLSolver< TypeTag >::getWeightsCalculator ( const PropertyTree prm,
const Matrix matrix,
std::size_t  pressIndex 
) const
inlineprotected

◆ initialize()

◆ initPrepare()

◆ isParallel()

◆ iterations()

template<class TypeTag >
int Opm::ISTLSolver< TypeTag >::iterations ( ) const
inline

Solve the system of linear equations Ax = b, with A being the combined derivative matrix of the residual and b being the residual itself.

Parameters
[in]residualresidual object containing A and b.
Returns
the solution x

References Opm::ISTLSolver< TypeTag >::iterations_.

Referenced by Opm::ISTLSolver< TypeTag >::shouldCreateSolver().

◆ numAvailableSolvers()

template<class TypeTag >
int Opm::ISTLSolver< TypeTag >::numAvailableSolvers ( )
inline

◆ parallelInformation()

template<class TypeTag >
const std::any & Opm::ISTLSolver< TypeTag >::parallelInformation ( ) const
inline

◆ prepare() [1/2]

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::prepare ( const Matrix M,
Vector b 
)
inline

◆ prepare() [2/2]

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::prepare ( const SparseMatrixAdapter M,
Vector b 
)
inline

◆ prepareFlexibleSolver()

◆ registerParameters()

template<class TypeTag >
static void Opm::ISTLSolver< TypeTag >::registerParameters ( )
inlinestatic

◆ resetSolveCount()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::resetSolveCount ( )
inline

◆ setActiveSolver()

◆ setMatrix()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::setMatrix ( const SparseMatrixAdapter )
inline

◆ setResidual()

template<class TypeTag >
void Opm::ISTLSolver< TypeTag >::setResidual ( Vector )
inline

◆ shouldCreateSolver()

template<class TypeTag >
bool Opm::ISTLSolver< TypeTag >::shouldCreateSolver ( ) const
inlineprotected

◆ solve()

Member Data Documentation

◆ activeSolverNum_

◆ comm_

◆ converged_

template<class TypeTag >
bool Opm::ISTLSolver< TypeTag >::converged_
mutableprotected

◆ flexibleSolver_

◆ forceSerial_

template<class TypeTag >
bool Opm::ISTLSolver< TypeTag >::forceSerial_ = false
protected

◆ interiorRows_

template<class TypeTag >
std::vector<int> Opm::ISTLSolver< TypeTag >::interiorRows_
protected

◆ iterations_

template<class TypeTag >
int Opm::ISTLSolver< TypeTag >::iterations_
mutableprotected

◆ matrix_

◆ overlapRows_

template<class TypeTag >
std::vector<int> Opm::ISTLSolver< TypeTag >::overlapRows_
protected

◆ parallelInformation_

template<class TypeTag >
std::any Opm::ISTLSolver< TypeTag >::parallelInformation_
protected

◆ parameters_

◆ pressureIndex

template<class TypeTag >
constexpr std::size_t Opm::ISTLSolver< TypeTag >::pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx
staticconstexprprotected

◆ prm_

◆ rhs_

◆ simulator_

◆ solveCount_

◆ useWellConn_


The documentation for this class was generated from the following files: