Skip to content

Commit

Permalink
Add KDOP<2,4> and KDOP<2,8>
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed May 15, 2024
1 parent 8aae58e commit fa77eb4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/geometry/ArborX_KDOP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,38 @@ namespace Details
template <int DIM, int k, typename Coordinate>
struct KDOP_Directions;

template <typename Coordinate>
struct KDOP_Directions<2, 4, Coordinate>
{
static constexpr int n_directions = 2;
static KOKKOS_FUNCTION auto const &directions()
{
using Direction = Vector<2, Coordinate>;
static constexpr Kokkos::Array<Direction, n_directions> directions = {
Direction{1, 0},
Direction{0, 1},
};
return directions;
}
};

template <typename Coordinate>
struct KDOP_Directions<2, 8, Coordinate>
{
static constexpr int n_directions = 4;
static KOKKOS_FUNCTION auto const &directions()
{
using Direction = Vector<2, Coordinate>;
static constexpr Kokkos::Array<Direction, n_directions> directions = {
Direction{1, 0},
Direction{0, 1},
Direction{1, 1},
Direction{1, -1},
};
return directions;
}
};

template <typename Coordinate>
struct KDOP_Directions<3, 6, Coordinate>
{
Expand Down

0 comments on commit fa77eb4

Please sign in to comment.