Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar > Class Template Reference

Time integrator suitable for pseudotransient forward sensitivity analysis. More...

#include <Tempus_IntegratorPseudoTransientForwardSensitivity_decl.hpp>

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

Public Member Functions

 IntegratorPseudoTransientForwardSensitivity (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< SensitivityModelEvaluatorBase< Scalar > > &sens_model, const Teuchos::RCP< IntegratorBasic< Scalar > > &fwd_integrator, const Teuchos::RCP< IntegratorBasic< Scalar > > &sens_integrator, const bool reuse_solver, const bool force_W_update)
 Constructor with ParameterList and model, and will be fully initialized.
 
 IntegratorPseudoTransientForwardSensitivity ()
 Destructor.
 
virtual ~IntegratorPseudoTransientForwardSensitivity ()
 Destructor.
 
- Public Member Functions inherited from Tempus::Integrator< Scalar >

Overridden from Teuchos::Describable

Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > model_
 
Teuchos::RCP< SensitivityModelEvaluatorBase< Scalar > > sens_model_
 
Teuchos::RCP< IntegratorBasic< Scalar > > state_integrator_
 
Teuchos::RCP< IntegratorBasic< Scalar > > sens_integrator_
 
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory_
 
bool reuse_solver_
 
bool force_W_update_
 
SensitivityStepMode stepMode_
 
std::string description () const override
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
 
SensitivityStepMode getStepMode () const
 What mode the current time integration step is in.
 
void buildSolutionHistory ()
 

Basic integrator methods

virtual bool advanceTime ()
 Advance the solution to timeMax, and return true if successful.
 
virtual bool advanceTime (const Scalar timeFinal) override
 Advance the solution to timeFinal, and return true if successful.
 
virtual Scalar getTime () const override
 Get current time.
 
virtual int getIndex () const override
 Get current index.
 
virtual Status getStatus () const override
 Get Status.
 
virtual void setStatus (const Status st) override
 Set Status.
 
virtual Teuchos::RCP< Stepper< Scalar > > getStepper () const override
 Get the Stepper.
 
Teuchos::RCP< Stepper< Scalar > > getStateStepper () const
 
Teuchos::RCP< Stepper< Scalar > > getSensStepper () const
 
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory () const override
 Get the SolutionHistory.
 
Teuchos::RCP< const SolutionHistory< Scalar > > getStateSolutionHistory () const
 
Teuchos::RCP< const SolutionHistory< Scalar > > getSensSolutionHistory () const
 
virtual Teuchos::RCP< SolutionHistory< Scalar > > getNonConstSolutionHistory () override
 Get the SolutionHistory.
 
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl () const override
 Get the TimeStepControl.
 
virtual Teuchos::RCP< TimeStepControl< Scalar > > getNonConstTimeStepControl () override
 
Teuchos::RCP< TimeStepControl< Scalar > > getStateNonConstTimeStepControl ()
 
Teuchos::RCP< TimeStepControl< Scalar > > getSensNonConstTimeStepControl ()
 
virtual Teuchos::RCP< IntegratorObserver< Scalar > > getObserver ()
 Get the Observer.
 
virtual void setObserver (Teuchos::RCP< IntegratorObserver< Scalar > > obs=Teuchos::null)
 Set the Observer.
 
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer () const override
 Returns the IntegratorTimer_ for this Integrator.
 
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer () const override
 
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)
 
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getX () const
 Get current the solution, x.
 
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.
 
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.
 
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDXDotDotDp () const
 
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getG () const
 Return response function g.
 
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDgDp () const
 Return forward sensitivity stored in Jacobian format.
 

Detailed Description

template<class Scalar>
class Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >

Time integrator suitable for pseudotransient forward sensitivity analysis.

For some problems, time integrators are used to compute steady-state solutions (also known as pseudo-transient solvers). When computing sensitivities, it is not necessary in these cases to propagate sensitivities all the way through the forward time integration. Instead the steady-state is first computed as usual, and then the sensitivities are computed using a similar pseudo-transient time integration applied to the sensitivity equations with the state frozen to the computed steady-state. This integrator specializes the transient sensitivity methods implemented by Tempus::IntegratorForwardSensitivity to this case.

