Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Related Functions | List of all members
Thyra::Simple2DModelEvaluator< Scalar > Class Template Reference

Simple 2d simulation only ModelEvaluator for f(x) = 0. More...

#include <Thyra_Simple2DModelEvaluator_decl.hpp>

Inheritance diagram for Thyra::Simple2DModelEvaluator< Scalar >:
Inheritance graph
[legend]

Related Functions

(Note that these are not member functions.)

template<class Scalar >
Teuchos::RCP
< Simple2DModelEvaluator
< Scalar > > 
simple2DModelEvaluator ()
 Nonmember constuctor. More...
 

Initializers/Accessors

void set_d (const Scalar &d)
 
void set_p (const Teuchos::ArrayView< const Scalar > &p)
 
void set_x0 (const Teuchos::ArrayView< const Scalar > &x0)
 
void setShowGetInvalidArgs (bool showGetInvalidArg)
 

Public functions overridden from ModelEvaulator.

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
 
Teuchos::RCP
< Thyra::PreconditionerBase
< Scalar > > 
create_W_prec () const
 
Teuchos::RCP< const
Thyra::LinearOpWithSolveFactoryBase
< Scalar > > 
get_W_factory () const
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
createInArgs () const
 

Additional Inherited Members

- Public Types inherited from Thyra::ModelEvaluator< Scalar >
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
ScalarMag
 
- Public Types inherited from Thyra::ModelEvaluatorBase
enum  EInArgsMembers {
  IN_ARG_x_dot_dot, IN_ARG_x_dot, IN_ARG_x, IN_ARG_x_dot_poly,
  IN_ARG_x_poly, IN_ARG_x_dot_mp, IN_ARG_x_mp, IN_ARG_t,
  IN_ARG_alpha, IN_ARG_beta, IN_ARG_W_x_dot_dot_coeff, IN_ARG_step_size,
  IN_ARG_stage_number
}
 
enum  EInArgs_p_mp { IN_ARG_p_mp }
 
enum  EEvalType { , EVAL_TYPE_APPROX_DERIV, EVAL_TYPE_VERY_APPROX_DERIV }
 The type of an evaluation. More...
 
enum  EDerivativeMultiVectorOrientation { DERIV_MV_JACOBIAN_FORM, DERIV_MV_GRADIENT_FORM, DERIV_MV_BY_COL = DERIV_MV_JACOBIAN_FORM, DERIV_TRANS_MV_BY_ROW = DERIV_MV_GRADIENT_FORM }
 
enum  EDerivativeLinearOp { DERIV_LINEAR_OP }
 
enum  EDerivativeLinearity { DERIV_LINEARITY_UNKNOWN, DERIV_LINEARITY_CONST, DERIV_LINEARITY_NONCONST }
 
enum  ERankStatus { DERIV_RANK_UNKNOWN, DERIV_RANK_FULL, DERIV_RANK_DEFICIENT }
 
enum  EOutArgsMembers {
  OUT_ARG_f, OUT_ARG_W, OUT_ARG_f_mp, OUT_ARG_W_mp,
  OUT_ARG_W_op, OUT_ARG_W_prec, OUT_ARG_f_poly
}
 
enum  EOutArgsDfDp { OUT_ARG_DfDp }
 
enum  EOutArgsDgDx_dot { OUT_ARG_DgDx_dot }
 
enum  EOutArgsDgDx { OUT_ARG_DgDx }
 
enum  EOutArgsDgDp { OUT_ARG_DgDp }
 
enum  EOutArgs_hess_vec_prod_f_xx { OUT_ARG_hess_vec_prod_f_xx }
 
enum  EOutArgs_hess_vec_prod_f_xp { OUT_ARG_hess_vec_prod_f_xp }
 
enum  EOutArgs_hess_vec_prod_f_px { OUT_ARG_hess_vec_prod_f_px }
 
enum  EOutArgs_hess_vec_prod_f_pp { OUT_ARG_hess_vec_prod_f_pp }
 
enum  EOutArgs_hess_vec_prod_g_xx { OUT_ARG_hess_vec_prod_g_xx }
 
enum  EOutArgs_hess_vec_prod_g_xp { OUT_ARG_hess_vec_prod_g_xp }
 
enum  EOutArgs_hess_vec_prod_g_px { OUT_ARG_hess_vec_prod_g_px }
 
enum  EOutArgs_hess_vec_prod_g_pp { OUT_ARG_hess_vec_prod_g_pp }
 
enum  EOutArgs_hess_f_xx { OUT_ARG_hess_f_xx }
 
enum  EOutArgs_hess_f_xp { OUT_ARG_hess_f_xp }
 
enum  EOutArgs_hess_f_pp { OUT_ARG_hess_f_pp }
 
enum  EOutArgs_hess_g_xx { OUT_ARG_hess_g_xx }
 
enum  EOutArgs_hess_g_xp { OUT_ARG_hess_g_xp }
 
enum  EOutArgs_hess_g_pp { OUT_ARG_hess_g_pp }
 
enum  EOutArgs_H_xx { OUT_ARG_H_xx }
 
enum  EOutArgs_H_xp { OUT_ARG_H_xp }
 
enum  EOutArgs_H_pp { OUT_ARG_H_pp }
 
enum  EOutArgsDfDp_mp { OUT_ARG_DfDp_mp }
 
enum  EOutArgs_g_mp { OUT_ARG_g_mp }
 
enum  EOutArgsDgDx_dot_mp { OUT_ARG_DgDx_dot_mp }
 
enum  EOutArgsDgDx_mp { OUT_ARG_DgDx_mp }
 
enum  EOutArgsDgDp_mp { OUT_ARG_DgDp_mp }
 
