Skip to content

Commit 6e3ee75

Browse files
committed
remarks on trixi-framework#18
1 parent 927120c commit 6e3ee75

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

benchmarks/count_neighbors.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ Due to the minimal computational cost, differences between neighborhood search
1111
implementations are highlighted. On the other hand, this is the least realistic benchmark.
1212
1313
For a computationally heavier benchmark, see [`benchmark_n_body`](@ref).
14+
15+
# Example
16+
```julia
17+
nhs_trivial = TrivialNeighborhoodSearch .......
18+
19+
...
20+
21+
nhs_grid = GridNeighborhoodSearch ....
22+
```
1423
"""
1524
function benchmark_count_neighbors(neighborhood_search, coordinates; parallel = true)
1625
n_neighbors = zeros(Int, size(coordinates, 2))

benchmarks/n_body.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ This is a more realistic benchmark for particle-based simulations than
1111
[`benchmark_count_neighbors`](@ref).
1212
However, due to the higher computational cost, differences between neighborhood search
1313
implementations are less pronounced.
14+
15+
# Example
16+
```julia
17+
nhs_trivial = TrivialNeighborhoodSearch .......
18+
19+
...
20+
21+
nhs_grid = GridNeighborhoodSearch ....
22+
```
1423
"""
1524
function benchmark_n_body(neighborhood_search, coordinates; parallel = true)
1625
mass = 1e10 * (rand(size(coordinates, 2)) .+ 1)

benchmarks/plot.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include("../test/point_cloud.jl")
99
seed = 1, perturbation_factor_position = 1.0,
1010
parallel = true, title = "")
1111
12-
Run a benchmark for with several neighborhood searches multiple times for increasing numbers
12+
Run a benchmark with several neighborhood searches multiple times for increasing numbers
1313
of points and plot the results.
1414
1515
# Arguments
@@ -28,10 +28,16 @@ of points and plot the results.
2828
- `perturbation_factor_position = 1.0`: Perturb point positions by this factor. A factor of
2929
`1.0` corresponds to points being moved by
3030
a maximum distance of `0.5` along each axis.
31+
32+
# Example
33+
34+
also an example?
3135
"""
3236
function plot_benchmarks(benchmark, n_points_per_dimension, iterations;
3337
parallel = true, title = "",
3438
seed = 1, perturbation_factor_position = 1.0)
39+
# Is there a reason why this is hard coded? Why not passing custom nhs like `custom_nhs...`?
40+
# And then `nameof(typeof(nhs))`
3541
neighborhood_searches_names = ["TrivialNeighborhoodSearch";;
3642
"GridNeighborhoodSearch";;
3743
"PrecomputedNeighborhoodSearch"]

0 commit comments

Comments
 (0)