Opm::NonlinearSolver< TypeTag, PhysicalModel > Class Template Reference

#include <NonlinearSolver.hpp>

Classes

struct  SolverParameters
 

Public Member Functions

 NonlinearSolver (const SolverParameters &param, std::unique_ptr< PhysicalModel > model)
 
SimulatorReportSingle step (const SimulatorTimerInterface &timer)
 
const SimulatorReportSinglefailureReport () const
 return the statistics if the step() method failed More...
 
int linearizations () const
 Number of linearizations used in all calls to step(). More...
 
int nonlinearIterations () const
 Number of full nonlinear solver iterations used in all calls to step(). More...
 
int linearIterations () const
 Number of linear solver iterations used in all calls to step(). More...
 
int wellIterations () const
 Number of well iterations used in all calls to step(). More...
 
int nonlinearIterationsLastStep () const
 Number of nonlinear solver iterations used in the last call to step(). More...
 
int linearIterationsLastStep () const
 Number of linear solver iterations used in the last call to step(). More...
 
int wellIterationsLastStep () const
 Number of well iterations used in all calls to step(). More...
 
std::vector< std::vector< double > > computeFluidInPlace (const std::vector< int > &fipnum) const
 
const PhysicalModel & model () const
 Reference to physical model. More...
 
PhysicalModel & model ()
 Mutable reference to physical model. More...
 
void detectOscillations (const std::vector< std::vector< double > > &residualHistory, const int it, bool &oscillate, bool &stagnate) const
 Detect oscillation or stagnation in a given residual history. More...
 
template<class BVector >
void stabilizeNonlinearUpdate (BVector &dx, BVector &dxOld, const double omega) const
 
double relaxMax () const
 The greatest relaxation factor (i.e. smallest factor) allowed. More...
 
double relaxIncrement () const
 The step-change size for the relaxation factor. More...
 
NonlinearRelaxType relaxType () const
 The relaxation type (Dampen or SOR). More...
 
double relaxRelTol () const
 The relaxation relative tolerance. More...
 
int maxIter () const
 The maximum number of nonlinear iterations allowed. More...
 
int minIter () const
 The minimum number of nonlinear iterations allowed. More...
 
void setParameters (const SolverParameters &param)
 Set parameters to override those given at construction time. More...
 

Detailed Description

template<class TypeTag, class PhysicalModel>
class Opm::NonlinearSolver< TypeTag, PhysicalModel >

A nonlinear solver class suitable for general fully-implicit models, as well as pressure, transport and sequential models.

Constructor & Destructor Documentation

◆ NonlinearSolver()

template<class TypeTag , class PhysicalModel >
Opm::NonlinearSolver< TypeTag, PhysicalModel >::NonlinearSolver ( const SolverParameters param,
std::unique_ptr< PhysicalModel >  model 
)
inline

Construct solver for a given model.

The model is a std::unique_ptr because the object to which model points to is not allowed to be deleted as long as the NonlinearSolver object exists.

Parameters
[in]paramparameters controlling nonlinear process
[in,out]modelphysical simulation model.

Member Function Documentation

◆ computeFluidInPlace()

template<class TypeTag , class PhysicalModel >
std::vector< std::vector< double > > Opm::NonlinearSolver< TypeTag, PhysicalModel >::computeFluidInPlace ( const std::vector< int > &  fipnum) const
inline

◆ detectOscillations()

template<class TypeTag , class PhysicalModel >
void Opm::NonlinearSolver< TypeTag, PhysicalModel >::detectOscillations ( const std::vector< std::vector< double > > &  residualHistory,
const int  it,
bool &  oscillate,
bool &  stagnate 
) const
inline

Detect oscillation or stagnation in a given residual history.

References Opm::detail::detectOscillations().

◆ failureReport()

template<class TypeTag , class PhysicalModel >
const SimulatorReportSingle & Opm::NonlinearSolver< TypeTag, PhysicalModel >::failureReport ( ) const
inline

return the statistics if the step() method failed

◆ linearIterations()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::linearIterations ( ) const
inline

Number of linear solver iterations used in all calls to step().

◆ linearIterationsLastStep()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::linearIterationsLastStep ( ) const
inline

Number of linear solver iterations used in the last call to step().

◆ linearizations()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::linearizations ( ) const
inline

Number of linearizations used in all calls to step().

◆ maxIter()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::maxIter ( ) const
inline

◆ minIter()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::minIter ( ) const
inline

◆ model() [1/2]

template<class TypeTag , class PhysicalModel >
PhysicalModel & Opm::NonlinearSolver< TypeTag, PhysicalModel >::model ( )
inline

Mutable reference to physical model.

◆ model() [2/2]

template<class TypeTag , class PhysicalModel >
const PhysicalModel & Opm::NonlinearSolver< TypeTag, PhysicalModel >::model ( ) const
inline

Reference to physical model.

◆ nonlinearIterations()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::nonlinearIterations ( ) const
inline

Number of full nonlinear solver iterations used in all calls to step().

◆ nonlinearIterationsLastStep()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::nonlinearIterationsLastStep ( ) const
inline

Number of nonlinear solver iterations used in the last call to step().

◆ relaxIncrement()

template<class TypeTag , class PhysicalModel >
double Opm::NonlinearSolver< TypeTag, PhysicalModel >::relaxIncrement ( ) const
inline

The step-change size for the relaxation factor.

References Opm::NonlinearSolver< TypeTag, PhysicalModel >::SolverParameters::relaxIncrement_.

◆ relaxMax()

template<class TypeTag , class PhysicalModel >
double Opm::NonlinearSolver< TypeTag, PhysicalModel >::relaxMax ( ) const
inline

The greatest relaxation factor (i.e. smallest factor) allowed.

References Opm::NonlinearSolver< TypeTag, PhysicalModel >::SolverParameters::relaxMax_.

◆ relaxRelTol()

template<class TypeTag , class PhysicalModel >
double Opm::NonlinearSolver< TypeTag, PhysicalModel >::relaxRelTol ( ) const
inline

◆ relaxType()

template<class TypeTag , class PhysicalModel >
NonlinearRelaxType Opm::NonlinearSolver< TypeTag, PhysicalModel >::relaxType ( ) const
inline

◆ setParameters()

template<class TypeTag , class PhysicalModel >
void Opm::NonlinearSolver< TypeTag, PhysicalModel >::setParameters ( const SolverParameters param)
inline

Set parameters to override those given at construction time.

◆ stabilizeNonlinearUpdate()

template<class TypeTag , class PhysicalModel >
template<class BVector >
void Opm::NonlinearSolver< TypeTag, PhysicalModel >::stabilizeNonlinearUpdate ( BVector &  dx,
BVector &  dxOld,
const double  omega 
) const
inline

Apply a stabilization to dx, depending on dxOld and relaxation parameters. Implemention for Dune block vectors.

References Opm::NonlinearSolver< TypeTag, PhysicalModel >::relaxType(), and Opm::detail::stabilizeNonlinearUpdate().

◆ step()

◆ wellIterations()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::wellIterations ( ) const
inline

Number of well iterations used in all calls to step().

◆ wellIterationsLastStep()

template<class TypeTag , class PhysicalModel >
int Opm::NonlinearSolver< TypeTag, PhysicalModel >::wellIterationsLastStep ( ) const
inline

Number of well iterations used in all calls to step().


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