12 #include "Teuchos_DefaultComm.hpp"
15 #include "Tempus_TimeEventRange.hpp"
16 #include "Tempus_TimeEventRangeIndex.hpp"
17 #include "Tempus_TimeEventList.hpp"
18 #include "Tempus_TimeEventListIndex.hpp"
21 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
24 static double PI = M_PI;
26 namespace Tempus_Unit_Test {
30 using Teuchos::rcp_const_cast;
31 using Teuchos::rcp_dynamic_cast;
39 "teRange1", 0.0,
PI, 1.0, 1.0e-14,
true));
46 "teRange2", -
PI/2.0,
PI/2.0,
PI/4.0, 1.0e-14,
true));
53 "teRange3", 4.0, 10.0, 4.0, 1.0e-14,
true));
62 std::vector<double> testList1;
63 testList1.push_back(-1.0);
64 testList1.push_back( 0.0);
65 testList1.push_back( 5.0);
66 testList1.push_back( 2.0);
67 testList1.push_back(
PI);
70 "teList1", testList1, 1.0e-14,
true));
76 std::vector<double> testList2;
77 testList2.push_back(-0.5);
78 testList2.push_back( 1.25);
79 testList2.push_back( 4.95);
80 testList2.push_back(12.34);
83 "teList2", testList2, 1.0e-14,
true));
89 std::vector<double> testList3;
90 testList3.push_back(-5.0);
91 testList3.push_back(-
PI);
94 "teList3", testList3, 1.0e-14,
true));
104 "teRangeIndex1", -1, 10, 3));
105 return teRangeIndex1;
111 "teRangeIndex2", -5, 8, 4));
112 return teRangeIndex2;
118 "teRangeIndex3", 10, 17, 5));
119 return teRangeIndex3;
127 std::vector<int> testListIndex1;
128 testListIndex1.push_back(-2);
129 testListIndex1.push_back( 0);
130 testListIndex1.push_back( 7);
131 testListIndex1.push_back( 3);
132 testListIndex1.push_back(-5);
135 "teListIndex1", testListIndex1));
141 std::vector<int> testListIndex2;
142 testListIndex2.push_back( 2);
145 "teListIndex2", testListIndex2));
151 std::vector<int> testListIndex3;
152 testListIndex3.push_back(14);
153 testListIndex3.push_back( 9);
156 "teListIndex3", testListIndex3));
174 TEST_COMPARE(te->indexToNextEvent(0), ==, te->getDefaultIndex());
175 TEST_COMPARE(te->indexOfNextEvent(0), ==, te->getDefaultIndex());
187 te->addTimeEvent(teRange1);
204 te->addTimeEvent(teRange1);
205 te->addTimeEvent(teRange2);
223 te->addTimeEvent(teRange3);
224 te->addTimeEvent(teRange2);
249 te->addTimeEvent(teList1);
266 te->addTimeEvent(teList1);
267 te->addTimeEvent(teList2);
285 te->addTimeEvent(teList3);
286 te->addTimeEvent(teList2);
310 te->addTimeEvent(teRangeIndex1);
327 te->addTimeEvent(teRangeIndex1);
328 te->addTimeEvent(teRangeIndex2);
346 te->addTimeEvent(teRangeIndex3);
347 te->addTimeEvent(teRangeIndex2);
372 te->addTimeEvent(teListIndex1);
389 te->addTimeEvent(teListIndex1);
390 te->addTimeEvent(teListIndex2);
408 te->addTimeEvent(teListIndex3);
409 te->addTimeEvent(teListIndex2);
432 te->addTimeEvent(teRange1);
433 te->addTimeEvent(teList1);
434 te->addTimeEvent(teRangeIndex1);
435 te->addTimeEvent(teListIndex1);
Teuchos::RCP< Tempus::TimeEventRange< double > > getTestRange3()
TimeEventRangeIndex specifies a start, stop and stride index.
Teuchos::RCP< Tempus::TimeEventRange< double > > getTestRange2()
Teuchos::RCP< Tempus::TimeEventListIndex< double > > getTestListIndex2()
TimeEventListIndex specifies a list of index events.
#define TEST_COMPARE(v1, comp, v2)
Teuchos::RCP< Tempus::TimeEventRangeIndex< double > > getTestRangeIndex3()
#define TEST_FLOATING_EQUALITY(v1, v2, tol)
Teuchos::RCP< Tempus::TimeEventList< double > > getTestList3()
Teuchos::RCP< Tempus::TimeEventRange< double > > getTestRange1()
TimeEventRange specifies a start, stop and stride time.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Tempus::TimeEventList< double > > getTestList1()
This composite TimeEvent loops over added TimeEvents.
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
Teuchos::RCP< Tempus::TimeEventListIndex< double > > getTestListIndex3()
Teuchos::RCP< Tempus::TimeEventListIndex< double > > getTestListIndex1()
Teuchos::RCP< Tempus::TimeEventRangeIndex< double > > getTestRangeIndex1()
Teuchos::RCP< Tempus::TimeEventList< double > > getTestList2()
Teuchos::RCP< Tempus::TimeEventRangeIndex< double > > getTestRangeIndex2()
TimeEventList specifies a list of time events.