[petsc-users] About the initial guess for KSP method.

Matthew Knepley knepley at gmail.com
Tue Mar 17 10:17:15 CDT 2020


On Mon, Mar 16, 2020 at 4:32 PM Xiaodong Liu <xliu29 at ncsu.edu> wrote:

> Hi, all,
>
> I am testing KSPSetInitialGuessNonzero using the case
>
>
> https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex50.c.html
>
> This case is special. WIth zero initial guess, 1 iteration can deliver the
> exact solution. But when I tried true for KSPSetInitialGuessNonzero, it
> shows the same convergence history as false.
>
> Does the code  change KSPSetInitialGuessNonzero to false automatically?
>

For that flag to make any difference, you have to pass in a nonzero vector
to KSPSolve(). This example does not do that.
Were you doing that?

  Thanks,

     Matt


> Take care.
>
> Thanks,
>
> Xiaodong Liu, PhD
> X: Computational Physics Division
> Los Alamos National Laboratory
> P.O. Box 1663,
> Los Alamos, NM 87544
> 505-709-0534
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200317/fb3b00ae/attachment.html>


More information about the petsc-users mailing list