Skip to content

Commit

Permalink
Merge pull request SCOREC#108 from Fuad-HH/master
Browse files Browse the repository at this point in the history
bboxWrap correction
  • Loading branch information
cwsmith authored Jul 17, 2024
2 parents 0dcdfee + 2312f1d commit 00131eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Omega_h_bbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ template< int N >
struct bboxWrap {
BBox<N> box;

KOKKOS_INLINE_FUNCTION // Default constructor - Initialize to 0's
KOKKOS_INLINE_FUNCTION // Default constructor
bboxWrap() {
const auto zero = zero_vector<N>();
box.min = zero;
box.max = zero;
box.min = fill_vector<N>(Kokkos::Experimental::finite_max_v<Real>);
box.max = fill_vector<N>(Kokkos::Experimental::finite_min_v<Real>);
}
KOKKOS_INLINE_FUNCTION // Copy Constructor
bboxWrap(const bboxWrap & rhs) {
Expand Down
4 changes: 4 additions & 0 deletions src/unit_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 00131eb

Please sign in to comment.