<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I have the following code:<br>
<br>
<font face="Courier New, Courier, monospace"> Mat H;<br>
PetscInt mat_size=x_npts*y_npts;<br>
ierr=MatCreate(PETSC_COMM_WORLD,&H);CHKERRQ(ierr);<br>
ierr=MatSetSizes(H,PETSC_DECIDE,PETSC_DECIDE,mat_size,mat_size);CHKERRQ(ierr);<br>
ierr=MatSetType(H,MATSEQMAIJ);CHKERRQ(ierr);<br>
PetscInt* nonzeros;<br>
PetscInt start_row,end_row,row_index;<br>
MatGetOwnershipRange(H,&start_row,&end_row);</font><br>
<br>
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?<br>
</body>
</html>