Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_IntegratorObserverComposite_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_IntegratorObserverComposite_impl_hpp
10 #define Tempus_IntegratorObserverComposite_impl_hpp
11 
13 #include "Tempus_TimeStepControl.hpp"
14 
15 namespace Tempus {
16 
17 template <class Scalar>
19 {
20 }
21 
22 template <class Scalar>
24 {
25 }
26 
27 template <class Scalar>
29  const Integrator<Scalar>& integrator)
30 {
31  for (auto& o : observers_) o->observeStartIntegrator(integrator);
32 }
33 
34 template <class Scalar>
36  const Integrator<Scalar>& integrator)
37 {
38  for (auto& o : observers_) o->observeStartTimeStep(integrator);
39 }
40 
41 template <class Scalar>
43  const Integrator<Scalar>& integrator)
44 {
45  for (auto& o : observers_) o->observeNextTimeStep(integrator);
46 }
47 
48 template <class Scalar>
50  const Integrator<Scalar>& integrator)
51 {
52  for (auto& o : observers_) o->observeBeforeTakeStep(integrator);
53 }
54 
55 template <class Scalar>
57  const Integrator<Scalar>& integrator)
58 {
59  for (auto& o : observers_) o->observeAfterTakeStep(integrator);
60 }
61 
62 template <class Scalar>
64  const Integrator<Scalar>& integrator)
65 {
66  for (auto& o : observers_) o->observeAfterCheckTimeStep(integrator);
67 }
68 
69 template <class Scalar>
71  const Integrator<Scalar>& integrator)
72 {
73  for (auto& o : observers_) o->observeEndTimeStep(integrator);
74 }
75 
76 template <class Scalar>
78  const Integrator<Scalar>& integrator)
79 {
80  for (auto& o : observers_) o->observeEndIntegrator(integrator);
81 }
82 
83 template <class Scalar>
85  const Teuchos::RCP<IntegratorObserver<Scalar> >& observer)
86 {
87  observers_.push_back(observer);
88 }
89 
90 template <class Scalar>
92 {
93  observers_.clear();
94 }
95 
96 } // namespace Tempus
97 #endif // Tempus_IntegratorObserverComposite_impl_hpp
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
void addObserver(const Teuchos::RCP< IntegratorObserver< Scalar > > &observer)
virtual void observeEndTimeStep(const Integrator< Scalar > &integrator) override
Observe the end of the time step loop.
IntegratorObserver class for time integrators.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
virtual void observeAfterCheckTimeStep(const Integrator< Scalar > &integrator) override
Observe after checking time step.
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator) override
Observe after Stepper takes step.
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator) override
Observe the beginning of the time step loop.
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator) override
Observe after the next time step size is selected.