petsc-3.12.1 2019-10-22
Report Typos and Errors

# KSPGetIterationNumber

Gets the current iteration number; if the KSPSolve() is complete, returns the number of iterations used.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  KSPGetIterationNumber(KSP ksp,PetscInt *its)

Not Collective

### Input Parameters

ksp -the iterative context

### Output Parameters

its -number of iterations

### Notes

During the ith iteration this returns i-1

### See Also

KSPBuildResidual(), KSPGetResidualNorm(), KSPGetTotalIterations()

### Level

intermediate

### Location

src/ksp/ksp/interface/iterativ.c

### Examples

src/ksp/pc/examples/tutorials/ex1.c.html
src/ksp/pc/examples/tutorials/ex2.c.html
src/ksp/pc/examples/tutorials/ex3.c.html
src/ksp/ksp/examples/tutorials/ex1.c.html
src/ksp/ksp/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex3.c.html
src/ksp/ksp/examples/tutorials/ex4.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex6.c.html
src/ksp/ksp/examples/tutorials/ex7.c.html
src/ksp/ksp/examples/tutorials/ex9.c.html
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages