Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra::ModelEvaluatorDefaultBase< Scalar > Class Template Referenceabstract

Default base class for concrete model evaluators. More...

#include <Thyra_ModelEvaluatorDefaultBase.hpp>

Inheritance diagram for Thyra::ModelEvaluatorDefaultBase< Scalar >:

(Note that these are not member symbols.)

template<class Scalar>
RCP< ModelEvaluatorBase::InArgs< Scalar > > clone (const ModelEvaluatorBase::InArgs< Scalar > &inArgs)
 Create a clone of an InArgs object.
template<class Scalar>
void assertDerivSpaces (const std::string &modelEvalDescription, const ModelEvaluatorBase::Derivative< Scalar > &deriv, const std::string &deriv_name, const VectorSpaceBase< Scalar > &fnc_space, const std::string &fnc_space_name, const VectorSpaceBase< Scalar > &var_space, const std::string &var_space_name)
 Assert that that Thyra objects imbedded in a Derivative object matches its function and variable spaces.
template<class Scalar>
void assertInArgsOutArgsSetup (const std::string &modelEvalDescription, const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs)
 Assert that an InArgs and OutArgs object are setup consistently.
template<class Scalar>
void assertInArgsEvalObjects (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &inArgs)
 Assert that the objects in an InArgs object match a given model.
template<class Scalar>
void assertOutArgsEvalObjects (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs, const ModelEvaluatorBase::InArgs< Scalar > *inArgs=0)
 Assert that the objects in an OutArgs object match a given model.

Private pure virtual functions that must be overridden by subclasses

 ModelEvaluatorDefaultBase ()

Overridden from ModelEvaluator

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

Setup functions called by subclasses

void initializeDefaultBase ()
 Function called by subclasses to fully initialize this object on any important change.
void resetDefaultBase ()
 Sets the the DefaultBase to an uninitialized state, forcing lazy initialization when needed.

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 { }
 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  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 }
virtual RCP< const VectorSpaceBase< Scalar > > get_x_space () const =0
 Return the vector space for the state variables x <: RE^n_x.
virtual RCP< const VectorSpaceBase< Scalar > > get_f_space () const =0
 Return the vector space for the state function f(...) <: RE^n_x.
virtual RCP< const VectorSpaceBase< Scalar > > get_p_space (int l) const =0
 Return the vector space for the auxiliary parameters p(l) <: RE^n_p_l.
virtual RCP< const Teuchos::Array< std::string > > get_p_names (int l) const =0
 Get the names of the parameters associated with parameter subvector l if available.
virtual RCP< const VectorSpaceBase< Scalar > > get_g_space (int j) const =0
 Return the vector space for the auxiliary response functions g(j) <: RE^n_g_j.
virtual Teuchos::ArrayView< const std::string > get_g_names (int j) const =0
 Get the names of the response functions associated with subvector j if available.
virtual ModelEvaluatorBase::InArgs< Scalar > getNominalValues () const =0
 Return the set of nominal values or initial guesses for the supported the input arguments.
virtual ModelEvaluatorBase::InArgs< Scalar > getLowerBounds () const =0
 Return the set of lower bounds for the input arguments.
virtual ModelEvaluatorBase::InArgs< Scalar > getUpperBounds () const =0
 Return the set of upper bounds for the input arguments.
virtual RCP< LinearOpBase< Scalar > > create_W_op () const =0
 If supported, create a LinearOpBase object for W to be evaluated.
virtual RCP< PreconditionerBase< Scalar > > create_W_prec () const =0
 If supported, create a PreconditionerBase object for W_prec to be evaluated.
virtual RCP< const LinearOpWithSolveFactoryBase< Scalar > > get_W_factory () const =0
 If supported, return a LinearOpWithSolveFactoryBase object that can be used to initialize a LOWSB object for W given a LOB object for W_op.
virtual ModelEvaluatorBase::InArgs< Scalar > createInArgs () const =0
 Create an empty input arguments object that can be set up and passed to evalModel().
virtual void reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)=0
 Report the final point and whether the problem was considered solved or not.
 ModelEvaluatorBase ()
 constructor
static const int NUM_E_IN_ARGS_MEMBERS =13
static const int NUM_E_OUT_ARGS_MEMBERS =7

Detailed Description

template<class Scalar>
class Thyra::ModelEvaluatorDefaultBase< Scalar >

Default base class for concrete model evaluators.

The primary purposes of this base class are to:

  • Provide default implementations for other forms of derivatives in ModelEvaluatorBase::Derivative. For example, if a multi-vector form of a derivative (i.e. my column DhDy or by row DhDy^T) is provided then the other form will be provided assuming the range space has in-core vectors. Also, if any multi-vector form of a general derivative is provided, a LinearOpBase version is automatically supported.

  • Provide a default implementation for computing the LOWSB from W given the LOB-only form W_op given a LOWSFB object W_factory supplied by the subclass. If the subclass wants to take this over, then it should override create_W().

  • Assert (in debug mode) that the underlying model has been set up correctly.

ToDo: Finish Documentation!

Definition at line 156 of file Thyra_ModelEvaluatorDefaultBase.hpp.

Constructor & Destructor Documentation

◆ ModelEvaluatorDefaultBase()

template<class Scalar>
Thyra::ModelEvaluatorDefaultBase< Scalar >::ModelEvaluatorDefaultBase ( )
protected

Definition at line 1004 of file Thyra_ModelEvaluatorDefaultBase.hpp.

Member Function Documentation

◆ Np()

template<class Scalar>
int Thyra::ModelEvaluatorDefaultBase< Scalar >::Np ( ) const
virtual

◆ Ng()

template<class Scalar>
int Thyra::ModelEvaluatorDefaultBase< Scalar >::Ng ( ) const
virtual

◆ create_DfDp_op()

template<class Scalar>
RCP< LinearOpBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::create_DfDp_op ( int l) const
virtual

◆ create_DgDx_dot_op()

template<class Scalar>
RCP< LinearOpBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::create_DgDx_dot_op ( int j) const
virtual

◆ create_DgDx_op()

template<class Scalar>
RCP< LinearOpBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::create_DgDx_op ( int j) const
virtual

◆ create_DgDp_op()

template<class Scalar>
RCP< LinearOpBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::create_DgDp_op ( int j,
int l ) const
virtual

◆ create_W()

template<class Scalar>
RCP< LinearOpWithSolveBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::create_W ( ) const
virtual

◆ createOutArgs()

template<class Scalar>
ModelEvaluatorBase::OutArgs< Scalar > Thyra::ModelEvaluatorDefaultBase< Scalar >::createOutArgs ( ) const
virtual

◆ evalModel()

template<class Scalar>
void Thyra::ModelEvaluatorDefaultBase< Scalar >::evalModel ( const ModelEvaluatorBase::InArgs< Scalar > & inArgs,
const ModelEvaluatorBase::OutArgs< Scalar > & outArgs ) const
virtual

◆ get_f_multiplier_space()

template<class Scalar>
RCP< const VectorSpaceBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::get_f_multiplier_space ( ) const
virtual

◆ get_g_multiplier_space()

template<class Scalar>
RCP< const VectorSpaceBase< Scalar > > Thyra::ModelEvaluatorDefaultBase< Scalar >::get_g_multiplier_space ( int j) const
virtual

◆ initializeDefaultBase()

template<class Scalar>
void Thyra::ModelEvaluatorDefaultBase< Scalar >::initializeDefaultBase ( )
protected

Function called by subclasses to fully initialize this object on any important change.

Note: This class will automatically call this function the first time to set things up and does not need to be called by the client the first time. However, if the state of the object changes, then this function should be called to reset the state of this object's implemention!

Definition at line 712 of file Thyra_ModelEvaluatorDefaultBase.hpp.

◆ resetDefaultBase()

template<class Scalar>
void Thyra::ModelEvaluatorDefaultBase< Scalar >::resetDefaultBase ( )
protected

Sets the the DefaultBase to an uninitialized state, forcing lazy initialization when needed.

This is used when a derived class changes state and requires lazy initialization.

Definition at line 856 of file Thyra_ModelEvaluatorDefaultBase.hpp.

◆ clone()

template<class Scalar>
RCP< ModelEvaluatorBase::InArgs< Scalar > > clone ( const ModelEvaluatorBase::InArgs< Scalar > & inArgs)
related

Create a clone of an InArgs object.

Warning! This function only creates a shallow copy of the underlying input objects. Therefore, be careful if you try to modify any of these.

◆ assertDerivSpaces()

template<class Scalar>
void Thyra::assertDerivSpaces ( const std::string & modelEvalDescription,
const ModelEvaluatorBase::Derivative< Scalar > & deriv,
const std::string & deriv_name,
const VectorSpaceBase< Scalar > & fnc_space,
const std::string & fnc_space_name,
const VectorSpaceBase< Scalar > & var_space,
const std::string & var_space_name )
related

Assert that that Thyra objects imbedded in a Derivative object matches its function and variable spaces.

Definition at line 434 of file Thyra_ModelEvaluatorHelpers.hpp.

◆ assertInArgsOutArgsSetup()

template<class Scalar>
void Thyra::assertInArgsOutArgsSetup ( const std::string & modelEvalDescription,
const ModelEvaluatorBase::InArgs< Scalar > & inArgs,
const ModelEvaluatorBase::OutArgs< Scalar > & outArgs )
related

Assert that an InArgs and OutArgs object are setup consistently.

Definition at line 499 of file Thyra_ModelEvaluatorHelpers.hpp.

◆ assertInArgsEvalObjects()

template<class Scalar>
void Thyra::assertInArgsEvalObjects ( const ModelEvaluator< Scalar > & model,
const ModelEvaluatorBase::InArgs< Scalar > & inArgs )
related

Assert that the objects in an InArgs object match a given model.

Definition at line 601 of file Thyra_ModelEvaluatorHelpers.hpp.

◆ assertOutArgsEvalObjects()

template<class Scalar>
void Thyra::assertOutArgsEvalObjects ( const ModelEvaluator< Scalar > & model,
const ModelEvaluatorBase::OutArgs< Scalar > & outArgs,
const ModelEvaluatorBase::InArgs< Scalar > * inArgs = 0 )
related

Assert that the objects in an OutArgs object match a given model.

Definition at line 638 of file Thyra_ModelEvaluatorHelpers.hpp.


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