[petsc-users] PetscSection: Fortran interfaces

Martin Diehl martin.diehl at kuleuven.be
Sat Feb 3 13:09:48 CST 2024


thanks.
I open an issue.

Martin

On Sat, 2024-02-03 at 11:19 -0600, Satish Balay wrote:
> diff --git a/src/vec/f90-mod/petscvecmod.F90 b/src/vec/f90-
> mod/petscvecmod.F90
> index 4c54fbf63dc..8772f89e135 100644
> --- a/src/vec/f90-mod/petscvecmod.F90
> +++ b/src/vec/f90-mod/petscvecmod.F90
> @@ -163,6 +163,7 @@
>  #include <../src/vec/f90-mod/petscvec.h90>
>          interface
>  #include <../src/vec/f90-mod/ftn-auto-interfaces/petscvec.h90>
> +#include <../src/vec/f90-mod/ftn-auto-
> interfaces/petscpetscsection.h90>
>          end interface
>          end module
> 
> 
> Perhaps there are more generated files that are missing from such
> listing..
> 
> Satish
> 
> On Sat, 3 Feb 2024, Martin Diehl wrote:
> 
> > thanks for the quick reply
> > 
> > I think my question was not clear enough:
> > With "interfaces" I ment the Fortran module files that ensure
> > correct
> > calling signatures.
> > 
> > In the example (ex26f90), I can replace "ierr" of
> > PetscSectionGetDof
> > with anything without getting complaints from the compiler. This
> > does
> > not work for other functions, e.g. "ISRestoreIndicesF90" in line
> > 272.
> > 
> > Martin
> >  
> > 
> > On Sat, 2024-02-03 at 11:51 -0500, Matthew Knepley wrote:
> > > Can you give us a simple code that is not working for you?  My
> > > test
> > > should work
> > > 
> > >   src/dm/impls/plex/tests/ex26f90
> > > 
> > >   Thanks,
> > > 
> > >      Matt
> > > 
> > > On Sat, Feb 3, 2024 at 11:36 AM Barry Smith <bsmith at petsc.dev>
> > > wrote:
> > > > 
> > > >   The Fortran "stubs" (subroutines) should be in
> > > > $PETSC_ARCH/src/vec/is/section/interface/ftn-auto/sectionf.c
> > > > and
> > > > compiled and linked into the PETSc library.
> > > > 
> > > >   The same tool that builds the interfaces in
> > > > $PETSC_ARCH/src/vec/f90-mod/ftn-auto-
> > > > interfaces/petscpetscsection.h90,  also builds the stubs so it
> > > > is
> > > > surprising one would exist but not the other.
> > > > 
> > > >   Barry
> > > > 
> > > > 
> > > > > On Feb 3, 2024, at 11:27 AM, Martin Diehl
> > > > > <martin.diehl at kuleuven.be> wrote:
> > > > > 
> > > > > Dear PETSc team,
> > > > > 
> > > > > I currently can't make use of Fortran interfaces for
> > > > > "section".
> > > > > In particular, I can't see how to use
> > > > > 
> > > > > PetscSectionGetFieldComponents                               
> > > > >    
> > > > >     
> > > > > PetscSectionGetFieldDof                                     
> > > > >    
> > > > >      
> > > > > PetscSectionGetFieldOffset
> > > > > 
> > > > > The interfaces for them are created in
> > > > > $PETSC_ARCH/src/vec/f90-
> > > > > mod/ftn-
> > > > > auto-interfaces/petscpetscsection.h90, but it seems that they
> > > > > are
> > > > > not
> > > > > exposed to the public.
> > > > > 
> > > > > Could you give me a hint how to use them or fix this?
> > > > > 
> > > > > with best regards,
> > > > > Martin
> > > > > 
> > > > > 
> > > > > -- 
> > > > > KU Leuven
> > > > > Department of Computer Science
> > > > > Department of Materials Engineering
> > > > > Celestijnenlaan 200a
> > > > > 3001 Leuven, Belgium
> > > > > 
> > > > 
> > > 
> > > 
> > > -- 
> > > What most experimenters take for granted before they begin their
> > > experiments is infinitely more interesting than any results to
> > > which
> > > their experiments lead.
> > > -- Norbert Wiener
> > > 
> > > https://www.cse.buffalo.edu/~knepley/
> > 
> > 

-- 
KU Leuven
Department of Computer Science
Department of Materials Engineering
Celestijnenlaan 200a
3001 Leuven, Belgium

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240203/88ce16a7/attachment.sig>


More information about the petsc-users mailing list