#include "petscts.h" PetscErrorCode TSSetEventHandler(TS ts,PetscInt nevents,PetscInt direction[],PetscBool terminate[],PetscErrorCode (*eventhandler)(TS,PetscReal,Vec,PetscScalar[],void*),PetscErrorCode (*postevent)(TS,PetscInt,PetscInt[],PetscReal,Vec,PetscBool,void*),void *ctx)Logically Collective on TS
ts | - the TS context obtained from TSCreate() | |
nevents | - number of local events | |
direction | - direction of zero crossing to be detected. -1 => Zero crossing in negative direction, +1 => Zero crossing in positive direction, 0 => both ways (one for each event) | |
terminate | - flag to indicate whether time stepping should be terminated after event is detected (one for each event) | |
eventhandler | - event monitoring routine | |
postevent | - [optional] post-event function | |
ctx | - [optional] user-defined context for private data for the event monitor and post event routine (use NULL if no context is desired) |
ts | - the TS context | |
t | - current time | |
U | - current iterate | |
ctx | - [optional] context passed with eventhandler |
ts | - the TS context | |
nevents_zero | - number of local events whose event function is zero | |
events_zero | - indices of local events which have reached zero | |
t | - current time | |
U | - current solution | |
forwardsolve | - Flag to indicate whether TS is doing a forward solve (1) or adjoint solve (0) | |
ctx | - the context passed with eventhandler |