petsc-3.7.0 2016-04-25
Report Typos and Errors

TSSetIJacobian

Set the function to compute the matrix dF/dU + v*dF/dU_t + a*dF/dU_tt where F(t,U,U_t,U_tt) is the function you provided with TSSetI2Function().

Synopsis

#include "petscts.h"  
PetscErrorCode TSSetI2Jacobian(TS ts,Mat J,Mat P,TSI2Jacobian jac,void *ctx)
Logically Collective on TS

Input Parameters

ts - the TS context obtained from TSCreate()
J - Jacobian matrix
P - preconditioning matrix for J (may be same as J)
jac - the Jacobian evaluation routine
ctx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)

Calling sequence of jac

 jac(TS ts,PetscReal t,Vec U,Vec U_t,Vec U_tt,PetscReal v,PetscReal a,Mat *J,Mat *P,MatStructure *m,void *ctx);

t - time at step/stage being solved
U - state vector
U_t - time derivative of state vector
U_tt - second time derivative of state vector
v - shift for U_t
a - shift for U_tt
J - Jacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU + v*dF/dU_t + a*dF/dU_tt
P - preconditioning matrix for J, may be same as J
m - flag indicating information about the preconditioner matrix structure (same as flag in KSPSetOperators())
ctx - [optional] user-defined context for matrix evaluation routine

Notes

The matrices J and P are exactly the matrices that are used by SNES for the nonlinear solve.

The matrix dF/dU + v*dF/dU_t + a*dF/dU_tt you provide turns out to be the Jacobian of G(U) = F(t,U,W+v*U,W'+a*U) where F(t,U,U_t,U_tt) = 0 is the DAE to be solved. The time integrator internally approximates U_t by W+v*U and U_tt by W'+a*U where the positive "shift" parameters 'a' and 'b' and vectors W, W' depend on the integration method, step size, and past states.

Keywords

TS, timestep, set, ODE, DAE, Jacobian

See Also

TSSetI2Function()

Level:beginner
Location:
src/ts/interface/ts.c
Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/ts/examples/tutorials/ex6.c.html
src/ts/examples/tutorials/ex8.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/ex10.c.html
src/ts/examples/tutorials/ex14.c.html
src/ts/examples/tutorials/ex15.c.html
src/ts/examples/tutorials/ex16.c.html
src/ts/examples/tutorials/ex17.c.html
src/ts/examples/tutorials/ex19.c.html
src/ts/examples/tutorials/ex20.c.html
src/ts/examples/tutorials/ex22.c.html