11 #include "Tempus_TimeStepControl.hpp"
16 namespace Tempus_Unit_Test {
20 using Teuchos::rcp_const_cast;
21 using Teuchos::rcp_dynamic_cast;
23 using Teuchos::sublist;
52 0.123,
"Full_Construction_Test"));
66 auto pl = Tempus::getTimeStepControlStrategyConstantPL<double>();
69 pl->set<
double>(
"Time Step", 0.02);
71 auto tscsc = Tempus::createTimeStepControlStrategyConstant<double>(pl);
85 double initTime = 1.0;
90 auto inArgsIC = model->getNominalValues();
92 auto icState = Tempus::createSolutionStateX<double>(icSolution);
94 solutionHistory->addState(icState);
95 solutionHistory->getCurrentState()->setTimeStep(0.9);
96 solutionHistory->getCurrentState()->setTime(initTime);
97 solutionHistory->getCurrentState()->setIndex(initIndex);
101 tsc->setTimeStepControlStrategy(tscs);
102 tsc->setInitTime(initTime);
103 tsc->setFinalTime(100.0);
104 tsc->setMinTimeStep(0.01);
105 tsc->setInitTimeStep(0.02);
106 tsc->setMaxTimeStep(0.05);
107 tsc->setInitIndex(initIndex);
108 tsc->setFinalIndex(100);
114 solutionHistory->initWorkingState();
116 tsc->setNextTimeStep(solutionHistory, status);
119 auto workingState = solutionHistory->getWorkingState();
131 auto pl = tscsc->getValidParameters();
133 TEST_COMPARE ( pl->get<std::string>(
"Strategy Type"), ==,
"Constant");
137 std::ostringstream unusedParameters;
138 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)