2 #ifndef RYTHMOS_STEP_CONTROL_INFO_HPP
3 #define RYTHMOS_STEP_CONTROL_INFO_HPP
7 #pragma clang system_header
10 #include "Rythmos_StepperSupportTypes.hpp"
17 template<
class Scalar>
18 struct StepControlInfo {
38 template<
class Scalar>
39 std::ostream& operator<<(
40 std::ostream &out,
const StepControlInfo<Scalar> &stepCtrlInfo
45 <<
"stepType = " << toString(stepCtrlInfo.stepType) << endl
46 <<
"stepSize = " << stepCtrlInfo.stepSize << endl
47 <<
"limitedByBreakPoint = " << stepCtrlInfo.limitedByBreakPoint << endl
48 <<
"breakPointType = " << toString(stepCtrlInfo.breakPointType) << endl;
60 template<
class Scalar>
61 StepControlInfo<Scalar>
64 const Scalar &stepSizeTaken
67 typedef Teuchos::ScalarTraits<Scalar> ST;
68 const Scalar zero = ST::zero();
70 stepCtrlInfo.stepSize = stepSizeTaken;
71 if ( trialStepCtrlInfo.stepSize > zero && stepSizeTaken > zero ) {
72 if (stepSizeTaken < trialStepCtrlInfo.stepSize) {
73 stepCtrlInfo.limitedByBreakPoint =
false;
77 stepCtrlInfo.limitedByBreakPoint =
false;
90 #endif // RYTHMOS_STEP_CONTROL_INFO_HPP
StepControlInfo()
Initialize to invalid state.
StepControlInfo< Scalar > stepCtrlInfoTaken(const StepControlInfo< Scalar > &trialStepCtrlInfo, const Scalar &stepSizeTaken)
Return a step control info object for a step actually taken.
Simple struct to aggregate integration/stepper control information.
Scalar stepSize
The size of the time step.
EBreakPointType breakPointType
True if the time integrator should restart when passing over the breakpoint.
bool limitedByBreakPoint
True if step size is limited by a breakpoint.
StepSizeType stepType
The type of time step.