[petsc-dev] Problem with conjugate gradient solver

Barry Smith bsmith at mcs.anl.gov
Mon Aug 23 18:40:34 CDT 2010


On Aug 23, 2010, at 2:31 PM, Anush Krishnan wrote:

> Hi,
> 
> I was trying to compile and run the example file $PETSC_DIR/src/ksp/pc/examples/tutorials/ex3.c, which demonstrates PETSc's preconditioned conjugate gradient solver for a system of linear equations. After compiling, running make runex3 is supposed to throw up the error "Divergence because of indefinite preconditioner" and running make runex3_pd is supposed to work and give the correct solution. But instead I get the error "Other kind of divergence: this should not happen." for the latter. Is there some bug in the code, or are there any other options that need to be set?

   Hmm, worked for me. 

    Please hg pull; hg update then rebuild PETSc and run the make runex3 runex3_pd again and send the output. I added to that example what reason it did have to maybe help determine the problem. Or you can run the example with the options given in the makefile and also the option -ksp_converged_reason


   Barry

> 
> Thanks,
> Anush




More information about the petsc-dev mailing list