Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperSubcyclingModifierBase.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_StepperSubcyclingModifierBase_hpp
10 #define Tempus_StepperSubcyclingModifierBase_hpp
11 
12 #include "Tempus_config.hpp"
13 #include "Tempus_SolutionHistory.hpp"
15 
16 namespace Tempus {
17 
18 /** \brief Base modifier for StepperSubcycling.
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{Subcycling with the locations of the application actions indicated.}
34  * \begin{algorithmic}[1]
35  * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)}
36  * \State Compute $x_{n}$ from $x_{n-1}$, applying appActions from sub-steppers
37  * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)}
38  * \end{algorithmic}
39  * \f}
40  */
41 
42 template<class Scalar>
44  : virtual public Tempus::StepperSubcyclingAppAction<Scalar>
45 {
46 private:
47 
48  /* \brief Adaptor execute function
49  *
50  * This is an adaptor function to bridge between the AppAction
51  * interface and the Modifier interface. It is meant to be private
52  * and non-virtual as deriving from this class should only need to
53  * implement the modify function.
54  *
55  * For the Modifier interface, this adaptor is a "simple pass through".
56  */
57  void execute(
58  Teuchos::RCP<SolutionHistory<Scalar> > sh,
59  Teuchos::RCP<StepperSubcycling<Scalar> > stepper,
61  { this->modify(sh, stepper, actLoc); }
62 
63 public:
64 
65  /// Modify Subcycling Stepper.
66  virtual void modify(
67  Teuchos::RCP<SolutionHistory<Scalar> > /* sh */,
68  Teuchos::RCP<StepperSubcycling<Scalar> > /* stepper */,
69  const typename StepperSubcyclingAppAction<Scalar>::ACTION_LOCATION actLoc) = 0;
70 
71 };
72 
73 } // namespace Tempus
74 
75 #endif // Tempus_StepperSubcyclingModifierBase_hpp
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.
Application Action for StepperSubcycling.
virtual void modify(Teuchos::RCP< SolutionHistory< Scalar > >, Teuchos::RCP< StepperSubcycling< Scalar > >, const typename StepperSubcyclingAppAction< Scalar >::ACTION_LOCATION actLoc)=0
Modify Subcycling Stepper.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
ACTION_LOCATION
Indicates the location of application action (see algorithm).