- Public Member Functions inherited from Thyra::StateFuncModelEvaluatorBase< Scalar >
RCP< const VectorSpaceBase
< Scalar > > 
get_p_space (int l) const
 Throws exception. More...
 
RCP< const Teuchos::Array
< std::string > > 
get_p_names (int l) const
 Throws exception. More...
 
RCP< const VectorSpaceBase
< Scalar > > 
get_g_space (int j) const
 Throws exception. More...
 
Teuchos::ArrayView< const
std::string > 
get_g_names (int j) const
 Throws exception. More...
 
ModelEvaluatorBase::InArgs
< Scalar > 
getLowerBounds () const
 Returns this->createInArgs(). More...
 
ModelEvaluatorBase::InArgs
< Scalar > 
getUpperBounds () const
 Returns this->createInArgs(). More...
 
void reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
 Ignores input and does nothing. More...
 
- Public Member Functions inherited from Thyra::ModelEvaluatorDefaultBase< Scalar >
int Np () const
 
int Ng () const
 
RCP< LinearOpBase< Scalar > > create_DfDp_op (int l) const
 
RCP< LinearOpBase< Scalar > > create_DgDx_dot_op (int j) const
 
RCP< LinearOpBase< Scalar > > create_DgDx_op (int j) const
 
RCP< LinearOpBase< Scalar > > create_DgDp_op (int j, int l) const
 
RCP< LinearOpWithSolveBase
< Scalar > > 
create_W () const
 
ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgs () const
 
void evalModel (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
 
virtual RCP< const
VectorSpaceBase< Scalar > > 
get_f_multiplier_space () const
 
virtual RCP< const
VectorSpaceBase< Scalar > > 
get_g_multiplier_space (int j) const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_f_xx () const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_f_xp (int l) const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_f_pp (int l1, int l2) const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_g_xx (int j) const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_g_xp (int j, int l) const
 
virtual RCP< LinearOpBase
< Scalar > > 
create_hess_g_pp (int j, int l1, int l2) const
 
- Public Member Functions inherited from Thyra::ModelEvaluator< Scalar >
- Public Member Functions inherited from Thyra::ModelEvaluatorBase
 ModelEvaluatorBase ()
 constructor More...
 
- Static Public Attributes inherited from Thyra::ModelEvaluatorBase
static const int NUM_E_IN_ARGS_MEMBERS =13
 
static const int NUM_E_OUT_ARGS_MEMBERS =7
 
- Protected Member Functions inherited from Thyra::ModelEvaluatorDefaultBase< Scalar >
 ModelEvaluatorDefaultBase ()
 
void initializeDefaultBase ()
 Function called by subclasses to fully initialize this object on any important change. More...
 
void resetDefaultBase ()
 Sets the the DefaultBase to an uninitialized state, forcing lazy initialization when needed. More...
 

Detailed Description

template<class Scalar>
class Thyra::Simple2DModelEvaluator< Scalar >

Simple 2d simulation only ModelEvaluator for f(x) = 0.

The equations modeled are:

   f[0] =       x[0]      + x[1]*x[1] - p[0];
   f[1] = d * ( x[0]*x[0] - x[1]      - p[1] );

The Matrix W = d(f)/d(x) is implemented as a Thyra::MultiVectorBase object and the class Thyra::DefaultSerialDenseLinearOpWithSolveFactory is used to create the linear solver.

This class also supports an app-defined preconditioner W_prec but it is not used by the linear solver object. The preconditioner operator is implemented as the inverse diagonal of the forward Jacobian W.

This is really more of a mock test driver model for Thyra than an example of implementing a real simulation-constrained ModelEvaluator subclass. However, it is a very simple Thyra-only example and therefore is not a bad starting point.

Definition at line 55 of file Thyra_Simple2DModelEvaluator_decl.hpp.

Member Function Documentation

template<class Scalar >
void Thyra::Simple2DModelEvaluator< Scalar >::set_d ( const Scalar &  d)

Definition at line 78 of file Thyra_Simple2DModelEvaluator_def.hpp.

template<class Scalar >
void Thyra::Simple2DModelEvaluator< Scalar >::set_p ( const Teuchos::ArrayView< const Scalar > &  p)

Definition at line 85 of file Thyra_Simple2DModelEvaluator_def.hpp.

template<class Scalar >
void Thyra::Simple2DModelEvaluator< Scalar >::set_x0 ( const Teuchos::ArrayView< const Scalar > &  x0)

Definition at line 95 of file Thyra_Simple2DModelEvaluator_def.hpp.

template<class Scalar >
void Thyra::Simple2DModelEvaluator< Scalar >::setShowGetInvalidArgs ( bool  showGetInvalidArg)

Definition at line 106 of file Thyra_Simple2DModelEvaluator_def.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Thyra::Simple2DModelEvaluator< Scalar >::get_x_space ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Thyra::Simple2DModelEvaluator< Scalar >::get_f_space ( ) const
virtual
template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Thyra::Simple2DModelEvaluator< Scalar >::getNominalValues ( ) const
virtual
template<class Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Thyra::Simple2DModelEvaluator< Scalar >::create_W_op ( ) const
virtual
template<class Scalar >
Teuchos::RCP< Thyra::PreconditionerBase< Scalar > > Thyra::Simple2DModelEvaluator< Scalar >::create_W_prec ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > Thyra::Simple2DModelEvaluator< Scalar >::get_W_factory ( ) const
virtual
template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Thyra::Simple2DModelEvaluator< Scalar >::createInArgs ( ) const
virtual

Friends And Related Function Documentation

template<class Scalar >
Teuchos::RCP< Simple2DModelEvaluator< Scalar > > simple2DModelEvaluator ( )
related

Nonmember constuctor.

Definition at line 68 of file Thyra_Simple2DModelEvaluator_def.hpp.


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