[petsc-users] Getting 0 for both start and end with MatGetOwnershipRange()

Daniel Christian Weflen Daniel.Weflen at Colorado.EDU
Wed May 9 18:01:34 CDT 2012


I have the following code:

     Mat H;
     PetscInt mat_size=x_npts*y_npts;
     ierr=MatCreate(PETSC_COMM_WORLD,&H);CHKERRQ(ierr);
     
ierr=MatSetSizes(H,PETSC_DECIDE,PETSC_DECIDE,mat_size,mat_size);CHKERRQ(ierr);
     ierr=MatSetType(H,MATSEQMAIJ);CHKERRQ(ierr);
     PetscInt* nonzeros;
     PetscInt start_row,end_row,row_index;
     MatGetOwnershipRange(H,&start_row,&end_row);

When I check the values of start_row and end_row right after calling 
MatGetOwnershipRange, both are 0. What am I doing wrong here? Am I 
calling MatCreate(), MatSetSizes() and MatSetType() in the wrong order?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120509/3da7a7ae/attachment.htm>


More information about the petsc-users mailing list