Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_IntegratorPseudoTransientForwardSensitivity_decl.hpp
Go to the documentation of this file.
1 //@HEADER
2 // *****************************************************************************
3 // Tempus: Time Integration and Sensitivity Analysis Package
4 //
5 // Copyright 2017 NTESS and the Tempus contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 //@HEADER
9 
10 #ifndef Tempus_IntegratorPseudoTransientForwardSensitivity_decl_hpp
11 #define Tempus_IntegratorPseudoTransientForwardSensitivity_decl_hpp
12 
13 // Tempus
14 #include "Tempus_config.hpp"
15 #include "Tempus_IntegratorBasic.hpp"
17 
18 #include "Tempus_StepperStaggeredForwardSensitivity.hpp" // For SensitivityStepMode
19 
20 namespace Tempus {
21 
57 template <class Scalar>
59  : virtual public Tempus::Integrator<Scalar> {
60  public:
98  const Teuchos::RCP<IntegratorBasic<Scalar>>& fwd_integrator,
99  const Teuchos::RCP<IntegratorBasic<Scalar>>& sens_integrator,
100  const bool reuse_solver, const bool force_W_update);
101 
103 
106 
109 
111 
112 
114  virtual bool advanceTime();
116  virtual bool advanceTime(const Scalar timeFinal) override;
118  virtual Scalar getTime() const override;
120  virtual int getIndex() const override;
122  virtual Status getStatus() const override;
124  virtual void setStatus(const Status st) override;
126  virtual Teuchos::RCP<Stepper<Scalar>> getStepper() const override;
131  const override;
136  override;
139  const override;
141  override;
147  virtual void setObserver(
148  Teuchos::RCP<IntegratorObserver<Scalar>> obs = Teuchos::null);
150  {
151  return state_integrator_->getIntegratorTimer();
152  }
154  {
155  return state_integrator_->getStepperTimer();
156  }
157 
159 
161  virtual void initializeSolutionHistory(
162  Scalar t0, Teuchos::RCP<const Thyra::VectorBase<Scalar>> x0,
163  Teuchos::RCP<const Thyra::VectorBase<Scalar>> xdot0 = Teuchos::null,
164  Teuchos::RCP<const Thyra::VectorBase<Scalar>> xdotdot0 = Teuchos::null,
165  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar>> DxDp0 = Teuchos::null,
167  Teuchos::null,
168  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar>> DxdotdotDp0 =
169  Teuchos::null);
170 
180  const;
181 
186 
188 
189  std::string description() const override;
191  const Teuchos::EVerbosityLevel verbLevel) const override;
193 
196 
197  protected:
198  void buildSolutionHistory();
199 
208 };
209 
211 
222 template <class Scalar>
227  const Teuchos::RCP<Thyra::ModelEvaluator<Scalar>>& sens_residual_model,
228  const Teuchos::RCP<Thyra::ModelEvaluator<Scalar>>& sens_solve_model);
229 
231 
241 template <class Scalar>
246  const Teuchos::RCP<Thyra::ModelEvaluator<Scalar>>& sens_residual_model)
247 {
249  pList, model, sens_residual_model, sens_residual_model);
250 }
251 
253 
262 template <class Scalar>
267 {
268  return createIntegratorPseudoTransientForwardSensitivity(pList, model, model,
269  model);
270 }
271 
273 
281 template <class Scalar>
284 
285 } // namespace Tempus
286 
287 #endif // Tempus_IntegratorPseudoTransientForwardSensitivity_decl_hpp
virtual Teuchos::RCP< Stepper< Scalar > > getStepper() const override
Get the Stepper.
Teuchos::RCP< Tempus::IntegratorPseudoTransientForwardSensitivity< Scalar > > createIntegratorPseudoTransientForwardSensitivity(Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar >> &model, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar >> &sens_residual_model, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar >> &sens_solve_model)
Nonmember constructor.
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const override
Get the SolutionHistory.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDxDp() const
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< TimeStepControl< Scalar > > getNonConstTimeStepControl() override
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getG() const
Return response function g.
virtual bool advanceTime()
Advance the solution to timeMax, and return true if successful.
virtual void setObserver(Teuchos::RCP< IntegratorObserver< Scalar >> obs=Teuchos::null)
Set the Observer.
SensitivityStepMode getStepMode() const
What mode the current time integration step is in.
Status
Status for the Integrator, the Stepper and the SolutionState.
IntegratorObserver class for time integrators.
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer() const override
Returns the IntegratorTimer_ for this Integrator.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDgDp() const
Return forward sensitivity stored in Jacobian format.
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDotDot() const
Get current the second time derivative of the solution, xdotdot.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
virtual Teuchos::RCP< IntegratorObserver< Scalar > > getObserver()
Get the Observer.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDXDotDp() const
Time integrator suitable for pseudotransient forward sensitivity analysis.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl() const override
Get the TimeStepControl.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDXDotDotDp() const
virtual Teuchos::RCP< SolutionHistory< Scalar > > getNonConstSolutionHistory() override
Get the SolutionHistory.
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDot() const
Get current the time derivative of the solution, xdot.
A ModelEvaluator decorator for sensitivity analysis.
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getX() const
Get current the solution, x.