From 8b99d6394dc1601de7e08ea9fbfff90d37572455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 1 Dec 2014 11:10:16 +0100 Subject: [PATCH] Fix bug in test. Also add (inactive) second test. --- tests/test_anisotropiceikonal.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/test_anisotropiceikonal.cpp b/tests/test_anisotropiceikonal.cpp index 38ca9e573..5a3629f7d 100644 --- a/tests/test_anisotropiceikonal.cpp +++ b/tests/test_anisotropiceikonal.cpp @@ -29,25 +29,54 @@ #include #include +#include #include using namespace Opm; -BOOST_AUTO_TEST_CASE(cartesian_2d) +BOOST_AUTO_TEST_CASE(cartesian_2d_a) { const GridManager gm(2, 2); const UnstructuredGrid& grid = *gm.c_grid(); AnisotropicEikonal2d ae(grid); const std::vector metric = { + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1 }; + BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); const std::vector start = { 0 }; std::vector sol; ae.solve(metric.data(), start, sol); BOOST_REQUIRE(!sol.empty()); + BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); std::vector truth = { 0, 1, 1, std::sqrt(2) }; BOOST_CHECK_EQUAL_COLLECTIONS(sol.begin(), sol.end(), truth.begin(), truth.end()); } + + +// BOOST_AUTO_TEST_CASE(cartesian_2d_b) +// { +// const GridManager gm(3, 2, 1.0, 2.0); +// const UnstructuredGrid& grid = *gm.c_grid(); +// AnisotropicEikonal2d ae(grid); + +// const std::vector metric = { +// 1, 0, 0, 1, +// 1, 0, 0, 1, +// 1, 0, 0, 1, +// 1, 0, 0, 1, +// 1, 0, 0, 1, +// 1, 0, 0, 1 +// }; +// BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); +// const std::vector start = { 0 }; +// std::vector sol; +// ae.solve(metric.data(), start, sol); +// BOOST_REQUIRE(!sol.empty()); +// BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); +// std::vector truth = { 0, 1, 2, 2, std::sqrt(5), std::sqrt(8) }; +// BOOST_CHECK_EQUAL_COLLECTIONS(sol.begin(), sol.end(), truth.begin(), truth.end()); +// }