1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Copyright (c) 2024-2026 The Regents of the University of Michigan.
// Part of hoomd-rs, released under the BSD 3-Clause License.
//! 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.
//!
//! [complete documentation]: https://hoomd-rs.readthedocs.io
use PositiveReal;
pub use AllPairs;
pub use ;
pub use ;
/// Allow incremental updates to points in the spatial data.
/// Find all points in the given ball.
/// Construct a spatial data structure capable of searching up to the given radius.
/// Locate the index of a given point.
///
/// This is used by `Microstate` to sort for cache coherency.