Skip to main content

Crate hoomd_spatial

Crate hoomd_spatial 

Source
Expand description

Spatial data structures.

Use a spatial data structure to efficiently find points near a position in space. Microstate maintains a spatial data structure internally for use with pair potential computations. Specifically, Microstate interoperates with:

  • VecCell is the highest performance spatial data structure. Use it in typical simulations where points remain inside a fixed boundary and have a roughly uniform density throughout.
  • HashCell is only slightly slower than VecCell. HashCell will use less memory in simulations with open boundaries and/or when there are large regions of space with no points.
  • AllPairs is very slow. Use it only when necessary.

You can also utilize any of these data structures directly. They operate by mapping keys (of a generic type) to points in space. Add points to a spatial data structure with PointUpdate::insert, which also updates the position of already added points. Remove points with PointUpdate::remove.

PointsNearBall::points_near_ball takes a position and a radius and returns an iterator that will yield all of the inserted points within the given ball. It may yield additional points that you need to filter out.

§Complete documentation

hoomd-spatial is is a part of hoomd-rs. Read the complete documentation for more information.

Structs§

AllPairs
Check all pairs.
HashCell
Bucket sort points into cubes with HashMap-backed storage
HashCellBuilder
Construct a HashCell with given parameters.
VecCell
Bucket sort points into cubes with Vec-backed storage
VecCellBuilder
Construct a VecCell with given parameters.

Traits§

IndexFromPosition
Locate the index of a given point.
PointUpdate
Allow incremental updates to points in the spatial data.
PointsNearBall
Find all points in the given ball.
WithSearchRadius
Construct a spatial data structure capable of searching up to the given radius.