[petsc-users] Interaction between petsc4py and application Fortran library

Barry Smith bsmith at petsc.dev
Mon Sep 27 12:54:46 CDT 2021


  Nathan,

   Yes, you can call PetscInitializeFortran() from your Fortran library.

  Barry


> On Sep 27, 2021, at 11:59 AM, WUKIE, NATHAN A DR-02 USAF AFMC AFRL/RQVC via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> How should petsc initialization be handled for a python application utilizing petsc4py and a Fortran library application also using petsc?
> 
> The petsc documentation states that PetscInitializeFortran "should be called soon AFTER the call to PetscInitialize <https://petsc.org/release/docs/manualpages/Sys/PetscInitialize.html#PetscInitialize>() if one is using a C main program that calls Fortran routines that in turn call PETSc routines". Does petsc4py.init(...) call PetscInitializeFortran? Is it permissible to call PetscInitializeFortran from the fortran library application itself? Or must PetscInitializeFortran be called from the C main program?
> 
> Thank you,
> Nathan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210927/782ea67a/attachment.html>


More information about the petsc-users mailing list