41 #ifndef DTK_SPLINEINTERPOLATIONPAIRING_IMPL_HPP 42 #define DTK_SPLINEINTERPOLATIONPAIRING_IMPL_HPP 57 const Teuchos::ArrayView<const double> &child_centers,
58 const Teuchos::ArrayView<const double> &parent_centers,
const bool use_knn,
59 const unsigned num_neighbors,
const double radius )
61 DTK_REQUIRE( 0 == child_centers.size() % DIM );
62 DTK_REQUIRE( 0 == parent_centers.size() % DIM );
65 unsigned leaf_size = 30;
69 unsigned num_parents = parent_centers.size() / DIM;
70 d_pairings.resize( num_parents );
71 d_pair_sizes = Teuchos::ArrayRCP<EntityId>( num_parents );
72 d_radii.resize( num_parents );
75 for (
unsigned i = 0; i < num_parents; ++i )
86 tree.
nnSearch( parent_centers( DIM * i, DIM ), num_neighbors );
91 parent_centers( DIM * i, DIM ).getRawPtr(),
92 child_centers( DIM * d_pairings[i].back(), DIM ).getRawPtr() );
100 tree.
radiusSearch( parent_centers( DIM * i, DIM ), radius );
105 d_pair_sizes[i] = d_pairings[i].size();
115 Teuchos::ArrayView<const unsigned>
117 const unsigned parent_id )
const 119 DTK_REQUIRE( parent_id < d_pairings.size() );
120 Teuchos::ArrayView<const unsigned> id_view = d_pairings[parent_id]();
130 const unsigned parent_id )
const 132 DTK_REQUIRE( parent_id < d_radii.size() );
133 return d_radii[parent_id];
142 #endif // end DTK_SPLINEINTERPOLATIONPAIRING_IMPL_HPP Local source/parent center pairings.
Teuchos::Array< unsigned > nnSearch(const Teuchos::ArrayView< const double > &point, const unsigned num_neighbors) const
Perform an n-nearest neighbor search.
Spatial searching for point clouds.
Spatial searching for point clouds.
SplineInterpolationPairing(const Teuchos::ArrayView< const double > &child_centers, const Teuchos::ArrayView< const double > &parent_centers, const bool use_knn, const unsigned num_neighbors, const double radius)
Constructor.
Teuchos::Array< unsigned > radiusSearch(const Teuchos::ArrayView< const double > &point, const double radius) const
Perform a nearest neighbor search within a specified radius.
Assertions and Design-by-Contract for error handling.
Eucliden distance function.
Teuchos::ArrayView< const unsigned > childCenterIds(const unsigned parent_id) const
Given a parent center local id get the ids of the child centers within the given radius.
Euclidean distance function.
Local child/parent center pairings.