Dear Jed,<br>Great solution, and both ways worked!<br><br>Thanks a lot,<br>Yan<br><br><div class="gmail_quote">On Sun, May 8, 2011 at 11:12 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><div class="gmail_quote">On Sun, May 8, 2011 at 17:09, Ryan Yan <span dir="ltr"><<a href="mailto:vyan2000@gmail.com" target="_blank">vyan2000@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>PetscOptionsSetValue("-ksp_view","1"); at very begin of the code, right after <br>

PetscInitialize.<br><br>But it seems like only the command line option "-ksp_view " will bring me the information on ksp.<br>The function call does not seem to response.</div></blockquote></div><br></div><div>The -ksp_view output is going into a file named "1".  I think PetscOptionsSetValue("-ksp_view",""); will do what you want. Note that you can just call KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD); after the solve.</div>

</blockquote></div><br>