Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_IntegratorAdjointSensitivity_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef Tempus_IntegratorAdjointSensitivity_decl_hpp
10 #define Tempus_IntegratorAdjointSensitivity_decl_hpp
11 
12 // Tempus
13 #include "Tempus_config.hpp"
14 #include "Tempus_IntegratorBasicOld.hpp"
15 #include "Tempus_AdjointAuxSensitivityModelEvaluator.hpp"
16 
17 namespace Tempus {
18 
19 
43 template<class Scalar>
45  virtual public Tempus::Integrator<Scalar>,
46  virtual public Teuchos::ParameterListAcceptor
47 {
48 public:
49 
83 
85 
87 
90 
92 
93 
95  virtual bool advanceTime();
97  virtual bool advanceTime(const Scalar timeFinal) override;
99  virtual Scalar getTime() const override;
101  virtual int getIndex() const override;
103  virtual Status getStatus() const override;
105  virtual Teuchos::RCP<Stepper<Scalar> > getStepper() const override;
116  { return state_integrator_->getIntegratorTimer();}
118  { return state_integrator_->getStepperTimer();}
119 
121 
123  virtual void initializeSolutionHistory(
124  Scalar t0,
126  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xdot0 = Teuchos::null,
127  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xdotdot0 = Teuchos::null,
128  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxDp0 = Teuchos::null,
129  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxdotDp0 = Teuchos::null,
130  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxdotdotDp0 = Teuchos::null);
131 
133  virtual void setObserver(
134  Teuchos::RCP<IntegratorObserver<Scalar> > obs = Teuchos::null);
136  virtual void initialize();
137 
144 
147 
149 
151  override;
154 
156  const override;
158 
160 
161  std::string description() const override;
162  void describe(Teuchos::FancyOStream & out,
163  const Teuchos::EVerbosityLevel verbLevel) const override;
165 
166 protected:
167 
168  // Create sensitivity model evaluator from application model
172  const Teuchos::RCP<Teuchos::ParameterList>& inputPL);
173 
175  const Teuchos::RCP<const SolutionHistory<Scalar> >& state_solution_history,
176  const Teuchos::RCP<const SolutionHistory<Scalar> >& adjoint_solution_history);
177 
183  int p_index_;
184  int g_index_;
191 };
192 
194 template<class Scalar>
199 
201 template<class Scalar>
204 
205 } // namespace Tempus
206 
207 #endif // Tempus_IntegratorAdjointSensitivity_decl_hpp
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > dgdp_
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList() override
virtual Teuchos::RCP< TimeStepControl< Scalar > > getNonConstTimeStepControl() override
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDotDot() const
Get current the second time derivative of the solution, xdotdot.
Teuchos::RCP< AdjointAuxSensitivityModelEvaluator< Scalar > > adjoint_model_
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer() const override
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList() override
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDot() const
Get current the time derivative of the solution, xdot.
Teuchos::RCP< IntegratorAdjointSensitivity< Scalar > > integratorAdjointSensitivity(Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
Nonmember constructor.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory_
void buildSolutionHistory(const Teuchos::RCP< const SolutionHistory< Scalar > > &state_solution_history, const Teuchos::RCP< const SolutionHistory< Scalar > > &adjoint_solution_history)
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getX() const
Get current the solution, x.
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer() const override
Returns the IntegratorTimer_ for this Integrator.
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const override
Get the SolutionHistory.
Status
Status for the Integrator, the Stepper and the SolutionState.
Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > dxdp_init_
virtual Teuchos::RCP< Teuchos::ParameterList > getTempusParameterList() override
Return a copy of the Tempus ParameterList.
IntegratorObserver class for time integrators.
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 TimeStepControl< Scalar > > getTimeStepControl() const override
Get the TimeStepControl.
virtual void setTempusParameterList(Teuchos::RCP< Teuchos::ParameterList > pl) override
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
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.
Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > model_
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
Teuchos::RCP< IntegratorBasicOld< Scalar > > adjoint_integrator_
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &pl) override
Time integrator suitable for adjoint sensitivity analysis.
virtual int getIndex() const override
Get current index.
Teuchos::RCP< AdjointAuxSensitivityModelEvaluator< Scalar > > createAdjointModel(const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< Teuchos::ParameterList > &inputPL)
virtual Scalar getTime() const override
Get current time.
virtual Status getStatus() const override
Get Status.
virtual void initialize()
Initializes the Integrator after set* function calls.
virtual Teuchos::RCP< Stepper< Scalar > > getStepper() const override
Get the Stepper.
Teuchos::RCP< IntegratorBasicOld< Scalar > > state_integrator_
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDgDp() const
Return adjoint sensitivity stored in gradient format.