Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperObserver.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_StepperObserver_hpp
10 #define Tempus_StepperObserver_hpp
11 
12 #include "Tempus_SolutionHistory.hpp"
13 
14 
15 namespace Tempus {
16 
17 // Forward Declaration for recursive includes (this Observer <--> Stepper)
18 template<class Scalar> class Stepper;
19 
20 /** \brief StepperObserver class for Stepper class.
21  *
22  * This is a means for application developers to perform tasks
23  * during the time steps, e.g.,
24  * - Compute specific quantities
25  * - Output information
26  * - "Massage" the working solution state
27  * - ...
28  *
29  * <b>Design Considerations</b>
30  * - This base class only requires two functions, observeBeginTakeStep()
31  * and observeEndTakeStep() as these are the only ones that all
32  * Steppers have in common.
33  * - StepperObserver is not stateless! Developers may touch the
34  * solution state! Developers need to be careful not to break the
35  * restart (checkpoint) capability.
36  */
37 template<class Scalar>
39 {
40 public:
41 
42  /// Observe Stepper at beginning of takeStep.
43  virtual void observeBeginTakeStep(
44  Teuchos::RCP<SolutionHistory<Scalar> > sh,
45  Stepper<Scalar> & stepper) = 0;
46 
47  /// Observe Stepper at end of takeStep.
48  virtual void observeEndTakeStep(
49  Teuchos::RCP<SolutionHistory<Scalar> > sh,
50  Stepper<Scalar> & stepper) = 0;
51 };
52 } // namespace Tempus
53 #endif // Tempus_StepperObserver_hpp
virtual void observeBeginTakeStep(Teuchos::RCP< SolutionHistory< Scalar > > sh, Stepper< Scalar > &stepper)=0
Observe Stepper at beginning of takeStep.
Thyra Base interface for time steppers.
virtual void observeEndTakeStep(Teuchos::RCP< SolutionHistory< Scalar > > sh, Stepper< Scalar > &stepper)=0
Observe Stepper at end of takeStep.
StepperObserver class for Stepper class.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...