Re: [petsc-users] Matrix-Free J*v in PETSc

2025-07-09 Thread Art
at 12:21 PM > *To: *Art , "petsc-users@mcs.anl.gov" < > petsc-users@mcs.anl.gov> > *Subject: *Re: [petsc-users] Matrix-Free J*v in PETSc > > > > Hi Art, > > Here is a TS example that uses MatShell for implicit time integration and > adjoint sensitivity calc

Re: [petsc-users] Matrix-Free J*v in PETSc

2025-07-08 Thread Zhang, Hong via petsc-users
at 12:21 PM To: Art , "petsc-users@mcs.anl.gov" Subject: Re: [petsc-users] Matrix-Free J*v in PETSc Hi Art, Here is a TS example that uses MatShell for implicit time integration and adjoint sensitivity calculation: src/ts/tutorials/advection-diffusion-reaction/ex5adj_mf.c You will n

Re: [petsc-users] Matrix-Free J*v in PETSc

2025-07-08 Thread Zhang, Hong via petsc-users
product) routines that are also included in this example. Hong From: petsc-users on behalf of Art Date: Monday, July 7, 2025 at 9:33 AM To: "petsc-users@mcs.anl.gov" Subject: [petsc-users] Matrix-Free J*v in PETSc Hi all, I am integrating a stiff system of ODEs/PDEs using PETSc TS

Re: [petsc-users] Matrix-Free J*v in PETSc

2025-07-08 Thread Matthew Knepley
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. Thanks, Matt On Tue, Jul 8, 2025 at 2:10 AM Jed Brown wrote: > Using MatShell is the standard method. Note that

Re: [petsc-users] Matrix-Free J*v in PETSc

2025-07-07 Thread Jed Brown
Using MatShell is the standard method. Note that MatShell allows exposing other "matrix operations", such as producing a diagonal or other preconditioning ingredients. Art writes: > Hi all, > > I am integrating a stiff system of ODEs/PDEs using PETSc TS (typically with > BDF or other implicit

[petsc-users] Matrix-Free J*v in PETSc

2025-07-07 Thread Art
Hi all, I am integrating a stiff system of ODEs/PDEs using PETSc TS (typically with BDF or other implicit time-stepping schemes), and I would like to exploit the fact that I can efficiently compute the action of the Jacobian on a vector (Jv) without assembling the full Jacobian matrix. Since for a