11#include "../TestModels/DahlquistTestModel.hpp"
18using Teuchos::rcp_const_cast;
19using Teuchos::rcp_dynamic_cast;
30 TEUCHOS_ASSERT(stepper->getOrder() == 1);
31 const auto rk_fe = stepper->getTableau();
33 TEUCHOS_ASSERT( rk_fe->isTVD() );
34 TEUCHOS_ASSERT( rk_fe->getTVDCoeff() == 1 );
62 Teuchos::RCP<const Thyra::ModelEvaluator<double> >
65 stepper->setModel(model);
66 stepper->setICConsistency(
"Consistent");
67 stepper->setUseFSAL(
true);
68 stepper->initialize();
74 stepper->setInitialConditions(solutionHistory);
75 solutionHistory->initWorkingState();
77 solutionHistory->getWorkingState()->setTimeStep(dt);
78 solutionHistory->getWorkingState()->setTime(dt);
79 stepper->takeStep(solutionHistory);
82 const double relTol = 1.0e-14;
85 auto currentState = solutionHistory->getCurrentState();
86 const double x_0 = get_ele(*(currentState->getX()), 0);
87 const double xDot_0 = get_ele(*(currentState->getXDot()), 0);
88 TEST_FLOATING_EQUALITY(x_0, 1.0, relTol);
89 TEST_FLOATING_EQUALITY(xDot_0, -1.0, relTol);
90 TEST_ASSERT(std::abs(currentState->getTime()) < relTol);
93 auto workingState = solutionHistory->getWorkingState();
94 const double x_1 = get_ele(*(workingState->getX()), 0);
95 const double xDot_1 = get_ele(*(workingState->getXDot()), 0);
97 TEST_ASSERT(std::abs(x_1 ) < relTol);
98 TEST_ASSERT(std::abs(xDot_1) < relTol);
99 TEST_FLOATING_EQUALITY(workingState->getTime(), 1.0, relTol);
Forward Euler Runge-Kutta Butcher Tableau.
The classic Dahlquist Test Problem.
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation.
void testExplicitRKAccessorsFullConstruction(const RCP< Tempus::StepperExplicitRK< double > > &stepper)
Unit test utility for ExplicitRK Stepper construction and accessors.
void testRKAppAction(const Teuchos::RCP< Tempus::StepperRKBase< double > > &stepper, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model, Teuchos::FancyOStream &out, bool &success)
Unit test utility for Stepper RK AppAction.
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
Teuchos::RCP< SolutionHistory< Scalar > > createSolutionHistoryME(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Nonmember contructor from a Thyra ModelEvaluator.