10 #ifndef Tempus_IntegratorObserverBasic_impl_hpp
11 #define Tempus_IntegratorObserverBasic_impl_hpp
13 #include "Tempus_Stepper.hpp"
17 template <
class Scalar>
22 template <
class Scalar>
27 template <
class Scalar>
31 std::time_t begin = std::time(
nullptr);
35 *out <<
"\nTempus - IntegratorBasic\n"
36 << std::asctime(std::localtime(&begin)) <<
"\n"
37 <<
" Stepper = " << integrator.
getStepper()->description() <<
"\n"
38 <<
" Simulation Time Range ["
41 <<
" Simulation Index Range ["
44 <<
"===================================================================="
46 <<
" Step Time dt Abs Error Rel Error Order nFail "
51 template <
class Scalar>
57 template <
class Scalar>
63 template <
class Scalar>
69 template <
class Scalar>
75 template <
class Scalar>
81 template <
class Scalar>
88 if ((cs->getOutputScreen() ==
true) || (cs->getOutput() ==
true) ||
97 *out << std::scientific << std::setw(6) << std::setprecision(3)
98 << cs->getIndex() << std::setw(11) << std::setprecision(3)
99 << cs->getTime() << std::setw(11) << std::setprecision(3)
100 << cs->getTimeStep() << std::setw(11) << std::setprecision(3)
101 << cs->getErrorAbs() << std::setw(11) << std::setprecision(3)
102 << cs->getErrorRel() << std::fixed << std::setw(7)
103 << std::setprecision(1) << cs->getOrder() << std::scientific
104 << std::setw(7) << std::setprecision(3) << cs->getNFailures()
105 << std::setw(11) << std::setprecision(3) << steppertime << std::endl;
109 template <
class Scalar>
113 std::string exitStatus;
118 exitStatus =
"Time integration FAILURE!";
121 exitStatus =
"Time integration complete.";
123 std::time_t end = std::time(
nullptr);
128 *out <<
"===================================================================="
130 <<
" Total runtime = " << runtime <<
" sec = " << runtime / 60.0
132 << std::asctime(std::localtime(&end)) <<
"\nNumber of Accepted Steps = "
134 <<
"\nNumber of Failures = "
138 ->getNRunningFailures()
140 << exitStatus <<
"\n"
145 #endif // Tempus_IntegratorObserverBasic_impl_hpp
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer() const =0
virtual Teuchos::RCP< Teuchos::Time > getIntegratorTimer() const =0
Returns the IntegratorTimer_ for this Integrator.
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator) override
Observe after the next time step size is selected.
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl() const =0
Returns the TimeStepControl for this Integrator.
IntegratorObserverBasic()
Constructor.
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
virtual Tempus::Status getStatus() const =0
Get the Status.
virtual void observeAfterCheckTimeStep(const Integrator< Scalar > &integrator) override
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator) override
Observe the beginning of the time step loop.
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.
double totalElapsedTime(bool readCurrentTime=false) const
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
virtual RCP< FancyOStream > getOStream() const
virtual Teuchos::RCP< Stepper< Scalar > > getStepper() const =0
Get the stepper.
virtual ~IntegratorObserverBasic()
Destructor.
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const =0
Returns the SolutionHistory for this Integrator.