[petsc-users] TSAdjointSolve using MatShell for RHSJacobianP

Zhang, Hong hongzhang at anl.gov
Thu Apr 9 23:16:05 CDT 2026


Stefanie,

Your understanding is correct. The Adjoint solvers do not require MatMult(). Only MatMultTranspose() is needed for your JacP matrix.

Hong
________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Guenther, Stefanie via petsc-users <petsc-users at mcs.anl.gov>
Sent: Thursday, April 9, 2026 7:26 PM
To: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: [petsc-users] TSAdjointSolve using MatShell for RHSJacobianP

Hi,

I want to use the TS adjoint solve to backpropagate gradients within a linear ODE of the form \dot u(t)= A(p,t)u(t). I want to use a MatShell for the RHSJacobianP function, representing the rectangular matrix dA(p,t)/dp * u. However, I only have the MatMultTranspose function available for this, not a MatMult. Is the MatMult strictly required for this shell? As far as I know, the back propagation should only be using the MatMultTranspose anyways, to apply (dRHS/dp)^T  * ubar, so I would think it should work without the MatMult, is that correct?

Thank you very much!
Stefanie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260410/2250b76e/attachment.html>


More information about the petsc-users mailing list