Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
12 #include "Tempus_config.hpp"
14 #include <vector>
15 
16 namespace Tempus {
17 
23 template <class Scalar>
25  : virtual public Tempus::StepperRKAppAction<Scalar> {
26  public:
29 
32 
34  virtual void execute(
37  const typename StepperRKAppAction<Scalar>::ACTION_LOCATION actLoc)
38  {
39  for (auto& a : appActions_) a->execute(sh, stepper, actLoc);
40  }
41 
42  // Add AppAction to the AppAction vector.
44  {
45  appActions_.push_back(appAction);
46  }
47 
48  // Clear the AppAction vector.
49  void clearRKAppActions() { appActions_.clear(); }
50 
51  // Return the size of the AppAction vector.
52  std::size_t getSize() const { return appActions_.size(); }
53 
54  private:
55  std::vector<Teuchos::RCP<StepperRKAppAction<Scalar> > > appActions_;
56 };
57 
58 } // namespace Tempus
59 #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.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
ACTION_LOCATION
Indicates the location of application action (see algorithm).
std::vector< Teuchos::RCP< StepperRKAppAction< Scalar > > > appActions_
void addRKAppAction(Teuchos::RCP< StepperRKAppAction< Scalar > > appAction)