Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
Thyra::ModelEvaluatorBase::InArgs< Scalar > Class Template Reference

Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object. More...

#include <Thyra_ModelEvaluatorBase_decl.hpp>

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

Public Types

typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
ScalarMag
 

Public Member Functions

 InArgs ()
 
int Np () const
 Return the number of parameter subvectors p(l) supported (Np >= 0). More...
 
int Ng () const
 Return the number of axillary response functions g(j)(...) supported (Ng >= 0). More...
 
bool supports (EInArgsMembers arg) const
 Determines if an input argument is supported or not. More...
 
void set_x_dot_dot (const RCP< const VectorBase< Scalar > > &x_dot_dot)
 Precondition: supports(IN_ARG_x_dot_dot)==true. More...
 
RCP< const VectorBase< Scalar > > get_x_dot_dot () const
 Precondition: supports(IN_ARG_x_dot_dot)==true. More...
 
void set_x_dot (const RCP< const VectorBase< Scalar > > &x_dot)
 Precondition: supports(IN_ARG_x_dot)==true. More...
 
RCP< const VectorBase< Scalar > > get_x_dot () const
 Precondition: supports(IN_ARG_x_dot)==true. More...
 
void set_x (const RCP< const VectorBase< Scalar > > &x)
 Precondition: supports(IN_ARG_x)==true. More...
 
RCP< const VectorBase< Scalar > > get_x () const
 Precondition: supports(IN_ARG_x)==true. More...
 
void set_x_direction (const RCP< const MultiVectorBase< Scalar > > &x_direction)
 Precondition: supports(IN_ARG_x)==true. More...
 
void set_p_direction (int l, const RCP< const MultiVectorBase< Scalar > > &p_direction_l)
 Precondition: supports(IN_ARG_x)==true. More...
 
RCP< const MultiVectorBase
< Scalar > > 
get_x_direction () const
 Precondition: supports(IN_ARG_x)==true. More...
 
RCP< const MultiVectorBase
< Scalar > > 
get_p_direction (int l) const
 Get p(l) where 0 <= l && l < this->Np(). More...
 
void set_f_multiplier (const RCP< const VectorBase< Scalar > > &f_multiplier)
 Precondition: supports(IN_ARG_x)==true. More...
 
RCP< const VectorBase< Scalar > > get_f_multiplier () const
 Precondition: supports(IN_ARG_x)==true. More...
 
void set_g_multiplier (int j, const RCP< const VectorBase< Scalar > > &g_multiplier)
 Precondition: supports(IN_ARG_x)==true. More...
 
RCP< const VectorBase< Scalar > > get_g_multiplier (int j) const
 Precondition: supports(IN_ARG_x)==true. More...
 
template<typename ObjectType >
bool supports () const
 Determines if an extended input argument of type ObjectType is supported. More...
 
template<typename ObjectType >
void set (const RCP< const ObjectType > &uo)
 Set an extended input object of type ObjectType in the InArgs. Precondition: supports()==true. More...
 
template<typename ObjectType >
RCP< const ObjectType > get () const
 Get an extended input object of type ObjectType>/tt> from the InArgs. Precondition: supports()==true. More...
 
void set_p (int l, const RCP< const VectorBase< Scalar > > &p_l)
 Set p(l) where 0 <= l && l < this->Np(). More...
 
RCP< const VectorBase< Scalar > > get_p (int l) const
 Get p(l) where 0 <= l && l < this->Np(). More...
 
void set_x_dot_mp (const RCP< const Stokhos::ProductEpetraVector > &x_dot_mp)
 Precondition: supports(IN_ARG_x_dot_mp)==true. More...
 
RCP< const
Stokhos::ProductEpetraVector > 
get_x_dot_mp () const
 Precondition: supports(IN_ARG_x_dotmp)==true. More...
 
void set_x_mp (const RCP< const Stokhos::ProductEpetraVector > &x_mp)
 Precondition: supports(IN_ARG_x_mp)==true. More...
 
RCP< const
Stokhos::ProductEpetraVector > 
get_x_mp () const
 Precondition: supports(IN_ARG_x_mp)==true. More...
 
bool supports (EInArgs_p_mp arg, int l) const
 
void set_t (ScalarMag t)
 Precondition: supports(IN_ARG_t)==true. More...
 
ScalarMag get_t () const
 .Precondition: supports(IN_ARG_t)==true More...
 
void set_alpha (Scalar alpha)
 Precondition: supports(IN_ARG_alpha)==true. More...
 
Scalar get_alpha () const
 Precondition: supports(IN_ARG_alpha)==true. More...
 
void set_beta (Scalar beta)
 Precondition: supports(IN_ARG_beta)==true. More...
 
Scalar get_beta () const
 Precondition: supports(IN_ARG_beta)==true. More...
 
void set_W_x_dot_dot_coeff (Scalar W_x_dot_dot_coeff)
 Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true. More...
 
Scalar get_W_x_dot_dot_coeff () const
 Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true. More...
 
void set_step_size (Scalar step_size)
 Precondition: supports(IN_ARG_step_size)==true. More...
 
Scalar get_step_size () const
 Precondition: supports(IN_ARG_step_size)==true. More...
 
void set_stage_number (Scalar stage_number)
 Precondition: supports(IN_ARG_stage_number)==true. More...
 
Scalar get_stage_number () const
 Precondition: supports(IN_ARG_stage_number)==true. More...
 
void setArgs (const InArgs< Scalar > &inArgs, bool ignoreUnsupported=false, bool cloneObjects=false)
 Set non-null arguments (does not overwrite non-NULLs with NULLs) . More...
 
void assertSameSupport (const InArgs< Scalar > &inArgs) const
 Assert that two InArgs objects have the same support. More...
 
std::string modelEvalDescription () const
 
std::string description () const
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
 Create a more detailed description along about this object and the ModelEvaluator that created it. More...
 

Protected Member Functions

void _setModelEvalDescription (const std::string &modelEvalDescription)
 
void _set_Np_Ng (int Np, int Ng)
 
void _setSupports (EInArgsMembers arg, bool supports)
 
void _setSupports (EInArgs_p_mp arg, int l, bool supports)
 
void _setSupports (const InArgs< Scalar > &inputInArgs, const int Np)
 
template<typename ObjectType >
void _setSupports (const bool supports)
 
void _setUnsupportsAndRelated (EInArgsMembers arg)
 

Detailed Description

template<class Scalar>
class Thyra::ModelEvaluatorBase::InArgs< Scalar >

Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object.

The set of supported objects is returned from the supports() function.

A client can not directly set what input arguments are supported or not supported. Only a subclass of ModelEvaluator can do that (through the InArgsSetup subclass).

Extended types: The methods for supports(), set() and get() that are templated on the ObjectType are used to support what are called extended types. This functionality allows developers to inject new objects into the ModelEvaluator evaluations. This can be used for expermenting with new capabilities that require adding new/special arguments to the inArgs. This also can be used to reduce the clutter and complexity of the model evaluator inArgs object. For example, users could create their own inArgs for a stochastic computation:

struct StochasticInArgs {
StochLib::MultiVector<Scalar> stochastic_x;
...
};

This object could then be used in a model evaluator without changing the base classes in Thyra:

auto inArgs = model->createInArgs();
assert(inArgs.template supports<StochasticInArgs<Scalar>>());
RCP<StochasticInArgs> stochInArgs = rcp(new StochasticInArgs<Scalar>);
stochInArgs->stochastic_x = ... // create and set objects
...
inArgs.set(stochInArgs);

Definition at line 127 of file Thyra_ModelEvaluatorBase_decl.hpp.

Member Typedef Documentation

template<class Scalar>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Thyra::ModelEvaluatorBase::InArgs< Scalar >::ScalarMag

Definition at line 130 of file Thyra_ModelEvaluatorBase_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar >::InArgs ( )

Definition at line 77 of file Thyra_ModelEvaluatorBase_def.hpp.

Member Function Documentation

template<class Scalar >
int Thyra::ModelEvaluatorBase::InArgs< Scalar >::Np ( ) const

Return the number of parameter subvectors p(l) supported (Np >= 0).

Definition at line 92 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
int Thyra::ModelEvaluatorBase::InArgs< Scalar >::Ng ( ) const

Return the number of axillary response functions g(j)(...) supported (Ng >= 0).

Definition at line 96 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
bool Thyra::ModelEvaluatorBase::InArgs< Scalar >::supports ( EInArgsMembers  arg) const

Determines if an input argument is supported or not.

Definition at line 100 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x_dot_dot ( const RCP< const VectorBase< Scalar > > &  x_dot_dot)

Precondition: supports(IN_ARG_x_dot_dot)==true.

Definition at line 118 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_dot_dot ( ) const

Precondition: supports(IN_ARG_x_dot_dot)==true.

Definition at line 125 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x_dot ( const RCP< const VectorBase< Scalar > > &  x_dot)

Precondition: supports(IN_ARG_x_dot)==true.

Definition at line 129 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_dot ( ) const

Precondition: supports(IN_ARG_x_dot)==true.

Definition at line 137 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x ( const RCP< const VectorBase< Scalar > > &  x)

Precondition: supports(IN_ARG_x)==true.

Definition at line 142 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x ( ) const

Precondition: supports(IN_ARG_x)==true.

Definition at line 150 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x_direction ( const RCP< const MultiVectorBase< Scalar > > &  x_direction)

Precondition: supports(IN_ARG_x)==true.

Definition at line 155 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_p_direction ( int  l,
const RCP< const MultiVectorBase< Scalar > > &  p_direction_l 
)

Precondition: supports(IN_ARG_x)==true.

Definition at line 162 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const MultiVectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_direction ( ) const

Precondition: supports(IN_ARG_x)==true.

Definition at line 170 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const MultiVectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_p_direction ( int  l) const

Get p(l) where 0 <= l && l < this->Np().

Definition at line 176 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_f_multiplier ( const RCP< const VectorBase< Scalar > > &  f_multiplier)

Precondition: supports(IN_ARG_x)==true.

Definition at line 206 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_f_multiplier ( ) const

Precondition: supports(IN_ARG_x)==true.

Definition at line 213 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_g_multiplier ( int  j,
const RCP< const VectorBase< Scalar > > &  g_multiplier 
)

Precondition: supports(IN_ARG_x)==true.

Definition at line 217 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_g_multiplier ( int  j) const

Precondition: supports(IN_ARG_x)==true.

Definition at line 228 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
template<typename ObjectType >
bool Thyra::ModelEvaluatorBase::InArgs< Scalar >::supports ( ) const

Determines if an extended input argument of type ObjectType is supported.

Definition at line 1653 of file Thyra_ModelEvaluatorBase_decl.hpp.

template<class Scalar >
template<typename ObjectType >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set ( const RCP< const ObjectType > &  uo)

Set an extended input object of type ObjectType in the InArgs. Precondition: supports()==true.

Definition at line 1666 of file Thyra_ModelEvaluatorBase_decl.hpp.

template<class Scalar>
template<typename ObjectType >
RCP<const ObjectType> Thyra::ModelEvaluatorBase::InArgs< Scalar >::get ( ) const

Get an extended input object of type ObjectType>/tt> from the InArgs. Precondition: supports()==true.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_p ( int  l,
const RCP< const VectorBase< Scalar > > &  p_l 
)

Set p(l) where 0 <= l && l < this->Np().

Definition at line 266 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const VectorBase< Scalar > > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_p ( int  l) const

Get p(l) where 0 <= l && l < this->Np().

Definition at line 274 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x_dot_mp ( const RCP< const Stokhos::ProductEpetraVector > &  x_dot_mp)

Precondition: supports(IN_ARG_x_dot_mp)==true.

Definition at line 181 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const Stokhos::ProductEpetraVector > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_dot_mp ( ) const

Precondition: supports(IN_ARG_x_dotmp)==true.

Definition at line 189 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_x_mp ( const RCP< const Stokhos::ProductEpetraVector > &  x_mp)

Precondition: supports(IN_ARG_x_mp)==true.

Definition at line 194 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
RCP< const Stokhos::ProductEpetraVector > Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_mp ( ) const

Precondition: supports(IN_ARG_x_mp)==true.

Definition at line 202 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
bool Thyra::ModelEvaluatorBase::InArgs< Scalar >::supports ( EInArgs_p_mp  arg,
int  l 
) const

Whether p_mp is supported for parameter vector l

Definition at line 111 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_t ( ScalarMag  t)

Precondition: supports(IN_ARG_t)==true.

Definition at line 291 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar >::ScalarMag Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_t ( ) const

.Precondition: supports(IN_ARG_t)==true

Definition at line 297 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_alpha ( Scalar  alpha)

Precondition: supports(IN_ARG_alpha)==true.

Definition at line 302 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
Scalar Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_alpha ( ) const

Precondition: supports(IN_ARG_alpha)==true.

Definition at line 307 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_beta ( Scalar  beta)

Precondition: supports(IN_ARG_beta)==true.

Definition at line 312 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
Scalar Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_beta ( ) const

Precondition: supports(IN_ARG_beta)==true.

Definition at line 317 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_W_x_dot_dot_coeff ( Scalar  W_x_dot_dot_coeff)

Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.

Definition at line 321 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
Scalar Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_W_x_dot_dot_coeff ( ) const

Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.

Definition at line 326 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_step_size ( Scalar  step_size)

Precondition: supports(IN_ARG_step_size)==true.

Definition at line 330 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
Scalar Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_step_size ( ) const

Precondition: supports(IN_ARG_step_size)==true.

Definition at line 334 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::set_stage_number ( Scalar  stage_number)

Precondition: supports(IN_ARG_stage_number)==true.

Definition at line 343 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
Scalar Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_stage_number ( ) const

Precondition: supports(IN_ARG_stage_number)==true.

Definition at line 338 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::setArgs ( const InArgs< Scalar > &  inArgs,
bool  ignoreUnsupported = false,
bool  cloneObjects = false 
)

Set non-null arguments (does not overwrite non-NULLs with NULLs) .

Definition at line 348 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::assertSameSupport ( const InArgs< Scalar > &  inArgs) const

Assert that two InArgs objects have the same support.

Definition at line 453 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
std::string Thyra::ModelEvaluatorBase::InArgs< Scalar >::modelEvalDescription ( ) const

Definition at line 476 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
std::string Thyra::ModelEvaluatorBase::InArgs< Scalar >::description ( ) const
virtual

Reimplemented from Teuchos::Describable.

Definition at line 483 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
virtual

Create a more detailed description along about this object and the ModelEvaluator that created it.

Reimplemented from Teuchos::Describable.

Definition at line 498 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setModelEvalDescription ( const std::string &  modelEvalDescription)
protected

Definition at line 587 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_set_Np_Ng ( int  Np,
int  Ng 
)
protected

Definition at line 596 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setSupports ( EInArgsMembers  arg,
bool  supports 
)
protected

Definition at line 607 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setSupports ( EInArgs_p_mp  arg,
int  l,
bool  supports 
)
protected

Definition at line 619 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar>
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setSupports ( const InArgs< Scalar > &  inputInArgs,
const int  Np 
)
protected

Definition at line 629 of file Thyra_ModelEvaluatorBase_def.hpp.

template<class Scalar >
template<class ObjectType >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setSupports ( const bool  supports)
protected

Definition at line 1702 of file Thyra_ModelEvaluatorBase_decl.hpp.

template<class Scalar >
void Thyra::ModelEvaluatorBase::InArgs< Scalar >::_setUnsupportsAndRelated ( EInArgsMembers  arg)
protected

Definition at line 641 of file Thyra_ModelEvaluatorBase_def.hpp.


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