petsc-3.6.2 2015-10-02
Report Typos and Errors


Provide a function that computes a forcing term for a ODE or PDE


#include "petscts.h"  
PetscErrorCode  TSSetForcingFunction(TS ts,PetscErrorCode (*f)(TS,PetscReal,Vec,void*),void *ctx)
Logically Collective on TS

Input Parameters

ts - the TS context obtained from TSCreate()
f - routine for evaluating the forcing 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,void *ctx);

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


This routine is useful for testing accuracy of time integration schemes when using the Method of Manufactured Solutions to create closed-form solutions with a non-physical forcing term.

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


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

See Also

TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetSolutionFunction()

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