Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperBackwardEulerAppAction.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_StepperBackwardEulerAppAction_hpp
10 #define Tempus_StepperBackwardEulerAppAction_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 StepperBackwardEuler;
20 
21 /** \brief Application Action for StepperBackwardEuler.
22  *
23  * This class provides a means to apply various actions with the BackwardEuler 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 BackwardEuler algorithm and includes the locations where the
30  * application can take actions (in italicized).
31  *
32  * \f{algorithm}{
33  * \renewcommand{\thealgorithm}{}
34  * \caption{Backward Euler with application-action locations indicated.}
35  * \begin{algorithmic}[1]
36  * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)}
37  * \State Compute the predictor (e.g., apply stepper to $x_n$).
38  * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)}
39  * \State Solve $\mathcal{F}_n(\dot{x}=(x_n-x_{n-1})/\Delta t_n, x_n, t_n)=0$ for $x_n$
40  * \State {\it appAction.execute(solutionHistory, stepper, AFTER\_SOLVE)}
41  * \State $\dot{x}_n \leftarrow (x_n-x_{n-1})/\Delta t_n$
42  * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)}
43  * \end{algorithmic}
44  * \f}
45  */
46 template<class Scalar>
48 {
49 public:
50 
51  /// Indicates the location of application action (see algorithm).
53  BEGIN_STEP, ///< At the beginning of the step.
54  BEFORE_SOLVE, ///< Before the implicit solve.
55  AFTER_SOLVE, ///< After the implicit solve.
56  END_STEP ///< At the end of the step.
57  };
58 
59  /// Constructor
61 
62  /// Destructor
64 
65  /// Execute application action for BackwardEuler Stepper.
66  virtual void execute(
67  Teuchos::RCP<SolutionHistory<Scalar> > sh,
68  Teuchos::RCP<StepperBackwardEuler<Scalar> > stepper,
70 };
71 
72 } // namespace Tempus
73 
74 #endif // Tempus_StepperBackwardEulerAppAction_hpp
virtual void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperBackwardEuler< Scalar > > stepper, const typename StepperBackwardEulerAppAction< Scalar >::ACTION_LOCATION actLoc)=0
Execute application action for BackwardEuler Stepper.
ACTION_LOCATION
Indicates the location of application action (see algorithm).
Application Action for StepperBackwardEuler.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...