[petsc-users] problem with initial value

Barry Smith bsmith at mcs.anl.gov
Fri Oct 21 11:29:23 CDT 2011


On Oct 21, 2011, at 9:29 AM, Dominik Szczerba wrote:

> I am doing a transient computation, solving one linear problem per timestep, so naturally I want to exploit 'x' from the previous time step to be the initial value for the next solve (KSPSetInitialGuessNonzero).
> For the longest time, however, I was getting wrong results, unless I was resetting 'x' each time step (to some constant value, pure zero caused bcgs to break down).

   What happened if you did not set it to some constant (that is kept the old solution)? Did you get KSP_DIVERGED_BREAKDOWN?   It would be very odd that starting with a good initial guess would lead to breakdown but that cannot be completely ruled out.

   I would also check with valgrind http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind

    Have you tried KSPBCGSL? This is "enhanced Bi-CG-stab" algorithm that is designed to handle certain situations that may cause grief for regular Bi-CG-stab I guess.

   Barry



> After hours of debugging I was unable to find any errors in my coefficients, I experimentally found out, however, that changing the solver from bcgs to gmres or fgmres removes the problem: I no longer need to clear the solution vector.
> Now I am a bit worried, if this is still some time bomb in my code or is a known phenomenon. Thanks for any hints.
> 
> Regards, Dominik



More information about the petsc-users mailing list