Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperForwardEulerAppAction.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_StepperForwardEulerAppAction_hpp
10 #define Tempus_StepperForwardEulerAppAction_hpp
11 
12 #include "Tempus_config.hpp"
13 #include "Tempus_SolutionHistory.hpp"
14 
15 
16 namespace Tempus {
17 
18 // Forward Declaration for recursive includes (this AppAction <--> Stepper)
19 template<class Scalar> class StepperForwardEuler;
20 
21 /** \brief Application Action for StepperForwardEuler.
22  *
23  * This class provides a means to apply various actions with the ForwardEuler time step.
24  * The data available to this class is solution variables (through
25  * SolutionHistory), and stepper data (through the Stepper). It allows
26  * the application to just observe this data (i.e., use but not change the
27  * data) to change any of it (USER BEWARE!).
28  *
29  * Below is the ForwardEuler algorithm and includes the locations where the
30  * application can take actions (in italicized).
31  *
32  * \f{algorithm}{
33  * \renewcommand{\thealgorithm}{}
34  * \caption{Forward Euler with the locations of the application actions indicated.}
35  * \begin{algorithmic}[1]
36  * \State Start with $x_n$, $\Delta t_n$
37  * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)}
38  * \State Form $f(x_{n},t_{n})$
39  * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)}
40  * \State Form $x_n \leftarrow x_{n} + \Delta t_n f(x_{n},t_n)$
41  * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)}
42  * \end{algorithmic}
43  * \f}
44  */
45 template<class Scalar>
47 {
48 public:
49 
50  /// Indicates the location of application action (see algorithm).
52  BEGIN_STEP, ///< At the beginning of the step.
53  BEFORE_EXPLICIT_EVAL, ///< Before the explicit evaluation.
54  END_STEP ///< At the end of the step.
55  };
56 
57  /// Constructor
59 
60  /// Destructor
62 
63  /// Execute application action for ForwardEuler Stepper.
64  virtual void execute(
65  Teuchos::RCP<SolutionHistory<Scalar> > sh,
66  Teuchos::RCP<StepperForwardEuler<Scalar> > stepper,
68 };
69 
70 } // namespace Tempus
71 
72 #endif // Tempus_StepperForwardEulerAppAction_hpp
ACTION_LOCATION
Indicates the location of application action (see algorithm).
Application Action for StepperForwardEuler.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperForwardEuler< Scalar > > stepper, const typename StepperForwardEulerAppAction< Scalar >::ACTION_LOCATION actLoc)=0
Execute application action for ForwardEuler Stepper.