<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 21, 2016 at 2:30 PM, Fangbo Wang <span dir="ltr"><<a href="mailto:fangbowa@buffalo.edu" target="_blank">fangbowa@buffalo.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div><b>Background:</b></div><div>I have a global matrix (sparse) which is very large (2 million by million), it is generated from local block matrix with size around 30,000 by 30,000 (also sparse) using stochastic galerkin projection method. </div><div><br></div><div>In the global matrix, I have 700 local block matrices which most of them are similar. At the end of the day, I only need to save 45 different local block matrices which can save a lot of memory than saving the global matrix.</div><div><br></div><div><b>my problem:</b></div><div><font color="#0000ff">I don't want to mannually create 45 petsc matrices with similar names, for example, A1, A2, A3, A4, etc. </font> I want to automatically create these matrices and be able to call these matrices according to its name.</div><div><br></div><div>Any one have experiences on this? Thank you very much.</div></div></blockquote><div><br></div><div>Try using</div><div><br></div><div>  <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html#MatCreateNest">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html#MatCreateNest</a></div><div><br></div><div>although its usually intended for s smaller number of block matrices.</div><div><br></div><div>   Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-HOEnZb"><font color="#888888"><div>Fangbo Wang <br></div><div><div><br></div>-- <br><div class="gmail-m_-4871907481076327152gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font size="1" color="#9900ff">Fangbo Wang, PhD student</font></div><div><font size="1" color="#9900ff">Stochastic Geomechanics Research Group</font></div><div><span style="color:rgb(153,0,255);font-size:x-small">Department of Civil, Structural and Environmental Engineering</span></div><div><font size="1" color="#9900ff">University at Buffalo</font></div><div><font size="1" color="#9900ff">Email: <u><a href="mailto:fangbowa@buffalo.edu" target="_blank">fangbowa@buffalo.edu</a></u></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>