Skip to content

Commit 0260b60

Browse files
committed
Add docs for NeighborListsNeighborhoodSearch
1 parent e51f9e8 commit 0260b60

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/nhs_neighbor_lists.jl

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
@doc raw"""
2+
NeighborListsNeighborhoodSearch{NDIMS}(search_radius, n_particles;
3+
periodic_box_min_corner = nothing,
4+
periodic_box_max_corner = nothing)
5+
6+
Neighborhood search with precomputed neighbor lists. A list of all neighbors is computed
7+
for each particle during initialization and update.
8+
This neighborhood search maximizes the performance of neighbor loops at the cost of a much
9+
slower [`update!`](@ref).
10+
11+
A [`GridNeighborhoodSearch`](@ref) is used internally to compute the neighbor lists during
12+
initialization and update.
13+
14+
# Arguments
15+
- `NDIMS`: Number of dimensions.
16+
- `search_radius`: The uniform search radius.
17+
- `n_particles`: Total number of particles.
18+
19+
# Keywords
20+
- `periodic_box_min_corner`: In order to use a (rectangular) periodic domain, pass the
21+
coordinates of the domain corner in negative coordinate
22+
directions.
23+
- `periodic_box_max_corner`: In order to use a (rectangular) periodic domain, pass the
24+
coordinates of the domain corner in positive coordinate
25+
directions.
26+
"""
127
struct NeighborListsNeighborhoodSearch{NDIMS, NHS, NL, PB}
228
neighborhood_search :: NHS
329
neighbor_lists :: NL
@@ -20,9 +46,7 @@ struct NeighborListsNeighborhoodSearch{NDIMS, NHS, NL, PB}
2046
end
2147
end
2248

23-
@inline function Base.ndims(neighborhood_search::NeighborListsNeighborhoodSearch{NDIMS}) where {
24-
NDIMS
25-
}
49+
@inline function Base.ndims(::NeighborListsNeighborhoodSearch{NDIMS}) where {NDIMS}
2650
return NDIMS
2751
end
2852

0 commit comments

Comments
 (0)