Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
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
16namespace Tempus {
17
18template <class Scalar>
22
23template <class Scalar>
27
28template <class Scalar>
30 const Integrator<Scalar>& integrator)
31{
32 for (auto& o : observers_) o->observeStartIntegrator(integrator);
33}
34
35template <class Scalar>
37 const Integrator<Scalar>& integrator)
38{
39 for (auto& o : observers_) o->observeStartTimeStep(integrator);
40}
41
42template <class Scalar>
44 const Integrator<Scalar>& integrator)
45{
46 for (auto& o : observers_) o->observeNextTimeStep(integrator);
47}
48
49template <class Scalar>
51 const Integrator<Scalar>& integrator)
52{
53 for (auto& o : observers_) o->observeBeforeTakeStep(integrator);
54}
55
56template <class Scalar>
58 const Integrator<Scalar>& integrator)
59{
60 for (auto& o : observers_) o->observeAfterTakeStep(integrator);
61}
62
63template <class Scalar>
65 const Integrator<Scalar>& integrator)
66{
67 for (auto& o : observers_) o->observeAfterCheckTimeStep(integrator);
68}
69
70template <class Scalar>
72 const Integrator<Scalar>& integrator)
73{
74 for (auto& o : observers_) o->observeEndTimeStep(integrator);
75}
76
77template <class Scalar>
79 const Integrator<Scalar>& integrator)
80{
81 for (auto& o : observers_) o->observeEndIntegrator(integrator);
82}
83
84template <class Scalar>
86 const Teuchos::RCP<IntegratorObserver<Scalar> >& observer)
87{
88 observers_.push_back(observer);
89}
90
91template <class Scalar>
93{
94 observers_.clear();
95}
96
97} // namespace Tempus
98#endif // Tempus_IntegratorObserverComposite_impl_hpp
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator) override
Observe after Stepper takes step.
virtual void observeEndTimeStep(const Integrator< Scalar > &integrator) override
Observe the end of the time step loop.
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator) override
Observe after the next time step size is selected.
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator) override
Observe the beginning of the time step loop.
void addObserver(const Teuchos::RCP< IntegratorObserver< Scalar > > &observer)
virtual void observeAfterCheckTimeStep(const Integrator< Scalar > &integrator) override
Observe after checking time step.
IntegratorObserver class for time integrators.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...