9 #ifndef Tempus_StepperRKObserverLogging_impl_hpp
10 #define Tempus_StepperRKObserverLogging_impl_hpp
13 #include "Tempus_TimeStepControl.hpp"
17 template<
class Scalar>
19 : nameObserveBeginTakeStep_ (
"observeBeginTakeStep"),
20 nameObserveBeginStage_ (
"observeBeginStage"),
21 nameObserveBeforeImplicitExplicitly_ (
"observeBeforeImplicitExplicitly"),
22 nameObserveBeforeSolve_ (
"observeBeforeSolve"),
23 nameObserveAfterSolve_ (
"observeAfterSolve"),
24 nameObserveBeforeExplicit_ (
"observeBeforeExplicit"),
25 nameObserveEndStage_ (
"observeEndStage"),
26 nameObserveEndTakeStep_ (
"observeEndTakeStep")
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>
41 { logCall(nameObserveBeginTakeStep_); }
43 template<
class Scalar>
48 { logCall(nameObserveBeginStage_); }
50 template<
class Scalar>
55 { logCall(nameObserveBeforeImplicitExplicitly_); }
57 template<
class Scalar>
62 { logCall(nameObserveBeforeSolve_); }
64 template<
class Scalar>
69 { logCall(nameObserveAfterSolve_); }
71 template<
class Scalar>
76 { logCall(nameObserveBeforeExplicit_); }
78 template<
class Scalar>
83 { logCall(nameObserveEndStage_); }
85 template<
class Scalar>
90 { logCall(nameObserveEndTakeStep_); }
92 template<
class Scalar>
95 (*counters_)[nameObserveBeginTakeStep_ ] = 0;
96 (*counters_)[nameObserveBeginStage_ ] = 0;
97 (*counters_)[nameObserveBeforeImplicitExplicitly_ ] = 0;
98 (*counters_)[nameObserveBeforeSolve_ ] = 0;
99 (*counters_)[nameObserveAfterSolve_ ] = 0;
100 (*counters_)[nameObserveBeforeExplicit_ ] = 0;
101 (*counters_)[nameObserveEndStage_ ] = 0;
102 (*counters_)[nameObserveEndTakeStep_ ] = 0;
106 template<
class Scalar>
107 Teuchos::RCP<const std::map<std::string,int> >
109 {
return counters_; }
111 template<
class Scalar>
112 Teuchos::RCP<const std::list<std::string> >
116 template<
class Scalar>
119 (*counters_)[call] += 1;
120 order_->push_back(call);
124 #endif // Tempus_StepperRKObserverLogging_impl_hpp
void logCall(const std::string call) const
Asserts next call on the stack is correct and removes from stack.
Teuchos::RCP< std::list< std::string > > order_
Teuchos::RCP< std::map< std::string, int > > counters_
virtual void observeBeginStage(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
2.) Observe Stepper at beginning of each stage.
Teuchos::RCP< const std::map< std::string, int > > getCounters()
Thyra Base interface for time steppers.
StepperRKObserverLogging()
Constructor.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void observeBeforeExplicit(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
6.) Observe Stepper before Explicit evaluation of Implicit ODE ME (IMEX).
Teuchos::RCP< const std::list< std::string > > getOrder()
virtual ~StepperRKObserverLogging()
Destructor.
virtual void observeBeforeImplicitExplicitly(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
3.) Observe Stepper before Explicit evaluation of Implicit ODE ME (IMEX).
virtual void observeBeginTakeStep(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
1.) Observe Stepper at beginning of takeStep.
virtual void observeAfterSolve(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
5.) Observe Stepper after nonlinear solve (DIRK/IMEX).
virtual void observeEndStage(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
7.) Observe Stepper at end of each stage.
virtual void observeEndTakeStep(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
8.) Observe Stepper at end of takeStep.
virtual void observeBeforeSolve(Teuchos::RCP< SolutionHistory< Scalar > >, Stepper< Scalar > &) override
4.) Observe Stepper before nonlinear solve (DIRK/IMEX).