<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 28, 2014 at 10:26 PM, Adrian Croucher <span dir="ltr"><<a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    <div>On 29/05/14 14:48, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote"><br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> OK. There are a few
                other things missing or broken in the Fortran interfaces
                that I will need at some point- e.g.
                DMPlexConstructGhostCells(), PetscFVCreate(). At present
                I'm writing my test code in C to avoid this issue, but
                will need to get it going in fortran eventually.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Okay,  I pushed those fixes to next.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Oh great, thanks very much :-)<br>
    <br>
    Is there a trick to calling PetscFVCreate() from fortran though? The
    test code snippet below errors out when I run it:<br></div></blockquote><div><br></div><div>You might have an old version of 'bfort' which does not know PetscFV is a type and thus creates</div><div>incorrect bindings. I am sending you src/dm/dt/interface/ftn-auto/dtfvf.c so you can test, but</div>
<div>you should</div><div><br></div><div>  rm -rf $PETSC_DIR/$PETSC_ARCH/externalpackages/sowing*</div><div>  rm -rf $PETSC_DIR/$PETSC_ARCH/conf/sowing</div><div><br></div><div>and reconfigure using</div><div><br></div><div>
  ./$PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
    program main<br>
    <br>
    ! testing PetscFVM from fortran<br>
    <br>
      implicit none<br>
    #include <finclude/petsc.h90><br>
      PetscFV :: fvm<br>
      PetscErrorCode :: ierr<br>
    <br>
      call PetscInitialize(PETSC_NULL_CHARACTER,ierr); CHKERRQ(ierr)<br>
      call PetscFVCreate(PETSC_COMM_WORLD, fvm, ierr); CHKERRQ(ierr)<br>
      call PetscFVDestroy(fvm, ierr); CHKERRQ(ierr)<br>
      call PetscFinalize(ierr); CHKERRQ(ierr)<br>
    <br>
    end program main<br>
    <br>
    The error is:<br>
    <br>
    [0]PETSC ERROR: --------------------- Error Message
    --------------------------------------------------------------<br>
    [0]PETSC ERROR: Null argument, when expecting valid pointer<br>
    [0]PETSC ERROR: Null Pointer: Parameter # 2<br>
    [0]PETSC ERROR: See
    <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble
    shooting.<br>
    [0]PETSC ERROR: Petsc Development GIT revision:
    v3.4.4-5833-g396e404  GIT Date: 2014-05-28 21:50:40 -0500<br>
    [0]PETSC ERROR: ./testfvm on a linux-gnu-c-opt named des108 by
    acro018 Thu May 29 15:01:42 2014<br>
    [0]PETSC ERROR: Configure options --download-netcdf
    --download-exodusii --with-hdf5-dir=/usr/lib
    --with-numpy-dir=/usr/lib/pymodules/p<br>
    ython2.7/numpy
    --with-scientificpython-dir=/usr/lib/python2.7/dist-packages/scipy
    --with-petsc4py-dir=/usr/local/lib/python2.7/dist-pa<br>
    ckages/petsc4py --download-triangle --with-fortran-interfaces=1
    --download-ptscotch --download-chaco --download-ctetgen             
    <br>
    [0]PETSC ERROR: #1 PetscFVCreate() line 1356 in
    /home/acro018/software/PETSc/code/src/dm/dt/interface/dtfv.c<br>
--------------------------------------------------------------------------<br>
    <br>
    Cheers, Adrian<span class=""><font color="#888888"><br>
    <pre cols="72">-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: <a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a>
tel: <a href="tel:%2B64%20%280%299%20923%204611" value="+6499234611" target="_blank">+64 (0)9 923 4611</a>
</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
</div></div>