<div dir="ltr"><br><div class="gmail_extra">On Sat, Aug 24, 2013 at 4:57 AM, 丁老师 <span dir="ltr"><<a href="mailto:ztdepyahoo@163.com" target="_blank">ztdepyahoo@163.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"><div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial">
in my code, i need to use kspsolve in the following way<br><br> KSP ksp;<br> <br> KSPCreate(PETSC_COMM_WORLD,&ksp);<br> KSPSetOperators(ksp,A,A,SAME_NONZERO_PATTERN);<br> KSPSetOperators(ksp,A,A,SAME_PRECONDITIONER);<br>
KSPSetInitialGuessNonzero(ksp,PETSC_TRUE)<br> KSPSetType(ksp,KSPBCGS); <br> KSPSetFromOptions(ksp); <br><br> set the matrix A value and right hand side bu and bv.<br> kspsolve(A,bu);<br> kspsolve(A,bv); <br>
change the value of matrix A and bu bv,<br> kspsolve(A,bu);<br> kspsolve(A,bv);<br> <br> the first and second call to
the kspsolve use the same preconditioner. but which preconditoner does the third and fourth call to the kspsolve since the value of the matrix A has changed. <br></div></div></blockquote><div><br></div><div>The first call is redundant, and the subsequent solves use the same preconditioner, as you asked.</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 style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial">
<span title="neteasefooter"><span></span></span></div> <br><br><span title="neteasefooter"><span></span></span></div><br><br><span title="neteasefooter"><span></span></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
</div></div>