OGS
|
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 31 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. | |
virtual void | preFirstIteration () |
virtual void | setNoFirstIteration () |
virtual void | reset () |
virtual bool | isSatisfied () const |
Tell if the convergence criterion is satisfied. | |
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 34 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::ConvergenceCriterionDeltaX, NumLib::ConvergenceCriterionPerComponentDeltaX, NumLib::ConvergenceCriterionPerComponentResidual, and NumLib::ConvergenceCriterionResidual.
|
pure virtual |
Check if the residual satisfies the convergence criterion.
Implemented in NumLib::ConvergenceCriterionDeltaX, NumLib::ConvergenceCriterionPerComponentDeltaX, NumLib::ConvergenceCriterionPerComponentResidual, and NumLib::ConvergenceCriterionResidual.
|
inline |
|
pure virtual |
Tells if the change of the solution between iterations is checked.
Implemented in NumLib::ConvergenceCriterionDeltaX, NumLib::ConvergenceCriterionPerComponentDeltaX, NumLib::ConvergenceCriterionPerComponentResidual, and NumLib::ConvergenceCriterionResidual.
|
pure virtual |
Tells if the residual is checked.
Implemented in NumLib::ConvergenceCriterionDeltaX, NumLib::ConvergenceCriterionPerComponentDeltaX, NumLib::ConvergenceCriterionPerComponentResidual, and NumLib::ConvergenceCriterionResidual.
|
inlinevirtual |
Tell if the convergence criterion is satisfied.
Definition at line 90 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 70 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::ConvergenceCriterionDeltaX, and NumLib::ConvergenceCriterionPerComponentDeltaX.
Definition at line 83 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 74 of file ConvergenceCriterion.h.
References _is_first_iteration.
|
protected |
Definition at line 98 of file ConvergenceCriterion.h.
Referenced by NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), NumLib::ConvergenceCriterionResidual::checkResidual(), preFirstIteration(), reset(), and setNoFirstIteration().
|
protected |
Definition at line 99 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 97 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().