<div dir="ltr">Dear all,<div><br></div><div>I solved my problem without using any Petsc routine. Thanks anyway!</div><div><br></div><div>Eda</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>>, 17 Haz 2019 Pzt, 18:36 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
  If you are using a MPIAIJ matrix that has already been created you can use MatMPIAIJGetSeqAIJ(). This gives you back on each process the "diagonal" block and the "off-diagonal" block.<br>
<br>
<br>
<br>
> On Jun 17, 2019, at 7:44 AM, Eda Oktay via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
> <br>
> Hello everyone,<br>
> <br>
> I am trying to find the off diagonal blocks of a matrix. For example, I partitioned a 10*10 matrix into 4*4 and 6*6 block sub matrices. I need to find the other blocks in order to find the number of nonzero elements in them.<br>
> <br>
> I tried to use MatGetLocalSubMatrix but I couldn't figure out how to give iscol and isrow. Also, from the manual, ı understood that MatSetLocalToGlobalMapping should be used before this routine but I couldn't used it properly because before MatGetLocalSuMatrix, the submatrix doesn't exist. I tried to give zero to all elements so that I can use Mapping routine, but I got an error saying that it is invalid.<br>
> <br>
> How can I fix this probelm?<br>
> <br>
> Thank you,<br>
> <br>
> Eda<br>
<br>
</blockquote></div>