<div dir="ltr"><div dir="ltr">On Tue, Jan 22, 2019 at 4:57 AM NENNIG Benoit via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I would like to create a matrix aij with the same OwnershipRanges as an other existing matrix with petsc4py. The two matrices have not the same non zeros patern. <br>
<br>
Any ideas ?<br></blockquote><div><br></div><div>MatSetSizes() can be used to determine the parallel layout of a matrix. So you could call MatGetLocalSize() on the first Mat,</div><div>and then MatSetSizes() on the copy.</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:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Regards,<br>
<br>
Benoit<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-2676593605199861849gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>