[petsc-users] Fortran: PetscDSRestoreTabulation + PetscDSGetTabulation
Matthew Knepley
knepley at gmail.com
Thu Aug 29 16:18:25 CDT 2024
On Thu, Aug 29, 2024 at 9:57 AM Martin Diehl <martin.diehl at kuleuven.be>
wrote:
> Dear PETSc team,
>
> I have a question regarding the use of PetscDSGetTabulation from
> Fortran.
> PetscDSGetTabulation has a slightly different function signature
> between Fortran and C. In addition, there is an (undocumented)
> PetscDSRestoreTabulation in Fortran which cleans up the arrays. Calling
> it results in a segmentation fault.
>
> I believe that PetscDSRestoreTabulation is not needed. At least our
> Fortran FEM code compiles and runs without it. However, we have
> convergence issues that we don't understand so any suspicious code is
> currently under investigation.
>
This may be due to my weak Fortran knowledge. Here is the code
https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/interface/f90-custom/zdtdsf90.c?ref_type=heads__;!!G_uCfscf7eWS!dBU6FLrC9bckJQhQgaPX-SxZbtbXKaPqvirTeDpSB_7r8Pn1M2Lo4ZkCq70i-eFj3KAT-qA_gjQDfjsxLbf2$
I call F90Array1dCreate() in the GetTabulation and F90Array1dDestroy() in
the RestoreTabulation(), which I thought
was right. However, I remember something about interface declarations,
which have now moved somewhere I cannot find.
Barry, is the interface declaration for this function correct?
Thanks,
Matt
> 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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dBU6FLrC9bckJQhQgaPX-SxZbtbXKaPqvirTeDpSB_7r8Pn1M2Lo4ZkCq70i-eFj3KAT-qA_gjQDfgnXdIvK$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dBU6FLrC9bckJQhQgaPX-SxZbtbXKaPqvirTeDpSB_7r8Pn1M2Lo4ZkCq70i-eFj3KAT-qA_gjQDfmLCD_GY$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240829/1f12bb78/attachment.html>
More information about the petsc-users
mailing list