Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | 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 >:
Thyra::StateFuncModelEvaluatorBase< Scalar > Thyra::ModelEvaluatorDefaultBase< Scalar > Thyra::ModelEvaluator< class > Thyra::ModelEvaluatorBase Teuchos::Describable Teuchos::LabeledObject

Public Member Functions

 VanDerPol_ModelEvaluator_02 ()
 
- 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)
 

Private Attributes

Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
prototypicalInArgs_
 
Thyra::ModelEvaluatorBase::OutArgs
< Scalar > 
prototypicalOutArgs_
 Prototypical OutArgs that just supports the evaluation vector (OUT_ARG_f) More...
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
nominalValues_
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
x_space_
 Solution vector space (a defaultSpmdVectorSpace of dimension 2) More...
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
f_space_
 Function evaluation vector space (a defaultSpmdVectorSpace of dimension 2) More...
 
int dim_
 Number of state unknowns (2) More...
 
Scalar t0_ic_
 initial time = 0 More...
 
Scalar epsilon_
 This is a model parameter ( $\epsilon=0.1$ ) More...
 
Scalar x0_ic_
 initial condition for $x_0 = 2$ More...
 
Scalar x1_ic_
 initial condition for $x_1 = 0$ 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
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
createInArgs () 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
 

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 26 of file VanDerPol_ModelEvaluator_02.hpp.

Constructor & Destructor Documentation

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 25 of file VanDerPol_ModelEvaluator_02.cpp.

Member Function Documentation

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

Implements Thyra::ModelEvaluator< class >.

Definition at line 53 of file VanDerPol_ModelEvaluator_02.hpp.

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

Implements Thyra::ModelEvaluator< class >.

Definition at line 55 of file VanDerPol_ModelEvaluator_02.hpp.

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

Implements Thyra::ModelEvaluator< class >.

Definition at line 57 of file VanDerPol_ModelEvaluator_02.hpp.

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

Implements Thyra::ModelEvaluator< class >.

Definition at line 59 of file VanDerPol_ModelEvaluator_02.hpp.

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

Definition at line 67 of file VanDerPol_ModelEvaluator_02.hpp.

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 82 of file VanDerPol_ModelEvaluator_02.cpp.

Member Data Documentation

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 95 of file VanDerPol_ModelEvaluator_02.hpp.

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 97 of file VanDerPol_ModelEvaluator_02.hpp.

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 101 of file VanDerPol_ModelEvaluator_02.hpp.

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 103 of file VanDerPol_ModelEvaluator_02.hpp.

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 105 of file VanDerPol_ModelEvaluator_02.hpp.

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

Number of state unknowns (2)

Definition at line 107 of file VanDerPol_ModelEvaluator_02.hpp.

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

initial time = 0

Definition at line 108 of file VanDerPol_ModelEvaluator_02.hpp.

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

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

Definition at line 109 of file VanDerPol_ModelEvaluator_02.hpp.

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

initial condition for $x_0 = 2$

Definition at line 110 of file VanDerPol_ModelEvaluator_02.hpp.

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

initial condition for $x_1 = 0$

Definition at line 111 of file VanDerPol_ModelEvaluator_02.hpp.


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