9 #ifndef Tempus_IntegratorObserverBasic_impl_hpp
10 #define Tempus_IntegratorObserverBasic_impl_hpp
12 #include "Tempus_Stepper.hpp"
16 template<
class Scalar>
19 template<
class Scalar>
22 template<
class Scalar>
26 std::time_t begin = std::time(
nullptr);
27 const Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
28 Teuchos::OSTab ostab(out,0,
"ScreenOutput");
29 *out <<
"\nTempus - IntegratorBasic\n"
30 << std::asctime(std::localtime(&begin)) <<
"\n"
31 <<
" Stepper = " << integrator.
getStepper()->description() <<
"\n"
36 <<
"============================================================================\n"
37 <<
" Step Time dt Abs Error Rel Error Order nFail dCompTime"
41 template<
class Scalar>
45 template<
class Scalar>
49 template<
class Scalar>
53 template<
class Scalar>
57 template<
class Scalar>
61 template<
class Scalar>
66 RCP<SolutionStateMetaData<Scalar> > csmd =
69 if ((csmd->getOutputScreen() ==
true) or
70 (csmd->getOutput() ==
true) or
73 const Scalar steppertime = integrator.
getStepperTimer()->totalElapsedTime();
77 const Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
78 Teuchos::OSTab ostab(out,0,
"ScreenOutput");
80 <<std::setw( 6)<<std::setprecision(3)<<csmd->getIStep()
81 <<std::setw(11)<<std::setprecision(3)<<csmd->getTime()
82 <<std::setw(11)<<std::setprecision(3)<<csmd->getDt()
83 <<std::setw(11)<<std::setprecision(3)<<csmd->getErrorAbs()
84 <<std::setw(11)<<std::setprecision(3)<<csmd->getErrorRel()
85 <<std::fixed <<std::setw( 7)<<std::setprecision(1)<<csmd->getOrder()
86 <<std::scientific<<std::setw( 7)<<std::setprecision(3)<<csmd->getNFailures()
87 <<std::setw(11)<<std::setprecision(3)<<steppertime
93 template<
class Scalar>
97 std::string exitStatus;
101 exitStatus =
"Time integration FAILURE!";
103 exitStatus =
"Time integration complete.";
105 std::time_t end = std::time(
nullptr);
107 const Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
108 Teuchos::OSTab ostab(out,0,
"ScreenOutput");
109 *out <<
"============================================================================\n"
110 <<
" Total runtime = " << runtime <<
" sec = "
111 << runtime/60.0 <<
" min\n"
112 << std::asctime(std::localtime(&end))
113 << exitStatus <<
"\n"
118 #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
Observe after checking time step. Observer can still fail the time step here.
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.
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
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.