9 #ifndef _COMPADRE_POINTCLOUDSEARCH_HPP_
10 #define _COMPADRE_POINTCLOUDSEARCH_HPP_
14 #include "nanoflann.hpp"
15 #include <Kokkos_Core.hpp>
31 template <
typename _DistanceType,
typename _IndexType =
size_t>
58 bool full()
const {
return true; }
112 DistanceType best_distance = std::numeric_limits<DistanceType>::max();
116 if (
r_dist[i] < best_distance) {
117 best_distance =
r_dist[i];
118 best_distance_index =
i_dist[i];
123 if (best_index != 0) {
125 i_dist[0] = best_distance_index;
126 i_dist[best_index] = tmp_ind;
150 template <
typename view_type>
155 typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PointCloudSearch<view_type> >,
157 typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PointCloudSearch<view_type> >,
159 typedef nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PointCloudSearch<view_type> >,
178 _dim((dimension < 0) ? src_pts_view.extent(1) : dimension),
179 _max_leaf((max_leaf < 0) ? 10 : max_leaf) {
180 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename view_type::memory_space>::accessible==1)
181 &&
"Views passed to PointCloudSearch at construction should be accessible from the host.");
191 if (dimension==1) multiplier = 2;
192 return multiplier * 2.0 * unisolvency_size * std::pow(epsilon_multiplier, dimension) + 1;
205 inline double kdtree_distance(
const double* queryPt,
const int idx,
long long sz)
const {
208 for (
int i=0; i<
_dim; ++i) {
211 return std::sqrt(distance);
217 _tree_1d = std::make_shared<tree_type_1d>(1, *
this, nanoflann::KDTreeSingleIndexAdaptorParams(
_max_leaf));
219 }
else if (
_dim==2) {
220 _tree_2d = std::make_shared<tree_type_2d>(2, *
this, nanoflann::KDTreeSingleIndexAdaptorParams(
_max_leaf));
222 }
else if (
_dim==3) {
223 _tree_3d = std::make_shared<tree_type_3d>(3, *
this, nanoflann::KDTreeSingleIndexAdaptorParams(
_max_leaf));
239 template <
typename trg_view_type,
typename neighbor_lists_view_type,
typename epsilons_view_type>
241 neighbor_lists_view_type neighbor_lists, epsilons_view_type epsilons,
242 const double uniform_radius = 0.0,
double max_search_radius = 0.0) {
246 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename trg_view_type::memory_space>::accessible==1) &&
247 "Target coordinates view passed to generate2DNeighborListsFromRadiusSearch should be accessible from the host.");
249 "Target coordinates view passed to generate2DNeighborListsFromRadiusSearch must have \
250 second dimension as large as _dim.");
251 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename neighbor_lists_view_type::memory_space>::accessible==1) &&
252 "Views passed to generate2DNeighborListsFromRadiusSearch should be accessible from the host.");
253 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename epsilons_view_type::memory_space>::accessible==1) &&
254 "Views passed to generate2DNeighborListsFromRadiusSearch should be accessible from the host.");
265 && neighbor_lists.extent(1)>=1)
266 &&
"neighbor lists View does not have large enough dimensions");
270 &&
"epsilons View does not have the correct dimension");
272 typedef Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
275 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
279 int team_scratch_size = 0;
280 team_scratch_size += scratch_double_view::shmem_size(neighbor_lists.extent(1));
281 team_scratch_size += scratch_int_view::shmem_size(neighbor_lists.extent(1));
282 team_scratch_size += scratch_double_view::shmem_size(
_dim);
285 size_t max_num_neighbors = 0;
288 Kokkos::parallel_reduce(
"radius search",
host_team_policy(num_target_sites, Kokkos::AUTO)
289 .set_scratch_size(0 , Kokkos::PerTeam(team_scratch_size)),
290 KOKKOS_LAMBDA(
const host_member_type& teamMember,
size_t& t_max_num_neighbors) {
293 scratch_double_view neighbor_distances(teamMember.team_scratch(0 ), neighbor_lists.extent(1));
294 scratch_int_view neighbor_indices(teamMember.team_scratch(0 ), neighbor_lists.extent(1));
295 scratch_double_view this_target_coord(teamMember.team_scratch(0 ),
_dim);
297 size_t neighbors_found = 0;
299 const int i = teamMember.league_rank();
302 if (uniform_radius > 0) epsilons(i) = uniform_radius;
305 compadre_kernel_assert_release((epsilons(i)<=max_search_radius || max_search_radius==0) &&
"max_search_radius given (generally derived from the size of a halo region), and search radius needed would exceed this max_search_radius.");
307 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, neighbor_lists.extent(1)), [&](
const int j) {
308 neighbor_indices(j) = 0;
309 neighbor_distances(j) = -1.0;
311 teamMember.team_barrier();
313 Kokkos::single(Kokkos::PerTeam(teamMember), [&] () {
317 for (
int j=0; j<
_dim; ++j) {
318 this_target_coord(j) = trg_pts_view(i,j);
321 nanoflann::SearchParams sp;
324 neighbors_found =
_tree_1d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
325 }
else if (_dim==2) {
326 neighbors_found =
_tree_2d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
327 }
else if (_dim==3) {
328 neighbors_found =
_tree_3d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
331 t_max_num_neighbors = (neighbors_found > t_max_num_neighbors) ? neighbors_found : t_max_num_neighbors;
334 neighbor_lists(i,0) = neighbors_found;
338 teamMember.team_barrier();
341 int loop_bound = (neighbors_found < neighbor_lists.extent(1)-1) ? neighbors_found : neighbor_lists.extent(1)-1;
344 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, loop_bound), [&](
const int j) {
346 neighbor_lists(i,j+1) =
static_cast<typename std::remove_pointer<typename std::remove_pointer<typename neighbor_lists_view_type::data_type>::type
>::type>(neighbor_indices(j));
348 teamMember.team_barrier();
351 }, Kokkos::Max<size_t>(max_num_neighbors) );
356 &&
"neighbor_lists does not contain enough columns for the maximum number of neighbors needing to be stored.");
358 return max_num_neighbors;
373 template <
typename trg_view_type,
typename neighbor_lists_view_type,
typename epsilons_view_type>
375 neighbor_lists_view_type neighbor_lists, neighbor_lists_view_type number_of_neighbors_list,
376 epsilons_view_type epsilons,
const double uniform_radius = 0.0,
double max_search_radius = 0.0) {
380 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename trg_view_type::memory_space>::accessible==1) &&
381 "Target coordinates view passed to generateCRNeighborListsFromRadiusSearch should be accessible from the host.");
383 "Target coordinates view passed to generateCRNeighborListsFromRadiusSearch must have \
384 second dimension as large as _dim.");
385 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename neighbor_lists_view_type::memory_space>::accessible==1) &&
386 "Views passed to generateCRNeighborListsFromRadiusSearch should be accessible from the host.");
387 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename epsilons_view_type::memory_space>::accessible==1) &&
388 "Views passed to generateCRNeighborListsFromRadiusSearch should be accessible from the host.");
398 &&
"number_of_neighbors_list or neighbor lists View does not have large enough dimensions");
401 typedef Kokkos::View<
global_index_type*,
typename neighbor_lists_view_type::array_layout,
402 typename neighbor_lists_view_type::memory_space,
typename neighbor_lists_view_type::memory_traits> row_offsets_view_type;
403 row_offsets_view_type row_offsets;
404 int max_neighbor_list_row_storage_size = 1;
407 max_neighbor_list_row_storage_size = nla.getMaxNumNeighbors();
408 Kokkos::resize(row_offsets, num_target_sites);
410 Kokkos::parallel_for(Kokkos::RangePolicy<host_execution_space>(0,num_target_sites), [&](
const int i) {
411 row_offsets(i) = nla.getRowOffsetHost(i);
417 &&
"epsilons View does not have the correct dimension");
419 typedef Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
422 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
426 int team_scratch_size = 0;
427 team_scratch_size += scratch_double_view::shmem_size(max_neighbor_list_row_storage_size);
428 team_scratch_size += scratch_int_view::shmem_size(max_neighbor_list_row_storage_size);
429 team_scratch_size += scratch_double_view::shmem_size(
_dim);
433 Kokkos::parallel_for(
"radius search",
host_team_policy(num_target_sites, Kokkos::AUTO)
434 .set_scratch_size(0 , Kokkos::PerTeam(team_scratch_size)),
438 scratch_double_view neighbor_distances(teamMember.team_scratch(0 ), max_neighbor_list_row_storage_size);
439 scratch_int_view neighbor_indices(teamMember.team_scratch(0 ), max_neighbor_list_row_storage_size);
440 scratch_double_view this_target_coord(teamMember.team_scratch(0 ),
_dim);
442 size_t neighbors_found = 0;
444 const int i = teamMember.league_rank();
447 if (uniform_radius > 0) epsilons(i) = uniform_radius;
450 compadre_kernel_assert_release((epsilons(i)<=max_search_radius || max_search_radius==0) &&
"max_search_radius given (generally derived from the size of a halo region), and search radius needed would exceed this max_search_radius.");
452 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, max_neighbor_list_row_storage_size), [&](
const int j) {
453 neighbor_indices(j) = 0;
454 neighbor_distances(j) = -1.0;
456 teamMember.team_barrier();
458 Kokkos::single(Kokkos::PerTeam(teamMember), [&] () {
462 for (
int j=0; j<
_dim; ++j) {
463 this_target_coord(j) = trg_pts_view(i,j);
466 nanoflann::SearchParams sp;
469 neighbors_found =
_tree_1d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
470 }
else if (_dim==2) {
471 neighbors_found =
_tree_2d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
472 }
else if (_dim==3) {
473 neighbors_found =
_tree_3d->template radiusSearchCustomCallback<Compadre::RadiusResultSet<double> >(this_target_coord.data(), rrs, sp) ;
478 if (is_dry_run || uniform_radius!=0.0) {
479 number_of_neighbors_list(i) = neighbors_found;
482 &&
"Number of neighbors found changed since dry-run.");
487 teamMember.team_barrier();
490 int loop_bound = neighbors_found;
493 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, loop_bound), [&](
const int j) {
495 neighbor_lists(row_offsets(i)+j) =
static_cast<typename std::remove_pointer<typename std::remove_pointer<typename neighbor_lists_view_type::data_type>::type
>::type>(neighbor_indices(j));
497 teamMember.team_barrier();
503 return nla.getTotalNeighborsOverAllListsHost();
517 template <
typename trg_view_type,
typename neighbor_lists_view_type,
typename epsilons_view_type>
519 neighbor_lists_view_type neighbor_lists, epsilons_view_type epsilons,
520 const int neighbors_needed,
const double epsilon_multiplier = 1.6,
521 double max_search_radius = 0.0) {
525 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename trg_view_type::memory_space>::accessible==1) &&
526 "Target coordinates view passed to generate2DNeighborListsFromKNNSearch should be accessible from the host.");
528 "Target coordinates view passed to generate2DNeighborListsFromRadiusSearch must have \
529 second dimension as large as _dim.");
530 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename neighbor_lists_view_type::memory_space>::accessible==1) &&
531 "Views passed to generate2DNeighborListsFromKNNSearch should be accessible from the host.");
532 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename epsilons_view_type::memory_space>::accessible==1) &&
533 "Views passed to generate2DNeighborListsFromKNNSearch should be accessible from the host.");
544 (neighbor_lists.extent(0)==(size_t)num_target_sites
545 && neighbor_lists.extent(1)>=(size_t)(neighbors_needed+1)))
546 &&
"neighbor lists View does not have large enough dimensions");
550 &&
"epsilons View does not have the correct dimension");
552 typedef Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
555 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
559 int team_scratch_size = 0;
560 team_scratch_size += scratch_double_view::shmem_size(neighbor_lists.extent(1));
561 team_scratch_size += scratch_int_view::shmem_size(neighbor_lists.extent(1));
562 team_scratch_size += scratch_double_view::shmem_size(
_dim);
565 size_t min_num_neighbors = 0;
573 Kokkos::parallel_reduce(
"knn search",
host_team_policy(num_target_sites, Kokkos::AUTO)
574 .set_scratch_size(0 , Kokkos::PerTeam(team_scratch_size)),
575 KOKKOS_LAMBDA(
const host_member_type& teamMember,
size_t& t_min_num_neighbors) {
578 scratch_double_view neighbor_distances(teamMember.team_scratch(0 ), neighbor_lists.extent(1));
579 scratch_int_view neighbor_indices(teamMember.team_scratch(0 ), neighbor_lists.extent(1));
580 scratch_double_view this_target_coord(teamMember.team_scratch(0 ),
_dim);
582 size_t neighbors_found = 0;
584 const int i = teamMember.league_rank();
586 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, neighbor_lists.extent(1)), [=](
const int j) {
587 neighbor_indices(j) = 0;
588 neighbor_distances(j) = -1.0;
591 teamMember.team_barrier();
592 Kokkos::single(Kokkos::PerTeam(teamMember), [&] () {
596 for (
int j=0; j<
_dim; ++j) {
597 this_target_coord(j) = trg_pts_view(i,j);
601 neighbors_found =
_tree_1d->knnSearch(this_target_coord.data(), neighbors_needed,
602 neighbor_indices.data(), neighbor_distances.data()) ;
603 }
else if (_dim==2) {
604 neighbors_found =
_tree_2d->knnSearch(this_target_coord.data(), neighbors_needed,
605 neighbor_indices.data(), neighbor_distances.data()) ;
606 }
else if (_dim==3) {
607 neighbors_found =
_tree_3d->knnSearch(this_target_coord.data(), neighbors_needed,
608 neighbor_indices.data(), neighbor_distances.data()) ;
612 t_min_num_neighbors = (neighbors_found < t_min_num_neighbors) ? neighbors_found : t_min_num_neighbors;
615 epsilons(i) = (neighbor_distances(neighbors_found-1) > 0) ?
616 std::sqrt(neighbor_distances(neighbors_found-1))*epsilon_multiplier : 1e-14*epsilon_multiplier;
624 &&
"Neighbors found exceeded storage capacity in neighbor list.");
626 &&
"max_search_radius given (generally derived from the size of a halo region), \
627 and search radius needed would exceed this max_search_radius.");
630 }, Kokkos::Min<size_t>(min_num_neighbors) );
635 if (num_target_sites==0) min_num_neighbors = neighbors_needed;
639 &&
"Neighbor search failed to find number of neighbors needed for unisolvency.");
643 epsilons, 0.0 , max_search_radius);
645 return max_num_neighbors;
659 template <
typename trg_view_type,
typename neighbor_lists_view_type,
typename epsilons_view_type>
661 neighbor_lists_view_type neighbor_lists, neighbor_lists_view_type number_of_neighbors_list,
662 epsilons_view_type epsilons,
const int neighbors_needed,
const double epsilon_multiplier = 1.6,
663 double max_search_radius = 0.0) {
667 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename trg_view_type::memory_space>::accessible==1) &&
668 "Target coordinates view passed to generateCRNeighborListsFromKNNSearch should be accessible from the host.");
670 "Target coordinates view passed to generateCRNeighborListsFromRadiusSearch must have \
671 second dimension as large as _dim.");
672 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename neighbor_lists_view_type::memory_space>::accessible==1) &&
673 "Views passed to generateCRNeighborListsFromKNNSearch should be accessible from the host.");
674 compadre_assert_release((Kokkos::SpaceAccessibility<host_execution_space, typename epsilons_view_type::memory_space>::accessible==1) &&
675 "Views passed to generateCRNeighborListsFromKNNSearch should be accessible from the host.");
686 &&
"number_of_neighbors_list or neighbor lists View does not have large enough dimensions");
690 int max_neighbor_list_row_storage_size = neighbors_needed;
693 max_neighbor_list_row_storage_size = nla.getMaxNumNeighbors();
697 &&
"epsilons View does not have the correct dimension");
699 typedef Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
702 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
706 int team_scratch_size = 0;
707 team_scratch_size += scratch_double_view::shmem_size(max_neighbor_list_row_storage_size);
708 team_scratch_size += scratch_int_view::shmem_size(max_neighbor_list_row_storage_size);
709 team_scratch_size += scratch_double_view::shmem_size(
_dim);
712 size_t min_num_neighbors = 0;
720 Kokkos::parallel_reduce(
"knn search",
host_team_policy(num_target_sites, Kokkos::AUTO)
721 .set_scratch_size(0 , Kokkos::PerTeam(team_scratch_size)),
722 KOKKOS_LAMBDA(
const host_member_type& teamMember,
size_t& t_min_num_neighbors) {
725 scratch_double_view neighbor_distances(teamMember.team_scratch(0 ), max_neighbor_list_row_storage_size);
726 scratch_int_view neighbor_indices(teamMember.team_scratch(0 ), max_neighbor_list_row_storage_size);
727 scratch_double_view this_target_coord(teamMember.team_scratch(0 ),
_dim);
729 size_t neighbors_found = 0;
731 const int i = teamMember.league_rank();
733 Kokkos::parallel_for(Kokkos::TeamThreadRange(teamMember, max_neighbor_list_row_storage_size), [=](
const int j) {
734 neighbor_indices(j) = 0;
735 neighbor_distances(j) = -1.0;
738 teamMember.team_barrier();
739 Kokkos::single(Kokkos::PerTeam(teamMember), [&] () {
743 for (
int j=0; j<
_dim; ++j) {
744 this_target_coord(j) = trg_pts_view(i,j);
748 neighbors_found =
_tree_1d->knnSearch(this_target_coord.data(), neighbors_needed,
749 neighbor_indices.data(), neighbor_distances.data()) ;
750 }
else if (_dim==2) {
751 neighbors_found =
_tree_2d->knnSearch(this_target_coord.data(), neighbors_needed,
752 neighbor_indices.data(), neighbor_distances.data()) ;
753 }
else if (_dim==3) {
754 neighbors_found =
_tree_3d->knnSearch(this_target_coord.data(), neighbors_needed,
755 neighbor_indices.data(), neighbor_distances.data()) ;
759 t_min_num_neighbors = (neighbors_found < t_min_num_neighbors) ? neighbors_found : t_min_num_neighbors;
762 epsilons(i) = (neighbor_distances(neighbors_found-1) > 0) ?
763 std::sqrt(neighbor_distances(neighbors_found-1))*epsilon_multiplier : 1e-14*epsilon_multiplier;
770 &&
"max_search_radius given (generally derived from the size of a halo region), \
771 and search radius needed would exceed this max_search_radius.");
774 }, Kokkos::Min<size_t>(min_num_neighbors) );
779 if (num_target_sites==0) min_num_neighbors = neighbors_needed;
783 &&
"Neighbor search failed to find number of neighbors needed for unisolvency.");
787 number_of_neighbors_list, epsilons, 0.0 , max_search_radius);
790 return nla.getTotalNeighborsOverAllListsHost();
795 template <
typename view_type>
const DistanceType radius
std::size_t global_index_type
size_t generate2DNeighborListsFromKNNSearch(bool is_dry_run, trg_view_type trg_pts_view, neighbor_lists_view_type neighbor_lists, epsilons_view_type epsilons, const int neighbors_needed, const double epsilon_multiplier=1.6, double max_search_radius=0.0)
Generates neighbor lists as 2D view by performing a k-nearest neighbor search Only accepts 2D neighbo...
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudSearch< view_type > >, PointCloudSearch< view_type >, 3 > tree_type_3d
import subprocess import os import re import math import sys import argparse d d num_target_sites
#define compadre_kernel_assert_release(condition)
compadre_kernel_assert_release is similar to compadre_assert_release, but is a call on the device...
int kdtree_get_point_count() const
Returns the number of source sites.
PointCloudSearch< view_type > CreatePointCloudSearch(view_type src_view, const local_index_type dimensions=-1, const local_index_type max_leaf=-1)
CreatePointCloudSearch allows for the construction of an object of type PointCloudSearch with templat...
RadiusResultSet(DistanceType radius_, DistanceType *r_dist_, IndexType *i_dist_, const IndexType max_size_)
DistanceType worstDist() const
size_t generateCRNeighborListsFromKNNSearch(bool is_dry_run, trg_view_type trg_pts_view, neighbor_lists_view_type neighbor_lists, neighbor_lists_view_type number_of_neighbors_list, epsilons_view_type epsilons, const int neighbors_needed, const double epsilon_multiplier=1.6, double max_search_radius=0.0)
Generates compressed row neighbor lists by performing a k-nearest neighbor search Only accepts 1D nei...
bool kdtree_get_bbox(BBOX &bb) const
Bounding box query method required by Nanoflann.
NeighborLists< view_type > CreateNeighborLists(view_type number_of_neighbors_list)
CreateNeighborLists allows for the construction of an object of type NeighborLists with template dedu...
Kokkos::TeamPolicy< host_execution_space > host_team_policy
size_t generate2DNeighborListsFromRadiusSearch(bool is_dry_run, trg_view_type trg_pts_view, neighbor_lists_view_type neighbor_lists, epsilons_view_type epsilons, const double uniform_radius=0.0, double max_search_radius=0.0)
Generates neighbor lists of 2D view by performing a radius search where the radius to be searched is ...
size_t generateCRNeighborListsFromRadiusSearch(bool is_dry_run, trg_view_type trg_pts_view, neighbor_lists_view_type neighbor_lists, neighbor_lists_view_type number_of_neighbors_list, epsilons_view_type epsilons, const double uniform_radius=0.0, double max_search_radius=0.0)
Generates compressed row neighbor lists by performing a radius search where the radius to be searched...
std::pair< IndexType, DistanceType > worst_item() const
local_index_type _max_leaf
Custom RadiusResultSet for nanoflann that uses pre-allocated space for indices and radii instead of u...
PointCloudSearch(view_type src_pts_view, const local_index_type dimension=-1, const local_index_type max_leaf=-1)
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudSearch< view_type > >, PointCloudSearch< view_type >, 2 > tree_type_2d
bool addPoint(DistanceType dist, IndexType index)
std::shared_ptr< tree_type_3d > _tree_3d
_DistanceType DistanceType
std::shared_ptr< tree_type_2d > _tree_2d
double kdtree_distance(const double *queryPt, const int idx, long long sz) const
Returns the distance between a point and a source site, given its index.
static int getEstimatedNumberNeighborsUpperBound(int unisolvency_size, const int dimension, const double epsilon_multiplier)
Returns a liberal estimated upper bound on number of neighbors to be returned by a neighbor search fo...
PointCloudSearch generates neighbor lists and window sizes for each target site.
host_team_policy::member_type host_member_type
std::shared_ptr< tree_type_1d > _tree_1d
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudSearch< view_type > >, PointCloudSearch< view_type >, 1 > tree_type_1d
double kdtree_get_pt(const int idx, int dim) const
Returns the coordinate value of a point.
view_type _src_pts_view
source site coordinates
#define compadre_assert_release(condition)
compadre_assert_release is used for assertions that should always be checked, but generally are not e...
#define compadre_kernel_assert_debug(condition)