[petsc-users] ksp/pc nonzero initial guess

Matthew Knepley knepley at gmail.com
Fri Jul 9 08:00:55 CDT 2010


On Fri, Jul 9, 2010 at 2:55 PM, Verena Kuhlemann <vkuhlem at emory.edu> wrote:

> Hello,
>
> I am trying to solve a linear system with GMRES and a preconditioner.
> I need a nonzero initial guess and tried to do so by using
>
>          KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
>
> and       PCSetInitialGuessNonzero(pc,PETSC_TRUE);
>
>
> Without a preconditioner (setting: PCSetType(pc,PCNONE)) it works and
>
> my nonzero initial guess is used. But if I try to use a preconditioner
>
> the solver always zeroes out the initial guess.
>

1) You only need to call to KSP

2) How do you determine that the guess is not used? I try it in PETSc
examples and it works fine.
    It would be helpful to include a small example.

   Matt


> I would greatly appreciate any help.
>
> Thanks,
>
> Verena
>
>
> Here is the relevant part of my code:
>
>          KSPCreate(PETSC_COMM_WORLD,&ksp);
>
> KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
>
>
>  KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);
>
>  KSPGetPC(ksp,&pc);
>
>  PCSetInitialGuessNonzero(pc,PETSC_TRUE);
>
>


-- 
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/20100709/7f241ea9/attachment.htm>


More information about the petsc-users mailing list