<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 8:45 AM Eda Oktay via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<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">Hello everyone,<div><br></div><div>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.</div><div><br></div><div>I tried to use MatGetLocalSubMatrix but I couldn't figure out how to give iscol and isrow. </div></div></blockquote><div><br></div><div>isrow would be the rows of your local part of the (CSR) matrix (start:end-1), iscol would be two parts, left (0:start) and right (end:N-1)</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"><div dir="ltr"><div>Also, from the manual, ı understood that MatSetLocalToGlobalMapping should be used before this routine </div></div></blockquote><div><br></div><div>I don't understand what you are referring to, but I am confused about what you are trying to do. Perhaps you can explain what you are trying to accomplish and we can help you with the details.</div><div><br></div><div>Thanks,</div><div>Mark</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"><div dir="ltr"><div>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.</div><div><br></div><div>How can I fix this probelm?</div><div><br></div><div>Thank you,</div><div><br></div><div>Eda</div></div>
</blockquote></div></div>