TSSetPostStage — PETSc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# TSSetPostStage

Sets the general-purpose function called once at the end of each stage.

## Synopsis

    #include "petscts.h"
    PetscErrorCode TSSetPostStage(TS ts, PetscErrorCode (*func)(TS ts, PetscReal stagetime, PetscInt stageindex, Vec *Y))

Logically Collective

## Input Parameters

- ts - The `TS` context obtained from `TSCreate()`

- func - The function

## Calling sequence of `func`

- ts - the `TS` context

- stagetime - the stage time

- stageindex - the stage index

- Y - Array of vectors (of size = total number of stages) with the stage solutions

## Note

There may be several stages per time step. If the solve for a given stage fails, the step may be rejected and retried. The time step number being computed can be queried using `TSGetStepNumber()` and the total size of the step being attempted can be obtained using `TSGetTimeStep()`. The time at the start of the step is available via `TSGetTime()`.

## See Also

TS: Scalable ODE and DAE Solvers, `TS`, `TSSetPreStage()`, `TSSetPreStep()`, `TSSetPostStep()`, `TSGetApplicationContext()`

## Level

intermediate

## Location

src/ts/interface/ts.c

## Examples

src/ts/tutorials/ex30.c

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