Skip to content

Commit

Permalink
Merge pull request lammps#4331 from akohlmey/collected-small-changes
Browse files Browse the repository at this point in the history
Collected small changes and fixes
  • Loading branch information
akohlmey authored Oct 1, 2024
2 parents 75f86a6 + b12aeb7 commit 5322b17
Show file tree
Hide file tree
Showing 96 changed files with 2,387 additions and 1,276 deletions.
81 changes: 40 additions & 41 deletions doc/src/Run_windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,70 @@ Running LAMMPS on Windows

To run a serial (non-MPI) executable, follow these steps:

* Get a command prompt by going to Start->Run... ,
then typing "cmd".
* Move to the directory where you have your input script,
* Install a LAMMPS installer package from https://packages.lammps.org/windows.html
* Open the "Command Prompt" or "Terminal" app.
* Change to the directory where you have your input script,
(e.g. by typing: cd "Documents").
* At the command prompt, type "lmp -in in.file", where
in.file is the name of your LAMMPS input script.
* At the command prompt, type "lmp -in in.file.lmp", where
``in.file.lmp`` is the name of your LAMMPS input script.

Note that the serial executable includes support for multi-threading
parallelization from the styles in the OPENMP packages. To run with
4 threads, you can type this:
parallelization from the styles in the OPENMP and KOKKOS packages.
To run with 4 threads, you can type this:

.. code-block:: bash
lmp -in in.lj -pk omp 4 -sf omp
lmp -in in.lj.lmp -pk omp 4 -sf omp
lmp -in in.lj.lmp -k on t 4 -sf kk
----------

For the MPI executable, which allows you to run LAMMPS under Windows
in parallel, follow these steps.
Alternately, you can also install a package with LAMMPS-GUI included and
open the LAMMPS-GUI app (the package includes the command line version
of LAMMPS as well) and open the input file in the GUI and run it from
there. For details on LAMMPS-GUI, see :doc:`Howto_lammps_gui`.

Download and install a compatible MPI library binary package:

* for 32-bit Windows: `mpich2-1.4.1p1-win-ia32.msi <https://download.lammps.org/thirdparty/mpich2-1.4.1p1-win-ia32.msi>`_
* for 64-bit Windows: `mpich2-1.4.1p1-win-x86-64.msi <https://download.lammps.org/thirdparty/mpich2-1.4.1p1-win-x86-64.msi>`_
----------

The LAMMPS Windows installer packages will automatically adjust your
path for the default location of this MPI package. After the
installation of the MPICH2 software, it needs to be integrated into
the system. For this you need to start a Command Prompt in
*Administrator Mode* (right click on the icon and select it). Change
into the MPICH2 installation directory, then into the subdirectory
**bin** and execute **smpd.exe -install**\ . Exit the command window.
For the MS-MPI executables, which allow you to run LAMMPS under Windows
in parallel using MPI rather than multi-threading, follow these steps.

* Get a new, regular command prompt by going to Start->Run... ,
then typing "cmd".
* Move to the directory where you have your input file
(e.g. by typing: cd "Documents").
Download and install the MS-MPI runtime package ``msmpisetup.exe`` from
https://www.microsoft.com/en-us/download/details.aspx?id=105289 (Note
that the ``msmpisdk.msi`` is **only** required for **compilation** of
LAMMPS from source on Windows using Microsoft Visual Studio). After
installation of MS-MPI perform a reboot.

Then you can run the executable in serial like in the example above
or in parallel using MPI with one of the following commands:

.. code-block:: bash
mpiexec -localonly 4 lmp -in in.file
mpiexec -np 4 lmp -in in.file
mpiexec -localonly 4 lmp -in in.file.lmp
mpiexec -np 4 lmp -in in.file.lmp
where in.file is the name of your LAMMPS input script. For the latter
case, you may be prompted to enter the password that you set during
installation of the MPI library software.
where ``in.file.lmp`` is the name of your LAMMPS input script. For the
latter case, you may be prompted to enter the password that you set
during installation of the MPI library software.

