<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 27, 2014 at 10:45 AM, Rolf Kuiper <span dir="ltr"><<a href="mailto:kuiper@mpia.de" target="_blank">kuiper@mpia.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Dear PETSc users and developers,<div><br></div><div>is there an easy way to set a <i>minimum</i> iteration number to a KSP context (such as a maximum iteration number in KSPSetTolerances())?</div>
<div><br></div><div>I don't know, if the following explanation is useful, but I will try to give an example usage here:</div><div>I need this to e.g. solve a linear system of equations several times (as the physical system proceeds in time); during a single call / timestep, the system, might not change stronger than the RTOL in use, but in the long-run (several hundreds to thousands of calls), the system will actually change by several RTOL; nonetheless, the default KSP solver stops without doing any iteration (= 0), i.e. the system does not change at all.</div>
</div></blockquote><div><br></div><div>1) This explanation makes no sense to me. Either you have a difference greater than the tolerance or not.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>I have the feeling that it might be possible by using my own convergence test with KSPSetConvergenceTest(), but I am not 100% sure and would prefer to go with the standard PETSc convergence test, just adding the <i>minimum</i> iteration number.</div>
</div></blockquote><div><br></div><div>2) The easiest thing to do is make a custom convergence test that immediately returns no if its the first iterate, and otherwise calls the default test.</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"><div style="word-wrap:break-word"><div>Thanks a lot,</div><div>Rolf</div>
</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
</div></div>