:orphan: # KSPSetPostSolve Sets a function that is called at the end of each `KSPSolve()` (whether it converges or not) ## Synopsis ``` #include "petscksp.h" PetscErrorCode KSPSetPostSolve(KSP ksp, PetscErrorCode (*postsolve)(KSP, Vec, Vec, void *), void *postctx) ``` Logically Collective ## Input Parameters - ***ksp -*** the solver object - ***postsolve -*** the function to call after the solve - ***postctx -*** any context needed by the function ## Calling sequence of `postsolve` ```none PetscErrorCode func(KSP ksp, Vec rhs, Vec x, void *ctx) ``` - ***ksp -*** the `KSP` context - ***rhs -*** the right-hand side vector - ***x -*** the solution vector - ***ctx -*** optional user-provided context ## See Also `KSPSetUp()`, `KSPSolve()`, `KSPDestroy()`, `KSP`, `KSPSetPreSolve()`, `PCEISENSTAT` ## Level developer ## Location src/ksp/ksp/interface/itcreate.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/itcreate.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)