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

Time integrator suitable for adjoint sensitivity analysis. More...

#include <Tempus_IntegratorAdjointSensitivity_decl.hpp>

Inheritance diagram for Tempus::IntegratorAdjointSensitivity< Scalar >:
Inheritance graph
[legend]

Public Member Functions

 IntegratorAdjointSensitivity (Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
 Constructor with ParameterList and model, and will be fully initialized. More...
 
 IntegratorAdjointSensitivity ()
 Destructor. More...
 
virtual ~IntegratorAdjointSensitivity ()
 Destructor. More...
 
virtual void initializeSolutionHistory (Scalar t0, Teuchos::RCP< const Thyra::VectorBase< Scalar > > x0, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdot0=Teuchos::null, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdotdot0=Teuchos::null, Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > DxDp0=Teuchos::null, Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > DxdotDp0=Teuchos::null, Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > DxdotdotDp0=Teuchos::null)
 Set the initial state from Thyra::VectorBase(s) More...
 
virtual void setObserver (Teuchos::RCP< IntegratorObserver< Scalar > > obs=Teuchos::null)
 Set the Observer. More...
 
virtual void initialize ()
 Initializes the Integrator after set* function calls. More...
 
virtual Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
getX () const
 Get current the solution, x. More...
 
virtual Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
getXDot () const
 Get current the time derivative of the solution, xdot. More...
 
virtual Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
getXDotDot () const
 Get current the second time derivative of the solution, xdotdot. More...
 
virtual Teuchos::RCP< const
Thyra::MultiVectorBase< Scalar > > 
getDgDp () const
 Return adjoint sensitivity stored in gradient format. More...
 
- Public Member Functions inherited from Tempus::Integrator< Scalar >
- Public Member Functions inherited from Teuchos::Describable
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 Teuchos::VerboseObject< Tempus::Integrator< Scalar > >
 VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectsetVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetOverridingVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual EVerbosityLevel getVerbLevel () const
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
RCP< const ParameterList
getValidVerboseObjectSublist ()
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
setupVerboseObjectSublist (ParameterList *paramList)
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel)
 
void readVerboseObjectSublist (ParameterList *paramList, VerboseObject< ObjectType > *verboseObject)
 
- Public Member Functions inherited from Teuchos::VerboseObjectBase
virtual ~VerboseObjectBase ()
 
 VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectBasesetOStream (const RCP< FancyOStream > &oStream) const
 
virtual const VerboseObjectBasesetOverridingOStream (const RCP< FancyOStream > &oStream) const
 
virtual VerboseObjectBasesetLinePrefix (const std::string &linePrefix)
 
virtual RCP< FancyOStreamgetOStream () const
 
virtual RCP< FancyOStreamgetOverridingOStream () const
 
virtual std::string getLinePrefix () const
 
virtual OSTab getOSTab (const int tabs=1, const std::string &linePrefix="") const
 
- Public Member Functions inherited from Teuchos::ParameterListAcceptor
virtual RCP< const ParameterListgetParameterList () const
 

Protected Member Functions

Teuchos::RCP
< AdjointAuxSensitivityModelEvaluator
< Scalar > > 
createAdjointModel (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< Teuchos::ParameterList > &inputPL)
 
void buildSolutionHistory (const Teuchos::RCP< const SolutionHistory< Scalar > > &state_solution_history, const Teuchos::RCP< const SolutionHistory< Scalar > > &adjoint_solution_history)
 
- Protected Member Functions inherited from Teuchos::VerboseObject< Tempus::Integrator< Scalar > >
void initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
- Protected Member Functions inherited from Teuchos::VerboseObjectBase
void initializeVerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual void informUpdatedVerbosityState () const
 

Protected Attributes

Teuchos::RCP
< Thyra::ModelEvaluator
< Scalar > > 
model_
 
Teuchos::RCP
< AdjointAuxSensitivityModelEvaluator
< Scalar > > 
adjoint_model_
 
Teuchos::RCP
< IntegratorBasicOld< Scalar > > 
state_integrator_
 
