[petsc-users] ISCreateStride and MatGetSubmatrices

shu guo greatgs2008 at gmail.com
Tue Aug 28 10:56:29 CDT 2012


Hi All,

I think I made a mistake. It seems it crashes when I call the command
of MatGetSubMatrices. There is an indication that saying,

 MatGetSubmatrices() is slightly different from C since the
     Fortran provides the array to hold the submatrix objects,while in C that
     array is allocated by the MatGetSubmatrices()

What does this mean? I don't even need this command to extract the submatrix?

Shu

On Tue, Aug 28, 2012 at 11:33 AM, shu guo <greatgs2008 at gmail.com> wrote:
> Dear All,
>
> I want to extract a sequential matrix from a MPIBAIJ matrix A with a
> dimension of 4n*4n. After assembly A, I use ISCreateStride to define
> the index by
>
>           call ISCreateStride(PETSC_COMM_WORLD,n,0,1,isrow,ierr)
>
> And extract the matrix as
>           call MatGetSubMatrices(Kmatem,1,isrow,isrow,
>      &                           MAT_INITIAL_MATRIX,Kmatemseq)
>
> But it gives me a segmentation fault when I call ISCreateStride. Is
> there anything I did wrong? Thanks for any advice.
>
> Shu


More information about the petsc-users mailing list