PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
To collect results of nanoflann tree search. In this class, we check the tag of a potential point and add the point to search list if the tag matches the tag of a point for which neighbors are computed. This is useful when computing neighbor list for peridynamics. In this case, we want points from the same particle to be in the peridynamics neighbor lsit. Default result output of nanoflann search uses std::vector<std::pair<size_t, double>>. We prefer to get the index and distance in a separate list. More...
#include <nflannSetup.h>
Public Types | |
typedef _DistanceType | DistanceType |
Distance type (double, float, etc) | |
typedef _IndexType | IndexType |
Index type (int, size_t, etc) | |
Public Member Functions | |
TreeSearchCheckIDIncludeResult (DistanceType radius_, std::vector< IndexType > &indices, std::vector< DistanceType > &dists, const IndexType &searchPointTag, const std::vector< IndexType > &dataTags) | |
Constructor. | |
void | init () |
Initialize the data (clear) | |
void | clear () |
Clear the data. | |
size_t | size () const |
Get the size of currently stored (found so far) indices. | |
bool | full () const |
Check (not implemented) | |
bool | addPoint (DistanceType dist, IndexType index) |
Called during search to add an element matching the criteria. | |
DistanceType | worstDist () const |
Return maximum distance for search. | |
std::pair< IndexType, DistanceType > | worst_item () const |
Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0. | |
Data Fields | |
const DistanceType | d_r |
Define search radius. Note this should be square of radius, where radius is a distance within which we are searching for points. | |
const IndexType & | d_tag |
Tag of the point we are searching for neighboring points. | |
std::vector< IndexType > & | d_indices |
Indices within the search radius. | |
std::vector< DistanceType > & | d_dists |
Distance of points found within the search radius. | |
const std::vector< IndexType > & | d_dataTags |
Tag of point data that we want to check with given point to be added to the search result. | |
To collect results of nanoflann tree search. In this class, we check the tag of a potential point and add the point to search list if the tag matches the tag of a point for which neighbors are computed. This is useful when computing neighbor list for peridynamics. In this case, we want points from the same particle to be in the peridynamics neighbor lsit. Default result output of nanoflann search uses std::vector<std::pair<size_t, double>>. We prefer to get the index and distance in a separate list.
Definition at line 314 of file nflannSetup.h.
typedef _DistanceType nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::DistanceType |
Distance type (double, float, etc)
Definition at line 317 of file nflannSetup.h.
typedef _IndexType nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::IndexType |
Index type (int, size_t, etc)
Definition at line 320 of file nflannSetup.h.
|
inline |
Constructor.
radius_ | Search radius (square of radius) |
indices | Reference to index vector |
dists | Reference to distance vector |
searchPointTag | Tag of a search point |
dataTags | Vector of tags for each point in the pointcloud |
Definition at line 348 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::init().
|
inline |
Called during search to add an element matching the criteria.
dist | Distance of point from the search point |
index | Id of point |
Definition at line 394 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_dataTags, nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_dists, nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_indices, nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_r, and nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_tag.
|
inline |
Clear the data.
Definition at line 369 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_dists, and nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_indices.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::init().
|
inline |
Check (not implemented)
Definition at line 385 of file nflannSetup.h.
|
inline |
Initialize the data (clear)
Definition at line 364 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::clear().
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::TreeSearchCheckIDIncludeResult().
|
inline |
Get the size of currently stored (found so far) indices.
Definition at line 379 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_indices.
|
inline |
Find the worst result (furtherest neighbor) without copying or sorting Pre-conditions: size() > 0.
Currently, we return pair(0, 0.)
Definition at line 418 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_indices.
|
inline |
Return maximum distance for search.
Definition at line 408 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_r.
const std::vector<IndexType>& nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_dataTags |
Tag of point data that we want to check with given point to be added to the search result.
Definition at line 337 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::addPoint().
std::vector<DistanceType>& nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_dists |
Distance of points found within the search radius.
Definition at line 334 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::clear().
std::vector<IndexType>& nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_indices |
Indices within the search radius.
Definition at line 331 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::addPoint(), nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::clear(), nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::size(), and nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::worst_item().
const DistanceType nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_r |
Define search radius. Note this should be square of radius, where radius is a distance within which we are searching for points.
Definition at line 325 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::worstDist().
const IndexType& nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::d_tag |
Tag of the point we are searching for neighboring points.
Definition at line 328 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDIncludeResult< _DistanceType, _IndexType >::addPoint().