Skip to content

Commit

Permalink
add note on number of cells
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Oct 20, 2023
1 parent fb2fe95 commit 4fb5ecd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/LowLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,14 @@ This parameter determines how fine is the mesh of cells. There is a trade-off be

As a rough guide, `lcell > 1` is only worthwhile if the number of particles per cell is greater than `~200-400`.

!!! note
The number of cells in which the particles will be classified is, for each dimension `lcell*length/cutoff`.
Thus if the `length` of the box is too large relative to the `cutoff`, many cells will be created, and this
imposes a perhaps large memory requirement. Usually, it is a good practice to limit the number of cells to
be not greater than the number of particles, and for that the cutoff may have to be increased, if there is
a memory botleneck. A reasonable choice is to use `cutoff = max(real_cutoff, length/n^(1/D))` where `D` is the
number of particles and `D` is the dimension (2 or 3). With that the number of cells will be close to `n` in the worst case.

## Output progress

For long-running computations, the user might want to see the progress. A progress meter can be turned on with the `show_progress` option. For example:
Expand Down
8 changes: 8 additions & 0 deletions docs/src/PeriodicSystems.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ Most times using `lcell=1` (default) or `lcell=2` will provide the optimal perfo
dense systems, or systems for which the number of particles within the cutoff is very large,
larger values of `lcell` may improve the performance. To be tested by the user.

!!! note
The number of cells in which the particles will be classified is, for each dimension `lcell*length/cutoff`.
Thus if the `length` of the box is too large relative to the `cutoff`, many cells will be created, and this
imposes a perhaps large memory requirement. Usually, it is a good practice to limit the number of cells to
be not greater than the number of particles, and for that the cutoff may have to be increased, if there is
a memory botleneck. A reasonable choice is to use `cutoff = max(real_cutoff, length/n^(1/D))` where `D` is the
number of particles and `D` is the dimension (2 or 3). With that the number of cells will be close to `n` in the worst case.

## Complete example codes

- [Simple energy computation](@ref)
Expand Down

0 comments on commit 4fb5ecd

Please sign in to comment.