Teuchos::RCP
< IntegratorBasicOld< Scalar > > 
adjoint_integrator_
 
Teuchos::RCP< SolutionHistory
< Scalar > > 
solutionHistory_
 
int p_index_
 
int g_index_
 
bool g_depends_on_p_
 
bool f_depends_on_p_
 
bool ic_depends_on_p_
 
bool mass_matrix_is_identity_
 
Teuchos::RCP< const
Thyra::MultiVectorBase< Scalar > > 
dxdp_init_
 
Teuchos::RCP
< Thyra::MultiVectorBase
< Scalar > > 
dgdp_
 

Basic integrator methods

virtual bool advanceTime ()
 Advance the solution to timeMax, and return true if successful. More...
 
virtual bool advanceTime (const Scalar timeFinal) override
 Advance the solution to timeFinal, and return true if successful. More...
 
virtual Scalar getTime () const override
 Get current time. More...
 
virtual int getIndex () const override
 Get current index. More...
 
virtual Status getStatus () const override
 Get Status. More...
 
virtual Teuchos::RCP< Stepper
< Scalar > > 
getStepper () const override
 Get the Stepper. More...
 
virtual Teuchos::RCP
< Teuchos::ParameterList
getTempusParameterList () override
 Return a copy of the Tempus ParameterList. More...
 
virtual void setTempusParameterList (Teuchos::RCP< Teuchos::ParameterList > pl) override
 
virtual Teuchos::RCP< const
SolutionHistory< Scalar > > 
getSolutionHistory () const override
 Get the SolutionHistory. More...
 
virtual Teuchos::RCP< const
TimeStepControl< Scalar > > 
getTimeStepControl () const override
 Get the TimeStepControl. More...
 
virtual Teuchos::RCP
< TimeStepControl< Scalar > > 
getNonConstTimeStepControl () override
 
virtual Teuchos::RCP
< Teuchos::Time
getIntegratorTimer () const override
 Returns the IntegratorTimer_ for this Integrator. More...
 
virtual Teuchos::RCP
< Teuchos::Time
getStepperTimer () const override
 

Overridden from Teuchos::ParameterListAcceptor

void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &pl) override
 
Teuchos::RCP
< Teuchos::ParameterList
getNonconstParameterList () override
 
Teuchos::RCP
< Teuchos::ParameterList
unsetParameterList () override
 
Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const override
 

Overridden from Teuchos::Describable

std::string description () const override
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from Teuchos::VerboseObject< Tempus::Integrator< Scalar > >
static void setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel)
 
static EVerbosityLevel getDefaultVerbLevel ()
 
- Static Public Member Functions inherited from Teuchos::VerboseObjectBase
static void setDefaultOStream (const RCP< FancyOStream > &defaultOStream)
 
static RCP< FancyOStreamgetDefaultOStream ()
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 

Detailed Description

template<class Scalar>
class Tempus::IntegratorAdjointSensitivity< Scalar >

Time integrator suitable for adjoint sensitivity analysis.

This integrator implements transient adjoint sensitivities. Given a model evaluator encapsulating the equations f(x_dot,x,p) = 0, and a response function g(x,p), these equations are integrated forward in time to some final time T. Then the adjoint equations F(y) = d/dt( df/dx_dot^T*y ) - df/dx^T*y = 0 are integrated backward in time starting at t = T where y is the adjoint variable. Nominally y is a multi-vector belonging to the vector space of f and the number of columns given by the number of entries in the response g. The initial conditions for y at t = T are given by y(T) = df/dx_dot(x_dot(T),x(T),p)^{-T} * dg/dx(x(T),p)^T. Then the final sensitivity of g is dg/dp(T) - int_{0}^T(df/dp^T*y)dt + dx/dp(0)^T*df/dx_dot(0)^T*y(0).

This integrator supports both implicit and explicit steppers, and provides a method to compute dg/dp as described above after the reverse integration. The solution history contains solutions stored as product vectors (x,y), with y further stored as a product vector for each component of g.

Because of limitations on the steppers, the implementation currently assumes df/dxdot is a constant matrix.

