<div dir="ltr">On Sat, Aug 24, 2013 at 6:48 AM, 丁老师 <span dir="ltr"><<a href="mailto:ztdepyahoo@163.com" target="_blank">ztdepyahoo@163.com</a>></span> wrote:<br><div class="gmail_extra"><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"> thank you . but the matrix element has been changed in the third and fourth call. how to re calculate the preconditioner.</div></blockquote><div><br></div><div>
Don't give SAME_PRECONDITIONER, and read the KSP section of the manual.</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><br><div></div><div></div><br>在 2013-08-24 18:18:17,"Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> 写道:<br>
<blockquote style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><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"><span class="HOEnZb"><font color="#888888"><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
</font></span></div></div>
</blockquote></div></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>