preconditioner for matrix-free linear system

Matthew Knepley knepley at
Tue Apr 14 13:26:55 CDT 2009

On Tue, Apr 14, 2009 at 1:04 PM, Yongcheng Zhou <yongcheng.zhou at>wrote:

> hi there,
> I want to link my own package with PETSc in order to make use of its
> various preconditioners.  I am using
> matrix free method, so that I can directly refer the large matrix
> saved in my own format. The connection
> works OK without preconditioners, but runs into trouble when most of
> the preconditioners is called.
> For example, I got this message when using PCICC preconditionder:
> Matrix format shell does not have a built-in PETSc direct solver!
> So my question is how to utilize PETSc's powerful preconditioners for
> my matrix-free application.

Most preconditioners want access directly to the underlying matrix data,
rather than its action. I see two alternatives:

  a) Create a PETSc Mat instead. This is sure to be the easiest alternative.
      Is there a reason you cannot do this?

  b) Write a converter to AIJ. This seems like a lot of work.

I think all the PCs you want rely on AIJ storage. People in linear algebra
think much of generic interfaces, and thus do not write their
to respect them (or you would only have to implement GetRow()).


> Thanks,
> Rocky
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