Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
Public Member Functions | List of all members
NeighbourSearcher Class Referenceabstract

An abstract class for the family of classes that performs the task of nearest neighbour search for particles. More...

#include <neighbour_searcher.h>

Inheritance diagram for NeighbourSearcher:
OctreeSearcher

Public Member Functions

virtual ~NeighbourSearcher ()
 Destructor.
 
virtual int buildSearchStructure (const double *x, const double *y, const double *z, size_t numParticles)=0
 Build the data structure for the nearest neighbour search, based on the input particle location ayyays in the x, y, and z-coordinates and the number of particles. More...
 
virtual int buildSearchStructure (const double *x, const double *y, const double *z, size_t begin, size_t numParticles)=0
 Build the data structure for the nearest neighbour search, based on the input particle location arrays in the x, y, and z-coordinates, the starting point in the arrays and the number of particles. More...
 
virtual int searchNeighbour (const double x, const double y, const double z, const double radius, int *result, double *distance, size_t &result_length, int index=-1)=0
 Searches the nearest neighbours for a particle on the built search data structure. More...
 

Detailed Description

An abstract class for the family of classes that performs the task of nearest neighbour search for particles.

Author
Yu, Kwangmin (yukwa.nosp@m.ngmi.nosp@m.n@gma.nosp@m.il.c.nosp@m.om)
Version
1.0
Date
2014/10/14

Created on: 2014/8/22

Member Function Documentation

virtual int NeighbourSearcher::buildSearchStructure ( const double *  x,
const double *  y,
const double *  z,
size_t  numParticles 
)
pure virtual

Build the data structure for the nearest neighbour search, based on the input particle location ayyays in the x, y, and z-coordinates and the number of particles.

The function uses the information of the input arrays in the range [0,numParticles)

Parameters
[in]xThe particle location array in the x-coordinate
[in]yThe particle location array in the y-coordinate
[in]zThe particle location array in the z-coordinate
[in]numParticlesThe number of particles used in the particle location arrays
Returns
0, if success

Implemented in OctreeSearcher.

virtual int NeighbourSearcher::buildSearchStructure ( const double *  x,
const double *  y,
const double *  z,
size_t  begin,
size_t  numParticles 
)
pure virtual

Build the data structure for the nearest neighbour search, based on the input particle location arrays in the x, y, and z-coordinates, the starting point in the arrays and the number of particles.

The function uses the information of the input arrays in the range [begin,numParticles)

Parameters
[in]xThe particle location array in the x-coordinate
[in]yThe particle location array in the y-coordinate
[in]zThe particle location array in the z-coordinate
[in]beginThe starting point in the particle array to use to build the search structure
[in]numParticlesThe number of particles used in the particle location arrays
Returns
0, if success

Implemented in OctreeSearcher.

virtual int NeighbourSearcher::searchNeighbour ( const double  x,
const double  y,
const double  z,
const double  radius,
int *  result,
double *  distance,
size_t &  result_length,
int  index = -1 
)
pure virtual

Searches the nearest neighbours for a particle on the built search data structure.

Parameters
[in]xThe location in the x-coordinate of the target particle
[in]yThe location in the y-coordinate of the target particle
[in]zThe location in the z-coordinate of the target particle
[in]radiusThe neighbour search radius
[out]resultAn array saving the results of neighbour search (the neighbour list), which is sorted based on the the distance (in the ascending order of distance)
[out]distanceAn array saving the distance between the target particle and its neighbours
[out]result_lengthThe number of neighbours obtained for the target particle
[in]indexThe index of target particle; this index is used to remove the target particle itself from its own neighbour list. The default argument is -1, which should only be used when the target particle itself is not in the search structure
Returns
0, if success
Note
This is the single-thread version of this function

Implemented in OctreeSearcher.


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