Consider an implicit ODE f(x_dot,x,p) = 0 with a stable steady-state solution x = x^s, x_dot = 0 where f(0,x^s,p) = 0 and all of the eigenvalues of df/dx(0,x^s,p) are in the right half-plane (for an explicit ODE, the eigenvalues must be in the left half-plane). In the pseudo-transient method a time-integrator is applied to f(x_dot,x,p) = 0 until x_dot is sufficiently small. Now consider the forward sensitivity equations: df/dx_dot*z_dot + df/dx*z + df/dp = 0 where z = dx/dp. For pseudo-transient forward sensitivities, the above is integrated from z(0) = 0 until z_dot is sufficiently small, in which case z^s = -(df/dx)^{-1}*(df/dp). Then the final sensitivity of g is dg/dp + dg/dx*z^s. One can see that z^s is the only steady-state solution of the sensitivity equations, since df/dx and df/dp are constant, and must be linearly stable since it has the same Jacobian matrix as the forward equations.

One should use the getX() and getDxDp() methods for extracting the final sultion and its parameter sensitivity as a multi-vector. This data can also be extracted from the solution history, but is stored as a Thyra product vector which requires knowledge of the internal implementation.

Definition at line 58 of file Tempus_IntegratorPseudoTransientForwardSensitivity_decl.hpp.

Constructor & Destructor Documentation

◆ IntegratorPseudoTransientForwardSensitivity() [1/2]

template<class Scalar >
Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::IntegratorPseudoTransientForwardSensitivity ( const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  model,
const Teuchos::RCP< SensitivityModelEvaluatorBase< Scalar > > &  sens_model,
const Teuchos::RCP< IntegratorBasic< Scalar > > &  fwd_integrator,
const Teuchos::RCP< IntegratorBasic< Scalar > > &  sens_integrator,
const bool  reuse_solver,
const bool  force_W_update 
)

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:

  • "Reuse State Linear Solver" (default: false) 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.
  • "Force W Update" (default: false) When reusing the solver as above whether to force recomputation of W. This can be necessary when the solver overwrites it during the solve-phase (e.g., by a factorization).
  • "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 22 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ IntegratorPseudoTransientForwardSensitivity() [2/2]

template<class Scalar >
Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::IntegratorPseudoTransientForwardSensitivity

Destructor.

Constructor that requires a subsequent setStepper, and initialize calls.

Definition at line 40 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ ~IntegratorPseudoTransientForwardSensitivity()

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

Destructor.

Definition at line 109 of file Tempus_IntegratorPseudoTransientForwardSensitivity_decl.hpp.

Member Function Documentation

◆ advanceTime() [1/2]

template<class Scalar >
bool Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::advanceTime
virtual

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

Definition at line 52 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ advanceTime() [2/2]

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

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

Implements Tempus::Integrator< Scalar >.

Definition at line 83 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getTime()

template<class Scalar >
Scalar Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getTime
overridevirtual

Get current time.

Implements Tempus::Integrator< Scalar >.

Definition at line 122 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getIndex()

template<class Scalar >
int Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getIndex
overridevirtual

Get current index.

Implements Tempus::Integrator< Scalar >.

Definition at line 130 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getStatus()

template<class Scalar >
Status Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStatus
overridevirtual

◆ setStatus()

template<class Scalar >
void Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::setStatus ( const Status  st)
overridevirtual

◆ getStepper()

template<class Scalar >
Teuchos::RCP< Stepper< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStepper
overridevirtual

◆ getStateStepper()

template<class Scalar >
Teuchos::RCP< Stepper< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStateStepper

◆ getSensStepper()

template<class Scalar >
Teuchos::RCP< Stepper< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getSensStepper

◆ getSolutionHistory()

template<class Scalar >
Teuchos::RCP< const SolutionHistory< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getSolutionHistory
overridevirtual

◆ getStateSolutionHistory()

