Loading...
Searching...
No Matches
Opm::Linear::ResidReductionCriterion< Vector > Class Template Reference
Linear

Provides a convergence criterion which looks at the reduction of the two-norm of the residual for the linear solvers. More...

`#include <residreductioncriterion.hh>`

Inheritance diagram for Opm::Linear::ResidReductionCriterion< Vector >:

## Public Member Functions

| ResidReductionCriterion (Dune::ScalarProduct< Vector > &scalarProduct, Scalar tolerance=1e-6)
void | setTolerance (Scalar tol)
| Set the maximum allowed weighted maximum of the reduction of the linear residual.
Scalar | tolerance () const
| Return the maximum allowed weighted maximum of the reduction of the linear residual.
void | setInitial (const Vector &, const Vector &curResid) override
| Set the initial solution of the linear system of equations.
void | update (const Vector &, const Vector &, const Vector &curResid) override
bool | converged () const override
| Returns true if and only if the convergence criterion is met.
Scalar | accuracy () const override
| Returns the accuracy of the solution at the last update.
void | printInitial (std::ostream &os=std::cout) const override
| Prints the initial information about the convergence behaviour.
void | print (Scalar iter, std::ostream &os=std::cout) const override
| Prints the information about the convergence behaviour for the current iteration.
Public Member Functions inherited from Opm::Linear::ConvergenceCriterion< Vector >
virtual | ~ConvergenceCriterion ()
| Destructor.
virtual bool | failed () const
| Returns true if the convergence criterion cannot be met anymore because the solver has broken down.
virtual void | print (Scalar, std::ostream &=std::cout) const
| Prints the information about the convergence behaviour for the current iteration.

## Detailed Description

template<class Vector>
class Opm::Linear::ResidReductionCriterion< Vector >

Provides a convergence criterion which looks at the reduction of the two-norm of the residual for the linear solvers.

For the ResidReductionCriterion, the error of the solution is defined as

## Member Function Documentation

## accuracy()

template<class Vector>

Scalar Opm::Linear::ResidReductionCriterion< Vector >::accuracy | ( |  | ) | const

inline override virtual

Returns the accuracy of the solution at the last update.

A value of zero means that the solution was exact.

Implements Opm::Linear::ConvergenceCriterion< Vector >.

## converged()

template<class Vector>

bool Opm::Linear::ResidReductionCriterion< Vector >::converged | ( |  | ) | const

inline override virtual

Returns true if and only if the convergence criterion is met.

Implements Opm::Linear::ConvergenceCriterion< Vector >.

## print()

template<class Vector>

void Opm::Linear::ResidReductionCriterion< Vector >::print | ( | Scalar | iter,
|  | std::ostream & | os = std::cout ) const

inline override

Prints the information about the convergence behaviour for the current iteration.

Parameters

  iter | The iteration number. The semantics of this parameter are chosen by the linear solver.
  os | The output stream to which the message gets written.

## printInitial()

template<class Vector>

void Opm::Linear::ResidReductionCriterion< Vector >::printInitial | ( | std::ostream & | os = std::cout | ) | const

inline override virtual

Prints the initial information about the convergence behaviour.

This method is called after setInitial() if the solver thinks it's a good idea to be verbose. In practice, "printing the initial information" means printing column headers and the initial state.

Parameters

  os | The output stream to which the message gets written.

Reimplemented from Opm::Linear::ConvergenceCriterion< Vector >.

## setInitial()

template<class Vector>

void Opm::Linear::ResidReductionCriterion< Vector >::setInitial | ( | const Vector & | ,
|  | const Vector & | curResid )

inline override virtual

Set the initial solution of the linear system of equations.

This version of the method does NOT take the two-norm of the residual as argument. If the two-norm of the defect is available for the linear solver, the version of the update() method with it should be called.

Parameters

  curSol | The current iterative solution of the linear system of equations
  curResid | The residual vector of the current iterative solution of the linear system of equations

Implements Opm::Linear::ConvergenceCriterion< Vector >.

## update()

template<class Vector>

void Opm::Linear::ResidReductionCriterion< Vector >::update | ( | const Vector & | ,
|  | const Vector & | ,
|  | const Vector & | curResid )

inline override virtual

Implements Opm::Linear::ConvergenceCriterion< Vector >.

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

- opm/simulators/linalg/residreductioncriterion.hh