Skip to content

Commit

Permalink
change neighbor list defaults to delay=0, every=1, check=yes
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlmey committed Oct 14, 2022
1 parent 13b7c41 commit 082defa
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 30 deletions.
76 changes: 47 additions & 29 deletions doc/src/neigh_modify.rst
Expand Up @@ -16,12 +16,12 @@ Syntax
keyword = *delay* or *every* or *check* or *once* or *cluster* or *include* or *exclude* or *page* or *one* or *binsize* or *collection/type* or *collection/interval*
*delay* value = N
N = delay building until this many steps since last build
N = delay building neighbor lists until this many steps since last build
*every* value = M
M = build neighbor list every this many steps
M = consider building neighbor lists every this many steps
*check* value = *yes* or *no*
*yes* = only build if some atom has moved half the skin distance or more
*no* = always build on 1st step that *every* and *delay* are satisfied
*yes* = only build if at least one atom has moved half the skin distance or more
*no* = always build on 1st step where *every* and *delay* are conditions are satisfied
*once* value = *yes* or *no*
*yes* = only build neighbor list once at start of run and never rebuild
*no* = rebuild neighbor list according to other settings
Expand Down Expand Up @@ -71,30 +71,48 @@ Description
"""""""""""

This command sets parameters that affect the building and use of
pairwise neighbor lists. Depending on what pair interactions and
other commands are defined, a simulation may require one or more
neighbor lists.

The *every*, *delay*, *check*, and *once* options affect how often
lists are built as a simulation runs. The *delay* setting means never
build new lists until at least N steps after the previous build. The
*every* setting means build lists every M steps (after the delay has
pairwise neighbor lists. Depending on what pair interactions and other
commands are defined, a simulation may require one or more neighbor
lists.

The *every*, *delay*, *check*, and *once* options affect how often lists
are built as a simulation runs. The *delay* setting means never build
new lists until at least N steps after the previous build. The *every*
setting means attempt to build lists every M steps (after the delay has
passed). If the *check* setting is *no*, the lists are built on the
first step that satisfies the *delay* and *every* settings. If the
*check* setting is *yes*, then the *every* and *delay* settings
determine when a build may possibly be performed, but an actual build
only occurs if some atom has moved more than half the skin distance
(specified in the :doc:`neighbor <neighbor>` command) since the last
build.

If the *once* setting is yes, then the neighbor list is only built
once at the beginning of each run, and never rebuilt, except on steps
when a restart file is written, or steps when a fix forces a rebuild
to occur (e.g. fixes that create or delete atoms, such as :doc:`fix deposit <fix_deposit>` or :doc:`fix evaporate <fix_evaporate>`).
This setting should only be made if you are certain atoms will not
move far enough that the neighbor list should be rebuilt, e.g. running
a simulation of a cold crystal. Note that it is not that expensive to
check if neighbor lists should be rebuilt.
only occurs if at least one atom has moved more than half the neighbor
skin distance (specified in the :doc:`neighbor <neighbor>` command)
since the last neighbor list build.

.. admonition:: Impact of neighbor list settings
:class: note

The choice of neighbor list settings can have a significant impact on
the (parallel) performance of LAMMPS and the correctness of the
results. Since the building of neighbor lists is time consuming,
doing it less frequently can speed up a calculation. However, if the
lists are rebuilt too infrequent, interacting pairs are missed and
thus the resulting pairwise interactions incorrect. The optimal
settings depend on the properties of the simulated system (like
density, geometry, temperature, pressure), the force field settings,
the size of the timestep, neighbor list skin distance and so on. The
default settings are chosen to be very conservative to promote
correctness of the simulation and they depend on the *check* flag
heuristics to reduce the number of neighbor list rebuilds at a minor
expense for executing the check.

If the *once* setting is yes, then the neighbor list is only built once
at the beginning of each run, and never rebuilt, except on steps when a
restart file is written, or steps when a fix forces a rebuild to occur
(e.g. fixes that create or delete atoms, such as :doc:`fix deposit
<fix_deposit>` or :doc:`fix evaporate <fix_evaporate>`). This setting
should only be made if you are certain atoms will not move far enough
that the neighbor list should be rebuilt, e.g. running a simulation of a
cold crystal. Note that it is not that expensive to check if neighbor
lists should be rebuilt.

When the rRESPA integrator is used (see the :doc:`run_style <run_style>`
command), the *every* and *delay* parameters refer to the longest
Expand Down Expand Up @@ -234,11 +252,11 @@ depend on their atom type.
Restrictions
""""""""""""

If the "delay" setting is non-zero, then it must be a multiple of the
"every" setting.
If the *delay* setting is non-zero, then it must be a multiple of the
*every* setting.

The molecule/intra and molecule/inter exclude options can only be used
with atom styles that define molecule IDs.
The *molecule/intra* and *molecule/inter* exclusion options can only
be used with atom styles that define molecule IDs.

The value of the *page* setting must be at least 10x larger than the
*one* setting. This insures neighbor pages are not mostly empty
Expand All @@ -252,6 +270,6 @@ Related commands
Default
"""""""

The option defaults are delay = 10, every = 1, check = yes, once = no,
The option defaults are delay = 0, every = 1, check = yes, once = no,
cluster = no, include = all (same as no include option defined),
exclude = none, page = 100000, one = 2000, and binsize = 0.0.
2 changes: 1 addition & 1 deletion src/neighbor.cpp
Expand Up @@ -119,7 +119,7 @@ pairclass(nullptr), pairnames(nullptr), pairmasks(nullptr)

style = Neighbor::BIN;
every = 1;
delay = 10;
delay = 0;
dist_check = 1;
pgsize = 100000;
oneatom = 2000;
Expand Down

0 comments on commit 082defa

Please sign in to comment.