12 #include "Teuchos_DefaultComm.hpp"
14 #include "Thyra_VectorStdOps.hpp"
16 #include "Tempus_StepperFactory.hpp"
17 #include "Tempus_TimeStepControl.hpp"
21 #include "../TestModels/SinCosModel.hpp"
22 #include "../TestModels/DahlquistTestModel.hpp"
23 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
28 namespace Tempus_Unit_Test {
32 using Teuchos::rcp_const_cast;
33 using Teuchos::rcp_dynamic_cast;
35 using Teuchos::sublist;
36 using Teuchos::getParametersFromXmlFile;
65 0.123,
"Full_Construction_Test"));
79 auto pl = Tempus::getTimeStepControlStrategyConstantPL<double>();
82 pl->set<
double>(
"Time Step", 0.02);
84 auto tscsc = Tempus::createTimeStepControlStrategyConstant<double>(pl);
98 double initTime = 1.0;
103 auto inArgsIC = model->getNominalValues();
105 auto icState = Tempus::createSolutionStateX<double>(icSolution);
107 solutionHistory->addState(icState);
108 solutionHistory->getCurrentState()->setTimeStep(0.9);
109 solutionHistory->getCurrentState()->setTime(initTime);
110 solutionHistory->getCurrentState()->setIndex(initIndex);
114 tsc->setTimeStepControlStrategy(tscs);
115 tsc->setInitTime(initTime);
116 tsc->setFinalTime(100.0);
117 tsc->setMinTimeStep(0.01);
118 tsc->setInitTimeStep(0.02);
119 tsc->setMaxTimeStep(0.05);
120 tsc->setInitIndex(initIndex);
121 tsc->setFinalIndex(100);
127 solutionHistory->initWorkingState();
129 tsc->setNextTimeStep(solutionHistory, status);
132 auto workingState = solutionHistory->getWorkingState();
144 auto pl = tscsc->getValidParameters();
146 TEST_COMPARE ( pl->get<std::string>(
"Strategy Type"), ==,
"Constant");
150 std::ostringstream unusedParameters;
151 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)