[petsc-dev] PetscSF in Fortran

Jed Brown jed at jedbrown.org
Wed Sep 20 22:15:08 CDT 2017


Unfortunately PetscSFSetGraph/PetscSFGetGraph need custom bindings for
Fortran and they have not been written.  Shouldn't be difficult, but
will take a little work/testing.  I would probably make the array of
PetscSFNode be a PetscInt array of length 2n (or of shape (2,n)) --
that's an equivalent memory representation to what we're using now.

Adrian Croucher <a.croucher at auckland.ac.nz> writes:

> hi
>
> For the dual-porosity stuff I'm working on, I'm creating a modified 
> DMPlex. Looking at e.g. TS ex11.c (in the SplitFaces() routine), it 
> appears I am going to have to set up a PetscSF for the new DM (from what 
> I can gather, that is needed for managing parallel communication of 
> partition ghost cell values).
>
> The way I've set up the modified DMPlex, the partition ghost cells are 
> in the same locations as they were in the original single-porosity DM. 
> So I'm thinking I basically just have to copy the SF straight over from 
> the original DM.
>
> The routine DMGetPointSF() seems to work OK in Fortran, but I'm having a 
> bit of trouble with PetscSFGetGraph().
>
> When I try to declare an array of type PetscSFNode for the iremote 
> parameter, it doesn't seem to know about PetscSFNode, even though I have 
> a 'use petsc' in my code, which normally gives access to everything.
>
> Also I'm not sure of exactly how to set up the ilocal and iremote array 
> parameters for this function in Fortran. How should they be declared- as 
> pointer arrays?
>
> - Adrian
>
> -- 
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 4611


More information about the petsc-dev mailing list