<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>  I think it is best to code the modified GMRES method in C; likely, much of the current GMRES code could be reused. We'd be happy to help incorporate it into PETSc.<div><br></div><div>  Barry</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jan 22, 2025, at 5:11 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr">On Wed, Jan 22, 2025 at 3:18 PM Frank Bramkamp <<a href="mailto:bramkamp@nsc.liu.se">bramkamp@nsc.liu.se</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><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 was planning to program a custom KSP method, some modified GMRES.<br>
We mainly use PETSc from Fortran. Therefore I wonder it is possible<br>
to have an interface to a custom KSP solver that is written in fortran.<br>
<br>
I thought of using KSPRegister to register my own routine, but that seems only<br>
available in C.  Or is it possible to have a fortran/C wrapper to do that ?<br></blockquote><div><br></div><div>We have wrappers for other functions that take callbacks, such as SNESSetFunction(). What</div><div>we need to do is have a list of Fortran function pointers for this method. They when you</div><div>register, we actually stick in a C wrapper that calls your Fortran function pointer that we have</div><div>stored in our list. It should be straightforward looking at the implementation for something like</div><div>SNESSetFunction(). We would help if you want to try :)</div><div><br></div><div>Barry, is this impacted by your binding rewrite?</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">
Thanks, Frank Bramkamp<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><div><br clear="all"></div><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!eRXZvRoV2JfqzeOdQlhP6UA71kWfULNX_F1C0-Fer5IItdUKkmstwIO3N1VrmApHJYGGisuS6EyybdCUXUwi$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></body></html>