56 Teuchos::RCP<SolutionHistory<Scalar> > solutionHistory,
57 Status & integratorStatus)
override
63 RCP<SolutionState<Scalar> >workingState=solutionHistory->getWorkingState();
64 const Scalar errorAbs = workingState->getErrorAbs();
65 const Scalar errorRel = workingState->getErrorRel();
66 Scalar dt = workingState->getTimeStep();
68 RCP<Teuchos::FancyOStream> out = tsc.getOStream();
69 Teuchos::OSTab ostab(out,1,
"setNextTimeStep");
70 out->setOutputToRootOnly(0);
74 if ( dt != tsc.getInitTimeStep() ) {
75 tsc.printDtChanges(workingState->getIndex(), dt, tsc.getInitTimeStep(),
76 "Resetting constant dt.");
77 dt = tsc.getInitTimeStep();
82 *out <<
"Failure - Stepper failed and can not change time step size!\n"
83 <<
" Time step type == CONSTANT_STEP_SIZE\n" << std::endl;
89 if (errorAbs > tsc.getMaxAbsError()) {
90 *out <<
"Failure - Absolute error failed and can not change time step!\n"
91 <<
" Time step type == CONSTANT_STEP_SIZE\n"
92 <<
" (errorAbs ="<<errorAbs<<
") > (errorMaxAbs ="
93 << tsc.getMaxAbsError() <<
")" << std::endl;
99 if (errorRel > tsc.getMaxRelError()) {
100 *out <<
"Failure - Relative error failed and can not change time step!\n"
101 <<
" Time step type == CONSTANT_STEP_SIZE\n"
102 <<
" (errorRel ="<<errorRel<<
") > (errorMaxRel ="
103 << tsc.getMaxRelError() <<
")" << std::endl;
104 integratorStatus =
FAILED;
109 workingState->setTimeStep(dt);
112 const Scalar initTime = tsc.getInitTime();
113 const int initIndex = tsc.getInitIndex();
114 const int index = workingState->getIndex();
115 const Scalar time = (index-initIndex)*dt + initTime;
116 workingState->setTime(time);
126 const Teuchos::EVerbosityLevel verbLevel)
const override
128 auto l_out = Teuchos::fancyOStream( out.getOStream() );
129 Teuchos::OSTab ostab(*l_out, 2, this->
description());
130 l_out->setOutputToRootOnly(0);
132 *l_out <<
"\n--- " << this->
description() <<
" ---" << std::endl;
134 if (Teuchos::as<int>(verbLevel) >= Teuchos::as<int>(Teuchos::VERB_MEDIUM)) {
136 <<
" Step Type = " << this->
getStepType() << std::endl
139 *l_out << std::string(this->
description().length()+8,
'-') <<std::endl;