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

van der Pol model formulated for the partitioned IMEX-RK. More...

#include <VanDerPol_IMEXPart_ImplicitModel_decl.hpp>

Inheritance diagram for Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >:

Public Member Functions

 VanDerPol_IMEXPart_ImplicitModel (Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
 

Private functions overridden from ModelEvaluatorDefaultBase.

int dim_
 Number of state unknowns (1)
 
int Np_
 Number of parameter vectors (1)
 
int np_
 Number of parameters in this vector (1)
 
int Ng_
 Number of observation functions (0)
 
int ng_
 Number of elements in this observation function (0)
 
bool haveIC_
 false => no nominal values are provided (default=true)
 
bool useDfDpAsTangent_
 Treat DfDp OutArg as tangent (df/dx*dx/dp+df/dp)
 
bool isInitialized_
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
 
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > p_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > y_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > dxdp_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > dydp_space_
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > g_space_
 
Scalar epsilon_
 This is a model parameter.
 
Scalar t0_ic_
 initial time
 
Scalar x0_ic_
 initial condition for x0
 
Scalar x1_ic_
 initial condition for x1
 
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
 
Teuchos::RCP< Thyra::LinearOpWithSolveBase< Scalar > > create_W () const
 
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op () const
 
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory () const
 
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs () const
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space (int l) const
 
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names (int l) const
 
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space (int j) const
 

Public functions overridden from ParameterListAcceptor.

void setParameterList (Teuchos::RCP< Teuchos::ParameterList > const &paramList)
 
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters () const
 
void setupInOutArgs_ () const
 

Detailed Description

template<class Scalar>
class Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >

van der Pol model formulated for the partitioned IMEX-RK.

This is a canonical equation of a nonlinear oscillator (Hairer, Norsett, and Wanner, pp. 111-115, and Hairer and Wanner, pp. 4-5) for an electrical circuit. In implicit ODE form, $ \mathcal{F}(\dot{x},x,t) = 0 $, the scaled problem can be written as

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

where the initial conditions are

\begin{eqnarray*}
  x_0(t_0=0) & = & 2 \\
  x_1(t_0=0) & = & 0
\end{eqnarray*}

and the initial time derivatives are

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

For a partitioned IMEX-RK time stepper, we need to rewrite this in the following form

\begin{eqnarray*}
  M(z,t)\, \dot{z} + G(z,t) + F(z,t) & = & 0, \\
  \mathcal{G}(\dot{z},z,t) + F(z,t) & = & 0,
\end{eqnarray*}

where $\mathcal{G}(\dot{z},z,t) = M(z,t)\, \dot{z} + G(z,t)$, $M(z,t)$ is the mass matrix, $F(z,t)$ is the operator representing the "slow" physics (and evolved explicitly), and $G(z,t)$ is the operator representing the "fast" physics. For the van der Pol problem, we can separate the terms as follows

\[
  z      = \left\{\begin{array}{c} y   \\ x   \end{array}\right\}
         = \left\{\begin{array}{c} x_0 \\ x_1 \end{array}\right\},\;\;\;
  F(z,t) = \left\{\begin{array}{c} F^y(x,y,t)\\F^x(x,y,t)\end{array}\right\}
         = \left\{\begin{array}{c} -x_1 \\ x_0/\epsilon\end{array}\right\},
  \mbox{ and }
  G(z,t) = \left\{\begin{array}{c} 0 \\ G^x(x,y,t)\end{array}\right\}
         = \left\{\begin{array}{c} 0 \\
                 -(1-x_0^2)x_1/\epsilon \end{array}\right\}
\]

where $M(z,t)=I$ is the identity matrix.

Thus the explicit van der Pol model (VanDerPol_IMEX_ExplicitModel) formulated for the partitioned IMEX-RK is

\begin{eqnarray*}
  F^y(x,y,t) & = & \dot{x}_0(t) - x_1(t) = 0 \\
  F^x(x,y,t) & = & \dot{x}_1(t) + x_0/\epsilon = 0
\end{eqnarray*}

and the implicit van der Pol model (VanDerPol_IMEXPart_ImplicitModel) formulated for the partitioned IMEX-RK is

\[
  G^x(x,y,t) = \dot{x}_1(t) - (1-x_0^2)x_1/\epsilon = 0
\]

Noting that $G^y(x,y,t) = \dot{x}_0(t) = 0$ is not needed.

Recalling the defintion of the iteration matrix, $W$,

\[
  W_{ij} \equiv \frac{d\mathcal{G}^x_i}{dx_j} =
    \alpha \frac{\partial\mathcal{G}^x_i}{\partial \dot{x}_j}
  + \beta \frac{\partial\mathcal{G}^x_i}{\partial x_j}
\]

where

\[
  \alpha = \left\{
    \begin{array}{cl}
      \frac{\partial\dot{x}_i}{\partial x_j} & \mbox{ if } i = j \\
      0 & \mbox{ if } i \neq j
    \end{array} \right.
  \;\;\;\; \mbox{ and } \;\;\;\;
  \beta = 1
\]

we can write for the implicit van der Pol model (VanDerPol_IMEXPart_ImplicitModel)

\begin{eqnarray*}
  W_{00} = \alpha \frac{\partial\mathcal{G}^x_0}{\partial \dot{x}_1}
          + \beta \frac{\partial\mathcal{G}^x_0}{\partial x_1}
       & = & \alpha + \beta (x^2_0 - 1)/\epsilon \\
\end{eqnarray*}

Definition at line 102 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

Constructor & Destructor Documentation

◆ VanDerPol_IMEXPart_ImplicitModel()

template<class Scalar >
Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::VanDerPol_IMEXPart_ImplicitModel ( Teuchos::RCP< Teuchos::ParameterList >  pList = Teuchos::null)

Definition at line 30 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

Member Function Documentation

◆ get_x_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_x_space

Definition at line 64 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ get_f_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_f_space

Definition at line 72 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ getNominalValues()

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::getNominalValues

Definition at line 80 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ create_W()

template<class Scalar >
Teuchos::RCP< Thyra::LinearOpWithSolveBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::create_W

Definition at line 90 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ create_W_op()

template<class Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::create_W_op

Definition at line 123 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ get_W_factory()

template<class Scalar >
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_W_factory

Definition at line 134 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ createInArgs()

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::createInArgs

Definition at line 145 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ get_p_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_p_space ( int  l) const

Definition at line 298 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ get_p_names()

template<class Scalar >
Teuchos::RCP< const Teuchos::Array< std::string > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_p_names ( int  l) const

Definition at line 315 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ get_g_space()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::get_g_space ( int  j) const

Definition at line 336 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ setParameterList()

template<class Scalar >
void Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::setParameterList ( Teuchos::RCP< Teuchos::ParameterList > const &  paramList)

Definition at line 415 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ getValidParameters()

template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::getValidParameters

Definition at line 440 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ setupInOutArgs_()

template<class Scalar >
void Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::setupInOutArgs_
private

Definition at line 345 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ createOutArgsImpl()

template<class Scalar >
Thyra::ModelEvaluatorBase::OutArgs< Scalar > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::createOutArgsImpl
private

Definition at line 158 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

◆ evalModelImpl()

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

Definition at line 168 of file VanDerPol_IMEXPart_ImplicitModel_impl.hpp.

Member Data Documentation

◆ dim_

template<class Scalar >
int Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::dim_
private

Number of state unknowns (1)

Definition at line 147 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ Np_

template<class Scalar >
int Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::Np_
private

Number of parameter vectors (1)

Definition at line 148 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ np_

template<class Scalar >
int Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::np_
private

Number of parameters in this vector (1)

Definition at line 149 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ Ng_

template<class Scalar >
int Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::Ng_
private

Number of observation functions (0)

Definition at line 150 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ ng_

template<class Scalar >
int Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::ng_
private

Number of elements in this observation function (0)

Definition at line 151 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ haveIC_

template<class Scalar >
bool Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::haveIC_
private

false => no nominal values are provided (default=true)

Definition at line 152 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ useDfDpAsTangent_

template<class Scalar >
bool Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::useDfDpAsTangent_
private

Treat DfDp OutArg as tangent (df/dx*dx/dp+df/dp)

Definition at line 153 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ isInitialized_

template<class Scalar >
bool Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::isInitialized_
mutableprivate

Definition at line 154 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ inArgs_

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs<Scalar> Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::inArgs_
mutableprivate

Definition at line 155 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ outArgs_

template<class Scalar >
Thyra::ModelEvaluatorBase::OutArgs<Scalar> Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::outArgs_
mutableprivate

Definition at line 156 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ nominalValues_

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs<Scalar> Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::nominalValues_
mutableprivate

Definition at line 157 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ x_space_

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

Definition at line 158 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ f_space_

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

Definition at line 159 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ p_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::p_space_
private

Definition at line 160 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ y_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::y_space_
private

Definition at line 161 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ dxdp_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::dxdp_space_
private

Definition at line 162 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ dydp_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::dydp_space_
private

Definition at line 163 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ g_space_

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::g_space_
private

Definition at line 164 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ epsilon_

template<class Scalar >
Scalar Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::epsilon_
private

This is a model parameter.

Definition at line 167 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ t0_ic_

template<class Scalar >
Scalar Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::t0_ic_
private

initial time

Definition at line 168 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ x0_ic_

template<class Scalar >
Scalar Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::x0_ic_
private

initial condition for x0

Definition at line 169 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.

◆ x1_ic_

template<class Scalar >
Scalar Tempus_Test::VanDerPol_IMEXPart_ImplicitModel< Scalar >::x1_ic_
private

initial condition for x1

Definition at line 170 of file VanDerPol_IMEXPart_ImplicitModel_decl.hpp.


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