In this mode, output may not immediately show up on the screen, so if
your input script takes a long time to execute, you may need to be
patient before the output shows up.

The parallel executable can also run on a single processor by typing
something like this:
Note that the parallel executable also includes OpenMP multi-threading
through both the OPENMP and the KOKKOS package, which can be combined
with MPI using something like:

.. code-block:: bash
lmp -in in.lj
Note that the parallel executable also includes OpenMP
multi-threading, which can be combined with MPI using something like:

.. code-block:: bash
mpiexec -localonly 2 lmp -in in.lj.lmp -pk omp 2 -sf omp
mpiexec -localonly 2 lmp -in in.lj.lmp -kokkos on t 2 -sf kk
mpiexec -localonly 2 lmp -in in.lj -pk omp 2 -sf omp
-------------

MPI parallelization will work for *all* functionality in LAMMPS and in
many cases the MPI parallelization is more efficient than
multi-threading since LAMMPS was designed from ground up for MPI
parallelization using domain decomposition. Multi-threading is only
available for selected styles and implemented on top of the MPI
parallelization. Multi-threading is most useful for systems with large
load imbalances when using domain decomposition and a smaller number
of threads (<= 8).
48 changes: 25 additions & 23 deletions doc/src/fix_adapt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,29 +322,31 @@ all types from 1 to :math:`N`. A leading asterisk means all types from
If :doc:`bond_style hybrid <bond_hybrid>` is used, *bstyle* should be a
sub-style name. The bond styles that currently work with fix adapt are:

+---------------------------------------------------+---------------------------+------------+
| :doc:`class2 <bond_class2>` | r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`fene <bond_fene>` | k,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`fene/expand <bond_fene_expand>` | k,r0,epsilon,sigma,shift | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`fene/nm <bond_fene>` | k,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`gromos <bond_gromos>` | k,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`harmonic <bond_harmonic>` | k,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`harmonic/shift <bond_harmonic_shift>` | k,r0,r1 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`harmonic/restrain <bond_harmonic_restrain>` | k | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`mm3 <bond_mm3>` | k,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`morse <bond_morse>` | r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
| :doc:`nonlinear <bond_nonlinear>` | epsilon,r0 | type bonds |
+---------------------------------------------------+---------------------------+------------+
+-----------------------------------------------------+---------------------------+------------+
| :doc:`class2 <bond_class2>` | r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`fene <bond_fene>` | k,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`fene/expand <bond_fene_expand>` | k,r0,epsilon,sigma,shift | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`fene/nm <bond_fene>` | k,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`gromos <bond_gromos>` | k,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`harmonic <bond_harmonic>` | k,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`harmonic/restrain <bond_harmonic_restrain>` | k | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`harmonic/shift <bond_harmonic_shift>` | k,r0,r1 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`harmonic/shift/cut <bond_harmonic_shift_cut>` | k,r0,r1 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`mm3 <bond_mm3>` | k,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`morse <bond_morse>` | r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+
| :doc:`nonlinear <bond_nonlinear>` | epsilon,r0 | type bonds |
+-----------------------------------------------------+---------------------------+------------+

----------

Expand Down
13 changes: 7 additions & 6 deletions doc/src/fix_gcmc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Syntax
*intra_energy* value = intramolecular energy (energy units)
*tfac_insert* value = scale up/down temperature of inserted atoms (unitless)
*overlap_cutoff* value = maximum pair distance for overlap rejection (distance units)
*max* value = Maximum number of molecules allowed in the system
*min* value = Minimum number of molecules allowed in the system
*max* value = Maximum number of atoms allowed in the fix group (and region)
*min* value = Minimum number of atoms allowed in the fix group (and region)
Examples
""""""""
Expand Down Expand Up @@ -380,10 +380,11 @@ an infinite positive energy to all new configurations that place any
pair of atoms closer than the specified overlap cutoff distance.

