petscmaster 20200705
KSPComputeRitz
Computes the Ritz or harmonic Ritz pairs associated to the smallest or largest in modulus, for the preconditioned operator. Called after KSPSolve().
Synopsis
#include "petscksp.h"
#include "petscmat.h"
PetscErrorCode KSPComputeRitz(KSP ksp,PetscBool ritz,PetscBool small,PetscInt *nrit,Vec S[],PetscReal tetar[],PetscReal tetai[])
Not Collective
Input Parameters
 ksp   iterative context obtained from KSPCreate()

 ritz   PETSC_TRUE or PETSC_FALSE for ritz pairs or harmonic Ritz pairs, respectively

 small   PETSC_TRUE or PETSC_FALSE for smallest or largest (harmonic) Ritz values, respectively

 nrit   number of (harmonic) Ritz pairs to compute

Output Parameters
 nrit   actual number of computed (harmonic) Ritz pairs

 S   multidimensional vector with Ritz vectors

 tetar   real part of the Ritz values

 tetai   imaginary part of the Ritz values

Notes
For GMRES, the (harmonic) Ritz pairs are computed from the Hessenberg matrix obtained during
the last complete cycle, or obtained at the end of the solution if the method is stopped before
a restart. Then, the number of actual (harmonic) Ritz pairs computed is less or equal to the restart
parameter for GMRES if a complete cycle has been performed or less or equal to the number of GMRES
iterations.
Moreover, for real matrices, the (harmonic) Ritz pairs are possibly complexvalued. In such a case,
the routine selects the complex (harmonic) Ritz value and its conjugate, and two successive columns of S
are equal to the real and the imaginary parts of the associated vectors.
the (harmonic) Ritz pairs are given in order of increasing (harmonic) Ritz values in modulus
this is currently not implemented when PETSc is built with complex numbers
One must call KSPSetComputeRitz() before calling KSPSetUp()
in order for this routine to work correctly.
See Also
KSPSetComputeRitz(), KSP
Level
advanced
Location
src/ksp/ksp/interface/itfunc.c
Implementations
KSPComputeRitz_GMRES in src/ksp/ksp/impls/gmres/gmreig.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages