# TSDiscGradGetFormulation
Get the construction method for S, F, and grad F from the formulation u_t = S grad F for `TSDISCGRAD` 
## Synopsis
```
#include "petscts.h"   
PetscErrorCode TSDiscGradGetFormulation(TS ts, PetscErrorCode (**Sfunc)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode (**Ffunc)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode (**Gfunc)(TS, PetscReal, Vec, Vec, void *), void *ctx)
```
Not Collective


## Input Parameter

- ***ts -*** timestepping context



## Output Parameters

- ***Sfunc -*** constructor for the S matrix from the formulation
- ***Ffunc -*** functional F from the formulation
- ***Gfunc -*** constructor for the gradient of F from the formulation
- ***ctx   -*** the user context



## Calling sequence of Sfunc
```none
PetscErrorCode func(TS ts, PetscReal time, Vec u, Mat S, void *)
```


## Calling sequence of Ffunc
```none
PetscErrorCode func(TS ts, PetscReal time, Vec u, PetscScalar *F, void *)
```


## Calling sequence of Gfunc
```none
PetscErrorCode func(TS ts, PetscReal time, Vec u, Vec G, void *)
```




## See Also
 [](chapter_ts), `TS`, `TSDISCGRAD`, `TSDiscGradSetFormulation()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/discgrad/tsdiscgrad.c.html#TSDiscGradGetFormulation">src/ts/impls/implicit/discgrad/tsdiscgrad.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/discgrad/tsdiscgrad.c.html#TSDiscGradGetFormulation_DiscGrad(TS ts, PetscErrorCode (**Sfunc)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode (**Ffunc)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode (**Gfunc)">TSDiscGradGetFormulation_DiscGrad(TS ts, PetscErrorCode (**Sfunc)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode (**Ffunc)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode (**Gfunc) in src/ts/impls/implicit/discgrad/tsdiscgrad.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/impls/implicit/discgrad/tsdiscgrad.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)  
