If you want to use a separate preconditioner, you need to call PETScKrylovSolver.set_operators(A, P)
where P
is your preconditioner matrix. I don’t think there’s an interface to that through the generic solve()
syntactic sugar.
Like I’ve said in the past, solve()
is a gross oversimplification which detracts from the underlying operations that need to be performed.
I strongly recommend designing your own Newton solver as above, or use a PETScSNESSolver
, or use PETSc
directly through petsc4py
.