# KSPConvergedDefaultSetConvergedMaxits
allows the default convergence test to declare convergence and return `KSP_CONVERGED_ITS` if the maximum number of iterations is reached 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPConvergedDefaultSetConvergedMaxits(KSP ksp, PetscBool flg)
```
Collective on ksp


## Input Parameters

- ***ksp -*** iterative context
- ***flg -*** boolean flag



## Options Database Key

- ***-ksp_converged_maxits <bool> -*** Declare convergence if the maximum number of iterations is reached


The precise values of reason are macros such as `KSP_CONVERGED_RTOL`, which
are defined in petscksp.h.




## See Also
 [](chapter_ksp), `KSP`, `KSPSetConvergenceTest()`, `KSPSetTolerances()`, `KSPConvergedSkip()`, `KSPConvergedReason`, `KSPGetConvergedReason()`, `KSPConvergedDefaultSetUMIRNorm()`, `KSPConvergedDefaultSetUIRNorm()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/iterativ.c.html#KSPConvergedDefaultSetConvergedMaxits">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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