The *max* and *min* keywords allow for the restriction of the number of
atoms in the simulation. They automatically reject all insertion or
deletion moves that would take the system beyond the set boundaries.
Should the system already be beyond the boundary, only moves that bring
the system closer to the bounds may be accepted.
atoms in the fix group (and region in case the *region* keyword is
used). They automatically reject all insertion or deletion moves that
would take the system beyond the set boundaries. Should the system
already be beyond the boundary, only moves that bring the system closer
to the bounds may be accepted.

The *group* keyword adds all inserted atoms to the :doc:`group <group>`
of the group-ID value. The *grouptype* keyword adds all inserted atoms
Expand Down
51 changes: 34 additions & 17 deletions doc/src/read_dump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ to tell LAMMPS how many parallel files exist, via its specified

The format of the dump file is selected through the *format* keyword.
If specified, it must be the last keyword used, since all remaining
arguments are passed on to the dump reader. The *native* format is
for native LAMMPS dump files, written with a :doc:`dump atom <dump>`
or :doc:`dump custom <dump>` command. The *xyz* format is for generic XYZ
formatted dump files. These formats take no additional values.
arguments are passed on to the dump reader. The *native* format is for
native LAMMPS dump files, written with a :doc:`dump atom <dump>` or
:doc:`dump custom <dump>` command. The *xyz* format is for generic XYZ
formatted dump files (see details below). These formats take no
additional values.

The *molfile* format supports reading data through using the `VMD <vmd_>`_
molfile plugin interface. This dump reader format is only available,
Expand Down Expand Up @@ -230,23 +231,39 @@ will then have a label corresponding to the fix-ID rather than "x" or
"xs". The *label* keyword can also be used to specify new column
labels for fields *id* and *type*\ .

For dump files in *xyz* format, only the *x*, *y*, and *z* fields are
supported. The dump file does not store atom IDs, so these are
assigned consecutively to the atoms as they appear in the dump file,
starting from 1. Thus you should ensure that order of atoms is
consistent from snapshot to snapshot in the XYZ dump file. See
the :doc:`dump_modify sort <dump_modify>` command if the XYZ dump file
was written by LAMMPS.
For dump files in *xyz* format, only the *type*, *x*, *y*, and *z*
fields are supported. There are many variants of the XYZ file format.
LAMMPS will read the number of atoms from the first line of each frame,
ignore the second (title) line, and then read one line for each atom in the format:

.. parsed-literal::
<label> <x coordinate> <y coordinate> <z coordinate>
If the atom label is a numeric integer (like with XYZ files created by
created with default settings by :doc:`dump style <dump>` *xyz*), that
number will be used as the atom type. If the atom label is a string,
then a type map must be created using the :doc:`labelmap command
<labelmap>`. This map needs to associate each (numeric) atom type with
a string label. The numeric atom type is stored internally.

The xyz format dump file does not store atom IDs, so these are assigned
consecutively to the atoms as they appear in the dump file, starting
from 1. Thus you should ensure that the order of atoms is consistent
from snapshot to snapshot in the XYZ dump file. See the
:doc:`dump_modify sort <dump_modify>` command if the XYZ dump file was
written by LAMMPS.

For dump files in *molfile* format, the *x*, *y*, *z*, *vx*, *vy*, and
*vz* fields can be specified. However, not all molfile formats store
velocities, or their respective plugins may not support reading of
velocities. The molfile dump files do not store atom IDs, so these
are assigned consecutively to the atoms as they appear in the dump
file, starting from 1. Thus you should ensure that order of atoms are
consistent from snapshot to snapshot in the molfile dump file.
See the :doc:`dump_modify sort <dump_modify>` command if the dump file
was written by LAMMPS.
velocities. The molfile dump files do not store atom IDs, so these are
assigned consecutively to the atoms as they appear in the dump file,
starting from 1. Thus you should ensure that the order of atoms are
consistent from snapshot to snapshot in the molfile dump file. See the
:doc:`dump_modify sort <dump_modify>` command if the dump file was
written by LAMMPS.

The *adios* format supports all fields that the *native* format supports
except for the *q* charge field.
Expand Down
6 changes: 3 additions & 3 deletions examples/ASPHERE/line/in.line
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ neigh_modify delay 0 every 1 check yes
neigh_modify exclude molecule/intra all

pair_style line/lj 2.5
pair_coeff * * 1.0 1.0 1.0 0.25 2.5
pair_coeff * * 0.25 0.25 1.0 0.25 2.5

fix 2 all rigid molecule langevin 2.0 2.0 1.0 492983

fix 3 all deform 1 x scale 0.3 y scale 0.3
fix 3 all deform 5 x scale 0.8 y scale 0.8
fix 4 all enforce2d

compute 10 all property/atom end1x end1y end2x end2y
Expand All @@ -26,7 +26,7 @@ compute 10 all property/atom end1x end1y end2x end2y
#dump 2 all custom 500 dump1.line id type &
# c_10[1] c_10[2] c_10[3] c_10[4]

timestep 0.004
timestep 0.001

compute 1 all erotate/asphere
compute 2 all ke
Expand Down
22 changes: 11 additions & 11 deletions examples/ASPHERE/line/in.line.srd
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ set group small mass 0.01
# delete overlaps
# must set 1-2 cutoff to non-zero value

pair_style lj/cut 1.5
pair_style lj/cut 1.5
pair_coeff 1 1 1.0 1.0
pair_coeff 2 2 0.0 1.0 0.0
pair_coeff 1 2 0.0 1.0
pair_coeff 1 2 1.0 1.0

delete_atoms overlap 1.5 small big

Expand All @@ -34,7 +34,7 @@ reset_timestep 0

velocity small create 1.44 87287 loop geom

neighbor 0.3 multi
neighbor 0.8 multi
neigh_modify delay 0 every 1 check yes
neigh_modify exclude molecule/intra big include big

Expand All @@ -44,21 +44,21 @@ neigh_modify include big
# no pairwise interactions with small particles

pair_style line/lj 2.5
pair_coeff 1 1 1.0 1.0 1.0 1.0 2.5
pair_coeff 2 2 0.0 0.0 0.0 1.0 0.0
pair_coeff 1 2 1.0 0.0 0.0 1.0 0.0
pair_coeff 1 1 1.0 1.0 1.0 1.0 2.5
pair_coeff 2 2 0.0 0.0 0.0 1.0 0.0
pair_coeff 1 2 1.0 0.2 1.0 0.2 2.5

# use fix SRD to push small particles out from inside big ones
# if comment out, big particles won't see SRD particles

timestep 0.001
timestep 0.0001

fix 1 big rigid molecule
fix 2 small srd 20 big 1.0 0.25 49894 &
search 0.2 cubic warn 0.0001 shift yes 49829 &
overlap yes collision noslip

fix 3 all deform 1 x scale 0.35 y scale 0.35
fix 3 all deform 1 x scale 1.25 y scale 1.25
fix 4 all enforce2d

# diagnostics
Expand Down Expand Up @@ -96,12 +96,12 @@ change_box all triclinic

fix 2 small srd 20 big 1.0 0.25 49894 &
search 0.2 cubic warn 0.0001 shift yes 49829 &
overlap yes collision noslip tstat yes
overlap yes collision noslip #tstat yes

#dump 1 all custom 500 dump2.atom.srd id type x y z ix iy iz
#dump 2 all custom 500 dump2.line.srd id type &
# c_10[1] c_10[2] c_10[3] c_10[4]

fix 3 all deform 1 xy erate 0.05 units box remap v
fix 3 all deform 1 xy erate 0.0002 units box remap v

run 40000
run 30000
Loading

0 comments on commit 5322b17

Please sign in to comment.