diff --git a/src/Omega_h_bbox.cpp b/src/Omega_h_bbox.cpp index d3c974ab9..91b7cfa78 100644 --- a/src/Omega_h_bbox.cpp +++ b/src/Omega_h_bbox.cpp @@ -10,11 +10,10 @@ template< int N > struct bboxWrap { BBox box; - KOKKOS_INLINE_FUNCTION // Default constructor - Initialize to 0's + KOKKOS_INLINE_FUNCTION // Default constructor bboxWrap() { - const auto zero = zero_vector(); - box.min = zero; - box.max = zero; + box.min = fill_vector(Kokkos::Experimental::finite_max_v); + box.max = fill_vector(Kokkos::Experimental::finite_min_v); } KOKKOS_INLINE_FUNCTION // Copy Constructor bboxWrap(const bboxWrap & rhs) { diff --git a/src/unit_mesh.cpp b/src/unit_mesh.cpp index bf4717872..e794ef610 100644 --- a/src/unit_mesh.cpp +++ b/src/unit_mesh.cpp @@ -235,6 +235,10 @@ static void test_hilbert() { } static void test_bbox() { + OMEGA_H_CHECK(are_close(BBox<2>(vector_2(-10, -15), vector_2(-1, -1)), + find_bounding_box<2>(Reals({-3, -12, -10, -1, -1, -15, -3, -2})))); + OMEGA_H_CHECK(are_close(BBox<2>(vector_2(1, 1), vector_2(10, 15)), + find_bounding_box<2>(Reals({3, 12, 10, 1, 1, 15, 3, 2})))); OMEGA_H_CHECK(are_close(BBox<2>(vector_2(-3, -3), vector_2(3, 3)), find_bounding_box<2>(Reals({0, -3, 3, 0, 0, 3, -3, 0})))); OMEGA_H_CHECK(are_close(BBox<3>(vector_3(-3, -3, -3), vector_3(3, 3, 3)),