<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 21, 2014 at 12:34 PM, Chung-Kan Huang <span dir="ltr"><<a href="mailto:ckhuangf@gmail.com" target="_blank">ckhuangf@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>In my application I like to use </div><div><div>PetscErrorCode  KSPSetOperators(KSP ksp,Mat Amat,Mat Pmat,MatStructure flag)<br clear="all">
</div></div><div>and have Pmat different from Amat</div>
<div><br></div><div>if Amat = L + D + U</div><div>then Pmat  = Amat  - L* - U* + rowsum(L* + U*)</div><div>where L* and U* is a portion of L and U and rowsum(L* + U*) will add into D</div><div><br></div><div>I know I can explicitly construct Pmat step-by-step but wonder what will be the most easy way to do this in PETSC?</div>
</div></blockquote><div><br></div><div>It sounds like you should just use MatSetValues() since we have no idea what L* and U* are.</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">
<div dir="ltr"><div>Thanks,</div><div><br></div><div><br></div><div>Kan</div>
</div>
</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
</div></div>