[petsc-users] ksppreonly question

Shao-Ching Huang huangsc at gmail.com
Fri Sep 21 14:45:55 CDT 2012


Hi

I am trying to write the procedure of a legacy code in PETSc (for
comparison purposes). Instead of solving the system "Ax = b", the
legacy code iterates on something like:

A1*x(n+1) = b - A2*x(n)

where A=A1+A2 and "n" is the iteration index. It seems to me that I
need to use ksppreonly
(http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPPREONLY.html).

My question is: how do I update the right-hand-side, b - A2*x(n),
after every iteration using PETSc API?

Thanks.

Shao-Ching


More information about the petsc-users mailing list