Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperSubcyclingObserverBase.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_StepperSubcyclingObserverBase_hpp
10 #define Tempus_StepperSubcyclingObserverBase_hpp
11 
12 #include "Tempus_config.hpp"
13 #include "Tempus_SolutionHistory.hpp"
15 
16 
17 namespace Tempus {
18 
19 /** \brief Base observer for StepperSubcycling.
20  *
21  * This class provides a means to observe values (e.g., solution variables
22  * through SolutionHistory, and stepper member data through the Stepper),
23  * and cannot modify them.
24  *
25  * Users deriving from this class can observer a lot of data, and it is
26  * expected that users will NOT modify any of that data. If the user
27  * wishes to modify the solution and/or stepper data during the
28  * Stepper::takeStep, they should use the Modifier class (with care!).
29  *
30  * Below is the Subcycling algorithm with the locations of the observe calls
31  * italicized.
32  *
33  * \f{algorithm}{
34  * \renewcommand{\thealgorithm}{}
35  * \caption{Subcycling with the locations of the application actions indicated.}
36  * \begin{algorithmic}[1]
37  * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)}
38  * \State Compute $x_{n}$ from $x_{n-1}$, applying appActions from sub-steppers
39  * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)}
40  * \end{algorithmic}
41  * \f}
42  */
43 template<class Scalar>
45  : virtual public Tempus::StepperSubcyclingAppAction<Scalar>
46 {
47 private:
48 
49  /* \brief Adaptor execute function
50  *
51  * This is an adaptor function to bridge between the AppAction
52  * interface and this derived interface. It is meant to be private
53  * and non-virtual as deriving from this class should only need to
54  * implement the observe function.
55  *
56  * For the Observer interface, this adaptor simply "applies" constantness
57  * to the arguments.
58  */
59  void execute(
60  Teuchos::RCP<SolutionHistory<Scalar> > sh,
61  Teuchos::RCP<StepperSubcycling<Scalar> > stepper,
63  { this->observe(sh, stepper, actLoc); }
64 
65 public:
66 
67  /// Observe Subcycling Stepper.
68  virtual void observe(
69  Teuchos::RCP<const SolutionHistory<Scalar> > /* sh */,
70  Teuchos::RCP<const StepperSubcycling<Scalar> > /* stepper */,
71  const typename StepperSubcyclingAppAction<Scalar>::ACTION_LOCATION actLoc) = 0;
72 
73 };
74 
75 } // namespace Tempus
76 
77 #endif // Tempus_StepperSubcyclingObserverBase_hpp
Application Action for StepperSubcycling.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
ACTION_LOCATION
Indicates the location of application action (see algorithm).
virtual void observe(Teuchos::RCP< const SolutionHistory< Scalar > >, Teuchos::RCP< const StepperSubcycling< Scalar > >, const typename StepperSubcyclingAppAction< Scalar >::ACTION_LOCATION actLoc)=0
Observe Subcycling Stepper.
void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperSubcycling< Scalar > > stepper, const typename StepperSubcyclingAppAction< Scalar >::ACTION_LOCATION actLoc)
Execute application action for Subcycling Stepper.