Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperBDF2AppActionComposite.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_StepperBDF2AppActionComposite_hpp
10 #define Tempus_StepperBDF2AppActionComposite_hpp
11 
12 #include "Tempus_config.hpp"
14 #include "Tempus_TimeStepControl.hpp"
15 #include <vector>
16 
17 namespace Tempus {
18 
24 template <class Scalar>
26  : virtual public Tempus::StepperBDF2AppAction<Scalar> {
27  public:
30 
33 
35  virtual void execute(
39  {
40  for (auto& a : appActions_) a->execute(sh, stepper, actLoc);
41  }
42 
43  // Add AppAction to the AppAction vector.
45  {
46  appActions_.push_back(appAction);
47  }
48 
49  // Clear the AppAction vector.
50  void clearBDF2AppActions();
51  {
52  appActions_.clear();
53  }
54 
55  // Return the size of the AppAction vector.
56  std::size_t getSize() const { return appActions_.size(); }
57 
58  private:
59  std::vector<Teuchos::RCP<StepperBDF2AppAction<Scalar> > > appActions_;
60 };
61 
62 } // namespace Tempus
63 #endif // Tempus_StepperBDF2AppActionComposite_hpp
BDF2 (Backward-Difference-Formula-2) time stepper.
ACTION_LOCATION
Indicates the location of application action (see algorithm).
void addBDF2AppAction(Teuchos::RCP< StepperBDF2AppAction< Scalar > > appAction)
std::vector< Teuchos::RCP< StepperBDF2AppAction< Scalar > > > appActions_
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual ~StepperBDF2AppActionComposite()
Destructor.
virtual void execute(Teuchos::RCP< SolutionHistory< Scalar > > sh, Teuchos::RCP< StepperBDF2< Scalar > > stepper, const typename StepperBDF2AppAction< Scalar >::ACTION_LOCATION actLoc)
Execute application action for BDF2 Stepper.
Application Action for StepperBDF2.
StepperBDF2AppActionComposite()
Default constructor.
This composite AppAction loops over added AppActions.