Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperObserverComposite_impl.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_StepperObserverComposite_impl_hpp
10 #define Tempus_StepperObserverComposite_impl_hpp
11 
13 #include "Tempus_TimeStepControl.hpp"
14 
15 namespace Tempus {
16 
17 template<class Scalar>
19 
20 template<class Scalar>
22 
23 template<class Scalar>
26  Stepper<Scalar> & stepper)
27 {
28  for(auto& o : observers_)
29  o->observeBeginTakeStep(sh,stepper);
30 }
31 
32 template<class Scalar>
35  Stepper<Scalar> & stepper)
36 {
37  for(auto& o : observers_)
38  o->observeEndTakeStep(sh,stepper);
39 }
40 
41 template<class Scalar>
43 addObserver(const Teuchos::RCP<StepperObserver<Scalar> > &observer)
44 {
45  observers_.push_back(observer);
46 }
47 
48 template<class Scalar>
50 clearObservers() { observers_.clear();}
51 
52 } // namespace Tempus
53 #endif // Tempus_StepperObserverComposite_impl_hpp
void addObserver(const Teuchos::RCP< StepperObserver< Scalar > > &observer)
Thyra Base interface for time steppers.
virtual void observeBeginTakeStep(Teuchos::RCP< SolutionHistory< Scalar > > sh, Stepper< Scalar > &stepper) override
Observe the beginning of the time integrator.
StepperObserver class for Stepper class.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void observeEndTakeStep(Teuchos::RCP< SolutionHistory< Scalar > > sh, Stepper< Scalar > &stepper) override
Observe the beginning of the time step loop.