On Thu, Oct 4, 2012 at 12:07 AM, Gong Ding <gdiso at ustc.edu> wrote:
> call SNESSetLagPreconditioner before SNESSolve is useless. > It seems SNESSetLagPreconditioner does not reset the internal information. > > I am looking directly at the code: http://www.mcs.anl.gov/petsc/petsc-dev/src/snes/interface/snes.c.html#SNESSetLagPreconditioner It definitely changes the "internal information". Matt > If you are calling SNESSolve(), just call SNESSetLagPreconditioner() again > before each solve. > > > On Wed, Oct 3, 2012 at 10:25 PM, Gong Ding <gdiso at ustc.edu> wrote: > >> Only implemented this strategy in TS is not enough, i.e. DC sweep (each >> DC point requires nonlinear iteration) may also need it. >> Will you implement it into the SNES and send me the patch? >> For example, a flag -3 to SNESSetLagPreconditioner. >> At the first ineration of each SENSSolve call, the PC will be built and >> never change in the same SENSSolve iteration. >> I'd like to try it asap since this strategy improves simulation speed >> significantly. >> >> Gong Ding >> >> >> >> >> >> 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. >> >> On Wed, Oct 3, 2012 at 11:00 AM, Gong Ding <gdiso at ustc.edu> wrote: >> >>> Hi, >>> I am doing a nonlinear transient simulation. For each time step, a >>> SNESSolve is called. >>> 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. >>> >>> >>> SNESSetLagPreconditioner(-1) seems just skips all the following >>> factorization, even in the different time step. >>> How can I do? >>> >>> >>> Gong Ding >>> >>> >>> >> > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121004/228b6cb9/attachment.html>
