Hi Jed, Thanks, So the following is very confusing: http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetValuesBlocked.html
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 size<http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/size.html#size>is 2 and you are passing in values for rows 2,3,4,5 then m would be 2 (not 4). The values in idxm would be 1 2; that is the first index for each block divided by the block size<http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/size.html#size>. Note that you must call MatSetBlockSize<http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetBlockSize.html#MatSetBlockSize>() when constructing this matrix (and before preallocating it)......... On Sat, Nov 7, 2009 at 3:12 PM, Jed Brown <jed at 59a2.org> 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: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20091107/d160b583/attachment.htm>
