34 Kokkos::Profiling::pushRegion(
35 "FiniteElement::ComputeBoxTargetPointIntersection");
36 if (transfer.nbSpaceDimElements == 0) {
40 using MemorySpace =
typename ExecSpace::memory_space;
41 using Box = ArborX::Box<Dim, coordinates_t>;
43 ExecSpace execSpace{};
45 Kokkos::Profiling::pushRegion(
46 "copy pointers and allocate auxiliary data structures");
48 auto sourcePointsPtr = transfer.sourcePoints;
49 auto sourceValuesPtr = transfer.sourceValues;
51 auto targetPointsPtr = transfer.targetPoints;
52 auto targetValuesPtr = transfer.targetValues;
53 auto targetStatusPtr = transfer.targetStatus;
54 auto nbtargetPoints = targetPointsPtr.extent_int(0);
56 auto connValPtr = transfer.connValues;
57 auto connOffPtr = transfer.connOffsets;
58 auto CellTypesPtr = transfer.cellTypes;
60 Kokkos::Profiling::popRegion();
62 Kokkos::Profiling::pushRegion(
63 "Allocate auxiliary data structures for box-point intersection");
64 Kokkos::View<Box *, MemorySpace> bboxes(
65 Kokkos::view_alloc(execSpace, Kokkos::WithoutInitializing,
66 "Boundary boxes of elements"),
67 transfer.nbSpaceDimElements);
68 Kokkos::View<int *, MemorySpace> parents(
69 Kokkos::view_alloc(execSpace, Kokkos::WithoutInitializing,
71 transfer.nbSpaceDimElements);
72 Kokkos::Profiling::popRegion();
100 "Compute element bounding boxes functor",
101 Kokkos::RangePolicy(execSpace, 0, transfer.nbElems),
102 KOKKOS_LAMBDA(
const int_t &i) {
103 ArborX::Point<Dim, coordinates_t> pmin;
104 ArborX::Point<Dim, coordinates_t> pmax;
105 for (
int d = 0; d < Dim; ++d) {
107 pmax[d] = -9999999.0;
109 for (
int_t k = connOffPtr(i); k < connOffPtr(i + 1); k++) {
110 for (
int d = 0; d < Dim; ++d) {
111 pmin[d] = Kokkos::min(pmin[d], sourcePointsPtr(connValPtr(k))[d]);
112 pmax[d] = Kokkos::max(pmax[d], sourcePointsPtr(connValPtr(k))[d]);
115 bboxes(i) = Box(pmin, pmax);
119 ArborX::BoundingVolumeHierarchy bvhBoxes(
120 execSpace, ArborX::Experimental::attach_indices(bboxes));
127 Kokkos::Profiling::popRegion();