9 #include "Teuchos_UnitTestHarness.hpp"
13 #include "../TestModels/SinCosModel.hpp"
16 namespace Tempus_Unit_Test {
20 using Teuchos::rcp_const_cast;
21 using Teuchos::rcp_dynamic_cast;
32 stepper->setModel(model);
33 stepper->initialize();
34 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
40 bool useFSAL = stepper->getUseFSALDefault();
41 std::string ICConsistency = stepper->getICConsistencyDefault();
42 bool ICConsistencyCheck = stepper->getICConsistencyCheckDefault();
43 bool useEmbedded = stepper->getUseEmbeddedDefault();
46 Teuchos::SerialDenseMatrix<int,double> A(NumStages,NumStages);
47 Teuchos::SerialDenseVector<int,double> b(NumStages);
48 Teuchos::SerialDenseVector<int,double> c(NumStages);
49 Teuchos::SerialDenseVector<int,double> bstar(0);
52 A(0,0) = 0.0; A(0,1) = 0.0; A(0,2) = 0.0; A(0,3) = 0.0;
53 A(1,0) = 0.5; A(1,1) = 0.0; A(1,2) = 0.0; A(1,3) = 0.0;
54 A(2,0) = 0.0; A(2,1) = 0.5; A(2,2) = 0.0; A(2,3) = 0.0;
55 A(3,0) = 0.0; A(3,1) = 0.0; A(3,2) = 1.0; A(3,3) = 0.0;
58 b(0) = 1.0/6.0; b(1) = 1.0/3.0; b(2) = 1.0/3.0; b(3) = 1.0/6.0;
61 c(0) = 0.0; c(1) = 0.5; c(2) = 0.5; c(3) = 1.0;
67 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
69 stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
71 stepper->setAppAction(modifier); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
72 stepper->setAppAction(modifierX); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
73 stepper->setAppAction(observer); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
74 stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
75 stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
76 stepper->setICConsistencyCheck(ICConsistencyCheck); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
77 stepper->setUseEmbedded(useEmbedded); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
79 stepper->setTableau(A, b, c, order, order, order); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
83 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
85 model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded,
86 A, b, c, order, order, order, bstar));
87 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
90 model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded,
91 A, b, c, order, order, order, bstar, modifier));
92 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
95 TEUCHOS_ASSERT(stepper->getOrder() == 4);
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.
General Explicit Runge-Kutta Butcher Tableau.
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
Default ModifierX for StepperRK.
Default modifier for StepperRK.
This observer is a composite observer,.