[petsc-users] Create MATSEQAIJ from MATMPIAIJ

Eda Oktay eda.oktay at metu.edu.tr
Mon Jun 22 06:14:08 CDT 2020


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!


More information about the petsc-users mailing list