Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_IntegratorObserverLogging_decl.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_IntegratorObserverLogging_decl_hpp
11#define Tempus_IntegratorObserverLogging_decl_hpp
12
13#include "Tempus_config.hpp"
15#include <list>
16
17namespace Tempus {
18
24template <class Scalar>
26 : virtual public Tempus::IntegratorObserver<Scalar> {
27 public:
30
33
35
36
37 virtual void observeStartIntegrator(
38 const Integrator<Scalar>& integrator) override;
39
41 virtual void observeStartTimeStep(
42 const Integrator<Scalar>& integrator) override;
43
45 virtual void observeNextTimeStep(
46 const Integrator<Scalar>& integrator) override;
47
49 virtual void observeBeforeTakeStep(
50 const Integrator<Scalar>& integrator) override;
51
53 virtual void observeAfterTakeStep(
54 const Integrator<Scalar>& integrator) override;
55
57 virtual void observeAfterCheckTimeStep(
58 const Integrator<Scalar>& integrator) override;
59
61 virtual void observeEndTimeStep(
62 const Integrator<Scalar>& integrator) override;
63
65 virtual void observeEndIntegrator(
66 const Integrator<Scalar>& integrator) override;
68
69 void resetLogCounters();
70
71 Teuchos::RCP<const std::map<std::string, int> > getCounters();
72
73 Teuchos::RCP<const std::list<std::string> > getOrder();
74
79 const std::string nameObserveStartIntegrator_;
80 const std::string nameObserveStartTimeStep_;
81 const std::string nameObserveNextTimeStep_;
82 const std::string nameObserveBeforeTakeStep_;
83 const std::string nameObserveAfterTakeStep_;
85 const std::string nameObserveEndTimeStep_;
86 const std::string nameObserveEndIntegrator_;
88
89 private:
95 void logCall(const std::string call) const;
96
97 Teuchos::RCP<std::map<std::string, int> > counters_;
98 Teuchos::RCP<std::list<std::string> > order_;
99};
100
101} // namespace Tempus
102#endif // Tempus_IntegratorObserverLogging_decl_hpp
This observer logs calls to observer functions. This observer simply logs and counts the calls to eac...
Teuchos::RCP< const std::list< std::string > > getOrder()
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator) override
Observe after Stepper takes step.
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.
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
Teuchos::RCP< const std::map< std::string, int > > getCounters()
void logCall(const std::string call) const
Asserts next call on the stack is correct and removes from stack.
Teuchos::RCP< std::map< std::string, int > > counters_
Teuchos::RCP< std::list< std::string > > order_
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
virtual void observeEndTimeStep(const Integrator< Scalar > &integrator) override
Observe the end of the time step loop.
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...