10 #ifndef Tempus_IntegratorObserverLogging_impl_hpp
11 #define Tempus_IntegratorObserverLogging_impl_hpp
14 #include "Tempus_TimeStepControl.hpp"
18 template <
class Scalar>
20 : nameObserveStartIntegrator_(
"observeStartIntegrator"),
21 nameObserveStartTimeStep_(
"observeStartTimeStep"),
22 nameObserveNextTimeStep_(
"observeNextTimeStep"),
23 nameObserveBeforeTakeStep_(
"observeBeforeTakeStep"),
24 nameObserveAfterTakeStep_(
"observeAfterTakeStep"),
25 nameObserveAfterCheckTimeStep_(
"observeAfterCheckTimeStep"),
26 nameObserveEndTimeStep_(
"observeEndTimeStep"),
27 nameObserveEndIntegrator_(
"observeEndIntegrator")
34 template <
class Scalar>
39 template <
class Scalar>
43 logCall(nameObserveStartIntegrator_);
46 template <
class Scalar>
50 logCall(nameObserveStartTimeStep_);
53 template <
class Scalar>
57 logCall(nameObserveNextTimeStep_);
60 template <
class Scalar>
64 logCall(nameObserveBeforeTakeStep_);
67 template <
class Scalar>
71 logCall(nameObserveAfterTakeStep_);
74 template <
class Scalar>
78 logCall(nameObserveAfterCheckTimeStep_);
81 template <
class Scalar>
85 logCall(nameObserveEndTimeStep_);
88 template <
class Scalar>
92 logCall(nameObserveEndIntegrator_);
95 template <
class Scalar>
98 (*counters_)[nameObserveStartIntegrator_] = 0;
99 (*counters_)[nameObserveStartTimeStep_] = 0;
100 (*counters_)[nameObserveNextTimeStep_] = 0;
101 (*counters_)[nameObserveBeforeTakeStep_] = 0;
102 (*counters_)[nameObserveAfterTakeStep_] = 0;
103 (*counters_)[nameObserveAfterCheckTimeStep_] = 0;
104 (*counters_)[nameObserveEndTimeStep_] = 0;
105 (*counters_)[nameObserveEndIntegrator_] = 0;
109 template <
class Scalar>
116 template <
class Scalar>
123 template <
class Scalar>
126 (*counters_)[call] += 1;
127 order_->push_back(call);
131 #endif // Tempus_IntegratorObserverLogging_impl_hpp
Teuchos::RCP< const std::list< std::string > > getOrder()
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator) override
Observe after the next time step size is selected.
IntegratorObserverLogging()
Constructor.
Teuchos::RCP< std::list< std::string > > order_
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
Teuchos::RCP< std::map< std::string, int > > counters_
void logCall(const std::string call) const
Asserts next call on the stack is correct and removes from stack.
virtual void observeAfterCheckTimeStep(const Integrator< Scalar > &integrator) override
Observe after checking time step.
virtual void observeEndTimeStep(const Integrator< Scalar > &integrator) override
Observe the end of the time step loop.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual ~IntegratorObserverLogging()
Destructor.
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator) override
Observe after Stepper takes step.
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
Teuchos::RCP< const std::map< std::string, int > > getCounters()
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator) override
Observe the beginning of the time step loop.