Skip to main content
`Ctrl`+`K`

# KSPGetConvergenceContext

Gets the convergence context set with `KSPSetConvergenceTest()`.

## Synopsis

    #include "petscksp.h"
    #include "petscmat.h"
    PetscErrorCode KSPGetConvergenceContext(KSP ksp, PetscCtxRt ctx)

Not Collective

## Input Parameter

- ksp - iterative solver obtained from `KSPCreate()`

## Output Parameter

- ctx - monitoring context

## Fortran Note

This only works when the context is a Fortran derived type or a `PetscObject`. Declare `ctx` with

      type(tUsertype), pointer :: ctx

## See Also

KSP: Linear System Solvers, `KSP`, `KSPConvergedDefault()`, `KSPSetConvergenceTest()`, `KSPGetConvergenceTest()`

## Level

advanced

## Location

src/ksp/ksp/interface/itfunc.c

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