deal.II version GIT relicensing-6917-gb466a1809f 2026-10-16 06:30:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
access_traits.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2021 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_arborx_access_traits_h
14#define dealii_arborx_access_traits_h
15
16#include <deal.II/base/config.h>
17
18#ifdef DEAL_II_WITH_ARBORX
20
21# include <ArborX.hpp>
22
23# include <utility>
24
25#endif
26
28
29#ifdef DEAL_II_WITH_ARBORX
31{
32# if ARBORX_VERSION_MAJOR < 2
38 {
39 protected:
43 template <int dim, typename Number>
44 PointPredicate(const std::vector<::Point<dim, Number>> &points);
45
49 std::size_t
50 size() const;
51
55 const ::Point<3, float> &
56 get(unsigned int i) const;
57
58 private:
59 std::vector<::Point<3, float>> points;
60 };
61
62
63
71 {
72 public:
77 template <int dim, typename Number>
79 const std::vector<::Point<dim, Number>> &points);
80
81 // We need these since we inherit privately to avoid polymorphic use.
84 };
85
86
87
95 {
96 public:
102 template <int dim, typename Number>
104 const unsigned int n_nearest_neighbors);
105
109 unsigned int
111
112 // We need these since we inherit privately to avoid polymorphic use.
115
116 private:
118 };
119
120
121
127 {
128 protected:
133 template <int dim, typename Number>
135 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes);
136
140 std::size_t
141 size() const;
142
146 const ::BoundingBox<3, float> &
147 get(unsigned int i) const;
148
149 private:
150 std::vector<::BoundingBox<3, float>> bounding_boxes;
151 };
152
153
154
162 {
163 public:
168 template <int dim, typename Number>
170 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes);
171
172 // We need these since we inherit privately to avoid polymorphic use.
175 };
176
177
185 {
186 public:
192 template <int dim, typename Number>
194 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes,
195 const unsigned int n_nearest_neighbors);
196
200 unsigned int
202
203 // We need these since we inherit privately to avoid polymorphic use.
206
207 private:
209 };
210
211
212
218 {
219 protected:
224 template <int dim, typename Number>
226 const std::vector<std::pair<::Point<dim, Number>, Number>>
227 &spheres);
228
232 std::size_t
233 size() const;
234
238 const std::pair<::Point<3, float>, float> &
239 get(unsigned int) const;
240
241 private:
242 std::vector<std::pair<::Point<3, float>, float>> spheres;
243 };
244
245
246
254 {
255 public:
260 template <int dim, typename Number>
262 const std::vector<std::pair<::Point<dim, Number>, Number>>
263 &spheres);
264
265 // We need these since we inherit privately to avoid polymorphic use.
268 };
269
270
271
279 {
280 public:
286 template <int dim, typename Number>
288 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres,
289 const unsigned int n_nearest_neighbors);
290
294 unsigned int
296
297 // We need these since we inherit privately to avoid polymorphic use.
300
301 private:
303 };
304# else
305 namespace internal
306 {
307 template <int dim, typename Number>
308 ArborX::Point<dim, Number>
309 to_arborx_point(const ::Point<dim, Number> &p)
310 {
311 if constexpr (dim == 1)
312 {
313 return {{p[0]}};
314 }
315
316 if constexpr (dim == 2)
317 {
318 return {{p[0], p[1]}};
319 }
320
321 if constexpr (dim == 3)
322 {
323 return {{p[0], p[1], p[2]}};
324 }
325 }
326
331 struct IndexableGetter
332 {
333 template <int dim, typename Number>
334 ArborX::Point<dim, Number>
335 operator()(const ArborX::PairValueIndex<::Point<dim, Number>,
336 unsigned int> &pair) const
337 {
338 return to_arborx_point(pair.value);
339 }
340
341
342
343 template <int dim, typename Number>
344 ArborX::Box<dim, Number>
345 operator()(const ArborX::PairValueIndex<::BoundingBox<dim, Number>,
346 unsigned int> &pair) const
347 {
348 const auto boundary_points = pair.value.get_boundary_points();
349 const ::Point<dim, Number> min_corner = boundary_points.first;
350 const ::Point<dim, Number> max_corner = boundary_points.second;
351 return {to_arborx_point(min_corner), to_arborx_point(max_corner)};
352 }
353
354
355
356 template <int dim, typename Number>
357 ArborX::Sphere<dim, Number>
358 operator()(const ArborX::PairValueIndex<
359 std::pair<::Point<dim, Number>, Number>,
360 unsigned int> &pair) const
361 {
362 return {to_arborx_point(pair.value.first), pair.value.second};
363 }
364 };
365
366
367
371 struct ExtractIndex
372 {
373 template <typename Query, typename Value, typename Output>
374 KOKKOS_FUNCTION void
375 operator()(const Query &, const Value &value, const Output &out) const
376 {
377 out(value.index);
378 }
379 };
380
381
382
387 struct ExtractIndexRank
388 {
389 unsigned int rank;
390
391 template <typename Predicate, typename Value, typename Output>
392 KOKKOS_FUNCTION void
393 operator()(const Predicate &,
394 const ArborX::PairValueIndex<Value> &value,
395 const Output &out) const
396 {
397 out({value.index, rank});
398 }
399 };
400 } // namespace internal
401
402
403
409 template <int dim, typename Number>
410 class PointIntersectPredicate
411 {
412 public:
418 const std::vector<::Point<dim, Number>> &points);
419
423 std::size_t
424 size() const;
425
429 const ::Point<dim, Number> &
430 get(unsigned int i) const;
431
435 static constexpr bool is_nearest = false;
436
437 private:
438 std::vector<::Point<dim, Number>> points;
439 };
440
441
442
448 template <int dim, typename Number>
449 class PointNearestPredicate
450 {
451 public:
457 const unsigned int n_nearest_neighbors);
458
462 unsigned int
464
468 std::size_t
469 size() const;
470
474 const ::Point<dim, Number> &
475 get(unsigned int i) const;
476
477
481 static constexpr bool is_nearest = true;
482
483 private:
484 std::vector<::Point<dim, Number>> points;
485 unsigned int n_nearest_neighbors;
486 };
487
488
489
495 template <int dim, typename Number>
496 class BoundingBoxIntersectPredicate
497 {
498 public:
504 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes);
505
509 std::size_t
510 size() const;
511
515 const ::BoundingBox<dim, Number> &
516 get(unsigned int i) const;
517
521 static constexpr bool is_nearest = false;
522
523 private:
524 std::vector<::BoundingBox<dim, Number>> bounding_boxes;
525 };
526
527
528
534 template <int dim, typename Number>
535 class BoundingBoxNearestPredicate
536 {
537 public:
544 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes,
545 const unsigned int n_nearest_neighbors);
546
550 unsigned int
552
556 std::size_t
557 size() const;
558
562 const ::BoundingBox<dim, Number> &
563 get(unsigned int i) const;
564
568 static constexpr bool is_nearest = true;
569
570 private:
571 std::vector<::BoundingBox<dim, Number>> bounding_boxes;
572 unsigned int n_nearest_neighbors;
573 };
574
575
576
582 template <int dim, typename Number>
583 class SphereIntersectPredicate
584 {
585 public:
591 const std::vector<std::pair<::Point<dim, Number>, Number>>
592 &spheres);
593
597 std::size_t
598 size() const;
599
603 const std::pair<::Point<dim, Number>, Number> &
604 get(unsigned int) const;
605
609 static constexpr bool is_nearest = false;
610
611 private:
612 std::vector<std::pair<::Point<dim, Number>, Number>> spheres;
613 };
614
615
616
622 template <int dim, typename Number>
623 class SphereNearestPredicate
624 {
625 public:
632 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres,
633 const unsigned int n_nearest_neighbors);
634
638 unsigned int
640
644 std::size_t
645 size() const;
646
650 const std::pair<::Point<dim, Number>, Number> &
651 get(unsigned int) const;
652
656 static constexpr bool is_nearest = true;
657
658 private:
659 std::vector<std::pair<::Point<dim, Number>, Number>> spheres;
660 unsigned int n_nearest_neighbors;
661 };
662# endif
663} // namespace ArborXWrappers
664#endif
665
666DEAL_II_NAMESPACE_CLOSE // Do not convert for module purposes
667
668
672#ifdef DEAL_II_WITH_ARBORX
673 namespace ArborX
674{
675# if ARBORX_VERSION_MAJOR < 2
680 template <int dim, typename Number>
681 struct AccessTraits<std::vector<::Point<dim, Number>>, PrimitivesTag>
682 {
683 using memory_space = Kokkos::HostSpace;
684
688 static std::size_t
689 size(const std::vector<::Point<dim, Number>> &v);
690
694 static Point
695 get(const std::vector<::Point<dim, Number>> &v, std::size_t i);
696 };
697
698
699
704 template <int dim, typename Number>
705 struct AccessTraits<std::vector<::BoundingBox<dim, Number>>,
706 PrimitivesTag>
707 {
708 using memory_space = Kokkos::HostSpace;
709
713 static std::size_t
714 size(const std::vector<::BoundingBox<dim, Number>> &v);
715
719 static Box
720 get(const std::vector<::BoundingBox<dim, Number>> &v, std::size_t i);
721 };
722
723
724
729 template <int dim, typename Number>
730 struct AccessTraits<
731 std::vector<std::pair<::Point<dim, Number>, Number>>,
732 PrimitivesTag>
733 {
734 using memory_space = Kokkos::HostSpace;
735
739 static std::size_t
740 size(const std::vector<std::pair<::Point<dim, Number>, Number>> &v);
741
746 static Sphere
747 get(const std::vector<std::pair<::Point<dim, Number>, Number>> &v,
748 std::size_t i);
749 };
750# else
754 template <typename T>
755 struct AccessTraits<
756 std::vector<T>,
757 std::enable_if_t<
758 std::is_same_v<T, ::Point<T::dimension, float>> ||
759 std::is_same_v<T, ::Point<T::dimension, double>> ||
760 std::is_same_v<T, ::BoundingBox<T::dimension, float>> ||
761 std::is_same_v<T, ::BoundingBox<T::dimension, double>> ||
762 std::is_same_v<T, std::pair<::Point<T::dimension, float>, float>> ||
763 std::is_same_v<T,
764 std::pair<::Point<T::dimension, double>, double>>>>
765 {
766 using memory_space = Kokkos::HostSpace;
767
771 static std::size_t
772 size(const std::vector<T> &v);
773
777 static T
778 get(const std::vector<T> &v, std::size_t i);
779 };
780# endif
781
782
783
784# if ARBORX_VERSION_MAJOR < 2
788 template <>
790 PredicatesTag>
791 {
792 using memory_space = Kokkos::HostSpace;
793
797 static std::size_t
798 size(const ::ArborXWrappers::PointIntersectPredicate &pt_intersect);
799
804 static auto
805 get(const ::ArborXWrappers::PointIntersectPredicate &pt_intersect,
806 std::size_t i);
807 };
808
809
810
814 template <>
816 PredicatesTag>
817 {
818 using memory_space = Kokkos::HostSpace;
819
823 static std::size_t
824 size(const ::ArborXWrappers::PointNearestPredicate &pt_nearest);
825
831 static auto
832 get(const ::ArborXWrappers::PointNearestPredicate &pt_nearest,
833 std::size_t i);
834 };
835
836
837
842 template <>
844 PredicatesTag>
845 {
846 using memory_space = Kokkos::HostSpace;
847
851 static std::size_t
852 size(const ::ArborXWrappers::BoundingBoxIntersectPredicate
853 &bb_intersect);
854
859 static auto
860 get(
861 const ::ArborXWrappers::BoundingBoxIntersectPredicate &bb_intersect,
862 std::size_t i);
863 };
864
865
866
871 template <>
873 PredicatesTag>
874 {
875 using memory_space = Kokkos::HostSpace;
876
880 static std::size_t
881 size(const ::ArborXWrappers::BoundingBoxNearestPredicate &bb_nearest);
882
888 static auto
889 get(const ::ArborXWrappers::BoundingBoxNearestPredicate &bb_nearest,
890 std::size_t i);
891 };
892
893
894
899 template <>
901 PredicatesTag>
902 {
903 using memory_space = Kokkos::HostSpace;
904
908 static std::size_t
909 size(const ::ArborXWrappers::SphereIntersectPredicate &sph_intersect);
910
915 static auto
916 get(const ::ArborXWrappers::SphereIntersectPredicate &sph_intersect,
917 std::size_t i);
918 };
919
920
921
925 template <>
927 PredicatesTag>
928 {
929 using memory_space = Kokkos::HostSpace;
930
934 static std::size_t
935 size(const ::ArborXWrappers::SphereNearestPredicate &sph_nearest);
936
942 static auto
943 get(const ::ArborXWrappers::SphereNearestPredicate &sph_nearest,
944 std::size_t i);
945 };
946# else
950 template <int dim, typename Number>
951 struct AccessTraits<
953 {
954 using memory_space = Kokkos::HostSpace;
955
959 static std::size_t
960 size(const ::ArborXWrappers::PointIntersectPredicate<dim, Number>
961 &pt_intersect);
962
967 static auto
968 get(const ::ArborXWrappers::PointIntersectPredicate<dim, Number>
969 &pt_intersect,
970 std::size_t i);
971 };
972
973
974
978 template <int dim, typename Number>
979 struct AccessTraits<
981 {
982 using memory_space = Kokkos::HostSpace;
983
987 static std::size_t
988 size(const ::ArborXWrappers::PointNearestPredicate<dim, Number>
989 &pt_nearest);
990
996 static auto
997 get(const ::ArborXWrappers::PointNearestPredicate<dim, Number>
998 &pt_nearest,
999 std::size_t i);
1000 };
1001
1002
1003
1008 template <int dim, typename Number>
1009 struct AccessTraits<
1011 {
1012 using memory_space = Kokkos::HostSpace;
1013
1017 static std::size_t
1018 size(
1019 const ::ArborXWrappers::BoundingBoxIntersectPredicate<dim, Number>
1020 &bb_intersect);
1021
1026 static auto
1027 get(const ::ArborXWrappers::BoundingBoxIntersectPredicate<dim, Number>
1028 &bb_intersect,
1029 std::size_t i);
1030 };
1031
1032
1033
1038 template <int dim, typename Number>
1039 struct AccessTraits<
1041 {
1042 using memory_space = Kokkos::HostSpace;
1043
1047 static std::size_t
1048 size(const ::ArborXWrappers::BoundingBoxNearestPredicate<dim, Number>
1049 &bb_nearest);
1050
1056 static auto
1057 get(const ::ArborXWrappers::BoundingBoxNearestPredicate<dim, Number>
1058 &bb_nearest,
1059 std::size_t i);
1060 };
1061
1062
1063
1068 template <int dim, typename Number>
1069 struct AccessTraits<
1071 {
1072 using memory_space = Kokkos::HostSpace;
1073
1077 static std::size_t
1078 size(const ::ArborXWrappers::SphereIntersectPredicate<dim, Number>
1079 &sph_intersect);
1080
1085 static auto
1086 get(const ::ArborXWrappers::SphereIntersectPredicate<dim, Number>
1087 &sph_intersect,
1088 std::size_t i);
1089 };
1090
1091
1092
1096 template <int dim, typename Number>
1097 struct AccessTraits<
1099 {
1100 using memory_space = Kokkos::HostSpace;
1101
1105 static std::size_t
1106 size(const ::ArborXWrappers::SphereNearestPredicate<dim, Number>
1107 &sph_nearest);
1108
1114 static auto
1115 get(const ::ArborXWrappers::SphereNearestPredicate<dim, Number>
1116 &sph_nearest,
1117 std::size_t i);
1118 };
1119# endif
1120
1121 // ------------------------------- Inline ----------------------------------//
1122
1123 // The implementation of AccessTraits<..., PredicatesTag> needs to be in the
1124 // header file otherwise the return type of auto get() cannot be determined.
1125 // We use auto because ArborX does not expose the type of intersects
1126
1127# if ARBORX_VERSION_MAJOR < 2
1128 inline std::size_t
1129 AccessTraits<::ArborXWrappers::PointIntersectPredicate, PredicatesTag>::
1130 size(const ::ArborXWrappers::PointIntersectPredicate &pt_intersect)
1131 {
1132 return pt_intersect.size();
1133 }
1134
1135
1136
1137 inline auto
1138 AccessTraits<::ArborXWrappers::PointIntersectPredicate, PredicatesTag>::
1139 get(const ::ArborXWrappers::PointIntersectPredicate &pt_intersect,
1140 std::size_t i)
1141 {
1142 const auto dealii_point = pt_intersect.get(i);
1143 return intersects(Point{dealii_point[0], dealii_point[1], dealii_point[2]});
1144 }
1145
1146
1147
1148 inline std::size_t
1149 AccessTraits<::ArborXWrappers::PointNearestPredicate, PredicatesTag>::
1150 size(const ::ArborXWrappers::PointNearestPredicate &pt_nearest)
1151 {
1152 return pt_nearest.size();
1153 }
1154
1155
1156
1157 inline auto
1158 AccessTraits<::ArborXWrappers::PointNearestPredicate, PredicatesTag>::
1159 get(const ::ArborXWrappers::PointNearestPredicate &pt_nearest,
1160 std::size_t i)
1161 {
1162 const auto dealii_point = pt_nearest.get(i);
1163 return nearest(Point{dealii_point[0], dealii_point[1], dealii_point[2]},
1164 pt_nearest.get_n_nearest_neighbors());
1165 }
1166
1167
1168
1169 inline std::size_t
1171 PredicatesTag>::
1172 size(
1173 const ::ArborXWrappers::BoundingBoxIntersectPredicate &bb_intersect)
1174 {
1175 return bb_intersect.size();
1176 }
1177
1178
1179
1180 inline auto
1182 PredicatesTag>::
1183 get(
1184 const ::ArborXWrappers::BoundingBoxIntersectPredicate &bb_intersect,
1185 std::size_t i)
1186 {
1187 const auto boundary_points = bb_intersect.get(i).get_boundary_points();
1188 const ::Point<3, float> min_corner = boundary_points.first;
1189 const ::Point<3, float> max_corner = boundary_points.second;
1190
1191 return intersects(Box{{min_corner[0], min_corner[1], min_corner[2]},
1192 {max_corner[0], max_corner[1], max_corner[2]}});
1193 }
1194
1195
1196
1197 inline std::size_t
1199 PredicatesTag>::
1200 size(const ::ArborXWrappers::BoundingBoxNearestPredicate &bb_nearest)
1201 {
1202 return bb_nearest.size();
1203 }
1204
1205
1206
1207 inline auto AccessTraits<::ArborXWrappers::BoundingBoxNearestPredicate,
1208 PredicatesTag>::
1209 get(const ::ArborXWrappers::BoundingBoxNearestPredicate &bb_nearest,
1210 std::size_t i)
1211 {
1212 const auto boundary_points = bb_nearest.get(i).get_boundary_points();
1213 const ::Point<3, float> min_corner = boundary_points.first;
1214 const ::Point<3, float> max_corner = boundary_points.second;
1215
1216 return nearest(Box{{min_corner[0], min_corner[1], min_corner[2]},
1217 {max_corner[0], max_corner[1], max_corner[2]}},
1218 bb_nearest.get_n_nearest_neighbors());
1219 }
1220
1221
1222
1223 inline std::size_t AccessTraits<
1225 PredicatesTag>::size(const ::ArborXWrappers::SphereIntersectPredicate
1226 &sph_intersect)
1227 {
1228 return sph_intersect.size();
1229 }
1230
1231
1232
1233 inline auto AccessTraits<::ArborXWrappers::SphereIntersectPredicate,
1234 PredicatesTag>::
1235 get(const ::ArborXWrappers::SphereIntersectPredicate &sph_intersect,
1236 std::size_t i)
1237 {
1238 const auto sphere = sph_intersect.get(i);
1239 return intersects(
1240 Sphere{{sphere.first[0], sphere.first[1], sphere.first[2]},
1241 sphere.second});
1242 }
1243
1244
1245
1246 inline std::size_t
1247 AccessTraits<::ArborXWrappers::SphereNearestPredicate, PredicatesTag>::
1248 size(const ::ArborXWrappers::SphereNearestPredicate &sph_nearest)
1249 {
1250 return sph_nearest.size();
1251 }
1252
1253
1254
1255 inline auto
1256 AccessTraits<::ArborXWrappers::SphereNearestPredicate, PredicatesTag>::
1257 get(const ::ArborXWrappers::SphereNearestPredicate &sph_nearest,
1258 std::size_t i)
1259 {
1260 const auto sphere = sph_nearest.get(i);
1261 return nearest(Sphere{{sphere.first[0], sphere.first[1], sphere.first[2]},
1262 sphere.second},
1263 sph_nearest.get_n_nearest_neighbors());
1264 }
1265# else
1266 template <int dim, typename Number>
1267 inline std::size_t
1268 AccessTraits<::ArborXWrappers::PointIntersectPredicate<dim, Number>>::
1269 size(const ::ArborXWrappers::PointIntersectPredicate<dim, Number>
1270 &pt_intersect)
1271 {
1272 return pt_intersect.size();
1273 }
1274
1275
1276
1277 template <int dim, typename Number>
1278 inline auto
1279 AccessTraits<::ArborXWrappers::PointIntersectPredicate<dim, Number>>::
1280 get(const ::ArborXWrappers::PointIntersectPredicate<dim, Number>
1281 &pt_intersect,
1282 std::size_t i)
1283 {
1284 return intersects(
1285 ::ArborXWrappers::internal::to_arborx_point(pt_intersect.get(i)));
1286 }
1287
1288
1289
1290 template <int dim, typename Number>
1291 inline std::size_t
1292 AccessTraits<::ArborXWrappers::PointNearestPredicate<dim, Number>>::
1293 size(const ::ArborXWrappers::PointNearestPredicate<dim, Number>
1294 &pt_nearest)
1295 {
1296 return pt_nearest.size();
1297 }
1298
1299
1300
1301 template <int dim, typename Number>
1302 inline auto
1303 AccessTraits<::ArborXWrappers::PointNearestPredicate<dim, Number>>::get(
1304 const ::ArborXWrappers::PointNearestPredicate<dim, Number>
1305 &pt_nearest,
1306 std::size_t i)
1307 {
1308 return nearest(::ArborXWrappers::internal::to_arborx_point(
1309 pt_nearest.get(i)),
1310 pt_nearest.get_n_nearest_neighbors());
1311 }
1312
1313
1314
1315 template <int dim, typename Number>
1316 inline std::size_t AccessTraits<
1318 size(
1319 const ::ArborXWrappers::BoundingBoxIntersectPredicate<dim, Number>
1320 &bb_intersect)
1321 {
1322 return bb_intersect.size();
1323 }
1324
1325
1326
1327 template <int dim, typename Number>
1328 inline auto AccessTraits<
1330 get(const ::ArborXWrappers::BoundingBoxIntersectPredicate<dim, Number>
1331 &bb_intersect,
1332 std::size_t i)
1333 {
1334 const auto boundary_points = bb_intersect.get(i).get_boundary_points();
1335 const ::Point<dim, Number> min_corner = boundary_points.first;
1336 const ::Point<dim, Number> max_corner = boundary_points.second;
1337
1338 return intersects(
1339 Box{::ArborXWrappers::internal::to_arborx_point(min_corner),
1340 ::ArborXWrappers::internal::to_arborx_point(max_corner)});
1341 }
1342
1343
1344
1345 template <int dim, typename Number>
1346 inline std::size_t AccessTraits<
1348 size(const ::ArborXWrappers::BoundingBoxNearestPredicate<dim, Number>
1349 &bb_nearest)
1350 {
1351 return bb_nearest.size();
1352 }
1353
1354
1355
1356 template <int dim, typename Number>
1357 inline auto AccessTraits<
1359 get(const ::ArborXWrappers::BoundingBoxNearestPredicate<dim, Number>
1360 &bb_nearest,
1361 std::size_t i)
1362 {
1363 const auto boundary_points = bb_nearest.get(i).get_boundary_points();
1364 const ::Point<dim, Number> min_corner = boundary_points.first;
1365 const ::Point<dim, Number> max_corner = boundary_points.second;
1366
1367 return nearest(
1368 Box{::ArborXWrappers::internal::to_arborx_point(min_corner),
1369 ::ArborXWrappers::internal::to_arborx_point(max_corner)},
1370 bb_nearest.get_n_nearest_neighbors());
1371 }
1372
1373
1374
1375 template <int dim, typename Number>
1376 inline std::size_t
1377 AccessTraits<::ArborXWrappers::SphereIntersectPredicate<dim, Number>>::
1378 size(const ::ArborXWrappers::SphereIntersectPredicate<dim, Number>
1379 &sph_intersect)
1380 {
1381 return sph_intersect.size();
1382 }
1383
1384
1385
1386 template <int dim, typename Number>
1387 inline auto
1388 AccessTraits<::ArborXWrappers::SphereIntersectPredicate<dim, Number>>::
1389 get(const ::ArborXWrappers::SphereIntersectPredicate<dim, Number>
1390 &sph_intersect,
1391 std::size_t i)
1392 {
1393 const auto sphere = sph_intersect.get(i);
1394 return intersects(
1395 Sphere{::ArborXWrappers::internal::to_arborx_point(sphere.first),
1396 sphere.second});
1397 }
1398
1399
1400
1401 template <int dim, typename Number>
1402 inline std::size_t
1403 AccessTraits<::ArborXWrappers::SphereNearestPredicate<dim, Number>>::
1404 size(const ::ArborXWrappers::SphereNearestPredicate<dim, Number>
1405 &sph_nearest)
1406 {
1407 return sph_nearest.size();
1408 }
1409
1410
1411
1412 template <int dim, typename Number>
1413 inline auto
1414 AccessTraits<::ArborXWrappers::SphereNearestPredicate<dim, Number>>::
1415 get(const ::ArborXWrappers::SphereNearestPredicate<dim, Number>
1416 &sph_nearest,
1417 std::size_t i)
1418 {
1419 const auto sphere = sph_nearest.get(i);
1420 return nearest(Sphere{::ArborXWrappers::internal::to_arborx_point(
1421 sphere.first),
1422 sphere.second},
1423 sph_nearest.get_n_nearest_neighbors());
1424 }
1425# endif
1426} // namespace ArborX
1427
1428#endif
1429
1430DEAL_II_NAMESPACE_OPEN // Do not convert for module purposes
1432
1433#endif
*  *  Point< dim > operator()(const Point< dim > &p) const * 
BoundingBoxIntersectPredicate(const std::vector<::BoundingBox< dim, Number > > &bounding_boxes)
const ::BoundingBox< 3, float > & get(unsigned int i) const
BoundingBoxNearestPredicate(const std::vector<::BoundingBox< dim, Number > > &bounding_boxes, const unsigned int n_nearest_neighbors)
const ::BoundingBox< 3, float > & get(unsigned int i) const
std::vector<::BoundingBox< 3, float > > bounding_boxes
const ::BoundingBox< 3, float > & get(unsigned int i) const
PointIntersectPredicate(const std::vector<::Point< dim, Number > > &points)
const ::Point< 3, float > & get(unsigned int i) const
unsigned int get_n_nearest_neighbors() const
const ::Point< 3, float > & get(unsigned int i) const
PointNearestPredicate(const std::vector<::Point< dim, Number > > &points, const unsigned int n_nearest_neighbors)
std::vector<::Point< 3, float > > points
const ::Point< 3, float > & get(unsigned int i) const
const std::pair<::Point< 3, float >, float > & get(unsigned int) const
SphereIntersectPredicate(const std::vector< std::pair<::Point< dim, Number >, Number > > &spheres)
const std::pair<::Point< 3, float >, float > & get(unsigned int) const
SphereNearestPredicate(const std::vector< std::pair<::Point< dim, Number >, Number > > &spheres, const unsigned int n_nearest_neighbors)
const std::pair<::Point< 3, float >, float > & get(unsigned int) const
std::vector< std::pair<::Point< 3, float >, float > > spheres
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points()
Definition point.h:111
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
std::size_t size
Definition mpi.cc:733
*  *  *  RotationFunction< dim, Number >::RotationFunction Number(dim)
STL namespace.