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 does not match the tag of a point for which neighbors are computed. This is useful when computing neighbor list for contact. In this case, we do not want points from the same particle to be in the contact 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 | |
TreeSearchCheckIDExcludeResult (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 does not match the tag of a point for which neighbors are computed. This is useful when computing neighbor list for contact. In this case, we do not want points from the same particle to be in the contact 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 192 of file nflannSetup.h.
typedef _DistanceType nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::DistanceType |
Distance type (double, float, etc)
Definition at line 195 of file nflannSetup.h.
typedef _IndexType nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::IndexType |
Index type (int, size_t, etc)
Definition at line 198 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 226 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _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 272 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_dataTags, nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_dists, nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_indices, nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_r, and nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_tag.
|
inline |
Clear the data.
Definition at line 247 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_dists, and nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_indices.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::init().
|
inline |
Check (not implemented)
Definition at line 263 of file nflannSetup.h.
|
inline |
Initialize the data (clear)
Definition at line 242 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::clear().
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::TreeSearchCheckIDExcludeResult().
|
inline |
Get the size of currently stored (found so far) indices.
Definition at line 257 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _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 296 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_indices.
|
inline |
Return maximum distance for search.
Definition at line 286 of file nflannSetup.h.
References nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_r.
const std::vector<IndexType>& nsearch::TreeSearchCheckIDExcludeResult< _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 215 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::addPoint().
std::vector<DistanceType>& nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_dists |
Distance of points found within the search radius.
Definition at line 212 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::clear().
std::vector<IndexType>& nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_indices |
Indices within the search radius.
Definition at line 209 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::addPoint(), nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::clear(), nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::size(), and nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::worst_item().
const DistanceType nsearch::TreeSearchCheckIDExcludeResult< _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 203 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::addPoint(), and nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::worstDist().
const IndexType& nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::d_tag |
Tag of the point we are searching for neighboring points.
Definition at line 206 of file nflannSetup.h.
Referenced by nsearch::TreeSearchCheckIDExcludeResult< _DistanceType, _IndexType >::addPoint().