Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Example 5: Introduce Stepper

This example introduces Tempus::Stepper through Tempus::StepperForwardEuler. The van der Pol model is still provided through a Thyra::ModelEvaluator, and the application still manages the overall time loop and Tempus::SolutionHistory. However, the Forward Euler step itself is now delegated to a Tempus stepper object rather than being written explicitly in the application code.

The main purpose of this step is to separate the stepping algorithm from the surrounding application logic.

Relative to Example 4: Add SolutionHistory:

  • the Forward Euler update is performed by a Tempus::Stepper
  • the specific stepper used is Tempus::StepperForwardEuler
  • the application still manages the time loop and solution history
  • the stepper advances the working state using the model and timestep information already stored in the history

The central idea behind Tempus::Stepper is that a time integration algorithm should be encapsulated in its own object. This allows the application to reuse the same surrounding logic while changing only the stepping algorithm.

This example uses only part of the full Tempus::Stepper capability:


Transition notes
See Transition from Example 4 to Example 5 for a detailed explanation of what changed from Example 4: Add SolutionHistory.

← Previous Example | Tutorial Overview | Next Example →