Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar > Class Template Reference

van der Pol model formulated for IMEX. More...

#include <VanDerPol_IMEX_ExplicitModel_decl.hpp>

Inheritance diagram for Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >:
Thyra::StateFuncModelEvaluatorBase< Scalar > Teuchos::ParameterListAcceptorDefaultBase Thyra::ModelEvaluatorDefaultBase< Scalar > Teuchos::ParameterListAcceptor Thyra::ModelEvaluator< class > Thyra::ModelEvaluatorBase Teuchos::Describable Teuchos::LabeledObject

Public Member Functions

 VanDerPol_IMEX_ExplicitModel (Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null, bool useProductVector=false)
 
- Public Member Functions inherited from Thyra::StateFuncModelEvaluatorBase< Scalar >
RCP< const VectorSpaceBase
< Scalar > > 
get_p_space (int l) const
 
RCP< const Teuchos::Array
< std::string > > 
get_p_names (int l) const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_g_space (int j) const
 
Teuchos::ArrayView< const
std::string > 
get_g_names (int j) const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getNominalValues () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getLowerBounds () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getUpperBounds () const
 
RCP< LinearOpBase< Scalar > > create_W_op () const
 
RCP< PreconditionerBase< Scalar > > create_W_prec () const
 
RCP< const
LinearOpWithSolveFactoryBase
< Scalar > > 
get_W_factory () const
 
void reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
 
- Public Member Functions inherited from Thyra::ModelEvaluator< class >
virtual int Np () const =0
 
virtual int Ng () const =0
 
virtual RCP< const
VectorSpaceBase< Scalar > > 
get_f_multiplier_space () const =0
 
virtual RCP< const
VectorSpaceBase< Scalar > > 
get_g_multiplier_space (int j) const =0
 
virtual RCP
< LinearOpWithSolveBase
< Scalar > > 
create_W () const =0
 
virtual RCP< LinearOpBase
< Scalar > > 
create_DfDp_op (int l) const =0
 
virtual RCP< LinearOpBase
< Scalar > > 
create_DgDx_dot_op (int j) const =0
 
virtual RCP< LinearOpBase
< Scalar > > 
create_DgDx_op (int j) const =0
 
virtual RCP< LinearOpBase
< Scalar > > 
create_DgDp_op (int j, int l) const =0
 
virtual
ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgs () const =0
 
virtual void evalModel (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const =0
 
 ModelEvaluatorBase ()
 
std::string toString (ModelEvaluatorBase::EInArgsMembers)
 
std::string toString (ModelEvaluatorBase::EOutArgsMembers)
 
std::string toString (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation)
 
ModelEvaluatorBase::EDerivativeMultiVectorOrientation getOtherDerivativeMultiVectorOrientation (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation)
 
- Public Member Functions inherited from Teuchos::Describable
virtual std::string description () const
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
- Public Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
RCP< ParameterListgetNonconstParameterList ()
 
RCP< ParameterListunsetParameterList ()
 
RCP< const ParameterListgetParameterList () const
 

Private Member Functions

void setupInOutArgs_ () const
 

Private Attributes

bool useProductVector_
 
int dim_
 Number of state unknowns (2) More...
 
int Np_
 Number of parameter vectors (1) More...
 
int np_
 Number of parameters in this vector (1) More...
 
int Ng_
 Number of observation functions (0) More...
 
int ng_
 Number of elements in this observation function (0) More...
 
bool haveIC_
 false => no nominal values are provided (default=true) More...
 
bool acceptModelParams_
 Changes inArgs to require parameters. More...
 
bool useDfDpAsTangent_
 Treat DfDp OutArg as tangent (df/dx*dx/dp+df/dp) More...
 
bool isInitialized_
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
inArgs_
 
Thyra::ModelEvaluatorBase::OutArgs
< Scalar > 
outArgs_
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
nominalValues_
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
xSpace_
 
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 > > 
dxdp_space_
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
g_space_
 
Scalar epsilon_
 This is a model parameter. More...
 
Scalar t0_ic_
 initial time More...
 
Scalar x0_ic_
 initial condition for x0 More...
 
Scalar x1_ic_
 initial condition for x1 More...
 

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::LinearOpBase< Scalar > > 
create_W_op () 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
 

Private functions overridden from ModelEvaluatorDefaultBase.

Thyra::ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgsImpl () const
 
void evalModelImpl (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
 

Additional Inherited Members

- Public Types inherited from Thyra::ModelEvaluator< class >
enum  EInArgsMembers
 
enum  EInArgs_p_mp
 
enum  EEvalType
 
enum  EDerivativeMultiVectorOrientation
 
enum  EDerivativeLinearOp
 
enum  EDerivativeLinearity
 
enum  ERankStatus
 
enum  EOutArgsMembers
 
enum  EOutArgsDfDp
 
enum  EOutArgsDgDx_dot
 
enum  EOutArgsDgDx
 
enum  EOutArgsDgDp
 
enum  EOutArgsDfDp_mp
 
enum  EOutArgs_g_mp
 
enum  EOutArgsDgDx_dot_mp
 
enum  EOutArgsDgDx_mp
 
enum  EOutArgsDgDp_mp
 
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
ScalarMag
 
- Static Public Attributes inherited from Thyra::ModelEvaluator< class >
static const int NUM_E_IN_ARGS_MEMBERS
 
static const int NUM_E_OUT_ARGS_MEMBERS
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 
- Protected Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
void setMyParamList (const RCP< ParameterList > &paramList)
 
RCP< ParameterListgetMyNonconstParamList ()
 
RCP< const ParameterListgetMyParamList () const
 

Detailed Description

template<class Scalar>
class Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >

van der Pol model formulated for IMEX.

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 an IMEX time stepper, we need to rewrite this in the following form

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

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

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

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

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

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

and the implicit van der Pol model (VanDerPol_IMEX_ImplicitModel) formulated for IMEX is

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

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

\[ W_{ij} \equiv \frac{d\mathcal{F}_i}{dx_j} = \alpha \frac{\partial\mathcal{F}_i}{\partial \dot{x}_j} + \beta \frac{\partial\mathcal{F}_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 explicit van der Pol model (VanDerPol_IMEX_ExplicitModel)

\begin{eqnarray*} W_{00} = \alpha \frac{\partial\mathcal{F}_0}{\partial \dot{x}_0} + \beta \frac{\partial\mathcal{F}_0}{\partial x_0} & = & \alpha \\ W_{01} = \alpha \frac{\partial\mathcal{F}_0}{\partial \dot{x}_1} + \beta \frac{\partial\mathcal{F}_0}{\partial x_1} & = & -\beta \\ W_{10} = \alpha \frac{\partial\mathcal{F}_1}{\partial \dot{x}_0} + \beta \frac{\partial\mathcal{F}_1}{\partial x_0} & = & 1/\epsilon \\ W_{11} = \alpha \frac{\partial\mathcal{F}_1}{\partial \dot{x}_1} + \beta \frac{\partial\mathcal{F}_1}{\partial x_1} & = & \alpha \\ \end{eqnarray*}

Definition at line 108 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::VanDerPol_IMEX_ExplicitModel ( Teuchos::RCP< Teuchos::ParameterList pList = Teuchos::null,
bool  useProductVector = false 
)

Definition at line 31 of file VanDerPol_IMEX_ExplicitModel_impl.hpp.

Member Function Documentation

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::get_x_space ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::get_f_space ( ) const
virtual
template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::getNominalValues ( ) const
virtual
template<class Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::create_W_op ( ) const
virtual
template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::createInArgs ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::get_p_space ( int  l) const
virtual
template<class Scalar >
Teuchos::RCP< const Teuchos::Array< std::string > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::get_p_names ( int  l) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::get_g_space ( int  j) const
virtual
template<class Scalar >
void Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::setParameterList ( Teuchos::RCP< Teuchos::ParameterList > const &  paramList)
virtual
template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::getValidParameters ( ) const
virtual

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 232 of file VanDerPol_IMEX_ExplicitModel_impl.hpp.

template<class Scalar >
void Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::setupInOutArgs_ ( ) const
private

Definition at line 133 of file VanDerPol_IMEX_ExplicitModel_impl.hpp.

template<class Scalar >
Thyra::ModelEvaluatorBase::OutArgs< Scalar > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::createOutArgsImpl ( ) const
private

Definition at line 126 of file VanDerPol_IMEX_ExplicitModel_impl.hpp.

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

Definition at line 293 of file VanDerPol_IMEX_ExplicitModel_impl.hpp.

Member Data Documentation

template<class Scalar >
bool Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::useProductVector_
private

Definition at line 147 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Number of state unknowns (2)

Definition at line 148 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Number of parameter vectors (1)

Definition at line 149 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Number of parameters in this vector (1)

Definition at line 150 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Number of observation functions (0)

Definition at line 151 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Number of elements in this observation function (0)

Definition at line 152 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

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

Definition at line 153 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

template<class Scalar >
bool Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::acceptModelParams_
private

Changes inArgs to require parameters.

Definition at line 154 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

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

Definition at line 155 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 156 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 157 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 158 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 159 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

template<class Scalar >
Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > Tempus_Test::VanDerPol_IMEX_ExplicitModel< Scalar >::xSpace_
private

Definition at line 160 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 161 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 162 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 163 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 164 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

Definition at line 165 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

This is a model parameter.

Definition at line 168 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

initial time

Definition at line 169 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

initial condition for x0

Definition at line 170 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.

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

initial condition for x1

Definition at line 171 of file VanDerPol_IMEX_ExplicitModel_decl.hpp.


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