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: Time Integration and Sensitivity Analysis Package
4 //
5 // Copyright 2017 NTESS and the Tempus contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 //@HEADER
9 
10 #ifndef Tempus_IntegratorObserverComposite_impl_hpp
11 #define Tempus_IntegratorObserverComposite_impl_hpp
12 
14 #include "Tempus_TimeStepControl.hpp"
15 
16 namespace Tempus {
17 
18 template <class Scalar>
20 {
21 }
22 
23 template <class Scalar>
25 {
26 }
27 
28 template <class Scalar>
30  const Integrator<Scalar>& integrator)
31 {
32  for (auto& o : observers_) o->observeStartIntegrator(integrator);
33 }
34 
35 template <class Scalar>
37  const Integrator<Scalar>& integrator)
38 {
39  for (auto& o : observers_) o->observeStartTimeStep(integrator);
40 }
41 
42 template <class Scalar>
44  const Integrator<Scalar>& integrator)
45 {
46  for (auto& o : observers_) o->observeNextTimeStep(integrator);
47 }
48 
49 template <class Scalar>
51  const Integrator<Scalar>& integrator)
52 {
53  for (auto& o : observers_) o->observeBeforeTakeStep(integrator);
54 }
55 
56 template <class Scalar>
58  const Integrator<Scalar>& integrator)
59 {
60  for (auto& o : observers_) o->observeAfterTakeStep(integrator);
61 }
62 
63 template <class Scalar>
65  const Integrator<Scalar>& integrator)
66 {
67  for (auto& o : observers_) o->observeAfterCheckTimeStep(integrator);
68 }
69 
70 template <class Scalar>
72  const Integrator<Scalar>& integrator)
73 {
74  for (auto& o : observers_) o->observeEndTimeStep(integrator);
75 }
76 
77 template <class Scalar>
79  const Integrator<Scalar>& integrator)
80 {
81  for (auto& o : observers_) o->observeEndIntegrator(integrator);
82 }
83 
84 template <class Scalar>
86  const Teuchos::RCP<IntegratorObserver<Scalar> >& observer)
87 {
88  observers_.push_back(observer);
89 }
90 
91 template <class Scalar>
93 {
94  observers_.clear();
95 }
96 
97 } // namespace Tempus
98 #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.