<br><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 6:08 PM, Barry Smith <span dir="ltr">&lt;<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Nov 29, 2010, at 5:04 PM, Verena Kuhlemann wrote:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I have a (hopefully) quick question about setting the restart for gmres.<br>
&gt;<br>
&gt; I set the restart to be 50, but when I use KSPView it looks like GMRES<br>
&gt; still uses a restart of 30. It is possible that I overwrite my settings<br>
&gt; somehow? Here is the relevant part of my code:<br>
&gt;<br>
&gt; KSPCreate(PETSC_COMM_WORLD,&amp;ksp);<br>
&gt; KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);<br>
<br>
</div>   KSPSetType(ksp,KSPGMRES);<br>
<br>
&gt; KSPGMRESSetRestart(ksp,50);<br>
<br>
   You have not set the type to GMRES by this point, therefor the setting of restart is ignored. Must set the type before this.<br></blockquote><div><br></div><div>Ah, I thought I don&#39;t have to set it, since GMRES is the default. Now it works, thanks.</div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
   BTW: we highly recommend just calling KSPSetFromOptions() and setting parameters from the options database, much nicer IOHO then hardwiring in the source code.<br>
<font color="#888888"><br>
   Barry<br>
</font><div><div></div><div class="h5"><br>
<br>
&gt; KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);<br>
&gt; KSPSetTolerances(ksp,1.e-12,1.e-12,PETSC_DEFAULT,100000);<br>
&gt; KSPSetUp(ksp);<br>
&gt; KSPGetPC(ksp,&amp;pc);<br>
&gt; PCSetType(pc,PCNONE);<br>
&gt; KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);<br>
&gt; KSPSolve(ksp,b,x);<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Verena<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Verena Kuhlemann<div>Ph.D. Candidate</div><div>Mathematics and Computer Science Department</div><div>Emory University</div><br>