#include "tao.h" int TaoAppSetJacobianRoutine(TAO_APPLICATION taoapp,int (*jac)(TAO_APPLICATION,Vec,Mat*,Mat*,MatStructure*,void*),void *ctx)Collective on TAO_APPLICATION and Mat
taoapp | - the TAO_APPLICATION context | |
jac | - Jacobian evaluation routine | |
ctx | - [optional] user-defined context for private data for the Hessian evaluation routine (may be TAO_NULL) |
jac (TAO_APPLICATION taoapp,Vec x,Mat *J,Mat *JPre, void *ctx);
taoapp | - the TAO_APPLICATION context | |
x | - input vector | |
J | - Jacobian matrix | |
JPre | - matrix to precondition J | |
ctx | - [optional] user-defined Hessian context |
The function jac() takes Mat * as the matrix arguments rather than Mat. This allows the Jacobian evaluation routine to replace J with a completely new new matrix structure (not just different matrix elements) when appropriate, for instance, if the nonzero structure is changing throughout the global iterations.
Level:intermediate
Location:src/petsctao/application/petscapp/tao_app_j.c
TAO Solver Index
Table of Contents