Skip to main content
`Ctrl`+`K`

# TSSetComputeInitialCondition

Set the function used to automatically compute an initial condition for the timestepping.

## Synopsis

    #include "petscts.h"
    PetscErrorCode TSSetComputeInitialCondition(TS ts, PetscErrorCode (*initCondition)(TS ts, Vec e))

Logically collective

## Input Parameters

- ts - time stepping context

- initCondition - The function which computes an initial condition

## Calling sequence of `initCondition`

- ts - The timestepping context

- e - The input vector in which the initial condition is to be stored

## See Also

TS: Scalable ODE and DAE Solvers, `TS`, `TSGetComputeInitialCondition()`, `TSComputeInitialCondition()`

## Level

advanced

## Location

src/ts/interface/ts.c

## Examples

src/ts/tutorials/ex77.c
src/ts/tutorials/ex76.c
src/ts/tutorials/ex53.c
src/ts/tutorials/ex45.c

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