aboria / Aboria

Enables computations over a set of particles in N-dimensional space
https://aboria.github.io/Aboria
Other
105 stars 30 forks source link

allow indexing of particle container by id #10

Closed martinjrobins closed 6 years ago

martinjrobins commented 7 years ago

It is generally useful to be able to get a particle based on its unique id (e.g. to implement bonds). This can be implemented by having a map from id -> index that is updated whenever particles are inserted, deleted or reordered.

I'm currently thinking of implementing the simple custom implementation above for gpus, and falling back on std::map otherwise, just to get the functionality in there. I'm assuming that radial searches are the speed limiting issue for users, and things like bonds are relatively cheap. Later on, more sophisticated implementations can be considered

martinjrobins commented 6 years ago

d0cd463062839f3e7d35a0200e2c559da742d24b adds an id search, based on a binary search over a sorted list of ids/indicies. This is not yet documented