On Wed, May 9, 2012 at 8:09 PM, Daniel Christian Weflen <span dir="ltr"><<a href="mailto:Daniel.Weflen@colorado.edu" target="_blank">Daniel.Weflen@colorado.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I still get 0 for both the start and end rows.<br></blockquote><div><br></div><div>1) Is mat_size 0?</div><div><br></div><div>2) If not, put these line in a standalone executable that shows the bug and send it.</div><div>
<br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Dan<div class="HOEnZb"><div class="h5"><br>
<br>
On 05/09/2012 05:35 PM, Lisandro Dalcin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 9 May 2012 20:01, Daniel Christian Weflen<<a href="mailto:Daniel.Weflen@colorado.edu" target="_blank">Daniel.Weflen@colorado.<u></u>edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have the following code:<br>
<br>
Mat H;<br>
PetscInt mat_size=x_npts*y_npts;<br>
ierr=MatCreate(PETSC_COMM_<u></u>WORLD,&H);CHKERRQ(ierr);<br>
<br>
ierr=MatSetSizes(H,PETSC_<u></u>DECIDE,PETSC_DECIDE,mat_size,<u></u>mat_size);CHKERRQ(ierr);<br>
ierr=MatSetType(H,MATSEQMAIJ);<u></u>CHKERRQ(ierr);<br>
PetscInt* nonzeros;<br>
PetscInt start_row,end_row,row_index;<br>
MatGetOwnershipRange(H,&start_<u></u>row,&end_row);<br>
<br>
When I check the values of start_row and end_row right after calling<br>
MatGetOwnershipRange, both are 0. What am I doing wrong here? Am I calling<br>
MatCreate(), MatSetSizes() and MatSetType() in the wrong order?<br>
</blockquote>
Call MatSetUp() after MatSetType().<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>