Tempus  Version of the Day
Time Integration
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
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
StepControlStrategy class for TimeStepControl.
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.
void addStrategy(const Teuchos::RCP< TimeStepControlStrategy< Scalar > > &strategy)
StepControlStrategy class for TimeStepControl.
TimeStepControl manages the time step size. There several mechanicisms that effect the time step size...
Status
Status for the Integrator, the Stepper and the SolutionState.