9 #ifndef Tempus_IntegratorObserverLogging_impl_hpp
10 #define Tempus_IntegratorObserverLogging_impl_hpp
13 #include "Tempus_TimeStepControl.hpp"
17 template<
class Scalar>
19 : nameObserveStartIntegrator_ (
"observeStartIntegrator" ),
20 nameObserveStartTimeStep_ (
"observeStartTimeStep" ),
21 nameObserveNextTimeStep_ (
"observeNextTimeStep" ),
22 nameObserveBeforeTakeStep_ (
"observeBeforeTakeStep" ),
23 nameObserveAfterTakeStep_ (
"observeAfterTakeStep" ),
24 nameObserveAfterCheckTimeStep_(
"observeAfterCheckTimeStep"),
25 nameObserveEndTimeStep_ (
"observeEndTimeStep" ),
26 nameObserveEndIntegrator_ (
"observeEndIntegrator" )
28 counters_ = Teuchos::rcp(
new std::map<std::string,int>);
29 order_ = Teuchos::rcp(
new std::list<std::string>);
33 template<
class Scalar>
36 template<
class Scalar>
39 { logCall(nameObserveStartIntegrator_); }
41 template<
class Scalar>
44 { logCall(nameObserveStartTimeStep_); }
46 template<
class Scalar>
49 { logCall(nameObserveNextTimeStep_); }
51 template<
class Scalar>
54 { logCall(nameObserveBeforeTakeStep_); }
56 template<
class Scalar>
59 { logCall(nameObserveAfterTakeStep_); }
61 template<
class Scalar>
64 { logCall(nameObserveAfterCheckTimeStep_); }
66 template<
class Scalar>
69 { logCall(nameObserveEndTimeStep_); }
71 template<
class Scalar>
74 { logCall(nameObserveEndIntegrator_); }
76 template<
class Scalar>
79 (*counters_)[nameObserveStartIntegrator_ ] = 0;
80 (*counters_)[nameObserveStartTimeStep_ ] = 0;
81 (*counters_)[nameObserveNextTimeStep_ ] = 0;
82 (*counters_)[nameObserveBeforeTakeStep_ ] = 0;
83 (*counters_)[nameObserveAfterTakeStep_ ] = 0;
84 (*counters_)[nameObserveAfterCheckTimeStep_] = 0;
85 (*counters_)[nameObserveEndTimeStep_ ] = 0;
86 (*counters_)[nameObserveEndIntegrator_ ] = 0;
90 template<
class Scalar>
91 Teuchos::RCP<const std::map<std::string,int> >
95 template<
class Scalar>
96 Teuchos::RCP<const std::list<std::string> >
100 template<
class Scalar>
103 (*counters_)[call] += 1;
104 order_->push_back(call);
108 #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.
Teuchos::RCP< std::list< std::string > > order_
Teuchos::RCP< std::map< std::string, int > > counters_
IntegratorObserverLogging()
Constructor.
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
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.
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.