12 #include "Teuchos_DefaultComm.hpp"
14 #include "Tempus_TimeEventRange.hpp"
16 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
19 static double PI = M_PI;
21 namespace Tempus_Unit_Test {
25 using Teuchos::rcp_const_cast;
26 using Teuchos::rcp_dynamic_cast;
36 te->setName(
"TestName");
54 "TestName", 0.0,
PI, 1.0, 1.0e-14,
true));
65 "teRange2", -
PI/2.0,
PI/2.0,
PI/4.0, 1.0e-14,
true));
77 "TestName", 0.0,
PI, 5, 1.0e-14,
true));
97 te->setRelTol(1.0e-14);
98 te->setLandOnExactly(
false);
100 te->setLandOnExactly(
true);
103 te->setTimeStart(1.0);
110 te->setTimeStop(4.0);
117 te->setTimeStride(0.5);
130 te->setTimeStart(1.0);
131 te->setTimeStop(4.0);
132 te->setTimeStride(0.5);
135 te->setTimeStride(-0.5);
142 te->setTimeStride(5.0);
149 te->setTimeStride(1.0e-14);
164 te->setTimeRange(0.0,
PI, 1.0);
177 te->setTimeRange(0.0,
PI, 1.0);
208 te->setTimeRange(0.0,
PI, 1.0);
239 te->setTimeRange(0.0,
PI, 1.0);
270 te->setTimeRange(0.0,
PI, 1.0);
275 TEST_COMPARE(te->eventInRange(-1.0, -10.0e-14), ==,
false);
276 TEST_COMPARE(te->eventInRange(-1.0, -1.0e-14), ==, true );
278 TEST_COMPARE(te->eventInRange(-1.0, 1.0e-14), ==, true );
279 TEST_COMPARE(te->eventInRange(-1.0, 10.0e-14), ==, true );
282 TEST_COMPARE(te->eventInRange(0.5, 1.0 + -10.0e-14), ==,
false);
283 TEST_COMPARE(te->eventInRange(0.5, 1.0 + -1.0e-14), ==, true );
284 TEST_COMPARE(te->eventInRange(0.5, 1.0 + 0.0 ), ==, true );
285 TEST_COMPARE(te->eventInRange(0.5, 1.0 + 1.0e-14), ==, true );
286 TEST_COMPARE(te->eventInRange(0.5, 1.0 + 10.0e-14), ==, true );
289 TEST_COMPARE(te->eventInRange(2.5, 3.0 + -10.0e-14), ==,
false);
290 TEST_COMPARE(te->eventInRange(2.5, 3.0 + -1.0e-14), ==, true );
291 TEST_COMPARE(te->eventInRange(2.5, 3.0 + 0.0 ), ==, true );
292 TEST_COMPARE(te->eventInRange(2.5, 3.0 + 1.0e-14), ==, true );
293 TEST_COMPARE(te->eventInRange(2.5, 3.0 + 10.0e-14), ==, true );
297 TEST_COMPARE(te->eventInRange(-10.0e-14, 0.5), ==, true );
298 TEST_COMPARE(te->eventInRange( -1.0e-14, 0.5), ==, true );
300 TEST_COMPARE(te->eventInRange( 1.0e-14, 0.5), ==, true );
301 TEST_COMPARE(te->eventInRange( 10.0e-14, 0.5), ==,
false);
304 TEST_COMPARE(te->eventInRange(1.0 + -10.0e-14, 1.5), ==, true );
305 TEST_COMPARE(te->eventInRange(1.0 + -1.0e-14, 1.5), ==, true );
306 TEST_COMPARE(te->eventInRange(1.0 + 0.0 , 1.5), ==, true );
307 TEST_COMPARE(te->eventInRange(1.0 + 1.0e-14, 1.5), ==, true );
308 TEST_COMPARE(te->eventInRange(1.0 + 10.0e-14, 1.5), ==,
false);
311 TEST_COMPARE(te->eventInRange(3.0 + -10.0e-14, 4.0), ==, true );
312 TEST_COMPARE(te->eventInRange(3.0 + -1.0e-14, 4.0), ==, true );
313 TEST_COMPARE(te->eventInRange(3.0 + 0.0 , 4.0), ==, true );
314 TEST_COMPARE(te->eventInRange(3.0 + 1.0e-14, 4.0), ==, true );
315 TEST_COMPARE(te->eventInRange(3.0 + 10.0e-14, 4.0), ==,
false);
#define TEST_COMPARE(v1, comp, v2)
#define TEST_FLOATING_EQUALITY(v1, v2, tol)
TimeEventRange specifies a start, stop and stride time.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)