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"
19 #include "../TestModels/SinCosModel.hpp"
20 #include "../TestModels/VanDerPolModel.hpp"
21 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
26 namespace Tempus_Unit_Test {
30 using Teuchos::rcp_const_cast;
31 using Teuchos::rcp_dynamic_cast;
32 using Teuchos::ParameterList;
33 using Teuchos::sublist;
34 using Teuchos::getParametersFromXmlFile;
47 stepper->setModel(model);
48 stepper->initialize();
49 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
56 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
59 bool useFSAL = stepper->getUseFSALDefault();
60 std::string ICConsistency = stepper->getICConsistencyDefault();
61 bool ICConsistencyCheck = stepper->getICConsistencyCheckDefault();
62 bool useEmbedded = stepper->getUseEmbeddedDefault();
63 bool zeroInitialGuess = stepper->getZeroInitialGuess();
67 Teuchos::SerialDenseMatrix<int,double> A(NumStages,NumStages);
68 Teuchos::SerialDenseVector<int,double> b(NumStages);
69 Teuchos::SerialDenseVector<int,double> c(NumStages);
70 Teuchos::SerialDenseVector<int,double> bstar(0);
73 A(0,0) = 0.2928932188134524; A(0,1) = 0.0;
74 A(1,0) = 0.7071067811865476; A(1,1) = 0.2928932188134524;
77 b(0) = 0.7071067811865476;
78 b(1) = 0.2928932188134524;
81 c(0) = 0.2928932188134524;
87 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
89 stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
91 stepper->setAppAction(modifier); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
92 stepper->setAppAction(modifierX); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
93 stepper->setAppAction(observer); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
94 stepper->setSolver(solver); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
95 stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
96 stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
97 stepper->setICConsistencyCheck(ICConsistencyCheck); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
98 stepper->setUseEmbedded(useEmbedded); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
99 stepper->setZeroInitialGuess(zeroInitialGuess); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
101 stepper->setTableau(A, b, c, order, order, order); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
105 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
107 model, obs, solver, useFSAL,
108 ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess,
109 A, b, c, order, order, order, bstar));
110 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
113 model, solver, useFSAL, ICConsistency, ICConsistencyCheck,
114 useEmbedded, zeroInitialGuess, modifier,
115 A, b, c, order, order, order, bstar));
116 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
119 TEUCHOS_ASSERT(stepper->getOrder() == 2);
General Implicit Runge-Kutta Butcher Tableau.
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.
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
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,.