Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperForwardEulerModifierBase.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_StepperForwardEulerModifierBase_hpp
10 #define Tempus_StepperForwardEulerModifierBase_hpp
11 
12 #include "Tempus_config.hpp"
13 #include "Tempus_SolutionHistory.hpp"
15 
16 namespace Tempus {
17 
18 /** \brief Base modifier for StepperBackwardEuler.
19  *
20  * This class provides a means to modify values (e.g., solution variables
21  * through SolutionHistory, and stepper member data through the Stepper),
22  * and can be very powerful and easy to make changes to the stepper and
23  * the solution.
24  *
25  * Users deriving from this class can access a lot of data, and it is
26  * expected that those users know what changes are allowable without
27  * affecting the Stepper correctness, performance, accuracy and stability.
28  * Thus the user should be careful when accessing data through classes
29  * derived from the default modifier (i.e., USER BEWARE!!).
30  *
31  * \f{algorithm}{
32  * \renewcommand{\thealgorithm}{}
33  * \caption{Forward Euler with the locations of the application actions indicated.}
34  * \begin{algorithmic}[1]
35  * \State Start with $x_n$, $\Delta t_n$
36  * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)}
37  * \State Form $f(x_{n},t_{n})$
38  * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)}
39  * \State Form $x_n \leftarrow x_{n} + \Delta t_n f(x_{n},t_n)$
40  * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)}
41  * \end{algorithmic}
42  * \f}
43  */
44 
45 template<class Scalar>
47  : virtual public Tempus::StepperForwardEulerAppAction<Scalar>
48 {
49 private:
50 
51  /* \brief Adaptor execute function
52  *
53  * This is an adaptor function to bridge between the AppAction
54  * interface and the Modifier interface. It is meant to be private
55  * and non-virtual as deriving from this class should only need to
56  * implement the modify function.
57  *
58  * For the Modifier interface, this adaptor is a "simple pass through".
59  */
60  void execute(
61  Teuchos::RCP<SolutionHistory<Scalar> > sh,
62  Teuchos::RCP<StepperForwardEuler<Scalar> > stepper,
64  { this->modify(sh, stepper, actLoc); }
65 
66 public:
67 
68  /// Modify ForwardEuler Stepper.
69  virtual void modify(
70  Teuchos::RCP<SolutionHistory<Scalar> > /* sh */,
71  Teuchos::RCP<StepperForwardEuler<Scalar> > /* stepper */,
73 
74 };
75 
76 } // namespace Tempus
77 
78 #endif // Tempus_StepperForwardEulerModifierBase_hpp
virtual void modify(Teuchos::RCP< SolutionHistory< Scalar > >, Teuchos::RCP< StepperForwardEuler< Scalar > >, const typename StepperForwardEulerAppAction< Scalar >::ACTION_LOCATION actLoc)=0
Modify ForwardEuler Stepper.
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...
void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperForwardEuler< Scalar > > stepper, const typename StepperForwardEulerAppAction< Scalar >::ACTION_LOCATION actLoc)
Execute application action for ForwardEuler Stepper.