<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;">fixed<div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Dec 12, 2023, at 11:17 PM, Sanjay Govindjee <s_g@berkeley.edu> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>did you mean to write</div><div><pre id="gmail-codecell9"><span class="gmail-k">type</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-n">userctx</span><span class="gmail-p">)</span><span class="gmail-w"> ctx<br></span></pre><pre id="gmail-codecell9"><span class="gmail-w">in this example?<br></span></pre><pre id="gmail-codecell9"><span class="gmail-w"></span><br></pre><pre id="gmail-codecell9"><span class="gmail-w"></span></pre><pre id="gmail-codecell9">subroutine func(snes, x, f, ctx, ierr)<br>SNES snes<br>Vec x,f<br>type (userctx) user<br>PetscErrorCode ierr<br>...<br><br>external func<br>SNESSetFunction(snes, r, func, ctx, ierr)<br>SNES snes<br>Vec r<br>PetscErrorCode ierr<br>type (userctx) user</pre><pre id="gmail-codecell9"><span class="gmail-w"></span></pre></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 12, 2023 at 7:10 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div><span style="font-size:medium">See </span><a href="https://petsc.gitlab.io/-/petsc/-/jobs/5739238224/artifacts/public/html/manual/fortran.html#ch-fortran" rel="nofollow noreferrer noopener" target="_blank">https://petsc.gitlab.io/-/petsc/-/jobs/5739238224/artifacts/public/html/manual/fortran.html#ch-fortran</a><span style="font-size:medium"> and </span><a href="https://gitlab.com/petsc/petsc/-/merge_requests/7114" target="_blank">https://gitlab.com/petsc/petsc/-/merge_requests/7114</a><div><br></div><div><br id="m_-558040727457705067lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Dec 12, 2023, at 3:22 PM, Palmer, Bruce J via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div><br><div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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?<u></u><u></u></span></div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div id="m_-558040727457705067mail-editor-reference-message-container"><div><div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) currentcolor currentcolor;padding:3pt 0in 0in"><p class="MsoNormal" style="margin:0in 0in 12pt;font-size:10pt;font-family:Calibri,sans-serif"><b><span style="font-size:12pt">From:<span> </span></span></b><span style="font-size:12pt">Matthew Knepley <<a href="mailto:knepley@gmail.com" style="color:blue;text-decoration:underline" target="_blank">knepley@gmail.com</a>><br><b>Date:<span> </span></b>Tuesday, December 12, 2023 at 8:33 AM<br><b>To:<span> </span></b>Palmer, Bruce J <<a href="mailto:Bruce.Palmer@pnnl.gov" style="color:blue;text-decoration:underline" target="_blank">Bruce.Palmer@pnnl.gov</a>><br><b>Cc:<span> </span></b><a href="mailto:petsc-users@mcs.anl.gov" style="color:blue;text-decoration:underline" target="_blank">petsc-users@mcs.anl.gov</a><span> </span><<a href="mailto:petsc-users@mcs.anl.gov" style="color:blue;text-decoration:underline" target="_blank">petsc-users@mcs.anl.gov</a>><br><b>Subject:<span> </span></b>Re: [petsc-users] Fortran Interface<u></u><u></u></span></p></div><div style="border-width:medium medium medium 6pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(215,118,0);padding:0in;font-size:1.15rem"><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif;text-align:center;background:rgb(247,227,204)"><span style="font-size:11pt;font-family:Arial,sans-serif">Check twice before you click! This email originated from outside PNNL.</span><span style="font-size:11pt;font-family:Arial,sans-serif"><u></u><u></u></span></div></div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div><div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">On Tue, Dec 12, 2023 at 11:27 AM Palmer, Bruce J via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" style="color:blue;text-decoration:underline" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<u></u><u></u></span></div></div><div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Does documentation for the PETSc fortran interface still exist? I looked at the web pages for 3.20 (<a href="http://petsc.org/release" style="color:blue;text-decoration:underline" target="_blank">petsc.org/release</a>) but if you go under the tab C/Fortran API, only descriptions for the C interface are there.<u></u><u></u></span></div></div></div></div></blockquote><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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:<u></u><u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> <a href="https://petsc.org/release/manual/fortran/" style="color:blue;text-decoration:underline" target="_blank">https://petsc.org/release/manual/fortran/</a><u></u><u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> Thanks,<u></u><u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> Matt<u></u><u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> <u></u><u></u></span></div></div><blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Bruce Palmer<u></u><u></u></span></div></div></div></div></blockquote></div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><br clear="all"><u></u><u></u></span></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span><span style="font-size:11pt">--</span></span><span style="font-size:11pt"><u></u><u></u></span></div><div><div><div><div><div><div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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<u></u><u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div><div style="margin:0in;font-size:10pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><a href="http://www.cse.buffalo.edu/~knepley/" style="color:blue;text-decoration:underline" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></body></html>