exact MPI-based matrix using MatGetSubMatrix()

Barry Smith bsmith at mcs.anl.gov
Wed Dec 24 13:15:44 CST 2008


   If you want the resulting A11, etc to have the same distribution as  
B then when you construct A you will
have to construct it with the rows/columns from the 1 block interlaced  
with the 2 block.  This means
you would form A it would look
a00 a0,n a0,1 a0,n+1 ...
an,0 an,n an,1 an,n+1 ..
a1,0 a1,n ...
....

  Barry


On Dec 23, 2008, at 7:49 PM, Yujie wrote:

> Hi, PETSc Developer
>
> Now, I have two matrices, A and B. A (its dimension is 2N*2N) is  
> MPIDense format. B (N*N) is MPIAIJ.
>
> I want to exact four matrices from A, like this
>
>      A11 A12
>
> A=
>
>      A21 A22
>
> each submatrices is multplied by B. My question is if A11, A12, A21,  
> A22 have same distribution with B, how to do it with  
> MatGetSubMatrix()?
>
> Thanks a lot.
>
> Regards,
>
> Yujie
>




More information about the petsc-users mailing list