Hi, Jed, I agree with you that it's not wise to reuse pc with new operator. Basically, I just keep pc and matrix updating concurrently.
Thanks for telling me that option in ksp. It works. Bests, Jinlei On Fri, Aug 19, 2016 at 12:27 AM, Jed Brown <[email protected]> wrote: > Jinlei Shen <[email protected]> writes: > > > Hi Matt, > > > > Thanks for speedy reply. > > > > It seems effective in SNES. > > > > I'm curious about how it works in iterative solver. > > Let's say I'm using CG with BJACOBI for modified newton, if I Set lag as > 5, > > does that mean the ilu decomposition for pc is stored and reused for the > > next 4 iterations? Will this setting help to reduce the iteration number > of > > ksp solver? > > Reusing the preconditioner with a new operator will generally converge > more slowly (or sometimes not at all). Solving the stale linear system > may cause modified Newton to stagnate/fail, e.g., when it chooses a > search direction that is not a descent direction. > > > Also, I'm wondering how to set the same option for just linear KSP solver > > since I have coded the modified newton framework manually. > > You can call KSPSolve() repeatedly without KSPSetOperators. You can > also use KSPSetReusePreconditioner to reuse the preconditioner that was > set up in a previous solve. >
