Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Public Member Functions | List of all members
VanDerPol_ModelEvaluator_02< Scalar > Class Template Reference

ModelEvaluator implementation for the example van der Pol Problem. More...

#include <VanDerPol_ModelEvaluator_02.hpp>

Inheritance diagram for VanDerPol_ModelEvaluator_02< Scalar >:

Public Member Functions

 VanDerPol_ModelEvaluator_02 ()
 

Private functions overridden from ModelEvaluatorDefaultBase.

Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypicalInArgs_
 
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypicalOutArgs_
 Prototypical OutArgs that just supports the evaluation vector (OUT_ARG_f)
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
 Solution vector space (a defaultSpmdVectorSpace of dimension 2)
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
 Function evaluation vector space (a defaultSpmdVectorSpace of dimension 2)
 
int dim_
 Number of state unknowns (2)
 
Scalar t0_ic_
 initial time = 0
 
Scalar epsilon_
 This is a model parameter ( $\epsilon=0.1$ )
 
Scalar x0_ic_
 initial condition for $x_0 = 2$
 
Scalar x1_ic_
 initial condition for $x_1 = 0$
 
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl () const
 
void evalModelImpl (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
 

Public functions overridden from ModelEvaluator.

Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space () const
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space () const
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues () const
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs () const
 

Detailed Description

template<class Scalar>
class VanDerPol_ModelEvaluator_02< Scalar >

ModelEvaluator implementation for the example van der Pol Problem.

This is a trimmed down version of the ModelEvaluator used in Tempus testing, Tempus_Test::VanDerPolModel, which exercises additional functionalities. In this ModelEvaluator, we are just trying to demonstrate the mechanisms needed for the simple time integration, e.g., explicit and implicit ODEs for the van der Pol Problem.

Definition at line 25 of file VanDerPol_ModelEvaluator_02.hpp.

Constructor & Destructor Documentation

◆ VanDerPol_ModelEvaluator_02()

template<class Scalar >
VanDerPol_ModelEvaluator_02< Scalar >::VanDerPol_ModelEvaluator_02 ( )

Default Constructor sets the van der Pol Problem

  • parameter ( $\epsilon=0.1$ )
  • the inital time ( $t_0=0$ )
  • the initial conditions ( $x_0(t_0=0) = 2$, $x_1(t_0=0) = 0$, $\dot{x}_0(t_0=0) = 0$, and $\dot{x}_1(t_0=0) = -2/\epsilon$ )

constructs

  • the solution vector space (a defaultSpmdVectorSpace of dimension 2)
  • the function evaluation vector space (a defaultSpmdVectorSpace of dimension 2)
  • a prototypical InArgs that just supports
    • the time (IN_ARGS_t)
    • the solution vector (IN_ARGS_x)
    • the time derivative of the solution vector (IN_ARGS_x_dot)
  • a prototypical OutArgs that just supports
    • the evaluation vector (OUT_ARG_f)
  • the nominal values (a.k.a. initial conditions for transient problems)
    • simply the prototypical InArgs with the initial condition vectors

Definition at line 23 of file VanDerPol_ModelEvaluator_02.cpp.

Member Function Documentation

◆ get_x_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > VanDerPol_ModelEvaluator_02< Scalar >::get_x_space ( ) const
inline

Definition at line 52 of file VanDerPol_ModelEvaluator_02.hpp.

◆ get_f_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > VanDerPol_ModelEvaluator_02< Scalar >::get_f_space ( ) const
inline

Definition at line 54 of file VanDerPol_ModelEvaluator_02.hpp.

◆ getNominalValues()

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > VanDerPol_ModelEvaluator_02< Scalar >::getNominalValues ( ) const
inline

Definition at line 56 of file VanDerPol_ModelEvaluator_02.hpp.

◆ createInArgs()

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > VanDerPol_ModelEvaluator_02< Scalar >::createInArgs ( ) const
inline

Definition at line 58 of file VanDerPol_ModelEvaluator_02.hpp.

◆ createOutArgsImpl()

template<class Scalar >
Thyra::ModelEvaluatorBase::OutArgs< Scalar > VanDerPol_ModelEvaluator_02< Scalar >::createOutArgsImpl ( ) const
inlineprivate

Definition at line 66 of file VanDerPol_ModelEvaluator_02.hpp.

◆ evalModelImpl()

template<class Scalar >
void VanDerPol_ModelEvaluator_02< Scalar >::evalModelImpl ( const Thyra::ModelEvaluatorBase::InArgs< Scalar > & inArgs_bar,
const Thyra::ModelEvaluatorBase::OutArgs< Scalar > & outArgs_bar ) const
private

Evaluate the model based on if the InArgs.get_x_dot() is null or not. If it is null, evaluate the explicit ODE form of the model ( $ \dot{x} = f(x,t)$ ),

\begin{eqnarray*}
  \dot{x}_0(t) & = & f_0 = x_1(t) \\
  \dot{x}_1(t) & = & f_1 = [(1-x_0^2)x_1-x_0]/\epsilon
\end{eqnarray*}

otherwise, evaluate the implicit ODE form, $ \mathcal{F}(\dot{x},x,t) = 0 $,

\begin{eqnarray*}
  \mathcal{F}_0 & = & \dot{x}_0(t) - x_1(t) \\
  \mathcal{F}_1 & = & \dot{x}_1(t) - [(1-x_0^2)x_1-x_0]/\epsilon
\end{eqnarray*}

Both return their result through the OutArgs.get_f().

Definition at line 80 of file VanDerPol_ModelEvaluator_02.cpp.

Member Data Documentation

◆ prototypicalInArgs_

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs<Scalar> VanDerPol_ModelEvaluator_02< Scalar >::prototypicalInArgs_
mutableprivate

Prototypical InArgs that just supports

  • the time (IN_ARGS_t)
  • the solution vector (IN_ARGS_x)
  • the time derivative of the solution vector (IN_ARGS_x_dot)

Definition at line 94 of file VanDerPol_ModelEvaluator_02.hpp.

◆ prototypicalOutArgs_

template<class Scalar >
Thyra::ModelEvaluatorBase::OutArgs<Scalar> VanDerPol_ModelEvaluator_02< Scalar >::prototypicalOutArgs_
mutableprivate

Prototypical OutArgs that just supports the evaluation vector (OUT_ARG_f)

Definition at line 96 of file VanDerPol_ModelEvaluator_02.hpp.

◆ nominalValues_

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs<Scalar> VanDerPol_ModelEvaluator_02< Scalar >::nominalValues_
private

Nominal values (a.k.a. initial conditions for transient problems), and simply the prototypical InArgs with the initial condition vectors.

Definition at line 100 of file VanDerPol_ModelEvaluator_02.hpp.

◆ x_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > VanDerPol_ModelEvaluator_02< Scalar >::x_space_
private

Solution vector space (a defaultSpmdVectorSpace of dimension 2)

Definition at line 102 of file VanDerPol_ModelEvaluator_02.hpp.

◆ f_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > VanDerPol_ModelEvaluator_02< Scalar >::f_space_
private

Function evaluation vector space (a defaultSpmdVectorSpace of dimension 2)

Definition at line 104 of file VanDerPol_ModelEvaluator_02.hpp.

◆ dim_

template<class Scalar >
int VanDerPol_ModelEvaluator_02< Scalar >::dim_
private

Number of state unknowns (2)

Definition at line 106 of file VanDerPol_ModelEvaluator_02.hpp.

◆ t0_ic_

template<class Scalar >
Scalar VanDerPol_ModelEvaluator_02< Scalar >::t0_ic_
private

initial time = 0

Definition at line 107 of file VanDerPol_ModelEvaluator_02.hpp.

◆ epsilon_

template<class Scalar >
Scalar VanDerPol_ModelEvaluator_02< Scalar >::epsilon_
private

This is a model parameter ( $\epsilon=0.1$ )

Definition at line 108 of file VanDerPol_ModelEvaluator_02.hpp.

◆ x0_ic_

template<class Scalar >
Scalar VanDerPol_ModelEvaluator_02< Scalar >::x0_ic_
private

initial condition for $x_0 = 2$

Definition at line 109 of file VanDerPol_ModelEvaluator_02.hpp.

◆ x1_ic_

template<class Scalar >
Scalar VanDerPol_ModelEvaluator_02< Scalar >::x1_ic_
private

initial condition for $x_1 = 0$

Definition at line 110 of file VanDerPol_ModelEvaluator_02.hpp.


The documentation for this class was generated from the following files: