9 #include "Teuchos_UnitTestHarness.hpp"
10 #include "Teuchos_XMLParameterListHelpers.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
12 #include "Teuchos_DefaultComm.hpp"
14 #include "Thyra_VectorStdOps.hpp"
20 #include "../TestModels/VanDerPol_IMEX_ExplicitModel.hpp"
21 #include "../TestModels/VanDerPol_IMEX_ImplicitModel.hpp"
22 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
27 namespace Tempus_Unit_Test {
31 using Teuchos::rcp_const_cast;
32 using Teuchos::rcp_dynamic_cast;
33 using Teuchos::ParameterList;
34 using Teuchos::sublist;
35 using Teuchos::getParametersFromXmlFile;
49 explicitModel, implicitModel));
53 stepper->setModel(model);
54 stepper->initialize();
55 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
61 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
64 bool useFSAL = stepper->getUseFSALDefault();
65 std::string ICConsistency = stepper->getICConsistencyDefault();
66 bool ICConsistencyCheck = stepper->getICConsistencyCheckDefault();
67 bool zeroInitialGuess = stepper->getZeroInitialGuess();
68 std::string stepperType =
"IMEX RK SSP2";
70 auto explicitTableau = stepperERK->getTableau();
72 auto implicitTableau = stepperSDIRK->getTableau();
77 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
79 stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
81 stepper->setAppAction(modifier); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
82 stepper->setAppAction(modifierX); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
83 stepper->setAppAction(observer); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
84 stepper->setSolver(solver); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
85 stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
86 stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
87 stepper->setICConsistencyCheck(ICConsistencyCheck); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
88 stepper->setZeroInitialGuess(zeroInitialGuess); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
90 stepper->setStepperType(stepperType); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
91 stepper->setExplicitTableau(explicitTableau); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
92 stepper->setImplicitTableau(implicitTableau); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
93 stepper->setOrder(order); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
95 TEUCHOS_TEST_FOR_EXCEPT(explicitTableau != stepper->getTableau());
96 TEUCHOS_TEST_FOR_EXCEPT(explicitTableau != stepper->getExplicitTableau());
97 TEUCHOS_TEST_FOR_EXCEPT(implicitTableau != stepper->getImplicitTableau());
100 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
102 model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck,
103 zeroInitialGuess, stepperType, explicitTableau, implicitTableau, order));
104 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
107 model, solver, useFSAL, ICConsistency, ICConsistencyCheck,
108 zeroInitialGuess, modifier, stepperType, explicitTableau,
109 implicitTableau, order));
110 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
113 TEUCHOS_ASSERT(stepper->getOrder() == 2);
125 explicitModel, implicitModel));
139 explicitModel, implicitModel));
143 auto stepper = sf->createStepper(
"General IMEX RK", model);
144 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
156 explicitModel, implicitModel));
160 auto stepper = sf->createStepper(
"General IMEX RK");
161 stepper->setModel(model);
162 stepper->initialize();
163 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
176 explicitModel, implicitModel));
van der Pol model formulated for IMEX-RK.
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.
Default observer for StepperRK.
Explicit Runge-Kutta time stepper.
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
Default ModifierX for StepperRK.
Default modifier for StepperRK.
This observer is a composite observer,.
van der Pol model formulated for IMEX.