<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   The interface definition and Fortran stub look ok to my eyeballs. However, eyeballs cannot compile code, so using the debugger to determine the cause of the crash is best.<div><br></div><div>   Barry</div><div><br><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 29, 2024, at 5:18 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr">On Thu, Aug 29, 2024 at 9:57 AM Martin Diehl <<a href="mailto:martin.diehl@kuleuven.be">martin.diehl@kuleuven.be</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear PETSc team,<br>
<br>
I have a question regarding the use of PetscDSGetTabulation from<br>
Fortran.<br>
PetscDSGetTabulation has a slightly different function signature<br>
between Fortran and C. In addition, there is an (undocumented)<br>
PetscDSRestoreTabulation in Fortran which cleans up the arrays. Calling<br>
it results in a segmentation fault.<br>
<br>
I believe that PetscDSRestoreTabulation is not needed. At least our<br>
Fortran FEM code compiles and runs without it. However, we have<br>
convergence issues that we don't understand so any suspicious code is<br>
currently under investigation.<br></blockquote><div><br></div><div>This may be due to my weak Fortran knowledge. Here is the code</div><div><br></div><div>  <a href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/interface/f90-custom/zdtdsf90.c?ref_type=heads__;!!G_uCfscf7eWS!c6UMUopH2bMHgSiLAqHoFUrJqajqcyYKZ3EFjfB_9tp9k8ByFqwf12a_M6JkOBU2tA3kSC5h83TvWw9kIrmuwic$">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/interface/f90-custom/zdtdsf90.c?ref_type=heads</a></div><div><br></div><div>I call F90Array1dCreate() in the GetTabulation and F90Array1dDestroy() in the RestoreTabulation(), which I thought</div><div>was right. However, I remember something about interface declarations, which have now moved somewhere I cannot find.</div><div><br></div><div>Barry, is the interface declaration for this function correct?</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
best regards,<br>
Martin<br>
<br>
-- <br>
KU Leuven<br>
Department of Computer Science<br>
Department of Materials Engineering<br>
Celestijnenlaan 200a<br>
3001 Leuven, Belgium<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!c6UMUopH2bMHgSiLAqHoFUrJqajqcyYKZ3EFjfB_9tp9k8ByFqwf12a_M6JkOBU2tA3kSC5h83TvWw9kZ05AVyI$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></body></html>