Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_IntegratorForwardSensitivity_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_IntegratorForwardSensitivity_decl_hpp
10 #define Tempus_IntegratorForwardSensitivity_decl_hpp
11 
12 // Tempus
13 #include "Tempus_config.hpp"
14 #include "Tempus_IntegratorBasicOld.hpp"
16 #include "Tempus_StepperStaggeredForwardSensitivity.hpp"
17 
18 namespace Tempus {
19 
20 
46 template<class Scalar>
48  : virtual public Tempus::Integrator<Scalar>,
49  virtual public Teuchos::ParameterListAcceptor
50 {
51 public:
52 
88 
92  std::string stepperType);
93 
95 
97 
100 
102 
103  virtual bool advanceTime()
105  { return integrator_->advanceTime(); }
107  virtual bool advanceTime(const Scalar timeFinal) override
108  { return integrator_->advanceTime(timeFinal); }
110  virtual void startIntegrator()
111  { integrator_->startIntegrator(); }
113  virtual void startTimeStep()
114  { integrator_->startTimeStep(); }
116  virtual void checkTimeStep()
117  { integrator_->checkTimeStep(); }
119  virtual void endIntegrator()
120  { integrator_->endIntegrator(); }
123  { return integrator_->getTempusParameterList(); }
125  { integrator_->setTempusParameterList(pl); }
127 
129 
130  virtual Scalar getTime() const override
132  { return integrator_->getTime(); }
134  virtual int getIndex() const override
135  { return integrator_->getIndex(); }
137  virtual Status getStatus() const override
138  { return integrator_->getStatus(); }
140  virtual Teuchos::RCP<Stepper<Scalar> > getStepper() const override
141  { return integrator_->getStepper(); }
142 
145 
148  { integrator_->setStepperWStepper(stepper); }
151  Teuchos::RCP<SolutionState<Scalar> > state = Teuchos::null)
152  { integrator_->initializeSolutionHistory(state); }
153 
155  virtual void initializeSolutionHistory(
156  Scalar t0,
158  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xdot0 = Teuchos::null,
159  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xdotdot0 = Teuchos::null,
160  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxDp0 = Teuchos::null,
161  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxdotDp0 = Teuchos::null,
162  Teuchos::RCP<const Thyra::MultiVectorBase<Scalar> > DxdotdotDp0 = Teuchos::null);
163 
166  { return integrator_->getSolutionHistory(); }
168  virtual void setSolutionHistory(
169  Teuchos::RCP<SolutionHistory<Scalar> > sh = Teuchos::null)
170  { integrator_->setSolutionHistory(sh); }
173  { return integrator_->getTimeStepControl(); }
175  { return integrator_->getNonConstTimeStepControl(); }
177  virtual void setTimeStepControl(
178  Teuchos::RCP<TimeStepControl<Scalar> > tsc = Teuchos::null)
179  { integrator_->setTimeStepControl(tsc); }
182  { return integrator_->getObserver(); }
184  virtual void setObserver(
185  Teuchos::RCP<IntegratorObserver<Scalar> > obs = Teuchos::null)
186  { integrator_->setObserver(obs); }
188  virtual void initialize()
189  { integrator_->initialize(); }
191  { return integrator_->getIntegratorTimer(); }
193  { return integrator_->getStepperTimer(); }
194 
204 
207  {return integrator_->getCurrentState();}
209 
211  void parseScreenOutput() { integrator_->parseScreenOutput(); }
212 
214 
216  override;
218  { return tempus_pl_; }
220 
222  const override;
224 
226 
227  std::string description() const override;
228  void describe(Teuchos::FancyOStream & out,
229  const Teuchos::EVerbosityLevel verbLevel) const override;
231 
232 protected:
233 
234  // Create sensitivity model evaluator from application model
235  void
238 
247 };
248 
250 template<class Scalar>
255 
257 template<class Scalar>
261  std::string stepperType);
262 
264 template<class Scalar>
267 
268 } // namespace Tempus
269 
270 #endif // Tempus_IntegratorForwardSensitivity_decl_hpp
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const override
Get the SolutionHistory.
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer() const override
Returns the IntegratorTimer_ for this Integrator.
virtual int getIndex() const override
Get current index.
Teuchos::RCP< IntegratorBasicOld< Scalar > > integrator_
virtual bool advanceTime()
Advance the solution to timeMax, and return true if successful.
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDotDot() const
Get current the second time derivative of the solution, xdotdot.
virtual void initializeSolutionHistory(Teuchos::RCP< SolutionState< Scalar > > state=Teuchos::null)
Set the initial state which has the initial conditions.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDXDotDp() const
virtual void setTimeStepControl(Teuchos::RCP< TimeStepControl< Scalar > > tsc=Teuchos::null)
Set the TimeStepControl.
virtual Teuchos::RCP< IntegratorObserver< Scalar > > getObserver()
Get the Observer.
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl() const override
Get the TimeStepControl.
virtual void endIntegrator()
Perform tasks after end of integrator.
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDXDotDotDp() const
virtual void setSolutionHistory(Teuchos::RCP< SolutionHistory< Scalar > > sh=Teuchos::null)
Set the SolutionHistory.
Teuchos::RCP< StepperStaggeredForwardSensitivity< Scalar > > sens_stepper_
virtual void setStepper(Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > model)
Set the Stepper.
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList() override
virtual Teuchos::RCP< SolutionState< Scalar > > getCurrentState()
Get current state.
virtual Status getStatus() const override
Get Status.
virtual Teuchos::RCP< Teuchos::ParameterList > getTempusParameterList() override
Return a copy of the Tempus ParameterList.
Thyra Base interface for time steppers.
void createSensitivityModelAndStepper(const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
Teuchos::RCP< IntegratorForwardSensitivity< Scalar > > integratorForwardSensitivity(Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
Nonmember constructor.
virtual void startIntegrator()
Perform tasks before start of integrator.
virtual void checkTimeStep()
Check if time step has passed or failed.
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer() const override
virtual Teuchos::RCP< const Thyra::MultiVectorBase< Scalar > > getDxDp() const
virtual void initialize()
Initializes the Integrator after set* function calls.
virtual Teuchos::RCP< Stepper< Scalar > > getStepper() const override
Get the Stepper.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &pl) override
Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > model_
Status
Status for the Integrator, the Stepper and the SolutionState.
IntegratorObserver class for time integrators.
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
void parseScreenOutput()
Parse when screen output should be executed.
virtual Scalar getTime() const override
Get current time.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getX() const
Get current the solution, x.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual void setStepperWStepper(Teuchos::RCP< Stepper< Scalar > > stepper)
Set the Stepper.
virtual void setTempusParameterList(Teuchos::RCP< Teuchos::ParameterList > pl) override
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDot() const
Get current the time derivative of the solution, xdot.
virtual void setObserver(Teuchos::RCP< IntegratorObserver< Scalar > > obs=Teuchos::null)
Set the Observer.
virtual Teuchos::RCP< TimeStepControl< Scalar > > getNonConstTimeStepControl() override
Teuchos::RCP< SensitivityModelEvaluatorBase< Scalar > > sens_model_
Time integrator implementing forward sensitivity analysis.
virtual bool advanceTime(const Scalar timeFinal) override
Advance the solution to timeFinal, and return true if successful.
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList() override