# KSPFGMRESModifyPCKSP
modifies the attributes of the `KSPFGMRES` preconditioner. [](sec_flexibleksp). It serves as an example (not as something useful in practice) 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPFGMRESModifyPCKSP(KSP ksp, PetscInt total_its, PetscInt loc_its, PetscReal res_norm, void *dummy)
```

## Input Parameters

- ***ksp -*** the ksp context being used.
- ***total_its     -*** the total number of `KSPFGMRES` iterations that have occurred.
- ***loc_its       -*** the number of `KSPFGMRES` iterations since last restart.
- ***res_norm      -*** the current residual norm.
- ***dummy         -*** context, not used here





## Note
You can use this as a template for writing a custom monification callback


## See Also
 [](chapter_ksp), [](sec_flexibleksp), `KSPFGMRES`, `KSPFGMRESSetModifyPC()`, `KSPFGMRESModifyPCKSP()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/fgmres/modpcf.c.html#KSPFGMRESModifyPCKSP">src/ksp/ksp/impls/gmres/fgmres/modpcf.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/impls/gmres/fgmres/modpcf.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)  
