On Fri, Sep 21, 2012 at 5:13 PM, Shao-Ching Huang <span dir="ltr"><<a href="mailto:huangsc@gmail.com" target="_blank">huangsc@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks. A1 is part of the Laplacian operator discretized by finite<br>
volume method on non-Cartesian mesh.<br></blockquote><div><br></div><div>That is not very specific. Can you be more specific?</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Fri, Sep 21, 2012 at 3:09 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> On Fri, Sep 21, 2012 at 2:45 PM, Shao-Ching Huang <<a href="mailto:huangsc@gmail.com">huangsc@gmail.com</a>> wrote:<br>
>><br>
>> Hi<br>
>><br>
>> I am trying to write the procedure of a legacy code in PETSc (for<br>
>> comparison purposes). Instead of solving the system "Ax = b", the<br>
>> legacy code iterates on something like:<br>
>><br>
>> A1*x(n+1) = b - A2*x(n)<br>
>><br>
>> where A=A1+A2 and "n" is the iteration index. It seems to me that I<br>
>> need to use ksppreonly<br>
>><br>
>> (<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPPREONLY.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPPREONLY.html</a>).<br>
><br>
><br>
> This kind of splitting is common. PETSc has Richardson, Jacobi, SOR that do<br>
> this. What<br>
> are the matrices A1 and A2?<br>
><br>
>    Matt<br>
><br>
>><br>
>> My question is: how do I update the right-hand-side, b - A2*x(n),<br>
>> after every iteration using PETSc API?<br>
>><br>
>> Thanks.<br>
>><br>
>> Shao-Ching<br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> What most experimenters take for granted before they begin their experiments<br>
> is infinitely more interesting than any results to which their experiments<br>
> lead.<br>
> -- Norbert Wiener<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>