OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::NanoflannContact< T, PARTICLETYPE > Class Template Reference

#include <nanoflann_adaptor.hpp>

+ Inheritance diagram for olb::NanoflannContact< T, PARTICLETYPE >:
+ Collaboration diagram for olb::NanoflannContact< T, PARTICLETYPE >:

Public Member Functions

 NanoflannContact (ParticleSystem3D< T, PARTICLETYPE > &pSys, T sRad)
 
ContactDetection< T, PARTICLETYPE > * generate (ParticleSystem3D< T, PARTICLETYPE > &pSys) override
 
void sort () override
 
int getMatches (int pInt, std::vector< std::pair< size_t, T > > &matches) override
 
- Public Member Functions inherited from olb::ContactDetection< T, PARTICLETYPE >
 ContactDetection (ParticleSystem3D< T, PARTICLETYPE > &pSys)
 
 ContactDetection (ParticleSystem3D< T, PARTICLETYPE > &pSys, std::string name)
 
virtual ~ContactDetection ()
 
std::string getName ()
 

Additional Inherited Members

- Protected Attributes inherited from olb::ContactDetection< T, PARTICLETYPE >
ParticleSystem3D< T, PARTICLETYPE > & _pSys
 
std::string _name
 

Detailed Description

template<typename T, template< typename U > class PARTICLETYPE>
class olb::NanoflannContact< T, PARTICLETYPE >

Definition at line 88 of file nanoflann_adaptor.hpp.

Constructor & Destructor Documentation

◆ NanoflannContact()

template<typename T , template< typename U > class PARTICLETYPE>
olb::NanoflannContact< T, PARTICLETYPE >::NanoflannContact ( ParticleSystem3D< T, PARTICLETYPE > & pSys,
T sRad )
inline

Definition at line 91 of file nanoflann_adaptor.hpp.

91 : ContactDetection<T, PARTICLETYPE> (pSys, "Nanoflann"),
92 _pc2kd(pSys),
93 _index(3,_pc2kd, KDTreeSingleIndexAdaptorParams(10) ),
94 _sRad2(sRad*sRad),
95 _sRad(sRad)
96 {
97 _index.init();
98 _params.sorted = false;
99 }
Parameters (see http://code.google.com/p/nanoflann/ for help choosing the parameters)
bool sorted
only for radius search, require neighbours sorted by distance (default: true)

References nanoflann::KDTreeSingleIndexAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::init(), and nanoflann::SearchParams::sorted.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ generate()

template<typename T , template< typename U > class PARTICLETYPE>
ContactDetection< T, PARTICLETYPE > * olb::NanoflannContact< T, PARTICLETYPE >::generate ( ParticleSystem3D< T, PARTICLETYPE > & pSys)
inlineoverridevirtual

Reimplemented from olb::ContactDetection< T, PARTICLETYPE >.

Definition at line 100 of file nanoflann_adaptor.hpp.

100 {
101 //std::cout << "calling NanoflannContact.generate()" << std::endl;
102 return new NanoflannContact(pSys,_sRad);
103 }
NanoflannContact(ParticleSystem3D< T, PARTICLETYPE > &pSys, T sRad)

References olb::NanoflannContact< T, PARTICLETYPE >::NanoflannContact().

+ Here is the call graph for this function:

◆ getMatches()

template<typename T , template< typename U > class PARTICLETYPE>
int olb::NanoflannContact< T, PARTICLETYPE >::getMatches ( int pInt,
std::vector< std::pair< size_t, T > > & matches )
inlineoverridevirtual

Reimplemented from olb::ContactDetection< T, PARTICLETYPE >.

Definition at line 109 of file nanoflann_adaptor.hpp.

109 {
110 _index.radiusSearch(&this->_pSys[pInt].getPos()[0], _sRad2, matches, _params);
111 return matches.size();
112 }
size_t radiusSearch(const ElementType *query_point, const DistanceType radius, std::vector< std::pair< IndexType, DistanceType > > &IndicesDists, const SearchParams &searchParams) const
Find all the neighbors to query_point[0:dim-1] within a maximum radius.
ParticleSystem3D< T, PARTICLETYPE > & _pSys

References olb::ContactDetection< T, PARTICLETYPE >::_pSys, and nanoflann::KDTreeSingleIndexAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::radiusSearch().

+ Here is the call graph for this function:

◆ sort()

template<typename T , template< typename U > class PARTICLETYPE>
void olb::NanoflannContact< T, PARTICLETYPE >::sort ( )
inlineoverridevirtual

Reimplemented from olb::ContactDetection< T, PARTICLETYPE >.

Definition at line 105 of file nanoflann_adaptor.hpp.

105 {
106 _index.buildIndex();
107 }
void buildIndex()
Builds the index.

References nanoflann::KDTreeSingleIndexAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::buildIndex().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: