[petsc-users] Finding off diagonal blocks of matrix

Eda Oktay eda.oktay at metu.edu.tr
Thu Jun 20 03:40:17 CDT 2019


Dear all,

I solved my problem without using any Petsc routine. Thanks anyway!

Eda

Smith, Barry F. <bsmith at mcs.anl.gov>, 17 Haz 2019 Pzt, 18:36 tarihinde şunu
yazdı:

>
>   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.
>
>
>
> > On Jun 17, 2019, at 7:44 AM, Eda Oktay via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
> >
> > Hello everyone,
> >
> > 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.
> >
> > 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.
> >
> > How can I fix this probelm?
> >
> > Thank you,
> >
> > Eda
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190620/089af019/attachment.html>


More information about the petsc-users mailing list