<div dir="ltr">Also note that MatShell is _exactly_ the same as the CVODE interface. It is just a wrapper for that function pointer so that we do not need to change the top-level interface.<div><br></div><div> Thanks,</div><div><br></div><div> Matt</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Jul 8, 2025 at 2:10 AM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</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">Using MatShell is the standard method. Note that MatShell allows exposing other "matrix operations", such as producing a diagonal or other preconditioning ingredients.<br>
<br>
Art <<a href="mailto:mac3bar@gmail.com" target="_blank">mac3bar@gmail.com</a>> writes:<br>
<br>
> Hi all,<br>
><br>
> I am integrating a stiff system of ODEs/PDEs using PETSc TS (typically with<br>
> BDF or other implicit time-stepping schemes), and I would like to exploit<br>
> the fact that I can efficiently compute the action of the Jacobian on a<br>
> vector (Jv) without assembling the full Jacobian matrix. Since for a large<br>
> system it becomes expensive to assemble the Jacobian in each iteration. In<br>
> scikits.odes (SUNDIALS/CVODE), there is a native API for passing only a J*v<br>
> routine to the time integrator. In my experience, when I use only a<br>
> Jacobian-vector product routine (without assembling the full matrix), the<br>
> performance improves significantly for large systems. However, in PETSc TS,<br>
> the workflow seems more matrix-centric, and I have only found the<br>
> possibility to use MatShell for the Jacobian<br>
><br>
> Is there a way to do something similar in PETSc TS (for BDF or other<br>
> implicit schemes)?<br>
><br>
> Currently, I use the matrix-free Newton-Krylov method to approximate the<br>
> Jacobian and have adjusted the tolerances to achieve convergence, as<br>
> recommended by Barry. In that case, I obtain similar integration times<br>
> with scikits.odes CVODE without using the Jacobian times vector.<br>
><br>
> Best regards,<br>
><br>
> Art<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!ee4C66EMPaHUhn55k5ZDEY4tEPmxzmhPifOJHGQtd6NBISPZb8UlupQ3u-o3Vt7n7NjYikEhGokM90c1eT9N$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div>