TSSetRHSFunction#

Sets the routine for evaluating the function, where U_t = G(t,u).

Synopsis#

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

Logically Collective

Input Parameters#

  • ts - the TS context obtained from TSCreate()

  • r - vector to put the computed right-hand side (or NULL to have it created)

  • f - routine for evaluating the right-hand-side function

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

Note#

You must call this function or TSSetIFunction() to define your ODE. You cannot use this function when solving a DAE.

See Also#

TS: Scalable ODE and DAE Solvers, TS, TSRHSFunctionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()

Level#

beginner

Location#

src/ts/interface/ts.c

Examples#

src/ts/tutorials/ex20.c
src/ts/tutorials/extchemfield.c
src/ts/tutorials/ex20td.c
src/ts/tutorials/ex31.c
src/ts/tutorials/ex77.c
src/ts/utils/dmplexlandau/tutorials/ex2.c
src/ts/tutorials/ex51.c
src/ts/utils/dmplexlandau/tutorials/ex1.c
src/ts/tutorials/ex2.c
src/ts/tutorials/ex52.c


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