Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_TimeStepControlStrategyComposite.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_TimeStepControlStrategyComposite_hpp
10 #define Tempus_TimeStepControlStrategyComposite_hpp
11 
13 #include "Tempus_SolutionHistory.hpp"
14 
15 
16 namespace Tempus {
17 
18 template<class Scalar> class TimeStepControl;
19 
20 /** \brief StepControlStrategy class for TimeStepControl
21  *
22  */
23 template<class Scalar>
25 {
26 public:
27 
28  /// Constructor
30 
31  /// Destructor
33 
34  /** \brief Determine the time step size.*/
35  virtual void getNextTimeStep(const TimeStepControl<Scalar> tsc, Teuchos::RCP<SolutionHistory<Scalar> > sh ,
36  Status & integratorStatus) override {
37  for(auto& s : strategies_)
38  s->getNextTimeStep(tsc, sh, integratorStatus);
39  }
40 
41  // add strategy to the composite strategy list
42  void addStrategy(const Teuchos::RCP<TimeStepControlStrategy<Scalar> > &strategy){
43  if (Teuchos::nonnull(strategy))
44  strategies_.push_back(strategy);
45  }
46 
48  strategies_.clear();
49  }
50 
51 private:
52  std::vector<Teuchos::RCP<TimeStepControlStrategy<Scalar > > > strategies_;
53 
54 };
55 } // namespace Tempus
56 #endif // Tempus_TimeStepControlStrategy_hpp
std::vector< Teuchos::RCP< TimeStepControlStrategy< Scalar > > > strategies_
virtual void getNextTimeStep(const TimeStepControl< Scalar > tsc, Teuchos::RCP< SolutionHistory< Scalar > > sh, Status &integratorStatus) override
Determine the time step size.
Status
Status for the Integrator, the Stepper and the SolutionState.
TimeStepControl manages the time step size. There several mechanicisms that effect the time step size...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
StepControlStrategy class for TimeStepControl.
void addStrategy(const Teuchos::RCP< TimeStepControlStrategy< Scalar > > &strategy)
StepControlStrategy class for TimeStepControl.