11 #include "Tempus_TimeStepControl.hpp"
15 namespace Tempus_Unit_Test {
20 using Teuchos::rcp_const_cast;
21 using Teuchos::rcp_dynamic_cast;
22 using Teuchos::sublist;
38 tscs->setConstantTimeStep(0.989);
50 0.123,
"Full_Construction_Test"));
63 auto pl = Tempus::getTimeStepControlStrategyConstantPL<double>();
66 pl->set<
double>(
"Time Step", 0.02);
68 auto tscsc = Tempus::createTimeStepControlStrategyConstant<double>(pl);
81 double initTime = 1.0;
86 auto inArgsIC = model->getNominalValues();
89 auto icState = Tempus::createSolutionStateX<double>(icSolution);
91 solutionHistory->addState(icState);
92 solutionHistory->getCurrentState()->setTimeStep(0.9);
93 solutionHistory->getCurrentState()->setTime(initTime);
94 solutionHistory->getCurrentState()->setIndex(initIndex);
98 tsc->setTimeStepControlStrategy(tscs);
99 tsc->setInitTime(initTime);
100 tsc->setFinalTime(100.0);
101 tsc->setMinTimeStep(0.01);
102 tsc->setInitTimeStep(0.02);
103 tsc->setMaxTimeStep(0.05);
104 tsc->setInitIndex(initIndex);
105 tsc->setFinalIndex(100);
111 solutionHistory->initWorkingState();
113 tsc->setNextTimeStep(solutionHistory, status);
116 auto workingState = solutionHistory->getWorkingState();
127 auto pl = tscsc->getValidParameters();
129 TEST_COMPARE(pl->get<std::string>(
"Strategy Type"), ==,
"Constant");
133 std::ostringstream unusedParameters;
134 pl->unused(unusedParameters);
#define TEST_COMPARE(v1, comp, v2)
#define TEST_FLOATING_EQUALITY(v1, v2, tol)
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Status
Status for the Integrator, the Stepper and the SolutionState.
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
StepControlStrategy class for TimeStepControl.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)