Skip to main content
Ctrl+K
PETSc 3.23.2 documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • KSPGetIterat...

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/ex5f.F90
src/ksp/ksp/tutorials/ex53.c
src/ksp/ksp/tutorials/ex55.c
src/ksp/ksp/tutorials/ex46.c
src/ksp/ksp/tutorials/ex9.c
src/ksp/ksp/tutorials/ex3.c
src/ksp/ksp/tutorials/ex60.c
src/ksp/ksp/tutorials/ex11f.F90
src/ksp/ksp/tutorials/ex7f.F90
src/ksp/ksp/tutorials/ex19.c


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

On this page
  • Synopsis
  • Input Parameter
  • Output Parameter
  • Note
  • See Also
  • Level
  • Location
  • Examples
Edit on GitLab
Show Source

© Copyright 1991-2025, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2025-05-21T08:38:54-0500 (v3.23.2-41-gb677dd453eaf).