Matrix blocks

Matthew Knepley knepley at
Fri Sep 5 07:42:39 CDT 2008

You can extract matrix blocks using MatGetSubMatrix().


On Fri, Sep 5, 2008 at 6:50 AM, Michel Cancelliere
<fernandez858 at> wrote:
> Hi All,
> I am building a shell preconditioner, for implement that I should divide a
> sparse matrix into four blocks of dimension N/2xN/2 (N size of the Matrix),
> I took a look to src/mat/examples/tutorials/ex2 but it is for dense matrix.
> There is a function for do that in Petsc? or another method for efficiently
> implementation?
> Thank you,
> Michel Cancelliere

What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener

More information about the petsc-users mailing list