TSSetRHSFunction#
Sets the routine for evaluating the function, where U_t = G(t,u).
Synopsis#
#include "petscts.h"
PetscErrorCode TSSetRHSFunction(TS ts, Vec r, PetscErrorCode (*f)(TS, PetscReal, Vec, Vec, void *), void *ctx)
Logically Collective
Input Parameters#
Calling sequence of f
#
PetscErrorCode f(TS ts, PetscReal t, Vec u, Vec F, void *ctx)
ts - timestep context
t - current timestep
u - input vector
F - function vector
ctx - [optional] user-defined function context
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
, TSSetRHSJacobian()
, TSSetIJacobian()
, TSSetIFunction()
Level#
beginner
Location#
Examples#
src/tao/unconstrained/tutorials/burgers_spectral.c
src/tao/unconstrained/tutorials/spectraladjointassimilation.c
src/ts/tutorials/ex1.c
src/ts/tutorials/ex12.c
src/ts/tutorials/ex13.c
src/ts/tutorials/ex16.c
src/ts/tutorials/ex16fwd.c
src/ts/tutorials/ex1f.F90
src/ts/tutorials/ex2.c
src/ts/tutorials/ex20.c
src/ts/tutorials/ex20adj.c
Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages