On Sun, Apr 22, 2012 at 3:31 AM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com">zonexo@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">
<div bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I am using petsc-dev 2012-04-20.<br>
<br>
Btw, I'm referring to :<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex22f.F.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex22f.F.html</a><br>
<br>
Part of the code is :<br>
<br>
<pre>call KSPSetFromOptions(ksp,ierr)
call KSPSetUp(ksp,ierr)
call KSPSolve(ksp,PETSC_NULL_OBJECT,PETSC_NULL_OBJECT,ierr)
call KSPDestroy(ksp,ierr)
call DMDestroy(da,ierr)
call PetscFinalize(ierr)</pre>
<br>
<br>
Unlike other codes like ex29c or ex45c, there isn't a "call
KSPGetSolution(ksp,x,ierr)"<br></div></blockquote><div><br></div><div>You need to declare "Vec x", and then you can call KSPGetSolution(ksp, x, ierr)</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 bgcolor="#FFFFFF" text="#000000">
Also I want to add "call VecView(x,ierr)" to print out the results,
which is usally added after the above.<br>
<br>
Thank you<br>
<pre cols="72">Yours sincerely,
TAY wee-beng</pre>
<br>
On 22/4/2012 1:14 AM, Matthew Knepley wrote:
<blockquote type="cite">On Sat, Apr 21, 2012 at 6:31 PM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@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">
Hi,<br>
<br>
May I know if ex22f is complete? I can't find :<br>
<br>
call KSPGetSolution(ksp,x,ierr)<br>
<br>
If I entered it, it says x not found.<br>
</blockquote>
<div><br>
</div>
<div>This is correct in petsc-dev. What version are you using?</div>
<div><br>
</div>
<div> Thanks,</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">
Thank you!<span class="HOEnZb"><font color="#888888"><span><font color="#888888"><br>
<br>
-- <br>
Yours sincerely,<br>
<br>
TAY wee-beng<br>
<br>
</font></span></font></span></blockquote><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
<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>
</font></span></blockquote>
</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<br>