Definition at line 44 of file Tempus_IntegratorAdjointSensitivity_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::IntegratorAdjointSensitivity< Scalar >::IntegratorAdjointSensitivity ( Teuchos::RCP< Teuchos::ParameterList pList,
const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  model 
)

Constructor with ParameterList and model, and will be fully initialized.

In addition to all of the regular integrator options, the supplied parameter list supports the following options contained within a sublist "Sensitivities" from the top-level parameter list:

  • "Sensitivity Parameter Index", (default: 0) The 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.
  • "Response Depends on Parameters", (default: true) Whether the response function depends on the parameter vector p for which sensitivities will be computed. If set to false, the dg/dp term in the sensitivity formula will not be computed.
  • "Residual Depends on Parameters", (default: true) Whether the model residual f depends on the parameter vector p for which sensitivities will be computed. If set to false, its contribution to the sensitivities will not be computed.
  • "IC Depends on Parameters", (default: true) Whether the initial conditions depend on the parameter vector p for which sensitivities will be computed. If set to false, its contribution to the sensitivities will not be computed.
  • "Mass Matrix Is Constant" (default: true) Whether the mass matrix df/dx_dot is a constant matrix. As describe above, this is currently required to be true.
  • "Mass Matrix Is Identity" (default: false) Whether the mass matrix is the identity matrix, in which some computations can be skipped.

Definition at line 24 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

Destructor.

Constructor that requires a subsequent setParameterList, setStepper, and initialize calls.

Definition at line 46 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
virtual Tempus::IntegratorAdjointSensitivity< Scalar >::~IntegratorAdjointSensitivity ( )
inlinevirtual

Destructor.

Definition at line 89 of file Tempus_IntegratorAdjointSensitivity_decl.hpp.

Member Function Documentation

template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::advanceTime ( )
virtual

Advance the solution to timeMax, and return true if successful.

Definition at line 55 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::advanceTime ( const Scalar  timeFinal)
overridevirtual

Advance the solution to timeFinal, and return true if successful.

Implements Tempus::Integrator< Scalar >.

Definition at line 65 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Scalar Tempus::IntegratorAdjointSensitivity< Scalar >::getTime ( ) const
overridevirtual

Get current time.

Implements Tempus::Integrator< Scalar >.

Definition at line 223 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
int Tempus::IntegratorAdjointSensitivity< Scalar >::getIndex ( ) const
overridevirtual

Get current index.

Implements Tempus::Integrator< Scalar >.

Definition at line 231 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Status Tempus::IntegratorAdjointSensitivity< Scalar >::getStatus ( ) const
overridevirtual

Get Status.

Implements Tempus::Integrator< Scalar >.

Definition at line 239 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< Stepper< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getStepper ( ) const
overridevirtual
template<class Scalar >
Teuchos::RCP< Teuchos::ParameterList > Tempus::IntegratorAdjointSensitivity< Scalar >::getTempusParameterList ( )
overridevirtual

Return a copy of the Tempus ParameterList.

Implements Tempus::Integrator< Scalar >.

Definition at line 261 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::setTempusParameterList ( Teuchos::RCP< Teuchos::ParameterList pl)
overridevirtual
template<class Scalar >
Teuchos::RCP< const SolutionHistory< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getSolutionHistory ( ) const
overridevirtual
template<class Scalar >
Teuchos::RCP< const TimeStepControl< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getTimeStepControl ( ) const
overridevirtual
template<class Scalar >
Teuchos::RCP< TimeStepControl< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getNonConstTimeStepControl ( )
overridevirtual
template<class Scalar >
virtual Teuchos::RCP<Teuchos::Time> Tempus::IntegratorAdjointSensitivity< Scalar >::getIntegratorTimer ( ) const
inlineoverridevirtual

Returns the IntegratorTimer_ for this Integrator.

Implements Tempus::Integrator< Scalar >.

