[petsc-users] Fortran Interface
Palmer, Bruce J
Bruce.Palmer at pnnl.gov
Wed Dec 13 10:42:16 CST 2023
Thanks, that clears things up nicely.
Bruce
From: Barry Smith <bsmith at petsc.dev>
Date: Wednesday, December 13, 2023 at 6:28 AM
To: Sanjay Govindjee <s_g at berkeley.edu>
Cc: Palmer, Bruce J <Bruce.Palmer at pnnl.gov>, petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Fortran Interface
fixed
On Dec 12, 2023, at 11:17 PM, Sanjay Govindjee <s_g at berkeley.edu> wrote:
did you mean to write
type (userctx) ctx
in this example?
subroutine func(snes, x, f, ctx, ierr)
SNES snes
Vec x,f
type (userctx) user
PetscErrorCode ierr
...
external func
SNESSetFunction(snes, r, func, ctx, ierr)
SNES snes
Vec r
PetscErrorCode ierr
type (userctx) user
On Tue, Dec 12, 2023 at 7:10 PM Barry Smith <bsmith at petsc.dev<mailto:bsmith at petsc.dev>> wrote:
See https://petsc.gitlab.io/-/petsc/-/jobs/5739238224/artifacts/public/html/manual/fortran.html#ch-fortran and https://gitlab.com/petsc/petsc/-/merge_requests/7114
On Dec 12, 2023, at 3:22 PM, Palmer, Bruce J via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
What do you do with something like a void pointer? I’m looking at the TaoSetObjectiveAndGradient function and it wants to pass a void *ctx pointer. You can set this to null, but apparently you have to specify the type. What type should I use? Is there something called PETSC_NULL_VOID or PETSC_NULL_CONTEXT or do I use something else?
From: Matthew Knepley <knepley at gmail.com<mailto:knepley at gmail.com>>
Date: Tuesday, December 12, 2023 at 8:33 AM
To: Palmer, Bruce J <Bruce.Palmer at pnnl.gov<mailto:Bruce.Palmer at pnnl.gov>>
Cc: petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov> <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>>
Subject: Re: [petsc-users] Fortran Interface
Check twice before you click! This email originated from outside PNNL.
On Tue, Dec 12, 2023 at 11:27 AM Palmer, Bruce J via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
Does documentation for the PETSc fortran interface still exist? I looked at the web pages for 3.20 (petsc.org/release<http://petsc.org/release>) but if you go under the tab C/Fortran API, only descriptions for the C interface are there.
I think after the most recent changes, the interface was supposed to be very close to C, so we just document the differences on specific pages, and put the general stuff here:
https://petsc.org/release/manual/fortran/
Thanks,
Matt
Bruce Palmer
--
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/<http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231213/4cec86c5/attachment-0001.html>
More information about the petsc-users
mailing list