12 #include "Tempus_TimeStepControl.hpp"
16 namespace Tempus_Unit_Test {
21 using Teuchos::rcp_const_cast;
22 using Teuchos::rcp_dynamic_cast;
23 using Teuchos::sublist;
39 tscs->setConstantTimeStep(0.989);
51 0.123,
"Full_Construction_Test"));
64 auto pl = Tempus::getTimeStepControlStrategyConstantPL<double>();
67 pl->set<
double>(
"Time Step", 0.02);
69 auto tscsc = Tempus::createTimeStepControlStrategyConstant<double>(pl);
82 double initTime = 1.0;
87 auto inArgsIC = model->getNominalValues();
90 auto icState = Tempus::createSolutionStateX<double>(icSolution);
92 solutionHistory->addState(icState);
93 solutionHistory->getCurrentState()->setTimeStep(0.9);
94 solutionHistory->getCurrentState()->setTime(initTime);
95 solutionHistory->getCurrentState()->setIndex(initIndex);
99 tsc->setTimeStepControlStrategy(tscs);
100 tsc->setInitTime(initTime);
101 tsc->setFinalTime(100.0);
102 tsc->setMinTimeStep(0.01);
103 tsc->setInitTimeStep(0.02);
104 tsc->setMaxTimeStep(0.05);
105 tsc->setInitIndex(initIndex);
106 tsc->setFinalIndex(100);
112 solutionHistory->initWorkingState();
114 tsc->setNextTimeStep(solutionHistory, status);
117 auto workingState = solutionHistory->getWorkingState();
128 auto pl = tscsc->getValidParameters();
130 TEST_COMPARE(pl->get<std::string>(
"Strategy Type"), ==,
"Constant");
134 std::ostringstream unusedParameters;
135 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)