[petsc-users] KSPCG solution blow up

Jed Brown jedbrown at mcs.anl.gov
Mon Apr 15 16:15:40 CDT 2013


Hugo Gagnon <opensource.petsc at user.fastmail.fm> writes:

> For the problem I'm describing my serial in-house solver does not work
> with ILU(0) but works with ILU(3).  I have no option to run Jacobi.
> When I apply the same problem to PETSc's PC solver with ILU(3) in
> serial I get KSP_DIVERGED_INDEFINITE_PC

Does your in-house ILU(3) use a different ordering?  What shift scheme
does it use?

> on the first iteration (in MPI the solution somewhat converges but
> very slowly).
>
> call KSPGetPC(Pksp,Ppc,Pierr)
> call PCSetType(Ppc,PCILU,Pierr)
> call PCFactorSetLevels(Ppc,3,Pierr)
>
> This effectively changes the fill level from 0 to 3, right?

This only works in serial.  Check the -ksp_view output to see what is
done.  You should just call KSPSetFromOptions() and use run-time options
to configure the solver.  You can do it from code later, but writing
code is slow to figure out what works.


More information about the petsc-users mailing list