Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperRKAppActionComposite.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_StepperRKAppActionComposite_hpp
10 #define Tempus_StepperRKAppActionComposite_hpp
11 
13 #include <vector>
14 
15 namespace Tempus {
16 
17 /** \brief This composite AppAction loops over added AppActions.
18  *
19  * Individual AppActions are executed in the order in which they
20  * were added.
21  */
22 template<class Scalar>
24  : virtual public Tempus::StepperRKAppAction<Scalar>
25 {
26 public:
27 
28  /// Default constructor
30 
31  /// Destructor
33 
34  /// Execute application action for RK Stepper.
35  virtual void execute(
36  Teuchos::RCP<SolutionHistory<Scalar> > sh,
37  Teuchos::RCP<StepperRKBase<Scalar> > stepper,
38  const typename StepperRKAppAction<Scalar>::ACTION_LOCATION actLoc)
39  {
40  for(auto& a : appActions_)
41  a->execute(sh, stepper, actLoc);
42  }
43 
44  // Add AppAction to the AppAction vector.
45  void addRKAppAction(Teuchos::RCP<StepperRKAppAction<Scalar> > appAction)
46  {
47  appActions_.push_back(appAction);
48  }
49 
50  // Clear the AppAction vector.
52  { appActions_.clear(); }
53 
54  // Return the size of the AppAction vector.
55  std::size_t getSize() const { return appActions_.size(); }
56 
57 private:
58 
59  std::vector<Teuchos::RCP<StepperRKAppAction<Scalar > > > appActions_;
60 
61 };
62 
63 } // namespace Tempus
64 #endif // Tempus_StepperRKAppActionComposite_hpp
This composite AppAction loops over added AppActions.
Base class for Runge-Kutta methods, ExplicitRK, DIRK and IMEX.
Application Action for StepperRKBase.
virtual void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperRKBase< Scalar > > stepper, const typename StepperRKAppAction< Scalar >::ACTION_LOCATION actLoc)
Execute application action for RK Stepper.
std::vector< Teuchos::RCP< StepperRKAppAction< Scalar > > > appActions_
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
ACTION_LOCATION
Indicates the location of application action (see algorithm).
void addRKAppAction(Teuchos::RCP< StepperRKAppAction< Scalar > > appAction)