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 [email protected] -----------------------------------------------
