Hello everyone!
I am writing a code that uses PETSc/KSP to solve linear systems. I just realized that after running "KSPSolve(...)", the number of iterations given by
KSPGetIterationNumber(ksp, &numIts)
is *different* from the size of the residual history given by
KSPGetResidualHistory(ksp, NULL, &nEntries);
That is, "numIts" is not equal to "nEntries". Is this expected, or a bug in my code? (I thought they should be the same...)
I have tried several pairs of solvers and preconditioners (e.g., fgmres & bjacobi, ibcgs & bjacobi). This issue happens to all of them.
Thanks!
Kevin