[petsc-users] ASM Preconditioner with SNES

Gaetan Kenway kenway at utias.utoronto.ca
Mon Nov 29 13:01:17 CST 2010


Hello

I am wondering how one sets options for the sub-ksp contexts when using 
the ASM preconditoner for the krylov solve in a SNES.  After I create 
the snes context, set the FormFunction routine, set the snesSetJacobian 
routine, I run something like this:

   call SNESGetKSP(snes,ksp,ierr)
   call KSPSetType(ksp,KSPGMRES,ierr)
   call KSPGMRESSetRestart(ksp, 80, ierr)
   call KSPGetPC(ksp,pc,ierr)
   call PCSetType( pc, PCASM, ierr)
   call PCASMSetOverlap(pc,3,ierr)

All good up until here.  Elsewhere where I use just a Krylov solve (for 
the adjoint of the non-linear system),  I would normally use

call PCASMGetSubKSP( pc, nlocal,  first, subksp, ierr)
call KSPGetPC( subksp, subpc, ierr)
call PCSetType( subpc, PCILU, ierr)
call PCFactorSetLevels( subpc, fillLevel , ierr)
call KSPSetType(subksp, KSPPREONLY, ierr)

However, calling the PCASMGetSubKSP gives an error, specifically Error 
Code 58: "Operation done in wrong order".

Any thoughts on how to set these options for the subksp in the ASM 
pre-conditioner?

Thank you,
Gaetan


More information about the petsc-users mailing list