> On Nov 21, 2014, at 5:09 PM, Anush Krishnan <[email protected]> wrote:
> 
> Hello petsc-users,
> 
> I've been running some CFD simulations, and I ran into one case where the 
> system (which is a coupled system for pressure and body forces) did not 
> converge and the reason was KSP_DIVERGED_INDEFINITE_PC. The options I'm using 
> are -pc_gamg_agg_nsmooths 1 -pc_type gamg -pc_gamg_type agg with a conjugate 
> gradient solver.

   We've heard reports of this happening before. You should increase the number 
of smoothing steps for the multigrid or change to a "stronger" smoother.

   What do you get with -ksp_view for exact solver you are using?

   Are you using PETSc's SNES? TS? Or just KSP?

> 
> I saw in example ksp/pc/examples/tutorials/ex2.c that I should use the flag 
> -pc_factor_shift_positive_definite to avoid this.

   This flag is only for factorization based preconditioners not gamg so you 
should not use it.

> I have a few questions regarding this:
>       • What does it mean that the preconditioner is indefinite?

    It means that the preconditioner generated by GAMG has both negative and 
positive eigenvalues. CG cannot handle this, CG  requires the preconditioner 
have all eigenvalues of the same sign.

> What can cause this to happen? And what does the above flag do?
>       • The error occurs midway through the simulation. Is there any reason 
> why this might be the case? The left-hand side matrix does not change during 
> the simulation.

    Huh? If the matrix is not changing then the preconditioner should not be 
changing and hence the preconditioner should not be rebuilt and hence you 
should not see this message "midway through the simulation". Are you sure that 
the matrix is not changing?? 


>       • Do both -pc_factor_shift_positive_definite and -pc_factor_shift_type 
> POSITIVE_DEFINITE do the same thing?

   Yes, they are from different versions of PETSc, but neither are for gamg.

  Barry

> Thank you,
> 
> Anush
> 

Reply via email to