Skip to main content
`Ctrl`+`K`

# SNESGetConvergenceHistory

Gets the arrays used to hold the convergence history.

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESGetConvergenceHistory(SNES snes, PetscReal *a[], PetscInt *its[], PetscInt *na)

Not Collective

## Input Parameter

- snes - iterative context obtained from `SNESCreate()`

## Output Parameters

- a - array to hold history, usually was set with `SNESSetConvergenceHistory()`

- its - integer array holds the number of linear iterations (or negative if not converged) for each solve.

- na - size of `a` and `its`

## Note

This routine is useful, e.g., when running a code for purposes of accurate performance monitoring, when no I/O should be done during the section of code that is being timed.

## Fortran Notes

Return the arrays with ``SNESRestoreConvergenceHistory()`

Use the arguments

      PetscReal, pointer :: a(:)
      PetscInt, pointer :: its(:)

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESSolve()`, `SNESSetConvergenceHistory()`

## Level

intermediate

## Location

src/snes/interface/snes.c

## Examples

src/snes/tutorials/ex1f.F90

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