Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Example 1: Utilize Thyra

This example replaces the raw C++ arrays from Example 0: Basic Problem with Thyra vectors and vector spaces. The mathematical problem, timestepper, output pattern, and overall time-integration structure remain essentially unchanged. The main purpose is to introduce the abstract vector interfaces used throughout Tempus and other Trilinos packages.

Changes relative to Example 0: Basic Problem:

  • Teuchos::RCP is used for memory management
  • state storage moves from raw arrays to Thyra::VectorBase
  • a Thyra::VectorSpaceBase is introduced to define the state space
  • vector initialization and element access use Thyra::DetachedVectorView
  • vector algebra uses Thyra helper routines such as Thyra::V_VpStV, Thyra::norm, and Thyra::V_V

This example shows how the same application logic can be expressed in terms of abstract numerical objects rather than concrete array storage. That abstraction is a prerequisite for later examples that introduce Thyra::ModelEvaluator and Tempus solution-management objects.

As in Example 0: Basic Problem, the example prints the evolving solution in a simple table with columns for the step index, time, $x_0$, and $x_1$. The variable passed continues to indicate whether the explicit stepping loop succeeds, while the final tutorial success condition additionally requires that the final solution satisfy the regression check.


Transition notes
See Transition from Example 0 to Example 1 for a detailed explanation of what changed from Example 0: Basic Problem.

← Previous Example | Tutorial Overview | Next Example →