Skip to main content
`Ctrl`+`K`

# TSSetTimeSpan

sets the time span. The solution will be computed and stored for each time requested in the span

## Synopsis

    #include "petscts.h"
    PetscErrorCode TSSetTimeSpan(TS ts, PetscInt n, PetscReal span_times[])

Collective

## Input Parameters

- ts - the time-stepper

- n - number of the time points (>=2)

- span_times - array of the time points, must be increasing. The first element and the last element are the initial time and the final time respectively.

## Options Database Key

- -ts_time_span t0,…,tf - Sets the time span

## Notes

This function is identical to `TSSetEvaluationTimes()`, except that it also sets the initial time and final time for the `ts` to the first and last `span_times` entries.

The elements in `span_times` must be all increasing. They correspond to the intermediate points to be saved.

`TS_EXACTFINALTIME_MATCHSTEP` must be used to make the last time step in each sub-interval match the intermediate points specified.

The intermediate solutions are saved in a vector array that can be accessed with `TSGetEvaluationSolutions()`. Thus using time span may pressure the memory system when using a large number of span points.

## See Also

TS: Scalable ODE and DAE Solvers, `TS`, `TSSetEvaluationTimes()`, `TSGetEvaluationTimes()`, `TSGetEvaluationSolutions()`

## Level

intermediate

## Location

src/ts/interface/ts.c

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