[petsc-users] ksppreonly question

Matthew Knepley knepley at gmail.com
Fri Sep 21 17:09:43 CDT 2012


On Fri, Sep 21, 2012 at 2:45 PM, Shao-Ching Huang <huangsc at gmail.com> wrote:

> 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
> ).
>

This kind of splitting is common. PETSc has Richardson, Jacobi, SOR that do
this. What
are the matrices A1 and A2?

   Matt


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



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120921/4ccb4ee7/attachment.html>


More information about the petsc-users mailing list