[petsc-users] Create MATSEQAIJ from MATMPIAIJ

Junchao Zhang junchao.zhang at gmail.com
Mon Jun 22 10:00:55 CDT 2020


The resulting matrix is dependent on the number of processes you use (e.g.,
if you run with only one process, you will get a zero matrix).  Think it
over if this is really what you want.

--Junchao Zhang


On Mon, Jun 22, 2020 at 6:14 AM Eda Oktay <eda.oktay at metu.edu.tr> wrote:

> Hello everyone,
>
> I am trying to find elements in off diagonal blocks of a parallel
> sparse matrix. That is why, I want to use MatGetDiagonalBlock and from
> the matrix I obtain, I want to obtain off diagonal elements by
> subtracting it from my original matrix by using MatAXPY.
>
> However, since MatGetDiagonalBlock gives a sequential matrix and my
> original one is parallel, I can't use MatAXPY. That's why I want to
> change the type of one of the matrices.
>
> How can I change a MATSEQAIJ to MATMPIAIJ or vice versa?
>
> Thanks!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200622/a699641c/attachment.html>


More information about the petsc-users mailing list