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 Parameter#

  • ksp - the iterative context

Output Parameter#

  • its - number of iterations

Note#

During the ith iteration this returns i-1

See Also#

KSP: Linear System Solvers, KSP, KSPGetResidualNorm(), KSPBuildResidual(), KSPGetTotalIterations()

Level#

intermediate

Location#

src/ksp/ksp/interface/iterativ.c

Examples#

src/ksp/ksp/tutorials/ex52.c
src/tao/pde_constrained/tutorials/hyperbolic.c
src/tao/pde_constrained/tutorials/parabolic.c
src/ksp/pc/tutorials/ex2.c
src/ksp/pc/tutorials/ex3.c
src/tao/pde_constrained/tutorials/elliptic.c
src/ksp/ksp/tutorials/bench_kspsolve.c
src/snes/tutorials/ex3.c
src/ksp/ksp/tutorials/ex74.c
src/ksp/pc/tutorials/ex1.c


Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages