[petsc-users] MatGetSubmatrices from block matrix MPIBAIJ

shu guo greatgs2008 at gmail.com
Tue Oct 23 01:16:58 CDT 2012


Hi PETSc Users,

I have to subtract a submatrix from a blocked parallel matrix (MPIBAIJ).

from  K_11 K_12  to get K_11
        K_21 K_22

The code is

           call ISCreateStride(PETSC_COMM_WORLD,length,0,1,isrowpp,ierr)
           call MatGetSubMatrices(Kmatem,1,isrowpp,isrowpp,
MAT_INITIAL_MATRIX,Kppseq,ierr)

When I am running it, the command indicates as

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: Indices are not block ordered!
[0]PETSC ERROR:
------------------------------------------------------------------------


The reason seems pretty clear that the IS need to be in block format
either. Although the matrix is created as blocked, during the
calculation I have already permute the indices so that what I need
from the matrix is the square matrix exactly from 0--length. Can
anyone tell me based on my demand, how should I create this blocked IS
to get submatrix? Thank you very much!

Best,
Shu


More information about the petsc-users mailing list