<br><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 6:08 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></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>
> Hello,<br>
><br>
> I have a (hopefully) quick question about setting the restart for gmres.<br>
><br>
> I set the restart to be 50, but when I use KSPView it looks like GMRES<br>
> still uses a restart of 30. It is possible that I overwrite my settings<br>
> somehow? Here is the relevant part of my code:<br>
><br>
> KSPCreate(PETSC_COMM_WORLD,&ksp);<br>
> KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);<br>
<br>
</div> KSPSetType(ksp,KSPGMRES);<br>
<br>
> 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'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>
> KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);<br>
> KSPSetTolerances(ksp,1.e-12,1.e-12,PETSC_DEFAULT,100000);<br>
> KSPSetUp(ksp);<br>
> KSPGetPC(ksp,&pc);<br>
> PCSetType(pc,PCNONE);<br>
> KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);<br>
> KSPSolve(ksp,b,x);<br>
><br>
><br>
> Thanks,<br>
> 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>