template<class Scalar >
Teuchos::RCP< const SolutionHistory< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStateSolutionHistory

◆ getSensSolutionHistory()

template<class Scalar >
Teuchos::RCP< const SolutionHistory< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getSensSolutionHistory

◆ getNonConstSolutionHistory()

template<class Scalar >
Teuchos::RCP< SolutionHistory< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getNonConstSolutionHistory
overridevirtual

◆ getTimeStepControl()

template<class Scalar >
Teuchos::RCP< const TimeStepControl< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getTimeStepControl
overridevirtual

◆ getNonConstTimeStepControl()

template<class Scalar >
Teuchos::RCP< TimeStepControl< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getNonConstTimeStepControl
overridevirtual

◆ getStateNonConstTimeStepControl()

template<class Scalar >
Teuchos::RCP< TimeStepControl< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStateNonConstTimeStepControl

◆ getSensNonConstTimeStepControl()

template<class Scalar >
Teuchos::RCP< TimeStepControl< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getSensNonConstTimeStepControl

◆ getObserver()

template<class Scalar >
Teuchos::RCP< IntegratorObserver< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getObserver
virtual

Get the Observer.

Definition at line 247 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ setObserver()

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

Set the Observer.

Definition at line 255 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getIntegratorTimer()

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

Returns the IntegratorTimer_ for this Integrator.

Implements Tempus::Integrator< Scalar >.

Definition at line 146 of file Tempus_IntegratorPseudoTransientForwardSensitivity_decl.hpp.

◆ getStepperTimer()

template<class Scalar >
virtual Teuchos::RCP< Teuchos::Time > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStepperTimer ( ) const
inlineoverridevirtual

◆ initializeSolutionHistory()

template<class Scalar >
void Tempus::IntegratorPseudoTransientForwardSensitivity< 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 263 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getX()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getX
virtual

Get current the solution, x.

Definition at line 312 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getDxDp()

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getDxDp
virtual

◆ getXDot()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getXDot
virtual

Get current the time derivative of the solution, xdot.

Definition at line 334 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getDXDotDp()

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getDXDotDp
virtual

◆ getXDotDot()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getXDotDot
virtual

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

Definition at line 356 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getDXDotDotDp()

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getDXDotDotDp
virtual

◆ getG()

template<class Scalar >
Teuchos::RCP< const Thyra::VectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getG
virtual

Return response function g.

Definition at line 378 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ getDgDp()

template<class Scalar >
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getDgDp
virtual

Return forward sensitivity stored in Jacobian format.

Definition at line 404 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ description()

template<class Scalar >
std::string Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::description
override

◆ describe()

template<class Scalar >
void Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
override

◆ getStepMode()

template<class Scalar >
SensitivityStepMode Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::getStepMode

What mode the current time integration step is in.

Definition at line 457 of file Tempus_IntegratorPseudoTransientForwardSensitivity_impl.hpp.

◆ buildSolutionHistory()

template<class Scalar >
void Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::buildSolutionHistory
protected

Member Data Documentation

◆ model_

template<class Scalar >
Teuchos::RCP<Thyra::ModelEvaluator<Scalar> > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::model_
protected

◆ sens_model_

template<class Scalar >
Teuchos::RCP<SensitivityModelEvaluatorBase<Scalar> > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::sens_model_
protected

◆ state_integrator_

template<class Scalar >
Teuchos::RCP<IntegratorBasic<Scalar> > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::state_integrator_
protected

◆ sens_integrator_

template<class Scalar >
Teuchos::RCP<IntegratorBasic<Scalar> > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::sens_integrator_
protected

◆ solutionHistory_

template<class Scalar >
Teuchos::RCP<SolutionHistory<Scalar> > Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::solutionHistory_
protected

◆ reuse_solver_

template<class Scalar >
bool Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::reuse_solver_
protected

◆ force_W_update_

template<class Scalar >
bool Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::force_W_update_
protected

◆ stepMode_

template<class Scalar >
SensitivityStepMode Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar >::stepMode_
protected

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