Tempus
Version of the Day
Time Integration
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Tempus_IntegratorObserverSubcycling_impl.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ****************************************************************************
3
// Tempus: Copyright (2017) Sandia Corporation
4
//
5
// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6
// ****************************************************************************
7
// @HEADER
8
9
#ifndef Tempus_IntegratorObserverSubcycling_impl_hpp
10
#define Tempus_IntegratorObserverSubcycling_impl_hpp
11
12
#include "Tempus_Stepper.hpp"
13
14
namespace
Tempus
{
15
16
template
<
class
Scalar>
17
IntegratorObserverSubcycling<Scalar>::IntegratorObserverSubcycling
(){}
18
19
template
<
class
Scalar>
20
IntegratorObserverSubcycling<Scalar>::~IntegratorObserverSubcycling
(){}
21
22
template
<
class
Scalar>
23
void
IntegratorObserverSubcycling<Scalar>::
24
observeStartIntegrator
(
const
Integrator<Scalar>
& integrator){
25
26
const
Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
27
out->setOutputToRootOnly(0);
28
Teuchos::OSTab ostab(out, 0,
"ScreenOutput"
);
29
*out <<
"\n Begin Subcycling -------------------------------------------------------\n"
;
30
// << " Step Time dt Abs Error Rel Error Order nFail dCompTime"
31
// << std::endl;
32
}
33
34
template
<
class
Scalar>
35
void
IntegratorObserverSubcycling<Scalar>::
36
observeStartTimeStep
(
const
Integrator<Scalar>
&
/* integrator */
){}
37
38
template
<
class
Scalar>
39
void
IntegratorObserverSubcycling<Scalar>::
40
observeNextTimeStep
(
const
Integrator<Scalar>
&
/* integrator */
){}
41
42
template
<
class
Scalar>
43
void
IntegratorObserverSubcycling<Scalar>::
44
observeBeforeTakeStep
(
const
Integrator<Scalar>
&
/* integrator */
){}
45
46
template
<
class
Scalar>
47
void
IntegratorObserverSubcycling<Scalar>::
48
observeAfterTakeStep
(
const
Integrator<Scalar>
&
/* integrator */
){}
49
50
template
<
class
Scalar>
51
void
IntegratorObserverSubcycling<Scalar>::
52
observeAfterCheckTimeStep
(
const
Integrator<Scalar>
&
/* integrator */
){}
53
54
template
<
class
Scalar>
55
void
IntegratorObserverSubcycling<Scalar>::
56
observeEndTimeStep
(
const
Integrator<Scalar>
& integrator){
57
58
using
Teuchos::RCP;
59
auto
cs = integrator.
getSolutionHistory
()->getCurrentState();
60
61
if
((cs->getOutputScreen() ==
true
) ||
62
(cs->getOutput() ==
true
) ||
63
(cs->getTime() == integrator.
getTimeStepControl
()->getFinalTime())) {
64
65
const
Scalar steppertime = integrator.
getStepperTimer
()->totalElapsedTime();
66
// reset the stepper timer
67
integrator.
getStepperTimer
()->reset();
68
69
const
Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
70
out->setOutputToRootOnly(0);
71
Teuchos::OSTab ostab(out, 0,
"ScreenOutput"
);
72
*out<<std::scientific
73
<<std::setw( 6)<<std::setprecision(3)<<cs->getIndex()
74
<<std::setw(11)<<std::setprecision(3)<<cs->getTime()
75
<<std::setw(11)<<std::setprecision(3)<<cs->getTimeStep()
76
<<std::setw(11)<<std::setprecision(3)<<cs->getErrorAbs()
77
<<std::setw(11)<<std::setprecision(3)<<cs->getErrorRel()
78
<<std::fixed <<std::setw( 7)<<std::setprecision(1)<<cs->getOrder()
79
<<std::scientific<<std::setw( 7)<<std::setprecision(3)<<cs->getNFailures()
80
<<std::setw(11)<<std::setprecision(3)<<steppertime
81
<<std::endl;
82
}
83
84
}
85
86
template
<
class
Scalar>
87
void
IntegratorObserverSubcycling<Scalar>::
88
observeEndIntegrator
(
const
Integrator<Scalar>
& integrator){
89
90
const
Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
91
out->setOutputToRootOnly(0);
92
Teuchos::OSTab ostab(out, 0,
"ScreenOutput"
);
93
*out <<
" End Subcycling ---------------------------------------------------------\n\n"
;
94
}
95
96
}
// namespace Tempus
97
#endif
// Tempus_IntegratorObserverSubcycling_impl_hpp
Tempus::IntegratorObserverSubcycling::IntegratorObserverSubcycling
IntegratorObserverSubcycling()
Constructor.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:17
Tempus::IntegratorObserverSubcycling::observeEndIntegrator
virtual void observeEndIntegrator(const Integrator< Scalar > &integrator) override
Observe the end of the time integrator.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:88
Tempus::IntegratorObserverSubcycling::~IntegratorObserverSubcycling
virtual ~IntegratorObserverSubcycling()
Destructor.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:20
Tempus::IntegratorObserverSubcycling::observeAfterCheckTimeStep
virtual void observeAfterCheckTimeStep(const Integrator< Scalar > &integrator) override
Observe after checking time step. Observer can still fail the time step here.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:52
Tempus::IntegratorObserverSubcycling::observeStartTimeStep
virtual void observeStartTimeStep(const Integrator< Scalar > &integrator) override
Observe the beginning of the time step loop.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:36
Tempus::IntegratorObserverSubcycling::observeEndTimeStep
virtual void observeEndTimeStep(const Integrator< Scalar > &integrator) override
Observe the end of the time step loop.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:56
Tempus::IntegratorObserverSubcycling::observeBeforeTakeStep
virtual void observeBeforeTakeStep(const Integrator< Scalar > &integrator) override
Observe before Stepper takes step.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:44
Tempus::IntegratorObserverSubcycling::observeAfterTakeStep
virtual void observeAfterTakeStep(const Integrator< Scalar > &integrator) override
Observe after Stepper takes step.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:48
Tempus::IntegratorObserverSubcycling::observeNextTimeStep
virtual void observeNextTimeStep(const Integrator< Scalar > &integrator) override
Observe after the next time step size is selected.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:40
Tempus::IntegratorObserverSubcycling::observeStartIntegrator
virtual void observeStartIntegrator(const Integrator< Scalar > &integrator) override
Observe the beginning of the time integrator.
Definition
Tempus_IntegratorObserverSubcycling_impl.hpp:24
Tempus::Integrator
Thyra Base interface for time integrators. Time integrators are designed to advance the solution from...
Definition
Tempus_Integrator.hpp:65
Tempus::Integrator::getSolutionHistory
virtual Teuchos::RCP< const SolutionHistory< Scalar > > getSolutionHistory() const =0
Returns the SolutionHistory for this Integrator.
Tempus::Integrator::getTimeStepControl
virtual Teuchos::RCP< const TimeStepControl< Scalar > > getTimeStepControl() const =0
Returns the TimeStepControl for this Integrator.
Tempus::Integrator::getStepperTimer
virtual Teuchos::RCP< Teuchos::Time > getStepperTimer() const =0
Tempus
Definition
Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp:21
Generated by
1.17.0