<div>Thank you for giving the entry of source code.<br>I think I can patch it for my purpose.<br> <br></div><blockquote style="padding-left:5px;margin-left:5px;border-left:#a0c6e5 2px solid;margin-right:0px">On Thu, Oct 4, 2012 at 12:07 AM, Gong Ding <span dir="ltr"><<a href="mailto:gdiso@ustc.edu" target="_blank">gdiso@ustc.edu</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>call SNESSetLagPreconditioner before SNESSolve is useless.<br>It seems SNESSetLagPreconditioner does not reset the internal information. </div></blockquote><div><br></div><div>I am looking directly at the code:</div>
<div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/snes/interface/snes.c.html#SNESSetLagPreconditioner">http://www.mcs.anl.gov/petsc/petsc-dev/src/snes/interface/snes.c.html#SNESSetLagPreconditioner</a></div>
<div><br></div><div>It definitely changes the "internal information".</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>If you are calling SNESSolve(), just call SNESSetLagPreconditioner() again before each solve.</div><blockquote style="padding-left:5px;margin-left:5px;border-left:#a0c6e5 2px solid;margin-right:0px"><br><div class="gmail_quote">
On Wed, Oct 3, 2012 at 10:25 PM, Gong Ding <span dir="ltr"><<a href="mailto:gdiso@ustc.edu" target="_blank">gdiso@ustc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Only implemented this strategy in TS is not enough, i.e. DC sweep (each DC point requires nonlinear iteration) may also need it. <br>
Will you implement it into the SNES and send me the patch?<br>For example, a flag -3 to SNESSetLagPreconditioner. <br>At the first ineration of each SENSSolve call, the PC will be built and never change in the same SENSSolve iteration. <br>
I'd like to try it asap since this strategy improves simulation speed significantly.<span><font color="#888888"><br> <br></font></span></div><span><font color="#888888"><div>Gong Ding<br>
<br></div></font></span><div><div><div> </div><div> </div><blockquote style="padding-left:5px;margin-left:5px;border-left:#a0c6e5 2px solid;margin-right:0px"><br>I've been meaning to implement this for a while. You can put custom SNES control into a pre-stage or pre-step hook, but this particular case should, in my opinion, be provided as a TS option.<br>
<br><div class="gmail_quote">
On Wed, Oct 3, 2012 at 11:00 AM, Gong Ding <span dir="ltr"><<a href="mailto:gdiso@ustc.edu" target="_blank">gdiso@ustc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I am doing a nonlinear transient simulation. For each time step, a SNESSolve is called.<br>
I want to do a LU factorization at the first Newton iteration of EACH time step, and for the following Newton steps (in the same time step), no factorization any more. For the next time step, the LU factorization should be done again.<br>
<br>
<br>
SNESSetLagPreconditioner(-1) seems just skips all the following factorization, even in the different time step.<br>
How can I do?<br>
<span><font color="#888888"><br>
<br>
Gong Ding<br>
<br>
<br>
</font></span></blockquote></div><br>
</blockquote><span></span></div></div></blockquote></div><br>
</blockquote><span></span></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>
</blockquote><span ></span>