Krylov vectors of matrix-free KSP
Chun.SUN at 3ds.com
Thu Sep 24 10:42:04 CDT 2009
Sorry for the intrusion.
I am planning to use MATSHELL together with KSP to achieve matrix-free
Krylov solve. I understand that I need to provide a function as MatVec
to build the Krylov space.
I also want to retain all the input vectors that I got from PETSC. i.e.
I want to keep the Krylov vectors on my own side, together with some
intermediate results. However I found that my MatVec is not only called
during the building of Krylov space, it's also called else where like
initialization and norm calculation. If I say -ksp_norm_type=no, the
number of MatVec calls might still slightly off from what I see for the
number of iterations.
I just want to check: Is there a way to know if a particular MatVec call
is from Krylov iteration or from elsewhere like norm check?
Or after -ksp_norm_type=no I should see exactly the same number of
Krylov iterations comparing to the number that MatVec is called?
The reason for doing this is that I want to obtain each coefficient of
all the Krylov basis from *this* solve and use them elsewhere to build
solution to another related equation from the same Krylov space. I guess
I can't access these coefficients but if I can take advantage of all
vectors being orthogonal, I can recover the coefficients in a rather
cheap way. Do you see any way around this?
Thank you very much,
More information about the petsc-users