Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus::IntegratorForwardSensitivity< Scalar > Class Template Reference

Time integrator implementing forward sensitivity analysis. More...

#include <Tempus_IntegratorForwardSensitivity_decl.hpp>

Inheritance diagram for Tempus::IntegratorForwardSensitivity< Scalar >:
Tempus::Integrator< Scalar >

Public Member Functions

 IntegratorForwardSensitivity (Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
 Constructor with ParameterList and model, and will be fully initialized. More...
 
 IntegratorForwardSensitivity (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model, std::string stepperType)
 Constructor with model and "Stepper Type" and is fully initialized with default settings. More...
 
 IntegratorForwardSensitivity ()
 Destructor. More...
 
virtual ~IntegratorForwardSensitivity ()
 Destructor. More...
 
void parseScreenOutput ()
 Parse when screen output should be executed. More...
 
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 void startIntegrator ()
 Perform tasks before start of integrator. More...
 
virtual void startTimeStep ()
 Start time step. More...
 
virtual void checkTimeStep ()
 Check if time step has passed or failed. More...
 
virtual void endIntegrator ()
 Perform tasks after end of integrator. 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
 
Accessor methods
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 void setStepper (Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > model)
 Set the Stepper. More...
 
virtual void setStepperWStepper (Teuchos::RCP< Stepper< Scalar > > stepper)
 Set the Stepper. More...
 
virtual void initializeSolutionHistory (Teuchos::RCP< SolutionState< Scalar > > state=Teuchos::null)
 Set the initial state which has the initial conditions. 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 Teuchos::RCP< const
SolutionHistory< Scalar > > 
getSolutionHistory () const override
 Get the SolutionHistory. More...
 
virtual void setSolutionHistory (Teuchos::RCP< SolutionHistory< Scalar > > sh=Teuchos::null)
 Set the SolutionHistory. More...
 
virtual Teuchos::RCP< const
TimeStepControl< Scalar > > 
getTimeStepControl () const override
 Get the TimeStepControl. More...
 
virtual Teuchos::RCP
< TimeStepControl< Scalar > > 
getNonConstTimeStepControl () override
 
virtual void setTimeStepControl (Teuchos::RCP< TimeStepControl< Scalar > > tsc=Teuchos::null)
 Set the TimeStepControl. More...
 
virtual Teuchos::RCP
< IntegratorObserver< Scalar > > 
getObserver ()
 Get the Observer. 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
< Teuchos::Time > 
getIntegratorTimer () const override
 Returns the IntegratorTimer_ for this Integrator. More...
 
virtual Teuchos::RCP
< Teuchos::Time > 
getStepperTimer () const override
 
virtual Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
getX () const
 Get current the solution, x. More...
 
virtual Teuchos::RCP< const
Thyra::MultiVectorBase< Scalar > > 
getDxDp () const
 
virtual Teuchos::RCP< const
Thyra::VectorBase< Scalar > > 
getXdot () const
 Get current the time derivative of the solution, xdot. More...
 
virtual Teuchos::RCP< const
Thyra::MultiVectorBase< Scalar > > 
getDxdotDp () const
 
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 > > 
getDxdotdotDp () const
 
virtual Teuchos::RCP
< SolutionState< Scalar > > 
getCurrentState ()
 Get current state. More...
 
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
 
Basic integrator methods

Protected Member Functions

void createSensitivityModelAndStepper (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
 

Protected Attributes

Teuchos::RCP
< Thyra::ModelEvaluator
< Scalar > > 
model_
 
Teuchos::RCP
< SensitivityModelEvaluatorBase
< Scalar > > 
sens_model_
 
Teuchos::RCP
< StepperStaggeredForwardSensitivity
< Scalar > > 
sens_stepper_
 
Teuchos::RCP< IntegratorBasic
< Scalar > > 
integrator_
 
Teuchos::RCP
< Teuchos::ParameterList > 
tempus_pl_
 
Teuchos::RCP
< Teuchos::ParameterList > 
sens_pl_
 
Teuchos::RCP
< Teuchos::ParameterList > 
stepper_pl_
 
bool use_combined_method_
 

Detailed Description

template<class Scalar>
class Tempus::IntegratorForwardSensitivity< Scalar >

Time integrator implementing forward sensitivity analysis.

This integrator implements forward parameter sensitivity analysis by propagating the derivative of the solution with respect to model parameters alongside the solution. It supports sensitivity propagation methods:

  • "Combined" where the sensitivity and state equations are solved simultaneously. This is most appropriate for explicit time integration methods or implicit methods where a very-lightweight nonlinear solution strategy is used.
  • "Staggered" where the sensitivity equations are solved at each time step immediately after the state equations are solved. This is useful for implicit methods since it saves the cost of solving the sensitivity equations while the state equations are being solved. It generally does not work for explicit methods (and wouldn't be more efficient than the combined method even if it did).

Note that this integrator implements all of the same functions as the IntegratorBasic, but is not derived from IntegratorBasic. It also provides functions for setting the sensitivity initial conditions and extracting the sensitivity at the final time. Also the vectors stored in the solution history store product vectors of the state and sensitivities using Thyra;:DefaultMultiVectorProductVector.

Definition at line 46 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::IntegratorForwardSensitivity< Scalar >::IntegratorForwardSensitivity ( 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 Method" (default: "Combined") The sensitivity analysis method as described above.
  • "Reuse State Linear Solver" (default: false) For the staggered method, whether to reuse the model's W matrix, solver, and preconditioner when solving the sensitivity equations. If they can be reused, substantial savings in compute time are possible.
  • "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 in the Tempus::CombinedForwardSensitivityModelEvaluator documentation.
  • "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_IntegratorForwardSensitivity_impl.hpp.

template<class Scalar >
Tempus::IntegratorForwardSensitivity< Scalar >::IntegratorForwardSensitivity ( const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  model,
std::string  stepperType 
)

Constructor with model and "Stepper Type" and is fully initialized with default settings.

Definition at line 43 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

Destructor.

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

Definition at line 64 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

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

Destructor.

Definition at line 96 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

Member Function Documentation

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

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

Definition at line 101 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual bool Tempus::IntegratorForwardSensitivity< Scalar >::advanceTime ( const Scalar  timeFinal)
inlineoverridevirtual

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

Implements Tempus::Integrator< Scalar >.

Definition at line 104 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::checkTimeStep ( )
inlinevirtual

Check if time step has passed or failed.

Definition at line 113 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
void Tempus::IntegratorForwardSensitivity< Scalar >::createSensitivityModelAndStepper ( const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  model)
protected
template<class Scalar >
void Tempus::IntegratorForwardSensitivity< Scalar >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
override
template<class Scalar >
std::string Tempus::IntegratorForwardSensitivity< Scalar >::description ( ) const
override
template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::endIntegrator ( )
inlinevirtual

Perform tasks after end of integrator.

Definition at line 116 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<SolutionState<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getCurrentState ( )
inlinevirtual

Get current state.

Definition at line 203 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getDxdotdotDp ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getDxdotDp ( ) const
virtual
template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getDxDp ( ) const
virtual
template<class Scalar >
virtual int Tempus::IntegratorForwardSensitivity< Scalar >::getIndex ( ) const
inlineoverridevirtual

Get current index.

Implements Tempus::Integrator< Scalar >.

Definition at line 131 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<Teuchos::Time> Tempus::IntegratorForwardSensitivity< Scalar >::getIntegratorTimer ( ) const
inlineoverridevirtual

Returns the IntegratorTimer_ for this Integrator.

Implements Tempus::Integrator< Scalar >.

Definition at line 187 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::IntegratorForwardSensitivity< Scalar >::getNonconstParameterList ( )
inlineoverride
template<class Scalar >
virtual Teuchos::RCP<TimeStepControl<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getNonConstTimeStepControl ( )
inlineoverridevirtual
template<class Scalar >
virtual Teuchos::RCP<IntegratorObserver<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getObserver ( )
inlinevirtual

Get the Observer.

Definition at line 178 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<const SolutionHistory<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getSolutionHistory ( ) const
inlineoverridevirtual
template<class Scalar >
virtual Status Tempus::IntegratorForwardSensitivity< Scalar >::getStatus ( ) const
inlineoverridevirtual

Get Status.

Implements Tempus::Integrator< Scalar >.

Definition at line 134 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<Stepper<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getStepper ( ) const
inlineoverridevirtual
template<class Scalar >
virtual Teuchos::RCP<Teuchos::Time> Tempus::IntegratorForwardSensitivity< Scalar >::getStepperTimer ( ) const
inlineoverridevirtual
template<class Scalar >
virtual Teuchos::RCP<Teuchos::ParameterList> Tempus::IntegratorForwardSensitivity< Scalar >::getTempusParameterList ( )
inlineoverridevirtual

Return a copy of the Tempus ParameterList.

Implements Tempus::Integrator< Scalar >.

Definition at line 119 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Scalar Tempus::IntegratorForwardSensitivity< Scalar >::getTime ( ) const
inlineoverridevirtual

Get current time.

Implements Tempus::Integrator< Scalar >.

Definition at line 128 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual Teuchos::RCP<const TimeStepControl<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::getTimeStepControl ( ) const
inlineoverridevirtual
template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus::IntegratorForwardSensitivity< Scalar >::getValidParameters ( ) const
override
template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getX ( ) const
virtual

Get current the solution, x.

Definition at line 148 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getXdot ( ) const
virtual

Get current the time derivative of the solution, xdot.

Definition at line 176 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorForwardSensitivity< Scalar >::getXdotdot ( ) const
virtual

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

Definition at line 204 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

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

Initializes the Integrator after set* function calls.

Definition at line 185 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::initializeSolutionHistory ( Teuchos::RCP< SolutionState< Scalar > >  state = Teuchos::null)
inlinevirtual

Set the initial state which has the initial conditions.

Definition at line 147 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
void Tempus::IntegratorForwardSensitivity< 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 84 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

template<class Scalar >
void Tempus::IntegratorForwardSensitivity< Scalar >::parseScreenOutput ( )
inline

Parse when screen output should be executed.

Definition at line 208 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

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

Set the Observer.

Definition at line 181 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
void Tempus::IntegratorForwardSensitivity< Scalar >::setParameterList ( const Teuchos::RCP< Teuchos::ParameterList > &  pl)
override
template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::setSolutionHistory ( Teuchos::RCP< SolutionHistory< Scalar > >  sh = Teuchos::null)
inlinevirtual
template<class Scalar >
void Tempus::IntegratorForwardSensitivity< Scalar >::setStepper ( Teuchos::RCP< Thyra::ModelEvaluator< Scalar > >  model)
virtual

Set the Stepper.

Definition at line 72 of file Tempus_IntegratorForwardSensitivity_impl.hpp.

template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::setStepperWStepper ( Teuchos::RCP< Stepper< Scalar > >  stepper)
inlinevirtual

Set the Stepper.

Definition at line 144 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::setTempusParameterList ( Teuchos::RCP< Teuchos::ParameterList >  pl)
inlineoverridevirtual
template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::setTimeStepControl ( Teuchos::RCP< TimeStepControl< Scalar > >  tsc = Teuchos::null)
inlinevirtual
template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::startIntegrator ( )
inlinevirtual

Perform tasks before start of integrator.

Definition at line 107 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
virtual void Tempus::IntegratorForwardSensitivity< Scalar >::startTimeStep ( )
inlinevirtual

Start time step.

Definition at line 110 of file Tempus_IntegratorForwardSensitivity_decl.hpp.

template<class Scalar >
Teuchos::RCP< Teuchos::ParameterList > Tempus::IntegratorForwardSensitivity< Scalar >::unsetParameterList ( )
override

Member Data Documentation

template<class Scalar >
Teuchos::RCP<IntegratorBasic<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::integrator_
protected
template<class Scalar >
Teuchos::RCP<Thyra::ModelEvaluator<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::model_
protected
template<class Scalar >
Teuchos::RCP<SensitivityModelEvaluatorBase<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::sens_model_
protected
template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::IntegratorForwardSensitivity< Scalar >::sens_pl_
protected
template<class Scalar >
Teuchos::RCP<StepperStaggeredForwardSensitivity<Scalar> > Tempus::IntegratorForwardSensitivity< Scalar >::sens_stepper_
protected
template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::IntegratorForwardSensitivity< Scalar >::stepper_pl_
protected
template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::IntegratorForwardSensitivity< Scalar >::tempus_pl_
protected
template<class Scalar >
bool Tempus::IntegratorForwardSensitivity< Scalar >::use_combined_method_
protected

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