petsc-3.7.3 2016-07-24
Report Typos and Errors

# 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 on TS

### 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)

### Calling sequence of func

        func (TS ts,PetscReal t,Vec u,Vec F,void *ctx);

| t | - current timestep
| u | - input vector
| F | - function vector
| ctx | - [optional] user-defined function context

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

### Keywords

TS, timestep, set, right-hand-side, function

### See Also

TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()

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/ex1.c.html
src/ts/examples/tutorials/ex2.c.html
src/ts/examples/tutorials/ex3.c.html
src/ts/examples/tutorials/ex4.c.html
src/ts/examples/tutorials/ex5.c.html
src/ts/examples/tutorials/ex6.c.html
src/ts/examples/tutorials/ex7.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/ex12.c.html
src/ts/examples/tutorials/ex13.c.html
src/ts/examples/tutorials/ex16.c.html