Tempus
Version of the Day
Time Integration
|
ModelEvaluator for forming adjoint sensitivity equations. More...
#include <Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp>
Public Types | |
typedef Thyra::VectorBase< Scalar > | Vector |
typedef Thyra::MultiVectorBase < Scalar > | MultiVector |
Public Member Functions | |
AdjointAuxSensitivityModelEvaluator (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Scalar &t_final, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null) | |
Constructor. More... | |
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > | getModel () const |
Get the underlying model 'f'. More... | |
void | setForwardSolutionHistory (const Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > &sh) |
Set solution history from forward evaluation. 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 < Thyra::LinearOpBase< Scalar > > | create_W_op () const |
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase < Scalar > > | get_W_factory () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | createInArgs () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | getNominalValues () const |
Static Public Member Functions | |
static Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () |
Private Types | |
typedef Thyra::DefaultProductVectorSpace < Scalar > | DPVS |
typedef Thyra::DefaultProductVector < Scalar > | DPV |
typedef Thyra::DefaultMultiVectorProductVectorSpace < Scalar > | DMVPVS |
typedef Thyra::DefaultMultiVectorProductVector < Scalar > | DMVPV |
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 DMVPVS > | adjoint_space_ |
Teuchos::RCP< const DMVPVS > | residual_space_ |
Teuchos::RCP< const DMVPVS > | response_space_ |
Teuchos::RCP< const DPVS > | x_prod_space_ |
Teuchos::RCP< const DPVS > | f_prod_space_ |
Teuchos::RCP< const Tempus::SolutionHistory < Scalar > > | sh_ |
Scalar | t_final_ |
bool | mass_matrix_is_constant_ |
bool | mass_matrix_is_identity_ |
int | p_index_ |
int | g_index_ |
int | num_adjoint_ |
bool | mass_matrix_is_computed_ |
Teuchos::RCP < Thyra::LinearOpBase< Scalar > > | my_dfdx_ |
Teuchos::RCP < Thyra::LinearOpBase< Scalar > > | my_dfdxdot_ |
Teuchos::RCP < Thyra::LinearOpBase< Scalar > > | my_dfdp_op_ |
Teuchos::RCP < Thyra::MultiVectorBase < Scalar > > | my_dfdp_mv_ |
Teuchos::RCP < Tempus::SolutionState < Scalar > > | forward_state_ |
Scalar | t_interp_ |
ModelEvaluator for forming adjoint sensitivity equations.
This class wraps a given ModelEvalutor encapsulating f(x_dot,x,p) and creates a new "residual" for the adjoint sensitivity equations: F(y,z) = [ d/dt( df/dx_dot^T*y ) - df/dx^T*y ] = 0 [ dz/dt - df/dp^T*y ] where y is the adjoint variable and z is an auxiliary variable. Nominally y is a multi-vector belonging to the vector space of the residual f and a given number of columns and z is a multi-vector beling to the vector space p and the same number of columns. To satisfy the model evaluator interface, y and z are converted to a product vector formed by their columns. This is the form of the adjoint equations suitable for computing sensitivities of a response function g(x(T),p).
To compute adjoint sensitivities, the equations f(x_dot,x,p) = 0 are integrated forward in time to some final time T, with the adjoint equations above integrated backward in time starting at T. Since the tempus integrator can only integrate forward in time, we define tau = T - t and transform the adjoint equations to: F(y) = d/dtau( df/dx_dot^T*y ) + df/dx^T*y = 0. The initial conditions at t = T for y are y(T) = df/dx_dot(x_dot(T),x(T),p)^{-T} * dg/dx(x(T),p)^T. along with z(T) = 0. The sensitivity of g(T) is then dg/dp(T) - int_{0}^T(df/dp^T*y)dt + dx/dp(0)^T*df/dx_dot(0)^T*y(0) = dg/dp(T) - z(0) + dx/dp(0)^T*df/dx_dot(0)^T*y(0)
This model evaluator supports both implicit and explict forms of the governing equations. However it assumes df/dx_dot is constant with respect to x_dot, x, and t so that the adjoint equations become F(y) = df/dxdot^T*y_dot + df/dx^T*y = 0. Moving beyond this assumption will require modifications to the steppers in how they generate time-derivative terms.
Definition at line 56 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 123 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 122 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 121 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 120 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
typedef Thyra::MultiVectorBase<Scalar> Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::MultiVector |
Definition at line 60 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
typedef Thyra::VectorBase<Scalar> Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::Vector |
Definition at line 59 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::AdjointAuxSensitivityModelEvaluator | ( | const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > & | model, |
const Scalar & | t_final, | ||
const Teuchos::RCP< const Teuchos::ParameterList > & | pList = Teuchos::null |
||
) |
Constructor.
t_final is the final integration time used to implement the time transformation described above. num_adjoint is the number of adjoint variables defining the number of columns in y, which is determined by the number of elements in the vector space for the response g. The optionally supplied parameter list supports the following options:
Definition at line 28 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::create_W_op | ( | ) | const |
Definition at line 156 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::createInArgs | ( | ) | const |
Definition at line 203 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
|
private |
Definition at line 244 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
|
private |
Definition at line 252 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::get_f_space | ( | ) | const |
Definition at line 148 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< const Teuchos::Array< std::string > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::get_p_names | ( | int | p | ) | const |
Definition at line 131 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::get_p_space | ( | int | p | ) | const |
Definition at line 122 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::get_W_factory | ( | ) | const |
Definition at line 175 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::get_x_space | ( | ) | const |
Definition at line 140 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
|
inline |
Get the underlying model 'f'.
Definition at line 87 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::getNominalValues | ( | ) | const |
Definition at line 211 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
|
static |
Definition at line 436 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
void Tempus::AdjointAuxSensitivityModelEvaluator< Scalar >::setForwardSolutionHistory | ( | const Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > & | sh | ) |
Set solution history from forward evaluation.
Definition at line 111 of file Tempus_AdjointAuxSensitivityModelEvaluator_impl.hpp.
|
private |
Definition at line 137 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 141 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 155 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 147 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 150 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 144 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 145 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 135 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 154 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 153 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 151 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 152 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 148 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 146 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 132 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 133 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 138 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 139 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 142 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 143 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
mutableprivate |
Definition at line 156 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.
|
private |
Definition at line 140 of file Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp.