Default code to compute the residual.
Collecive on ksp
ksp - iterative context
t - pointer to temporary vector
v - pointer to user vector
V - pointer to a vector containing the residual
KSP methods such as
KSPGMRES do not compute the explicit residual at each iteration, this routine takes the information
they have computed during the previous iterations and uses it to compute the explicit residual via the formula r = b - A*x.
PETSC_EXTERN because it may be used by user written plugin