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
