Hi Jed,<br>Thanks,<br>So the following is very confusing:<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetValuesBlocked.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetValuesBlocked.html</a><br>
<br><h3><font color="#cc3333">Notes</font></h3>
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 <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/size.html#size">size</a> 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 <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/size.html#size">size</a>.
<p>
Note that you must call <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetBlockSize.html#MatSetBlockSize">MatSetBlockSize</a>() when constructing this matrix (and before
preallocating it).........</p><br><br><br><br><div class="gmail_quote">On Sat, Nov 7, 2009 at 3:12 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Ryan Yan wrote:<br>
> Hi All,<br>
> I have a question as follows:<br>
><br>
> In order to use MatSetValuesBlocked() for a MPIAIJ matrix. I need to<br>
> call MatSetBlockSize() when I create the matrix.<br>
<br>
</div>Call MatSetBlockSize *after* preallocation.<br>
<font color="#888888"><br>
Jed<br>
<br>
</font></blockquote></div><br>