29 Kokkos::Profiling::pushRegion(
"FTInterpNearest");
31 using MemorySpace =
typename ExecSpace::memory_space;
32 using Box = ::ArborX::Box<Dim, coordinates_t>;
34 ExecSpace execSpace{};
36 auto sourcePointsPtr = transfer.sourcePoints;
37 auto sourceValuesPtr = transfer.sourceValues;
39 auto targetPointsPtr = transfer.targetPoints;
40 auto targetValuesPtr = transfer.targetValues;
41 auto targetStatusPtr = transfer.targetStatus;
42 auto nbtargetPoints = targetPointsPtr.extent(0);
44 ::ArborX::BoundingVolumeHierarchy bvhPoints(
45 execSpace, ::ArborX::Experimental::attach_indices(sourcePointsPtr));
46 Kokkos::Profiling::pushRegion(
"Compute nearest points");
47 auto nearestPointValues = Kokkos::View<int_t *, MemorySpace>(
48 Kokkos::view_alloc(execSpace, Kokkos::WithoutInitializing,
49 "nearestPointValues"),
51 auto nearestPointOffsets = Kokkos::View<int_t *, MemorySpace>(
52 Kokkos::view_alloc(execSpace, Kokkos::WithoutInitializing,
53 "nearestPointOffsets"),
56 bvhPoints.query(execSpace, pcn,
ExtractIndex{}, nearestPointValues,
58 Kokkos::Profiling::popRegion();
60 Kokkos::Profiling::pushRegion(
"Compute target point FE intersection");
62 Kokkos::Profiling::popRegion();
65 Kokkos::Profiling::pushRegion(
"Get Nearest");
67 "Get Nearest functor",
68 Kokkos::RangePolicy<ExecSpace>(execSpace, 0, nbtargetPoints),
69 KOKKOS_LAMBDA(
const int_t &i) {
71 auto nearest_idx = nearestPointValues(i);
73 component < sourceValuesPtr.extent(1); ++component) {
74 targetValuesPtr(i, component) =
75 sourceValuesPtr(nearest_idx, component);
80 Kokkos::Profiling::popRegion();
82 Kokkos::Profiling::popRegion();