<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I changed the type from MATSEQMAIJ to MATSEQAIJ and it works
    correctly. mat_size is not 0, should I still send the standalone
    executable?<br>
    <br>
    -Dan<br>
    <br>
    On 05/10/2012 05:21 AM, Matthew Knepley wrote:
    <blockquote
cite="mid:CAMYG4GmHW-ztFX1cwrjPRVHf3GxhCVNwVR_YysRBcNc9me7_Yw@mail.gmail.com"
      type="cite">On Wed, May 9, 2012 at 8:09 PM, Daniel Christian
      Weflen <span dir="ltr">&lt;<a moz-do-not-send="true"
          href="mailto:Daniel.Weflen@colorado.edu" target="_blank">Daniel.Weflen@colorado.edu</a>&gt;</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>&nbsp; &nbsp;Thanks,</div>
        <div><br>
        </div>
        <div>&nbsp; &nbsp; &nbsp;Matt</div>
        <div>&nbsp;</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&lt;<a
                  moz-do-not-send="true"
                  href="mailto:Daniel.Weflen@colorado.edu"
                  target="_blank">Daniel.Weflen@colorado.edu</a>&gt;
                &nbsp;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>
                  &nbsp; &nbsp; Mat H;<br>
                  &nbsp; &nbsp; PetscInt mat_size=x_npts*y_npts;<br>
                  &nbsp; &nbsp; ierr=MatCreate(PETSC_COMM_WORLD,&amp;H);CHKERRQ(ierr);<br>
                  <br>
                  ierr=MatSetSizes(H,PETSC_DECIDE,PETSC_DECIDE,mat_size,mat_size);CHKERRQ(ierr);<br>
                  &nbsp; &nbsp; ierr=MatSetType(H,MATSEQMAIJ);CHKERRQ(ierr);<br>
                  &nbsp; &nbsp; PetscInt* nonzeros;<br>
                  &nbsp; &nbsp; PetscInt start_row,end_row,row_index;<br>
                  &nbsp; &nbsp; MatGetOwnershipRange(H,&amp;start_row,&amp;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>
    </blockquote>
  </body>
</html>