<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 10, 2015 at 6:30 AM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    <div>On 10/11/2015 8:27 PM, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Nov 10, 2015 at 3:27 AM, TAY
            wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
              <br>
              Inside my subroutine, I need to access the DA variable
              cu_types_array frequently.<br>
              <br>
              So I need to call DMDAVecGetArrayF90 and
              DMDAVecRestoreArrayF90 before and after frequently.<br>
              <br>
              Is this necessary? Can I call DMDAVecGetArrayF90 at the
              start and only call DMDAVecRestoreArrayF90 towards the
              end, where I don't need to modify the values of
              cu_types_array anymore?<br>
              <br>
              Will this cause memory corruption?<br>
            </blockquote>
            <div><br>
            </div>
            <div>You cannot use any other vector operations before you
              have called Restore.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Hi,<br>
    <br>
    What do you mean by vector operations? I will just be doing some
    maths operation to change the values in cu_types_array. Is that
    fine?</div></blockquote><div><br></div><div>While you have the array, no other operation can change the values.</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"><div bgcolor="#FFFFFF" text="#000000"> <blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              Also, must the array be restored using
              DMDAVecRestoreArrayF90 before calling
              DMLocalToLocalBegin,DMLocalToLocalEnd?</blockquote>
            <div><br>
            </div>
            <div>Yes.</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"><span><font color="#888888"><br><span class="HOEnZb"><font color="#888888">
                  -- <br>
                  Thank you.<br>
                  <br>
                  Yours sincerely,<br>
                  <br>
                  TAY wee-beng<br>
                  <br>
                </font></span></font></span></blockquote><span class="HOEnZb"><font color="#888888">
          </font></span></div><span class="HOEnZb"><font color="#888888">
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div>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</div>
        </font></span></div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>