<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 5, 2015 at 3:34 PM, Bikash Kanungo <span dir="ltr"><<a href="mailto:bikash@umich.edu" target="_blank">bikash@umich.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>I have four global matrices: A (mxm), B (mxn), C (nxm) and D (nxn). All of these are of type MATMPIAIJ (sparse parallel matrix) created using number of global rows and columns. I want to construct an (m+n)x(m+n) global matrix called M which would have A, B, C and D as its sub-matrices in clockwise fashion starting from A at the upper-left. What can be the best way to construct M from A, B, C and D sub-matrices?<br></div></div></div></blockquote><div><br></div><div>There are at least two ways:</div><div><br></div><div> 1) Use <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html</a> to get a view</div><div> into the matrix for each submatrix A, B, C, D</div><div><br></div><div> 2) Use <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div></div>Thanks,<br></div>Bikash <br clear="all"><span class=""><font color="#888888"><div><div><div><div><br>-- <br><div><div dir="ltr"><div><div><div><div><font color="#666666">Bikash S. Kanungo<br></font></div><font color="#666666">PhD Student<br></font></div><font color="#666666">Computational Materials Physics Group<br></font></div><font color="#666666">Mechanical Engineering <br></font></div><font color="#666666">University of Michigan<br><br></font></div></div>
</div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>