TSSetIFunction#

Set the function to compute F(t,U,U_t) where F() = 0 is the DAE to be solved.

Synopsis#

#include "petscts.h"  
PetscErrorCode TSSetIFunction(TS ts, Vec r, TSIFunctionFn *f, void *ctx)

Logically Collective

Input Parameters#

  • ts - the TS context obtained from TSCreate()

  • r - vector to hold the residual (or NULL to have it created internally)

  • f - the function evaluation routine

  • ctx - user-defined context for private data for the function evaluation routine (may be NULL)

Note#

The user MUST call either this routine or TSSetRHSFunction() to define the ODE. When solving DAEs you must use this function.

See Also#

TS: Scalable ODE and DAE Solvers, TS, TSIFunctionFn, TSSetRHSJacobian(), TSSetRHSFunction(), TSSetIJacobian()

Level#

beginner

Location#

src/ts/interface/ts.c

Examples#

src/ts/tutorials/ex36.c
src/ts/tutorials/ex31.c
src/ts/utils/dmplexlandau/tutorials/ex1.c
src/ts/tutorials/ex20fwd.c
src/ts/tutorials/ex20.c
src/ts/utils/dmplexlandau/tutorials/ex1f90.F90
src/ts/utils/dmplexlandau/tutorials/ex2.c
src/ts/tutorials/ex20adj.c
src/ts/tutorials/ex32.c
src/ts/tutorials/ex24.c


Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages