[petsc-users] Initial Guess for KSP in SNES

Jed Brown jed at jedbrown.org
Sun Apr 29 12:54:22 CDT 2018


Why do you want it to be an initial guess for the linear problem rather
than for the nonlinear problem?

I think you can use SNESSetUpdate() and in that function,
SNESGetSolutionUpdate() which you can set to whatever you want the
initial guess to be.

Derek Gaston <friedmud at gmail.com> writes:

> I'm interested in setting the initial guess for the first KSP solve in SNES
> (used in a transient calculation) - and whether anyone thinks it could be a
> good thing to do.
>
> I see some previous discussion on this from Jed and Matt here:
> https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2014-September/022779.html
> https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2014-September/022780.html
>
> I realize that the Newton solver is solving for the update... but that
> doesn't necessarily mean that guessing 0 is the best plan.  For instance:
> for fairly linear problems in time (or slightly nonlinear depending on how
> you look at it!) it might be a good idea to guess the first update to be
> the difference between the previous two time steps (or: more generally some
> sort of "projected" update based on your time integration scheme).
>
> Indeed - for a perfectly linear problem in time (with constant dt) this
> would yield a "perfect" guess for the linear solver and it would return
> immediately.
>
> I suppose that if you use a "predictor" for predicting the guess for the
> nonlinear system (which we often do - but not always)... then 0 for your
> first update is probably a decent choice (what else would you choose?).
> But if you're simply using the old timestep solution (which is what is
> commonly done)... then that first update is more likely to look like the
> difference between the last two timesteps than it looks like 0.
>
> Thoughts?
>
> Derek


More information about the petsc-users mailing list