[petsc-users] Matrix-Free Newton Krylov with Automatic Differentiation and User Provided Preconditioner
Buesing, Henrik
hbuesing at eonerc.rwth-aachen.de
Fri Apr 20 04:31:13 CDT 2018
Dear all,
I would like to use the matrix-free feature from PETSc, but I do not want to use finite differences to calculate J*u but automatic differentiation (AD). Since I do not want to live totally without preconditioning, I want to build important parts of the Jacobian and pass it for preconditioning.
As I understand it, I would create a Shell-Matrix A and associate my UserMult function with it. This uses my AD Jacobian J and computes J*u without actually forming J. Then I will create a different matrix P, which will hold a partly assembled Jacobian for preconditioning.
My FormJacobian function then takes this Shell-Matrix as Amat and my preconditioning matrix P as Pmat. Within FormJacobian I build the matrix Pmat, which holds parts of my Jacobian.
Does this make sense? Is this the way how I am supposed to do it? Do UserMult and FormJacobian function do the right things?
Thank you!
Henrik
--
Dipl.-Math. Henrik Büsing
Applied Geophysics and Geothermal Energy
E.ON Energy Research Center
RWTH Aachen University
-----------------------------------------------
Mathieustr. 10 | Tel +49 (0)241 80 49907
52074 Aachen, Germany | Fax +49 (0)241 80 49889
-----------------------------------------------
http://www.eonerc.rwth-aachen.de/GGE
hbuesing at eonerc.rwth-aachen.de
-----------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180420/1e0520e9/attachment.html>
More information about the petsc-users
mailing list