From 85683eed4d50fce1b6ee358f56bdc1383492b543 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 15 Aug 2023 10:46:06 -0400 Subject: [PATCH] Replace get_triangle/get_point with call operator --- .../triangle_intersection/triangle_intersection.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/triangle_intersection/triangle_intersection.cpp b/examples/triangle_intersection/triangle_intersection.cpp index 92a86a14c..f3bbe7ee6 100644 --- a/examples/triangle_intersection/triangle_intersection.cpp +++ b/examples/triangle_intersection/triangle_intersection.cpp @@ -119,7 +119,7 @@ class Points }); } - KOKKOS_FUNCTION auto const &get_point(int i) const { return _points(i); } + KOKKOS_FUNCTION auto operator()(int i) const { return _points(i); } KOKKOS_FUNCTION auto size() const { return _points.size(); } @@ -223,7 +223,7 @@ class Triangles KOKKOS_FUNCTION int size() const { return _triangles.size(); } KOKKOS_FUNCTION ArborX::ExperimentalHyperGeometry::Triangle<2> const & - get_triangle(int i) const + operator()(int i) const { return _triangles(i); } @@ -256,7 +256,7 @@ struct ArborX::AccessTraits, ArborX::PrimitivesTag> static KOKKOS_FUNCTION auto get(Triangles const &triangles, int i) { - auto const &triangle = triangles.get_triangle(i); + auto const &triangle = triangles(i); ArborX::ExperimentalHyperGeometry::Box<2> box{}; box += triangle.a; box += triangle.b; @@ -275,7 +275,7 @@ struct ArborX::AccessTraits, ArborX::PredicatesTag> } static KOKKOS_FUNCTION auto get(Points const &points, int i) { - return ArborX::attach(ArborX::intersects(points.get_point(i)), i); + return ArborX::attach(ArborX::intersects(points(i)), i); } }; @@ -371,8 +371,8 @@ int main() if (offsets(i) != i) Kokkos::abort("Offsets are wrong"); auto const &c = coefficients(i); - auto const &t = triangles.get_triangle(offsets(i)); - auto const &p_h = points.get_point(i); + auto const &t = triangles(offsets(i)); + auto const &p_h = points(i); auto const p = ArborX::ExperimentalHyperGeometry::Point<2>{ c[0] * t.a[0] + c[1] * t.b[0] + c[2] * t.c[0], c[0] * t.a[1] + c[1] * t.b[1] + c[2] * t.c[1]};