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

Daniel Christian Weflen Daniel.Weflen at Colorado.EDU
Wed May 9 19:09:21 CDT 2012


I still get 0 for both the start and end rows.

-Dan

On 05/09/2012 05:35 PM, Lisandro Dalcin wrote:
> On 9 May 2012 20:01, Daniel Christian Weflen<Daniel.Weflen at colorado.edu>  wrote:
>> 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?
> Call MatSetUp() after MatSetType().
>
>


More information about the petsc-users mailing list