Nearest Neighbour Connection Algorithm for Particles in C++

The following algorithm is used to connect each particle with its nearest neighbour by partitioning and sorting the particle-connection-list(pcl):
  1. store all connection with index1,index2(particle ids) and the distance between them in pcl
  2. sort the pcl-list so we have the minDist-neighbour on array elem [0]
  3. insert the minDist neighbour in the resulting connection list( m_SortedConnections_ast[])
  4. update the vertice buffer for the GL_LINES(OpenGL representation) connecting the particles

















No comments:

Post a Comment