:orphan:
# KSPMonitorDynamicTolerance
A monitor that changes the inner tolerance of nested preconditioners in every outer iteration in an adaptive way. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPMonitorDynamicTolerance(KSP ksp, PetscInt its, PetscReal fnorm, void *dummy)
```
Collective


## Input Parameters

- ***ksp   -*** iterative context
- ***n     -*** iteration number (not used)
- ***fnorm -*** the current residual norm
- ***ctx   -*** context used by monitor



## Options Database Key

- ***-sub_ksp_dynamic_tolerance <coef> -*** coefficient of dynamic tolerance for inner solver, default is 1.0





## Notes
Applies for `PCKSP`, `PCBJACOBI`, and `PCDEFLATION` preconditioners

This may be useful for a flexible preconditioned Krylov method, such as `KSPFGMRES`, [](sec_flexibleksp) to
control the accuracy of the inner solves needed to guarantee convergence of the outer iterations.

This is not called directly by users, rather one calls `KSPMonitorSet()`, with this function as an argument, to cause the monitor
to be used during the `KSP` solve.

Use `KSPMonitorDynamicToleranceCreate()` and `KSPMonitorDynamicToleranceSetCoefficient()` to create the context needed by this
monitor function.

Pass the context and `KSPMonitorDynamicToleranceDestroy()` to `KSPMonitorSet()`


## See Also
 [](sec_flexibleksp), `KSP`, `KSPMonitorDynamicToleranceCreate()`, `KSPMonitorDynamicToleranceDestroy()`, `KSPMonitorDynamicToleranceSetCoefficient()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/iterativ.c.html#KSPMonitorDynamicTolerance">src/ksp/ksp/interface/iterativ.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/iterativ.c)


[Index of all KSP routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
