<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font face="Ubuntu">Thanks Jed for your reply.<br>
      <br>
      1) I will use the DMDA object type then. I am still not very clear
      about the difference between DA and DMDA though.<br>
      <br>
      2) I am not interested in having ghost nodes updated. I want the
      proper values of the solution on the proper processor.<br>
           I have to fill the known-terms-vector with nodes-dependent
      values ( in contrast with  </font>ex45f.F, where vector b is
    filled with 1s, thus there is<br>
         no dependence on the grid location). Since every processor
    defines "non-local" (according to the PETSc internal ordering)
    components, the vector is re-arranged<br>
         and so is the solution vector.  So I will have on every process
    a solution  which partially should be on a difference process. And
    this is not about ghost cell.<br>
        Sorry for this long explanation but I am trying to be as clear
    as I can.<br>
    <br>
    Thank you fro your help and patience,<br>
    <br>
    Michele<br>
    <br>
    <font face="Ubuntu"><br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 06/26/2012 10:42 AM, Jed Brown
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAM9tzSnxsMn-XdrMnwLQQbCwSxJ2YEU=cSL6HSdefkyQST3mWg@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On Tue, Jun 26, 2012 at 9:37 AM, Michele
        Rosso <span dir="ltr"><<a moz-do-not-send="true"
            href="mailto:mrosso@uci.edu" target="_blank">mrosso@uci.edu</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"> <font face="Ubuntu">Hi,<br>
              <br>
              I need some help to use the PETSc library inside my
              Fortran 95 code.<br>
              My goal is to solve a symmetric linear system that derives
              from the finite difference discretization<br>
              of the Poisson equation. I will use the preconditioned
              conjugate method.<br>
              <br>
              I am mostly interested in how to decompose my data among
              the different processes. <br>
              In particular:<br>
              <br>
              1) Since my code already implements the 2D-decomposition,
              would it be best to build the matrix with the  DMDA object
              type, DA object type<br>
                   or the regular Mat type? <br>
            </font></div>
        </blockquote>
        <div><br>
        </div>
        <div>It is certainly easiest to just use DMDA (and you will get
          geometric multigrid for free, which is unbeatable for this
          problem), but you can work directly with Mat if you prefer.
          See src/ksp/ksp/examples/tutorials/ex45f.F for a Fortran
          example.</div>
        <div> </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"><font face="Ubuntu"> <br>
              2) After inserting values into a vector/matrix, PETSc
              performs any needed message passing of nonlocal
              components, thus the values locally contained on a
              process  may be communicated to another process.  How can
              I revert this at the end of the computation, that is, how
              can I be sure that the local solution vector contains the
              values associated to the grid nodes contained into the
              hosting process?<br>
            </font></div>
        </blockquote>
        <div><br>
        </div>
        <div>Please read the section of the user's manual on local
          versus global spaces and the structured grid decompositions.
          If you use DM, there is DMGlobalToLocalBegin/End that update
          the ghost points in the local vectors.</div>
        <div> </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"><font face="Ubuntu"> <br>
                    <br>
              Thank you,<br>
              <br>
              Michele</font> </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
  </body>
</html>