# TSFunctionDomainError
Checks if the current state is valid 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSFunctionDomainError(TS ts, PetscReal stagetime, Vec Y, PetscBool *accept)
```

## Input Parameters

- ***ts -*** the TS context
- ***stagetime -*** time of the simulation
- ***Y -*** state vector to check.



## Output Parameter

- ***accept -*** Set to PETSC_FALSE if the current state vector is valid.



## Note
This function is called by the TS integration routines and calls the user provided function (set with TSSetFunctionDomainError())
to check if the current state is valid.




## See Also
 `TSSetFunctionDomainError()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#TSFunctionDomainError">src/ts/interface/ts.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/ts.c)


[Index of all TS routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
