petsc-3.12.4 2020-02-04
Report Typos and Errors

# TSSetFunctionDomainError

Set a function that tests if the current state vector is valid

### Synopsis

    #include "petscts.h"
    PetscErrorCode TSSetFunctionDomainError(TS ts, PetscErrorCode (*func)(TS,PetscReal,Vec,PetscBool*))

### Input Parameters

| ts | - the TS context
| func | - function called within TSFunctionDomainError

### Calling sequence of func

        PetscErrorCode func(TS ts,PetscReal time,Vec state,PetscBool reject)

| ts | - the TS context
| time | - the current time (of the stage)
| state | - the state to check if it is valid
| reject | - (output parameter) PETSC_FALSE if the state is acceptable, PETSC_TRUE if not acceptable

### Notes

If an implicit ODE solver is being used then, in addition to providing this routine, the user's code should call SNESSetFunctionDomainError() when domain errors occur during function evaluations where the functions are provided by TSSetIFunction() or TSSetRHSFunction(). Use TSGetSNES() to obtain the SNES object

### Developer Notes

The naming of this function is inconsistent with the SNESSetFunctionDomainError() since one takes a function pointer and the other does not.

### See Also

TSAdaptCheckStage(), TSFunctionDomainError(), SNESSetFunctionDomainError(), TSGetSNES()

### Level

intermediate

### Location

src/ts/interface/ts.c

### Examples

src/ts/examples/tutorials/ex42.c.html
Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages