Skip to content

Commit

Permalink
Remove requirement on knowing geometry types in IndexableGetter
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Feb 5, 2025
1 parent d450228 commit ca28148
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/spatial/detail/ArborX_IndexableGetter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,30 @@ struct DefaultIndexableGetter
KOKKOS_DEFAULTED_FUNCTION
DefaultIndexableGetter() = default;

template <typename Geometry, typename Enable = std::enable_if_t<
GeometryTraits::is_valid_geometry<Geometry>>>
template <typename Geometry>
KOKKOS_FUNCTION auto const &operator()(Geometry const &geometry) const
{
return geometry;
}

template <typename Geometry, typename Enable = std::enable_if_t<
GeometryTraits::is_valid_geometry<Geometry>>>
template <typename Geometry,
typename Enable = std::enable_if_t<
!Details::is_pair_value_index_v<std::decay_t<Geometry>>>>
KOKKOS_FUNCTION auto operator()(Geometry &&geometry) const
{
return geometry;
}

template <typename Value, typename Index>
KOKKOS_FUNCTION Value const &
operator()(PairValueIndex<Value, Index> const &pair) const
template <typename Geometry, typename Index>
KOKKOS_FUNCTION Geometry const &
operator()(PairValueIndex<Geometry, Index> const &pair) const
{
return pair.value;
}

template <typename Value, typename Index>
KOKKOS_FUNCTION Value operator()(PairValueIndex<Value, Index> &&pair) const
template <typename Geometry, typename Index>
KOKKOS_FUNCTION Geometry
operator()(PairValueIndex<Geometry, Index> &&pair) const
{
return pair.value;
}
Expand Down

0 comments on commit ca28148

Please sign in to comment.