user's own preconditioner for PCG

Matthew Knepley knepley at
Thu May 7 16:12:31 CDT 2009

On Thu, May 7, 2009 at 4:09 PM, Shao-Ching Huang <schuang at>wrote:

> Hi,
> In a parallel PCG solve, is there a way to instruct PETSc to call my own
> (serial) solver to invert the per-process, local precondition matrix (as in
> the block-Jacobi preconditioner)?

It sounds like the proper way to do this is to use -pc_type bjacobi
-sub_ksp_type preonly and then pull out
then replace the block PC with a PCSHELL with wraps up your preconditioner.


> Is there an example/documentation that I can follow? Which part of code
> should I start looking at?
> We are trying to determine if there is any value to use the aforementioned
> customized preconditioner as compared to the general ones in PETSc and to
> DMMG, for this particular matrix at hand. This is a structured mesh problem.
> Thank you.
> Shao-Ching
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list