petsc-3.9.4 2018-09-11
Report Typos and Errors


Sets the array used to hold the residual history. If set, this array will contain the residual norms computed at each iteration of the solver.


#include "petscksp.h" 
PetscErrorCode  KSPSetResidualHistory(KSP ksp,PetscReal a[],PetscInt na,PetscBool reset)
Not Collective

Input Parameters

ksp - iterative context obtained from KSPCreate()
a - array to hold history
na - size of a
reset - PETSC_TRUE indicates the history counter is reset to zero for each new linear solve

Notes: The array is NOT freed by PETSc so the user needs to keep track of it and destroy once the KSP object is destroyed.

If 'a' is NULL then space is allocated for the history. If 'na' PETSC_DECIDE or PETSC_DEFAULT then a default array of length 10000 is allocated.


set, residual, history, norm

See Also

KSPGetResidualHistory(), KSP




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