[petsc-users] MatGetSubmatrices from block matrix MPIBAIJ

Jed Brown jedbrown at mcs.anl.gov
Tue Oct 23 06:46:03 CDT 2012


On Tue, Oct 23, 2012 at 1:16 AM, shu guo <greatgs2008 at gmail.com> wrote:

> 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!
>

Always send the ENTIRE error message.


> [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


Why are you doing this permutation? How does it look in parallel?


> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121023/29343528/attachment.html>


More information about the petsc-users mailing list