Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_Integrator.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_Integrator_hpp
10 #define Tempus_Integrator_hpp
11 
12 #include "Tempus_Types.hpp"
13 #include "Teuchos_VerboseObject.hpp"
14 #include "Teuchos_Describable.hpp"
15 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
16 
17 #include <string>
18 
19 namespace Teuchos {
20  class Time;
21 }
22 
23 namespace Tempus {
24  template<typename Scalar> class Stepper;
25  template<typename Scalar> class SolutionHistory;
26  template<typename Scalar> class TimeStepControl;
27 }
28 
29 namespace Tempus {
30 
31 /** \brief Thyra Base interface for time integrators.
32  * Time integrators are designed to advance the solution from an initial
33  * time, \f$t_0\f$, to a final time, \f$t_f\f$.
34  *
35  * <b>Design Considerations</b>
36  * - Integrators manage multiple time steps
37  * - Integrators have a single Stepper
38  * - Time-step ramping and startup are handled by TimeStepControl.
39  * - Solution output, e.g., solution plotting and check pointing,
40  * is coordinated in the Integrator.
41  * - Solution stability is handled in the timeStepControl, e.g., CFL
42  * constraint.
43  * - Error control over multiple time steps is handled in the Integrators,
44  * while error control over a single time step is handled in the Steppers.
45  * - Integrators will collect error control information from the Stepper
46  * and determine the next time step size and order.
47  * - Integrator maintains its own copy of the time history in the
48  * SolutionHistory, which may be just a single time step up to
49  * the entire solution history.
50  * - Integrators should compute the next time, and after accepting
51  * the time step advance the solution. This allows a simple undo
52  * capability, if a solution is not acceptable.
53  *
54  * <b> CS Design Considerations</b>
55  * - Integrators will be fully constructed with input or default parameters.
56  * - All input parameters (i.e., ParameterList) can be set by public methods.
57  * - The Integrator ParameterList must be consistent.
58  * - The "set" methods which update parameters in the ParameterList
59  * must update the Integrator ParameterList.
60  */
61 template<class Scalar>
63  : virtual public Teuchos::Describable,
64  virtual public Teuchos::VerboseObject<Tempus::Integrator<Scalar> >,
65  virtual public Teuchos::ParameterListAcceptor
66 {
67 public:
68 
69  /// \name Basic integrator methods
70  //@{
71  /// Advance the solution to time, and return true if successful.
72  virtual bool advanceTime(const Scalar time_final) = 0;
73  /// Get current time
74  virtual Scalar getTime() const = 0;
75  /// Get current index
76  virtual int getIndex() const = 0;
77  /// Get the Status
78  virtual Tempus::Status getStatus() const = 0;
79  /// Get the stepper
80  virtual Teuchos::RCP<Stepper<Scalar> > getStepper() const = 0;
81  /// Return a copy of the Tempus ParameterList
82  virtual Teuchos::RCP<Teuchos::ParameterList> getTempusParameterList() = 0;
83  virtual void setTempusParameterList(Teuchos::RCP<Teuchos::ParameterList> pl) = 0;
84  /// Returns the SolutionHistory for this Integrator
85  virtual Teuchos::RCP<const SolutionHistory<Scalar> > getSolutionHistory() const = 0;
86  /// Returns the TimeStepControl for this Integrator
87  virtual Teuchos::RCP<const TimeStepControl<Scalar> > getTimeStepControl() const = 0;
88  virtual Teuchos::RCP<TimeStepControl<Scalar> > getNonConstTimeStepControl() = 0;
89  /// Returns the IntegratorTimer_ for this Integrator
90  virtual Teuchos::RCP<Teuchos::Time> getIntegratorTimer() const = 0;
91  virtual Teuchos::RCP<Teuchos::Time> getStepperTimer() const = 0;
92  //@}
93 
94 };
95 } // namespace Tempus
96 #endif // Tempus_Integrator_hpp
virtual Teuchos::RCP< Teuchos::ParameterList > getTempusParameterList()=0
Return a copy of the Tempus ParameterList.
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer() const =0
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer() const =0
Returns the IntegratorTimer_ for this Integrator.
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl() const =0
Returns the TimeStepControl for this Integrator.
virtual Teuchos::RCP< TimeStepControl< Scalar > > getNonConstTimeStepControl()=0
virtual Tempus::Status getStatus() const =0
Get the Status.
Thyra Base interface for time steppers.
Status
Status for the Integrator, the Stepper and the SolutionState.
virtual Scalar getTime() const =0
Get current time.
TimeStepControl manages the time step size. There several mechanicisms that effect the time step size...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual bool advanceTime(const Scalar time_final)=0
Advance the solution to time, and return true if successful.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual Teuchos::RCP< Stepper< Scalar > > getStepper() const =0
Get the stepper.
virtual void setTempusParameterList(Teuchos::RCP< Teuchos::ParameterList > pl)=0
virtual int getIndex() const =0
Get current index.
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const =0
Returns the SolutionHistory for this Integrator.