On Tue, Jul 10, 2012 at 5:39 AM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</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">

  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    I read in the manual in page 50 that it's recommended to declare
    struct to represent field for dof > 1 for DM.<br></div></blockquote><div><br></div><div>We mean C struct. C makes it easy (just use a pointer type cast). Fortran makes it hard unfortunately.</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">
    I'm using Fortran and for testing, I use dof = 1 and write as:<br>
    <br>
    <i>type field<br>
      <br>
          </i><i>PetscScalar</i><i> u        (or real(8) :: u)<br>
      <br>
      end type field<br>
      <br>
      type(field), pointer :: field_u(:,:)</i><br>
    <br>
    When I tried to use :<br>
    <br>
    <i>call DMDAVecGetArrayF90(da,x_local,field_u,ierr)</i><br>
    <br>
    I got the error : There is no matching specific subroutine for this
    generic subroutine call.   [DMDAVECGETARRAYF90]<br>
    <br>
    The da, x_local has been defined with the specific DM routines. It
    worked if I use :<br>
    <br>
    <i>PetscScalar,pointer :: array(:,:) and<br>
      <br>
      call DMDAVecGetArrayF90(da,x_local,array,ierr)</i><br>
    <br>
    May I know what did I do wrong?<span class="HOEnZb"><font color="#888888"><br>
    <br>
    <br>
    <pre cols="72">-- 
Yours sincerely,

TAY wee-beng</pre>
  </font></span></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>