It works.<br>Thanks agian.<br><br>Yan<br><br><div class="gmail_quote">On Sat, Nov 7, 2009 at 3:17 PM, Ryan Yan <span dir="ltr">&lt;<a href="mailto:vyan2000@gmail.com">vyan2000@gmail.com</a>&gt;</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;">
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" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">MatSetBlockSize</a>() when constructing this matrix (and before
preallocating it).........</p><div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">On Sat, Nov 7, 2009 at 3:12 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jed@59a2.org" target="_blank">jed@59a2.org</a>&gt;</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>Ryan Yan wrote:<br>
&gt; Hi All,<br>
&gt; I have a question as follows:<br>
&gt;<br>
&gt; In order to use MatSetValuesBlocked() for a MPIAIJ matrix. I need to<br>
&gt; 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>
</div></div></blockquote></div><br>