Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 >:
Tempus::SensitivityModelEvaluatorBase< Scalar >

Public Types

typedef Thyra::VectorBase< Scalar > Vector
 
typedef Thyra::MultiVectorBase
< Scalar > 
MultiVector
 

Public Member Functions

 CombinedForwardSensitivityModelEvaluator (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &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 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
 
- 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 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< MultiVectordxdp_init_
 
Teuchos::RCP< MultiVectordx_dotdp_init_
 
Teuchos::RCP< MultiVectordx_dotdotdp_init_
 
int p_index_
 
int x_tangent_index_
 
int xdot_tangent_index_
 
int xdotdot_tangent_index_
 
bool use_dfdp_as_tangent_
 
int num_param_
 
Teuchos::RCP< const
Thyra::DefaultMultiVectorProductVectorSpace
< Scalar > > 
dxdp_space_
 
Teuchos::RCP< const
Thyra::DefaultMultiVectorProductVectorSpace
< Scalar > > 
x_dxdp_space_
 
Teuchos::RCP< const
Thyra::DefaultMultiVectorProductVectorSpace
< Scalar > > 
dfdp_space_
 
Teuchos::RCP< const
Thyra::DefaultMultiVectorProductVectorSpace
< Scalar > > 
f_dfdp_space_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdx_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdxdot_
 
Teuchos::RCP
< Thyra::LinearOpBase< Scalar > > 
my_dfdxdotdot_
 

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 37 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<typename Scalar >
Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::CombinedForwardSensitivityModelEvaluator ( const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  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.
  • "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 23 of file Tempus_CombinedForwardSensitivityModelEvaluator_impl.hpp.

Member Function Documentation

template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDp_op ( int  j,
int  l 
) const
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDx_dot_op ( int  j) const
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_DgDx_op ( int  j) const
template<typename Scalar >
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::create_W_op ( ) const
template<typename Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::createInArgs ( ) const
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
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_f_space ( ) const
template<typename Scalar >
Teuchos::ArrayView< const std::string > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_g_names ( int  j) const
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_g_space ( int  j) const
template<typename Scalar >
Teuchos::RCP< const Teuchos::Array< std::string > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_p_names ( int  p) const
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_p_space ( int  p) const
template<typename Scalar >
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_W_factory ( ) const
template<typename Scalar >
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::get_x_space ( ) const
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 79 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

template<typename Scalar >
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getNominalValues ( ) const
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getSensitivityParamIndex ( ) const
inline

Get sensitivity parameter index.

Definition at line 85 of file Tempus_CombinedForwardSensitivityModelEvaluator_decl.hpp.

template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::getValidParameters ( )
static

Member Data Documentation

template<typename Scalar >
Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dfdp_space_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dx_dotdotdp_init_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dx_dotdp_init_
private
template<typename Scalar >
Teuchos::RCP<MultiVector> Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dxdp_init_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::dxdp_space_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::f_dfdp_space_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::model_
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 >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::num_param_
private
template<typename Scalar >
int Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::p_index_
private
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 >
bool Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::use_dfdp_as_tangent_
private
template<typename Scalar >
Teuchos::RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> > Tempus::CombinedForwardSensitivityModelEvaluator< Scalar >::x_dxdp_space_
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

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