# TSSetRHSFunction

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

### Synopsis

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

Collective on TS

### Input Parameters

| ts | - the TS context obtained from TSCreate()
| f | - routine for evaluating the right-hand-side function
| ctx | - [optional] user-defined context for private data for the function evaluation routine (may be PETSC_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

### Important

The user MUST call either this routine or TSSetMatrices().

### Keywords

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

### See Also

TSSetMatrices()

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/ex7.c.html
src/ts/examples/tutorials/ex1f.F.html
src/ts/examples/tutorials/ex2f.F.html