creates a solution history initialized with an initial solution state
initWorkingState()
initializes a working state for the next tentative time step
getCurrentState()
returns the current accepted solution state
getWorkingState()
returns the tentative working solution state
getCurrentTime()
returns the time of the current accepted solution state
getCurrentIndex()
returns the index of the current accepted solution state
promoteWorkingState()
promotes the accepted working state to become the new current state
This is the first step in moving from state-based solution management to history-based solution management. That transition is important because many time integration algorithms require access to multiple states, including the current solution, tentative working states, and previously accepted states.
The initial condition remains the same, but it is now managed through a Tempus::SolutionHistory.
Access current and working states
Use SolutionHistory to access states. Instead of working directly with a single solution state, the application now asks the history object for the current and working states.
The new solution is written into the working state, the step result is associated with that state, and the history object manages promotion of that state to become the new current state.
As in the updated examples, the regression comparison remains separate from step status. Final tutorial success is determined after the loop by combining the final state status with the result of the regression test.
How to compare the examples
A more detailed comparison can be made by diffing:
From the packages/tempus directory, a focused comparison of the main time-integration logic between these two examples can be generated locally in bash or zsh with: