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

Transform a ModelEvaluator's sensitivity equations to its residual. More...

#include <Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp>

Inheritance diagram for Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >:
Thyra::StateFuncModelEvaluatorBase< Scalar > Tempus::SensitivityModelEvaluatorBase< Scalar > Thyra::ModelEvaluatorDefaultBase< Scalar > Thyra::ModelEvaluatorDefaultBase< Scalar > Thyra::ModelEvaluator< class > Thyra::ModelEvaluator< class > Thyra::ModelEvaluatorBase Thyra::ModelEvaluatorBase Teuchos::Describable Teuchos::Describable Teuchos::LabeledObject Teuchos::LabeledObject

Public Types

typedef Thyra::VectorBase< Scalar > Vector
 
typedef Thyra::MultiVectorBase
< Scalar > 
MultiVector
 
- 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
 

Public Member Functions

 CombinedForwardSensitivityModelEvaluator (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &sens_residual_model, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &sens_solve_model, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null, const Teuchos::RCP< MultiVector > &dxdp_init=Teuchos::null, const Teuchos::RCP< MultiVector > &dx_dotdp_init=Teuchos::null, const Teuchos::RCP< MultiVector > &dx_dotdot_dp_init=Teuchos::null)
 Constructor. More...
 
int getSensitivityParamIndex () const
 Get sensitivity parameter index. More...
 
- 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
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 Tempus::SensitivityModelEvaluatorBase< Scalar >
 SensitivityModelEvaluatorBase ()
 Constructor. More...
 
virtual ~SensitivityModelEvaluatorBase ()
 Destructor. More...
 
virtual void setForwardSolutionHistory (const Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > &)
 Set solution history from forward state evaluation (for interpolation) More...
 
virtual void setForwardSolutionState (const Teuchos::RCP< const Tempus::SolutionState< Scalar > > &)
 Set solution state from forward state evaluation (for frozen state) More...
 
virtual void setSolver (const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &, const bool)
 Set the solver of the underlying model if you want to reuse it. More...
 

Static Public Member Functions

static Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters ()
 

Private Types

typedef
Thyra::DefaultMultiVectorProductVectorSpace
< Scalar > 
DMVPVS
 

Private Member Functions

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

Private Attributes

Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
prototypeInArgs_
 
Thyra::ModelEvaluatorBase::OutArgs
< Scalar > 
prototypeOutArgs_
 
Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
model_
 
Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
sens_residual_model_
 
Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
sens_solve_model_
 
Teuchos::RCP< MultiVectordxdp_init_
 
Teuchos::RCP< MultiVectordx_dotdp_init_
 
Teuchos::RCP< MultiVectordx_dotdotdp_init_
 
int p_index_
 
int g_index_
 
int x_tangent_index_
 
int xdot_tangent_index_
 
int xdotdot_tangent_index_
 
bool use_dfdp_as_tangent_
 
bool use_dgdp_as_tangent_
 
int num_param_
 
int num_response_
 
int g_offset_
 
Teuchos::RCP< const DMVPVSdxdp_space_
 
Teuchos::RCP< const DMVPVSx_dxdp_space_
 
Teuchos::RCP< const DMVPVSdfdp_space_
 
Teuchos::RCP< const DMVPVSf_dfdp_space_
 
Teuchos::RCP< const DMVPVSdgdp_space_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdx_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdxdot_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdxdotdot_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dgdx_
 
Teuchos::RCP
< Thyra::MultiVectorBase
< Scalar > > 
my_dgdx_mv_
 

Public functions overridden from SensitivityModelEvaulator.

Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
getForwardModel () const
 Get the underlying model 'f'. More...
 

Public functions overridden from ModelEvaulator.

Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
get_p_space (int p) const
 
Teuchos::RCP< const
Teuchos::Array< std::string > > 
get_p_names (int p) const
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
get_x_space () const
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
get_f_space () const
 
Teuchos::RCP< const
Thyra::VectorSpaceBase< Scalar > > 
get_g_space (int j) const
 
Teuchos::ArrayView< const
std::string > 
get_g_names (int j) const
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
create_W_op () const
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
create_DgDx_dot_op (int j) const
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
create_DgDx_op (int j) const
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
create_DgDp_op (int j, int l) const
 
Teuchos::RCP< const
Thyra::LinearOpWithSolveFactoryBase
< Scalar > > 
get_W_factory () const
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
createInArgs () const
 
Thyra::ModelEvaluatorBase::InArgs
< Scalar > 
getNominalValues () const
 

Additional Inherited Members

- 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<typename Scalar>
class Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >

Transform a ModelEvaluator's sensitivity equations to its residual.

This class wraps a given ModelEvalutor encapsulating f(x,p) and creates a new "residual" for it and the forward sensitivity equations: F(X) = [ f(x,p) ] = 0 [ (df/dx)(x,p) * dx/dp + df/dp(x,p) ] where X = [ x; dx/dp ] (transient terms supressed for simplicity). This model evaluator can then be handed to a regular (non)linear solver to compute X. Note that even though these equations are linear in X, it is not necessarily the case that the underlying model evaluator accurately computes df/dx in its evaluation of W. Therefore this model evaluator can optionally reinterpret the model's df/dp out-arg as (df/dx)(x,p) * dx/dp + df/dp(x,p) where dx/dp is passed as another parameter (product) vector (encapsulated in the Thyra::DefaultMultiVectorProductVector). This is not standard model evaluator behavior, but is useful for models where W is only an approximation to df/dx and/or the model is capable of directly computing (df/dx)(x,p) * dx/dp + df/dp(x,p).

Definition at line 40 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

Member Typedef Documentation

template<typename Scalar >
typedef Thyra::VectorBase<Scalar> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::Vector
template<typename Scalar >
typedef Thyra::MultiVectorBase<Scalar> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::MultiVector
template<typename Scalar >
typedef Thyra::DefaultMultiVectorProductVectorSpace<Scalar> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::DMVPVS
private

Constructor & Destructor Documentation

template<typename Scalar >
Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::CombinedForwardSensitivityModelEvaluator ( const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  model,
const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  sens_residual_model,
const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  sens_solve_model,
const Teuchos::RCP< const Teuchos::ParameterList > &  pList = Teuchos::null,
const Teuchos::RCP< MultiVector > &  dxdp_init = Teuchos::null,
const Teuchos::RCP< MultiVector > &  dx_dotdp_init = Teuchos::null,
const Teuchos::RCP< MultiVector > &  dx_dotdot_dp_init = Teuchos::null 
)

Constructor.

The optionally supplied parameter list supports the following options:

  • "Use DfDp as Tangent" (default: false) Reinterpret the df/dp out-arg as the tangent vector (df/dx)(x,p) * dx/dp + df/dp(x,p) as described above. If it is false, this implementation will compute the tangent through several calls to the models evalModel().
  • "Sensitivity Parameter Index" (default: 0) Model evaluator parameter index for which sensitivities will be computed.
  • "Response Function Index", (default: 0) The model evaluator response index for which sensitivities will be computed if requested.
  • "Sensitivity X Tangent Index" (default: 1) If "Use DfDp as Tangent" is true, the model evaluator parameter index for passing dx/dp as a Thyra::DefaultMultiVectorProductVector.
  • "Sensitivity X-Dot Tangent Index" (default: 2) If "Use DfDp as Tangent" is true, the model evaluator parameter index for passing dx_dot/dp as a Thyra::DefaultMultiVectorProductVector.
  • "Sensitivity X-Dot-Dot Tangent Index" (default: 3) If "Use DfDp as Tangent" is true, the model evaluator parameter index for passing dx_dot_dot/dp as a Thyra::DefaultMultiVectorProductVector (if the model supports x_dot_dot).

Definition at line 24 of file Tempus_CombinedForwardSensitivityModelEvaluator_impl.hpp.

Member Function Documentation

template<typename Scalar >
Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getForwardModel ( ) const
inlinevirtual

Get the underlying model 'f'.

Reimplemented from Tempus::SensitivityModelEvaluatorBase< Scalar >.

Definition at line 89 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getSensitivityParamIndex ( ) const
inline

Get sensitivity parameter index.

Definition at line 97 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_p_space ( int  p) const
virtual
template<typename Scalar >
Teuchos::RCP< const Teuchos::Array< std::string > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_p_names ( int  p) const
virtual
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_x_space ( ) const
virtual
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_f_space ( ) const
virtual
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_g_space ( int  j) const
virtual
template<typename Scalar >
Teuchos::ArrayView< const std::string > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_g_names ( int  j) const
virtual
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_W_op ( ) const
virtual
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDx_dot_op ( int  j) const
virtual
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDx_op ( int  j) const
virtual
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDp_op ( int  j,
int  l 
) const
virtual
template<typename Scalar >
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_W_factory ( ) const
virtual
template<typename Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::createInArgs ( ) const
virtual
template<typename Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getNominalValues ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getValidParameters ( )
static
template<typename Scalar >
Thyra::ModelEvaluatorBase::OutArgs< Scalar > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::createOutArgsImpl ( ) const
private
template<typename Scalar >
void Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::evalModelImpl ( const Thyra::ModelEvaluatorBase::InArgs< Scalar > &  inArgs,
const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &  outArgs 
) const
private

Member Data Documentation

template<typename Scalar >
Thyra::ModelEvaluatorBase::InArgs<Scalar> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::prototypeInArgs_
private
template<typename Scalar >
Thyra::ModelEvaluatorBase::OutArgs<Scalar> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::prototypeOutArgs_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::model_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::sens_residual_model_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::sens_solve_model_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dxdp_init_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dx_dotdp_init_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dx_dotdotdp_init_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::p_index_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::g_index_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::x_tangent_index_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::xdot_tangent_index_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::xdotdot_tangent_index_
private
template<typename Scalar >
bool Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::use_dfdp_as_tangent_
private
template<typename Scalar >
bool Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::use_dgdp_as_tangent_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::num_param_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::num_response_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::g_offset_
private
template<typename Scalar >
Teuchos::RCP<const DMVPVS> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dxdp_space_
private
template<typename Scalar >
Teuchos::RCP<const DMVPVS> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::x_dxdp_space_
private
template<typename Scalar >
Teuchos::RCP<const DMVPVS> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dfdp_space_
private
template<typename Scalar >
Teuchos::RCP<const DMVPVS> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::f_dfdp_space_
private
template<typename Scalar >
Teuchos::RCP<const DMVPVS> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dgdp_space_
private
template<typename Scalar >
Teuchos::RCP<Thyra::LinearOpBase<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::my_dfdx_
mutableprivate
template<typename Scalar >
Teuchos::RCP<Thyra::LinearOpBase<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::my_dfdxdot_
mutableprivate
template<typename Scalar >
Teuchos::RCP<Thyra::LinearOpBase<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::my_dfdxdotdot_
mutableprivate
template<typename Scalar >
Teuchos::RCP<Thyra::LinearOpBase<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::my_dgdx_
mutableprivate
template<typename Scalar >
Teuchos::RCP<Thyra::MultiVectorBase<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::my_dgdx_mv_
mutableprivate

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