<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear Jed,<br>
    <br>
    thanks.<br>
    <br>
    Now I have the following:<br>
    <br>
    - Array unk, which should hold values inside the partition and in
    ghost cells.  It is big enough to hold both<br>
    - Vec x, created by command VecCreateGhost, with proper padding for
    ghost cells<br>
    - Successful call to linear solver in parallel.<br>
    <br>
    But I need to copy ghost values from x to my array unk. <br>
    <br>
    How can I do it?<br>
    <br>
    <br>
        Kind regards,<br>
    <br>
    <br>
        Bojan<br>
    <br>
    On 2/23/2012 10:10 PM, Jed Brown wrote:
    <blockquote
cite="mid:CAM9tzSmQradooMhtX-sje=Vy=0=piudnpp534d9M0f3TgvDc4A@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On Thu, Feb 23, 2012 at 15:05, Bojan
        Niceno <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:bojan.niceno@psi.ch">bojan.niceno@psi.ch</a>&gt;</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">No, I use global.<br>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>The local form is just a local vector. It doesn't even know
          that a global problem exists. You can't index into it using
          global indices. (In general, there is no efficient way to look
          up information in the local vector (includes ghost points)
          using global indices.)</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"> <br>
            <tt>  for(Int i=0; i&lt;n; i++) {<br>
                  Int gi = mesh.nodes[i].global_number;<br>
                  VecGetValues(x, 1, &amp;gi, &amp;unk[i]);<br>
                }<br>
            </tt><br>
            "n" is defined as the number of cells inside, i.e. without
            buffers.  "unk" is my external array.  If I try to access
            buffer values, I use:<br>
            <br>
            <tt>  for(Int i=0; i&lt;N; i++) {<br>
                  Int gi = mesh.nodes[i].global_number;<br>
                  VecGetValues(x, 1, &amp;gi, &amp;unk[i]);<br>
                }<br>
            </tt><br>
            But then I end up with tons of warnings, presumably because
            I am going beyond "n".  Vector x was created with
            VecCreateGhost.</div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <img src="cid:part1.03040609.01090806@psi.ch" border="0"></div>
  </body>
</html>