Can I use MatSetBlockSize() for MPIAIJ

Ryan Yan vyan2000 at
Sat Nov 7 14:17:01 CST 2009

Hi Jed,
So the following is very confusing:

Notes The m and n count the NUMBER of blocks in the row direction and column
direction, NOT the total number of rows/columns; for example, if the block
2 and you are passing in values for rows 2,3,4,5 then m would be 2
4). The values in idxm would be 1 2; that is the first index for each block
divided by the block

Note that you must call
when constructing this matrix (and before preallocating it).........

On Sat, Nov 7, 2009 at 3:12 PM, Jed Brown <jed at> wrote:

> Ryan Yan wrote:
> > Hi All,
> > I have a question as follows:
> >
> > In order to use MatSetValuesBlocked() for a MPIAIJ matrix. I need to
> > call MatSetBlockSize() when I create the matrix.
> Call MatSetBlockSize *after* preallocation.
> Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list