Tempus  Version of the Day
Time Integration
Tempus_IntegratorObserver.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_IntegratorObserver_hpp
10 #define Tempus_IntegratorObserver_hpp
11 
12 #include "Tempus_TimeStepControl.hpp"
13 
14 // Forward declarations
15 namespace Tempus {
16  template<typename Scalar> class Integrator;
17 }
18 
19 namespace Tempus {
20 
21 /** \brief IntegratorObserver class for time integrators.
22  *
23  * This is a means for application developers to perform tasks
24  * during the time integrator, e.g.,
25  * - Compute specific quantities
26  * - Output information
27  * - Adjust the time step (CFL stability)
28  * - "Massage" the working solution state
29  * - ...
30  *
31  * <b>Design Considerations</b>
32  * - IntegratorObserver should have access to the entire SolutionHistory,
33  * as application developers may have that need.
34  * - The needed IntegratorObserver functions are determined by the
35  * access needs in Integrator::advanceTime().
36  * - IntegratorObserver is not stateless! Developers may touch the
37  * solution state! Developers need to be careful not to break the
38  * restart (checkpoint) capability.
39  */
40 template<class Scalar>
42 {
43 public:
44 
45  /// \name Basic IntegratorObserver methods
46  //@{
47  /// Observe the beginning of the time integrator.
48  virtual void observeStartIntegrator(const Integrator<Scalar>& integrator) = 0;
49 
50  /// Observe the beginning of the time step loop.
51  virtual void observeStartTimeStep(const Integrator<Scalar>& integrator) = 0;
52 
53  /// Observe after the next time step size is selected. The
54  /// observer can choose to change the current integratorStatus.
55  virtual void observeNextTimeStep(const Integrator<Scalar>& integrator) = 0;
56 
57  /// Observe before Stepper takes step.
58  virtual void observeBeforeTakeStep(const Integrator<Scalar>& integrator) = 0;
59 
60  /// Observe after Stepper takes step.
61  virtual void observeAfterTakeStep(const Integrator<Scalar>& integrator) = 0;
62 
63  /// Observe after accepting time step. The observer can choose to
64  /// change the current integratorStatus.
65  virtual void observeAcceptedTimeStep(const Integrator<Scalar>& integrator) = 0;
66 
67  /// Observe the end of the time integrator.
68  virtual void observeEndIntegrator(const Integrator<Scalar>& integrator) = 0;
69  //@}
70 
71 };
72 } // namespace Tempus
73 #endif // Tempus_IntegratorObserver_hpp
Tempus::IntegratorObserver::observeAfterTakeStep
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator)=0
Observe after Stepper takes step.
Tempus::IntegratorObserver::observeAcceptedTimeStep
virtual void observeAcceptedTimeStep(const Integrator< Scalar > &integrator)=0
Tempus
Definition: Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp:20
Tempus::IntegratorObserver::observeStartTimeStep
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator)=0
Observe the beginning of the time step loop.
Tempus::Integrator
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
Definition: Tempus_Integrator.hpp:62
Tempus::IntegratorObserver::observeEndIntegrator
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator)=0
Observe the end of the time integrator.
Tempus::IntegratorObserver
IntegratorObserver class for time integrators.
Definition: Tempus_IntegratorObserver.hpp:41
Tempus::IntegratorObserver::observeNextTimeStep
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator)=0
Tempus::IntegratorObserver::observeBeforeTakeStep
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator)=0
Observe before Stepper takes step.
Tempus::IntegratorObserver::observeStartIntegrator
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator)=0
Observe the beginning of the time integrator.