Definition at line 115 of file Tempus_IntegratorAdjointSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<Teuchos::Time> Tempus::IntegratorAdjointSensitivity< Scalar >::getStepperTimer ( ) const
inlineoverridevirtual
template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::initializeSolutionHistory ( Scalar  t0,
Teuchos::RCP< const Thyra::VectorBase< Scalar > >  x0,
Teuchos::RCP< const Thyra::VectorBase< Scalar > >  xdot0 = Teuchos::null,
Teuchos::RCP< const Thyra::VectorBase< Scalar > >  xdotdot0 = Teuchos::null,
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > >  DxDp0 = Teuchos::null,
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > >  DxdotDp0 = Teuchos::null,
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > >  DxdotdotDp0 = Teuchos::null 
)
virtual

Set the initial state from Thyra::VectorBase(s)

Definition at line 301 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::setObserver ( Teuchos::RCP< IntegratorObserver< Scalar > >  obs = Teuchos::null)
virtual

Set the Observer.

Definition at line 315 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::initialize ( )
virtual

Initializes the Integrator after set* function calls.

Definition at line 325 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getX ( ) const
virtual

Get current the solution, x.

Definition at line 334 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getXDot ( ) const
virtual

Get current the time derivative of the solution, xdot.

Definition at line 342 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getXDotDot ( ) const
virtual

Get current the second time derivative of the solution, xdotdot.

Definition at line 350 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::getDgDp ( ) const
virtual

Return adjoint sensitivity stored in gradient format.

Definition at line 358 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::setParameterList ( const Teuchos::RCP< Teuchos::ParameterList > &  pl)
overridevirtual
template<class Scalar >
Teuchos::RCP< Teuchos::ParameterList > Tempus::IntegratorAdjointSensitivity< Scalar >::getNonconstParameterList ( )
overridevirtual
template<class Scalar >
Teuchos::RCP< Teuchos::ParameterList > Tempus::IntegratorAdjointSensitivity< Scalar >::unsetParameterList ( )
overridevirtual
template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus::IntegratorAdjointSensitivity< Scalar >::getValidParameters ( ) const
overridevirtual

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 417 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
std::string Tempus::IntegratorAdjointSensitivity< Scalar >::description ( ) const
overridevirtual

Reimplemented from Teuchos::Describable.

Definition at line 366 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
overridevirtual

Reimplemented from Teuchos::Describable.

Definition at line 375 of file Tempus_IntegratorAdjointSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< AdjointAuxSensitivityModelEvaluator< Scalar > > Tempus::IntegratorAdjointSensitivity< Scalar >::createAdjointModel ( const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  model,
const Teuchos::RCP< Teuchos::ParameterList > &  inputPL 
)
protected
template<class Scalar >
void Tempus::IntegratorAdjointSensitivity< Scalar >::buildSolutionHistory ( const Teuchos::RCP< const SolutionHistory< Scalar > > &  state_solution_history,
const Teuchos::RCP< const SolutionHistory< Scalar > > &  adjoint_solution_history 
)
protected

Member Data Documentation

template<class Scalar >
Teuchos::RCP<Thyra::ModelEvaluator<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::model_
protected
template<class Scalar >
Teuchos::RCP<AdjointAuxSensitivityModelEvaluator<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::adjoint_model_
protected
template<class Scalar >
Teuchos::RCP<IntegratorBasicOld<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::state_integrator_
protected
template<class Scalar >
Teuchos::RCP<IntegratorBasicOld<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::adjoint_integrator_
protected
template<class Scalar >
Teuchos::RCP<SolutionHistory<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::solutionHistory_
protected
template<class Scalar >
int Tempus::IntegratorAdjointSensitivity< Scalar >::p_index_
protected
template<class Scalar >
int Tempus::IntegratorAdjointSensitivity< Scalar >::g_index_
protected
template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::g_depends_on_p_
protected
template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::f_depends_on_p_
protected
template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::ic_depends_on_p_
protected
template<class Scalar >
bool Tempus::IntegratorAdjointSensitivity< Scalar >::mass_matrix_is_identity_
protected
template<class Scalar >
Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::dxdp_init_
protected
template<class Scalar >
Teuchos::RCP<Thyra::MultiVectorBase<Scalar> > Tempus::IntegratorAdjointSensitivity< Scalar >::dgdp_
protected

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