Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Example 4: Add SolutionHistory

This example introduces Tempus::SolutionHistory, which manages multiple Tempus::SolutionState objects during time integration. The van der Pol model is still provided through a Thyra::ModelEvaluator, and the Forward Euler update is still written explicitly in the application code, but the evolving solution is now organized through a history object rather than a single state.

The main purpose of this step is to move from managing one solution state at a time to managing a sequence of states through a core Tempus container.

Relative to Example 3: Introduce SolutionState:

  • the primary state is now stored in a Tempus::SolutionHistory
  • the current and working states are accessed through the history object
  • the history object initializes the working state for each new step
  • successful steps are accepted by promoting the working state
  • the example begins to follow the state-history management pattern used by Tempus steppers and integrators

The central idea behind Tempus::SolutionHistory is that time integration algorithms often need access to more than one solution state. A history object provides a structured way to manage the current state, tentative working states, and previously accepted states in support of stepping algorithms, interpolation, restart, and error recovery.

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

  • storing the current and working solution states
  • initializing a working state through initWorkingState()
  • accepting a step through promoteWorkingState()

For additional details, see SolutionHistory_Description.


Transition notes
See Transition from Example 3 to Example 4 for a detailed explanation of what changed from Example 3: Introduce SolutionState.

← Previous Example | Tutorial Overview | Next Example →