OGS
v6.4.0
|
Convergence criterion for iterative algorithms, like nonlinear solvers.
It is able to check the difference of the solution vector between iterations and the residual of the equation being solved (e.g. the nonlinear equation system).
Definition at line 29 of file ConvergenceCriterion.h.
#include <ConvergenceCriterion.h>
Public Member Functions | |
ConvergenceCriterion (const MathLib::VecNormType norm_type) | |
virtual bool | hasDeltaXCheck () const =0 |
virtual bool | hasResidualCheck () const =0 |
virtual void | checkDeltaX (GlobalVector const &minus_delta_x, GlobalVector const &x)=0 |
virtual void | checkResidual (GlobalVector const &residual)=0 |
Check if the residual satisfies the convergence criterion. More... | |
virtual void | preFirstIteration () |
virtual void | setNoFirstIteration () |
virtual void | reset () |
virtual bool | isSatisfied () const |
Tell if the convergence criterion is satisfied. More... | |
MathLib::VecNormType | getVectorNormType () const |
virtual | ~ConvergenceCriterion ()=default |
Protected Attributes | |
bool | _satisfied = true |
bool | _is_first_iteration = true |
const MathLib::VecNormType | _norm_type |
|
inlineexplicit |
Definition at line 32 of file ConvergenceCriterion.h.
|
virtualdefault |
|
pure virtual |
Check if the change of the solution between iterations satisfies the convergence criterion.
minus_delta_x | the current solution update |
x | the new solution from the current iteration |
minus_delta_x
. x
is needed for relative tolerances. Implemented in NumLib::ConvergenceCriterionResidual, NumLib::ConvergenceCriterionPerComponentResidual, NumLib::ConvergenceCriterionPerComponentDeltaX, and NumLib::ConvergenceCriterionDeltaX.
|
pure virtual |
Check if the residual satisfies the convergence criterion.
Implemented in NumLib::ConvergenceCriterionResidual, NumLib::ConvergenceCriterionPerComponentResidual, NumLib::ConvergenceCriterionPerComponentDeltaX, and NumLib::ConvergenceCriterionDeltaX.
|
inline |
|
pure virtual |
Tells if the change of the solution between iterations is checked.
Implemented in NumLib::ConvergenceCriterionResidual, NumLib::ConvergenceCriterionPerComponentResidual, NumLib::ConvergenceCriterionPerComponentDeltaX, and NumLib::ConvergenceCriterionDeltaX.
|
pure virtual |
Tells if the residual is checked.
Implemented in NumLib::ConvergenceCriterionResidual, NumLib::ConvergenceCriterionPerComponentResidual, NumLib::ConvergenceCriterionPerComponentDeltaX, and NumLib::ConvergenceCriterionDeltaX.
|
inlinevirtual |
Tell if the convergence criterion is satisfied.
Definition at line 84 of file ConvergenceCriterion.h.
References _satisfied.
|
inlinevirtual |
Tell the ConvergenceCriterion that it is called for the first time now (while solving a specific nonlinear system).
Definition at line 68 of file ConvergenceCriterion.h.
References _is_first_iteration.
|
inlinevirtual |
Indicate that a new iteration now starts.
A concrete implementation of ConvergenceCriterion might want to check both delta x and the residual. I.e., in a new iteration both checks have to be done anew. This method will make the ConvergenceCriterion forget the result of all checks already done, s.t. all necessary checks will have to be repeated in order to satisfy the ConvergenceCriterion.
Reimplemented in NumLib::ConvergenceCriterionPerComponentDeltaX, and NumLib::ConvergenceCriterionDeltaX.
Definition at line 81 of file ConvergenceCriterion.h.
References _is_first_iteration, and _satisfied.
|
inlinevirtual |
Tell the ConvergenceCriterion that it is not called for the first time (while solving a coupling system).
Definition at line 72 of file ConvergenceCriterion.h.
References _is_first_iteration.
|
protected |
Definition at line 92 of file ConvergenceCriterion.h.
Referenced by NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), NumLib::ConvergenceCriterionResidual::checkResidual(), preFirstIteration(), reset(), and setNoFirstIteration().
|
protected |
Definition at line 93 of file ConvergenceCriterion.h.
Referenced by NumLib::ConvergenceCriterionDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkDeltaX(), NumLib::ConvergenceCriterionResidual::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), NumLib::ConvergenceCriterionResidual::checkResidual(), and getVectorNormType().
|
protected |
Definition at line 91 of file ConvergenceCriterion.h.
Referenced by NumLib::ConvergenceCriterionDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), NumLib::ConvergenceCriterionResidual::checkResidual(), isSatisfied(), reset(), NumLib::ConvergenceCriterionDeltaX::reset(), and NumLib::ConvergenceCriterionPerComponentDeltaX::reset().