petsc-3.7.1 2016-05-15
Report Typos and Errors

# TSSetSolutionFunction

Provide a function that computes the solution of the ODE or DAE

### Synopsis

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

Logically Collective on TS Many br

### Input Parameters

| ts | - the TS context obtained from TSCreate() Many br
| f | - routine for evaluating the solution Many br
| ctx | - [optional] user-defined context for private data for the Many brfunction evaluation routine (may be NULL) Many br

### Calling sequence of func

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

| t | - current timestep Many br
| u | - output vector Many br
| ctx | - [optional] user-defined function context Many br

### Notes

This routine is used for testing accuracy of time integration schemes when you already know the solution. Many brIf analytic solutions are not known for your system, consider using the Method of Manufactured Solutions to Many brcreate closed-form solutions with non-physical forcing terms. Many br

For low-dimensional problems solved in serial, such as small discrete systems, TSMonitorLGError() can be used to monitor the error history. Many br

Many br

### Keywords

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

### See Also

TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetForcingFunction()

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