Loading...
Searching...
No Matches
Opm::Linear::ConvergenceCriterion< Vector > Class Template Referenceabstract
Linear

Base class for all convergence criteria which only defines an virtual API. More...

`#include <convergencecriterion.hh>`

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

## Public Member Functions

virtual | ~ConvergenceCriterion ()
| Destructor.
virtual void | setInitial (const Vector &curSol, const Vector &curResid)=0
| Set the initial solution of the linear system of equations.
virtual void | update (const Vector &curSol, const Vector &changeIndicator, const Vector &curResid)=0
| Update the internal members of the convergence criterion with the current solution.
virtual bool | converged () const =0
| Returns true if and only if the convergence criterion is met.
virtual bool | failed () const
| Returns true if the convergence criterion cannot be met anymore because the solver has broken down.
virtual Scalar | accuracy () const =0
| Returns the accuracy of the solution at the last update.
virtual void | printInitial (std::ostream &=std::cout) const
| Prints the initial information about the convergence behaviour.
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::ConvergenceCriterion< Vector >

Base class for all convergence criteria which only defines an virtual API.

## Constructor & Destructor Documentation

## ~ConvergenceCriterion()

template<class Vector>

virtual Opm::Linear::ConvergenceCriterion< Vector >::~ConvergenceCriterion | ( |  | ) |

inline virtual

Destructor.

In the ConvergenceCriterion it does not do anything, but it is required to be declared virtual.

## Member Function Documentation

## accuracy()

template<class Vector>

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

pure virtual

Returns the accuracy of the solution at the last update.

A value of zero means that the solution was exact.

Implemented in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, Opm::Linear::FixPointCriterion< Vector, CollectiveCommunication >, Opm::Linear::ResidReductionCriterion< Vector >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

## converged()

template<class Vector>

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

pure virtual

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

Implemented in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, Opm::Linear::FixPointCriterion< Vector, CollectiveCommunication >, Opm::Linear::ResidReductionCriterion< Vector >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

## failed()

template<class Vector>

virtual bool Opm::Linear::ConvergenceCriterion< Vector >::failed | ( |  | ) | const

inline virtual

Returns true if the convergence criterion cannot be met anymore because the solver has broken down.

Reimplemented in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

## print()

template<class Vector>

virtual void Opm::Linear::ConvergenceCriterion< Vector >::print | ( | Scalar | ,
|  | std::ostream & | = std::cout ) const

inline virtual

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>

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

inline 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 in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, Opm::Linear::ResidReductionCriterion< Vector >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

## setInitial()

template<class Vector>

virtual void Opm::Linear::ConvergenceCriterion< Vector >::setInitial | ( | const Vector & | curSol,
|  | const Vector & | curResid )

pure 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

Implemented in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, Opm::Linear::FixPointCriterion< Vector, CollectiveCommunication >, Opm::Linear::ResidReductionCriterion< Vector >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

## update()

template<class Vector>

virtual void Opm::Linear::ConvergenceCriterion< Vector >::update | ( | const Vector & | curSol,
|  | const Vector & | changeIndicator,
|  | const Vector & | curResid )

pure virtual

Update the internal members of the convergence criterion with the current solution.

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
  changeIndicator | A vector where all non-zero values indicate that the solution has changed since the last iteration.
  curResid | The residual vector of the current iterative solution of the linear system of equations

Implemented in Opm::Linear::CombinedCriterion< Vector, CollectiveCommunication >, Opm::Linear::FixPointCriterion< Vector, CollectiveCommunication >, Opm::Linear::ResidReductionCriterion< Vector >, and Opm::Linear::WeightedResidualReductionCriterion< Vector, CollectiveCommunication >.

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

- opm/simulators/linalg/convergencecriterion.hh