Merge branch 'master' of https://github.com/lammps/lammps into lammps-master
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
Basic build options
|
||||
===================
|
||||
|
||||
The following topics are covered on this page, for building both with
|
||||
The following topics are covered on this page, for building with both
|
||||
CMake and make:
|
||||
|
||||
* :ref:`Serial vs parallel build <serial>`
|
||||
@ -95,7 +95,7 @@ standard. A more detailed discussion of that is below.
|
||||
|
||||
.. note::
|
||||
|
||||
The file ``src/STUBS/mpi.c`` provides a CPU timer function
|
||||
The file ``src/STUBS/mpi.cpp`` provides a CPU timer function
|
||||
called ``MPI_Wtime()`` that calls ``gettimeofday()``. If your
|
||||
operating system does not support ``gettimeofday()``, you will
|
||||
need to insert code to call another timer. Note that the
|
||||
@ -234,14 +234,21 @@ LAMMPS.
|
||||
cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
|
||||
# Building with Intel Compilers:
|
||||
cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort
|
||||
# Building with Intel oneAPI Compilers:
|
||||
cmake ../cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_Fortran_COMPILER=ifx
|
||||
# Building with LLVM/Clang Compilers:
|
||||
cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
|
||||
# Building with PGI/Nvidia Compilers:
|
||||
cmake ../cmake -DCMAKE_C_COMPILER=pgcc -DCMAKE_CXX_COMPILER=pgc++ -DCMAKE_Fortran_COMPILER=pgfortran
|
||||
|
||||
For compiling with the Clang/LLVM compilers a CMake preset is
|
||||
provided that can be loaded with
|
||||
`-C ../cmake/presets/clang.cmake`. Similarly,
|
||||
`-C ../cmake/presets/intel.cmake` should switch the compiler
|
||||
toolchain to the Intel compilers.
|
||||
toolchain to the legacy Intel compilers, `-C ../cmake/presets/oneapi.cmake`
|
||||
will switch to the LLVM based oneAPI Intel compilers,
|
||||
and `-C ../cmake/presets/pgi.cmake`
|
||||
will switch the compiler to the PGI compilers.
|
||||
|
||||
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add
|
||||
compiler flags to tune for optimal performance on given hosts. By
|
||||
@ -523,6 +530,20 @@ you want to copy files to is protected.
|
||||
make # perform make after CMake command
|
||||
make install # perform the installation into prefix
|
||||
|
||||
During the installation process CMake will by default remove any runtime
|
||||
path settings for loading shared libraries. Because of this you may
|
||||
have to set or modify the ``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH``)
|
||||
environment variable, if you are installing LAMMPS into a non-system
|
||||
location and/or are linking to libraries in a non-system location that
|
||||
depend on such runtime path settings.
|
||||
As an alternative you may set the CMake variable ``LAMMPS_INSTALL_RPATH``
|
||||
to ``on`` and then the runtime paths for any linked shared libraries
|
||||
and the library installation folder for the LAMMPS library will be
|
||||
embedded and thus the requirement to set environment variables is avoided.
|
||||
The ``off`` setting is usually preferred for packaged binaries or when
|
||||
setting up environment modules, the ``on`` setting is more convenient
|
||||
for installing software into a non-system or personal folder.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
There is no "install" option in the ``src/Makefile`` for LAMMPS.
|
||||
|
||||
@ -37,6 +37,7 @@ This is the list of packages that may require additional steps.
|
||||
* :ref:`KOKKOS <kokkos>`
|
||||
* :ref:`LATTE <latte>`
|
||||
* :ref:`MESSAGE <message>`
|
||||
* :ref:`MLIAP <mliap>`
|
||||
* :ref:`MSCG <mscg>`
|
||||
* :ref:`OPT <opt>`
|
||||
* :ref:`POEMS <poems>`
|
||||
@ -51,6 +52,7 @@ This is the list of packages that may require additional steps.
|
||||
* :ref:`USER-MESONT <user-mesont>`
|
||||
* :ref:`USER-MOLFILE <user-molfile>`
|
||||
* :ref:`USER-NETCDF <user-netcdf>`
|
||||
* :ref:`USER-PACE <user-pace>`
|
||||
* :ref:`USER-PLUMED <user-plumed>`
|
||||
* :ref:`USER-OMP <user-omp>`
|
||||
* :ref:`USER-QMMM <user-qmmm>`
|
||||
@ -119,21 +121,21 @@ CMake build
|
||||
-D GPU_API=value # value = opencl (default) or cuda or hip
|
||||
-D GPU_PREC=value # precision setting
|
||||
# value = double or mixed (default) or single
|
||||
-D OCL_TUNE=value # hardware choice for GPU_API=opencl
|
||||
# generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
|
||||
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
||||
# value = sm_XX, see below
|
||||
# default is sm_50
|
||||
-D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip
|
||||
# value depends on selected HIP_PLATFORM
|
||||
# default is 'gfx906' for HIP_PLATFORM=hcc and 'sm_50' for HIP_PLATFORM=nvcc
|
||||
# default is 'gfx906' for HIP_PLATFORM=amd and 'sm_50' for HIP_PLATFORM=nvcc
|
||||
-D HIP_USE_DEVICE_SORT=value # enables GPU sorting
|
||||
# value = yes (default) or no
|
||||
-D CUDPP_OPT=value # optimization setting for GPU_API=cuda
|
||||
# enables CUDA Performance Primitives Optimizations
|
||||
# value = yes (default) or no
|
||||
-D CUDPP_OPT=value # use GPU binning on with CUDA (should be off for modern GPUs)
|
||||
# enables CUDA Performance Primitives, must be "no" for CUDA_MPS_SUPPORT=yes
|
||||
# value = yes or no (default)
|
||||
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon
|
||||
# value = yes or no (default)
|
||||
-D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed
|
||||
# value = yes (default) or no
|
||||
|
||||
:code:`GPU_ARCH` settings for different GPU hardware is as follows:
|
||||
|
||||
@ -160,19 +162,32 @@ When building with CMake, you **must NOT** build the GPU library in ``lib/gpu``
|
||||
using the traditional build procedure. CMake will detect files generated by that
|
||||
process and will terminate with an error and a suggestion for how to remove them.
|
||||
|
||||
If you are compiling for OpenCL, the default setting is to download, build, and
|
||||
link with a static OpenCL ICD loader library and standard OpenCL headers. This
|
||||
way no local OpenCL development headers or library needs to be present and only
|
||||
OpenCL compatible drivers need to be installed to use OpenCL. If this is not
|
||||
desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`.
|
||||
|
||||
If you are compiling with HIP, note that before running CMake you will have to
|
||||
set appropriate environment variables. Some variables such as
|
||||
:code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc`
|
||||
:code:`HCC_AMDGPU_TARGET` (for ROCm <= 4.0) or :code:`CUDA_PATH` are necessary for :code:`hipcc`
|
||||
and the linker to work correctly.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# AMDGPU target
|
||||
# AMDGPU target (ROCm <= 4.0)
|
||||
export HIP_PLATFORM=hcc
|
||||
export HCC_AMDGPU_TARGET=gfx906
|
||||
cmake -D PKG_GPU=on -D GPU_API=HIP -D HIP_ARCH=gfx906 -D CMAKE_CXX_COMPILER=hipcc ..
|
||||
make -j 4
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# AMDGPU target (ROCm >= 4.1)
|
||||
export HIP_PLATFORM=amd
|
||||
cmake -D PKG_GPU=on -D GPU_API=HIP -D HIP_ARCH=gfx906 -D CMAKE_CXX_COMPILER=hipcc ..
|
||||
make -j 4
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# CUDA target (not recommended, use GPU_ARCH=cuda)
|
||||
@ -218,11 +233,20 @@ Makefile if desired:
|
||||
* ``CUDA_PRECISION`` = precision (double, mixed, single)
|
||||
* ``EXTRAMAKE`` = which Makefile.lammps.\* file to copy to Makefile.lammps
|
||||
|
||||
The file Makefile.linux_multi is set up to include support for multiple
|
||||
The file Makefile.cuda is set up to include support for multiple
|
||||
GPU architectures as supported by the CUDA toolkit in use. This is done
|
||||
through using the "--gencode " flag, which can be used multiple times and
|
||||
thus support all GPU architectures supported by your CUDA compiler.
|
||||
|
||||
To enable GPU binning via CUDA performance primitives set the Makefile variable
|
||||
``CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini``. This should **not** be used with
|
||||
most modern GPUs.
|
||||
|
||||
To support the CUDA multiprocessor server you can set the define
|
||||
``-DCUDA_PROXY``. Please note that in this case you must **not** use
|
||||
the CUDA performance primitives and thus set the variable ``CUDPP_OPT``
|
||||
to empty.
|
||||
|
||||
If the library build is successful, 3 files should be created:
|
||||
``lib/gpu/libgpu.a``\ , ``lib/gpu/nvc_get_devices``\ , and
|
||||
``lib/gpu/Makefile.lammps``\ . The latter has settings that enable LAMMPS
|
||||
@ -249,18 +273,18 @@ To build with this package, the KIM library with API v2 must be downloaded
|
||||
and built on your system. It must include the KIM models that you want to
|
||||
use with LAMMPS.
|
||||
|
||||
If you would like to use the :doc:`kim_query <kim_commands>`
|
||||
If you would like to use the :doc:`kim query <kim_commands>`
|
||||
command, you also need to have libcurl installed with the matching
|
||||
development headers and the curl-config tool.
|
||||
|
||||
If you would like to use the :doc:`kim_property <kim_commands>`
|
||||
If you would like to use the :doc:`kim property <kim_commands>`
|
||||
command, you need to build LAMMPS with the PYTHON package installed
|
||||
and linked to Python 3.6 or later. See the :ref:`PYTHON package build info <python>`
|
||||
for more details on this. After successfully building LAMMPS with Python, you
|
||||
also need to install the kim-property Python package, which can be easily done using
|
||||
*pip* as ``pip install kim-property``, or from the *conda-forge* channel as
|
||||
``conda install kim-property`` if LAMMPS is built in Conda. More detailed
|
||||
information is available at:
|
||||
also need to install the ``kim-property`` Python package, which can be easily
|
||||
done using *pip* as ``pip install kim-property``, or from the *conda-forge*
|
||||
channel as ``conda install kim-property`` if LAMMPS is built in Conda. More
|
||||
detailed information is available at:
|
||||
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
||||
|
||||
In addition to installing the KIM API, it is also necessary to install the
|
||||
@ -282,6 +306,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes
|
||||
-D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on
|
||||
-D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer, value = no (default) or yes
|
||||
-D KIM_EXTRA_UNITTESTS=value # enables extra unit tests, value = no (default) or yes
|
||||
|
||||
If ``DOWNLOAD_KIM`` is set to *yes* (or *on*), the KIM API library
|
||||
will be downloaded and built inside the CMake build directory. If
|
||||
@ -290,11 +315,16 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
``PKG_CONFIG_PATH`` environment variable so that libkim-api can be
|
||||
found, or run the command ``source kim-api-activate``.
|
||||
|
||||
Extra unit tests can only be available if they are explicitly requested
|
||||
(``KIM_EXTRA_UNITTESTS`` is set to *yes* (or *on*)) and the prerequisites
|
||||
are met. See :ref:`KIM Extra unit tests <kim_extra_unittests>` for
|
||||
more details on this.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
You can download and build the KIM library manually if you prefer;
|
||||
follow the instructions in ``lib/kim/README``. You can also do
|
||||
this in one step from the lammps/src dir, using a command like
|
||||
this in one step from the lammps/src directory, using a command like
|
||||
these, which simply invoke the ``lib/kim/Install.py`` script with
|
||||
the specified args.
|
||||
|
||||
@ -314,7 +344,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLMP_NO_SSL_CHECK
|
||||
LMP_INC = -DLMP_NO_SSL_CHECK
|
||||
|
||||
Debugging OpenKIM web queries in LAMMPS
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -338,6 +368,39 @@ specify your own CA cert path by setting the environment variable
|
||||
``CURL_CA_BUNDLE`` to the path of your choice. A call to the KIM web
|
||||
query would get this value from the environment variable.
|
||||
|
||||
.. _kim_extra_unittests:
|
||||
|
||||
KIM Extra unit tests (CMake only)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
During development, testing, or debugging, if
|
||||
:doc:`unit testing <Build_development>` is enabled in LAMMPS, one can also
|
||||
enable extra tests on :doc:`KIM commands <kim_commands>` by setting the
|
||||
``KIM_EXTRA_UNITTESTS`` to *yes* (or *on*).
|
||||
|
||||
Enabling the extra unit tests have some requirements,
|
||||
|
||||
* It requires to have internet access.
|
||||
* It requires to have libcurl installed with the matching development headers
|
||||
and the curl-config tool.
|
||||
* It requires to build LAMMPS with the PYTHON package installed and linked to
|
||||
Python 3.6 or later. See the :ref:`PYTHON package build info <python>` for
|
||||
more details on this.
|
||||
* It requires to have ``kim-property`` Python package installed, which can be
|
||||
easily done using *pip* as ``pip install kim-property``, or from the
|
||||
*conda-forge* channel as ``conda install kim-property`` if LAMMPS is built in
|
||||
Conda. More detailed information is available at:
|
||||
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
||||
* It is also necessary to install
|
||||
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
||||
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
||||
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
||||
to learn how to install a pre-built binary of the OpenKIM Repository of
|
||||
Models or see
|
||||
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
||||
to learn how to install the specific KIM models.
|
||||
|
||||
----------
|
||||
|
||||
.. _kokkos:
|
||||
@ -482,11 +545,14 @@ They must be specified in uppercase.
|
||||
* - VEGA906
|
||||
- GPU
|
||||
- AMD GPU MI50/MI60 GFX906
|
||||
* - VEGA908
|
||||
- GPU
|
||||
- AMD GPU GFX908
|
||||
* - INTEL_GEN
|
||||
- GPU
|
||||
- Intel GPUs Gen9+
|
||||
|
||||
This list was last updated for version 3.2 of the Kokkos library.
|
||||
This list was last updated for version 3.3 of the Kokkos library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -732,6 +798,54 @@ be installed on your system.
|
||||
|
||||
----------
|
||||
|
||||
.. _mliap:
|
||||
|
||||
MLIAP package
|
||||
---------------------------
|
||||
|
||||
Building the MLIAP package requires including the :ref:`SNAP <PKG-SNAP>`
|
||||
package. There will be an error message if this requirement is not satisfied.
|
||||
Using the *mliappy* model also requires enabling Python support, which
|
||||
in turn requires the :ref:`PYTHON <PKG-PYTHON>`
|
||||
package **and** requires you have the `cython <https://cython.org>`_ software
|
||||
installed and with it a working ``cythonize`` command. This feature requires
|
||||
compiling LAMMPS with Python version 3.6 or later.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D MLIAP_ENABLE_PYTHON=value # enable mliappy model (default is autodetect)
|
||||
|
||||
Without this setting, CMake will check whether it can find a
|
||||
suitable Python version and the ``cythonize`` command and choose
|
||||
the default accordingly. During the build procedure the provided
|
||||
.pyx file(s) will be automatically translated to C++ code and compiled.
|
||||
Please do **not** run ``cythonize`` manually in the ``src/MLIAP`` folder,
|
||||
as that can lead to compilation errors if Python support is not enabled.
|
||||
If you did by accident, please remove the generated .cpp and .h files.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
The build uses the ``lib/python/Makefile.mliap_python`` file in the
|
||||
compile/link process to add a rule to update the files generated by
|
||||
the ``cythonize`` command in case the corresponding .pyx file(s) were
|
||||
modified. You may need to modify ``lib/python/Makefile.lammps``
|
||||
if the LAMMPS build fails.
|
||||
To manually enforce building MLIAP with Python support enabled,
|
||||
you can add
|
||||
``-DMLIAP_PYTHON`` to the ``LMP_INC`` variable in your machine makefile.
|
||||
You may have to manually run the ``cythonize`` command on .pyx file(s)
|
||||
in the ``src`` folder, if this is not automatically done during
|
||||
installing the MLIAP package. Please do **not** run ``cythonize``
|
||||
in the ``src/MLIAP`` folder, as that can lead to compilation errors
|
||||
if Python support is not enabled.
|
||||
If you did by accident, please remove the generated .cpp and .h files.
|
||||
|
||||
----------
|
||||
|
||||
.. _mscg:
|
||||
|
||||
MSCG package
|
||||
@ -1134,6 +1248,46 @@ be built for the most part with all major versions of the C++ language.
|
||||
|
||||
----------
|
||||
|
||||
.. _user-pace:
|
||||
|
||||
USER-PACE package
|
||||
-----------------------------
|
||||
|
||||
This package requires a library that can be downloaded and built
|
||||
in lib/pace or somewhere else, which must be done before building
|
||||
LAMMPS with this package. The code for the library can be found
|
||||
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
By default the library will be downloaded from the git repository
|
||||
and built automatically when the USER-PACE package is enabled with
|
||||
``-D PKG_USER-PACE=yes``. The location for the sources may be
|
||||
customized by setting the variable ``PACELIB_URL`` when
|
||||
configuring with CMake (e.g. to use a local archive on machines
|
||||
without internet access). Since CMake checks the validity of the
|
||||
archive with ``md5sum`` you may also need to set ``PACELIB_MD5``
|
||||
if you provide a different library version than what is downloaded
|
||||
automatically.
|
||||
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
You can download and build the USER-PACE library
|
||||
in one step from the ``lammps/src`` dir, using these commands,
|
||||
which invoke the ``lib/pace/Install.py`` script.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make lib-pace # print help message
|
||||
$ make lib-pace args="-b" # download and build the default version in lib/pace
|
||||
|
||||
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
||||
|
||||
----------
|
||||
|
||||
.. _user-plumed:
|
||||
|
||||
USER-PLUMED package
|
||||
|
||||
@ -20,16 +20,8 @@ the suffix ``.so.0`` (or some other number).
|
||||
.. note::
|
||||
|
||||
Care should be taken to use the same MPI library for the calling code
|
||||
and the LAMMPS library. The ``library.h`` file includes ``mpi.h``
|
||||
and uses definitions from it so those need to be available and
|
||||
consistent. When LAMMPS is compiled with the included STUBS MPI
|
||||
library, then its ``mpi.h`` file needs to be included. While it is
|
||||
technically possible to use a full MPI library in the calling code
|
||||
and link to a serial LAMMPS library compiled with MPI STUBS, it is
|
||||
recommended to use the *same* MPI library for both, and then use
|
||||
``MPI_Comm_split()`` in the calling code to pass a suitable
|
||||
communicator with a subset of MPI ranks to the function creating the
|
||||
LAMMPS instance.
|
||||
and the LAMMPS library unless LAMMPS is to be compiled without (real)
|
||||
MPI support using the include STUBS MPI library.
|
||||
|
||||
Link with LAMMPS as a static library
|
||||
------------------------------------
|
||||
@ -110,7 +102,7 @@ executable, that are also required to link the LAMMPS executable.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
||||
gcc -c -O -I${HOME}/lammps/src -caller.c
|
||||
g++ -o caller caller.o -L${HOME}/lammps/lib/poems \
|
||||
-L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src \
|
||||
-llammps_serial -lpoems -lmpi_stubs
|
||||
@ -174,7 +166,7 @@ the POEMS package installed becomes:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
||||
gcc -c -O -I${HOME}/lammps/src -caller.c
|
||||
g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial
|
||||
|
||||
Locating liblammps.so at runtime
|
||||
|
||||
@ -74,7 +74,11 @@ For the documentation build a python virtual environment is set up in
|
||||
the folder ``doc/docenv`` and various python packages are installed into
|
||||
that virtual environment via the ``pip`` tool. For rendering embedded
|
||||
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ JavaScript
|
||||
engine needs to be downloaded.
|
||||
engine needs to be downloaded. If you need to pass additional options
|
||||
to the pip commands to work (e.g. to use a web proxy or to point to
|
||||
additional SSL certificates) you can set them via the ``PIP_OPTIONS``
|
||||
environment variable or uncomment and edit the ``PIP_OPTIONS`` setting
|
||||
at beginning of the makefile.
|
||||
|
||||
The actual translation is then done via ``make`` commands in the doc
|
||||
folder. The following ``make`` commands are available:
|
||||
@ -108,7 +112,10 @@ installation of the HTML manual pages into the "install" step when
|
||||
installing LAMMPS after the CMake build via ``cmake --build . --target
|
||||
install``. The documentation build is included in the default build
|
||||
target, but can also be requested independently with
|
||||
``cmake --build . --target doc``.
|
||||
``cmake --build . --target doc``. If you need to pass additional options
|
||||
to the pip commands to work (e.g. to use a web proxy or to point to
|
||||
additional SSL certificates) you can set them via the ``PIP_OPTIONS``
|
||||
environment variable.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
@ -30,17 +30,17 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
|
||||
These links take you to the extra instructions for those select
|
||||
packages:
|
||||
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`COMPRESS <compress>` | :ref:`GPU <gpu>` | :ref:`KIM <kim>` | :ref:`KOKKOS <kokkos>` | :ref:`LATTE <latte>` | :ref:`MESSAGE <message>` |
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`MSCG <mscg>` | :ref:`OPT <opt>` | :ref:`POEMS <poems>` | :ref:`PYTHON <python>` | :ref:`VORONOI <voronoi>` | :ref:`USER-ADIOS <user-adios>` |
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-ATC <user-atc>` | :ref:`USER-AWPMD <user-awpmd>` | :ref:`USER-COLVARS <user-colvars>` | :ref:`USER-H5MD <user-h5md>` | :ref:`USER-INTEL <user-intel>` | :ref:`USER-MOLFILE <user-molfile>` |
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-NETCDF <user-netcdf>` | :ref:`USER-PLUMED <user-plumed>` | :ref:`USER-OMP <user-omp>` | :ref:`USER-QMMM <user-qmmm>` | :ref:`USER-QUIP <user-quip>` | :ref:`USER-SCAFACOS <user-scafacos>` |
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-SMD <user-smd>` | :ref:`USER-VTK <user-vtk>` | | | | |
|
||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`COMPRESS <compress>` | :ref:`GPU <gpu>` | :ref:`KIM <kim>` | :ref:`KOKKOS <kokkos>` | :ref:`LATTE <latte>` | :ref:`MESSAGE <message>` |
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`MSCG <mscg>` | :ref:`OPT <opt>` | :ref:`POEMS <poems>` | :ref:`PYTHON <python>` | :ref:`VORONOI <voronoi>` | :ref:`USER-ADIOS <user-adios>` |
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-ATC <user-atc>` | :ref:`USER-AWPMD <user-awpmd>` | :ref:`USER-COLVARS <user-colvars>` | :ref:`USER-H5MD <user-h5md>` | :ref:`USER-INTEL <user-intel>` | :ref:`USER-MOLFILE <user-molfile>` |
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-NETCDF <user-netcdf>` | :ref:`USER-PACE <user-pace>` | :ref:`USER-PLUMED <user-plumed>` | :ref:`USER-OMP <user-omp>` | :ref:`USER-QMMM <user-qmmm>` | :ref:`USER-QUIP <user-quip>` |
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
| :ref:`USER-SCAFACOS <user-scafacos>` | :ref:`USER-SMD <user-smd>` | :ref:`USER-VTK <user-vtk>` | | | |
|
||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
||||
|
||||
The mechanism for including packages is simple but different for CMake
|
||||
versus make.
|
||||
@ -160,6 +160,7 @@ one of them as a starting point and customize it to your needs.
|
||||
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default
|
||||
cmake -C ../cmake/presets/gcc.cmake [OPTIONS] ../cmake # change settings to use the GNU compilers by default
|
||||
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default
|
||||
cmake -C ../cmake/presets/pgi.cmake [OPTIONS] ../cmake # change settings to use the PGI compilers by default
|
||||
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
|
||||
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
||||
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
|
||||
|
||||
@ -60,11 +60,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`include <include>`
|
||||
* :doc:`info <info>`
|
||||
* :doc:`jump <jump>`
|
||||
* :doc:`kim_init <kim_commands>`
|
||||
* :doc:`kim_interactions <kim_commands>`
|
||||
* :doc:`kim_param <kim_commands>`
|
||||
* :doc:`kim_property <kim_commands>`
|
||||
* :doc:`kim_query <kim_commands>`
|
||||
* :doc:`kim <kim_commands>`
|
||||
* :doc:`kspace_modify <kspace_modify>`
|
||||
* :doc:`kspace_style <kspace_style>`
|
||||
* :doc:`label <label>`
|
||||
@ -90,6 +86,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`pair_style <pair_style>`
|
||||
* :doc:`pair_write <pair_write>`
|
||||
* :doc:`partition <partition>`
|
||||
* :doc:`plugin <plugin>`
|
||||
* :doc:`prd <prd>`
|
||||
* :doc:`print <print>`
|
||||
* :doc:`processors <processors>`
|
||||
|
||||
@ -126,7 +126,7 @@ OPT.
|
||||
* :doc:`quadratic (o) <dihedral_quadratic>`
|
||||
* :doc:`spherical <dihedral_spherical>`
|
||||
* :doc:`table (o) <dihedral_table>`
|
||||
* :doc:`table/cut <dihedral_table_cut>`
|
||||
* :doc:`table/cut <dihedral_table>`
|
||||
|
||||
.. _improper:
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ OPT.
|
||||
* :doc:`bond/react <fix_bond_react>`
|
||||
* :doc:`bond/swap <fix_bond_swap>`
|
||||
* :doc:`box/relax <fix_box_relax>`
|
||||
* :doc:`charge/regulation <fix_charge_regulation>`
|
||||
* :doc:`client/md <fix_client_md>`
|
||||
* :doc:`cmap <fix_cmap>`
|
||||
* :doc:`colvars <fix_colvars>`
|
||||
@ -114,7 +115,7 @@ OPT.
|
||||
* :doc:`nph/eff <fix_nh_eff>`
|
||||
* :doc:`nph/sphere (o) <fix_nph_sphere>`
|
||||
* :doc:`nphug <fix_nphug>`
|
||||
* :doc:`npt (iko) <fix_nh>`
|
||||
* :doc:`npt (giko) <fix_nh>`
|
||||
* :doc:`npt/asphere (o) <fix_npt_asphere>`
|
||||
* :doc:`npt/body <fix_npt_body>`
|
||||
* :doc:`npt/cauchy <fix_npt_cauchy>`
|
||||
@ -122,8 +123,8 @@ OPT.
|
||||
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
||||
* :doc:`npt/uef <fix_nh_uef>`
|
||||
* :doc:`numdiff <fix_numdiff>`
|
||||
* :doc:`nve (iko) <fix_nve>`
|
||||
* :doc:`nve/asphere (i) <fix_nve_asphere>`
|
||||
* :doc:`nve (giko) <fix_nve>`
|
||||
* :doc:`nve/asphere (gi) <fix_nve_asphere>`
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
||||
* :doc:`nve/awpmd <fix_nve_awpmd>`
|
||||
* :doc:`nve/body <fix_nve_body>`
|
||||
@ -138,7 +139,7 @@ OPT.
|
||||
* :doc:`nve/spin <fix_nve_spin>`
|
||||
* :doc:`nve/tri <fix_nve_tri>`
|
||||
* :doc:`nvk <fix_nvk>`
|
||||
* :doc:`nvt (iko) <fix_nh>`
|
||||
* :doc:`nvt (giko) <fix_nh>`
|
||||
* :doc:`nvt/asphere (o) <fix_nvt_asphere>`
|
||||
* :doc:`nvt/body <fix_nvt_body>`
|
||||
* :doc:`nvt/eff <fix_nh_eff>`
|
||||
@ -221,6 +222,8 @@ OPT.
|
||||
* :doc:`temp/rescale <fix_temp_rescale>`
|
||||
* :doc:`temp/rescale/eff <fix_temp_rescale_eff>`
|
||||
* :doc:`tfmc <fix_tfmc>`
|
||||
* :doc:`tgnpt/drude <fix_tgnh_drude>`
|
||||
* :doc:`tgnvt/drude <fix_tgnh_drude>`
|
||||
* :doc:`thermal/conductivity <fix_thermal_conductivity>`
|
||||
* :doc:`ti/spring <fix_ti_spring>`
|
||||
* :doc:`tmd <fix_tmd>`
|
||||
|
||||
@ -26,6 +26,7 @@ OPT.
|
||||
* :doc:`zero <pair_zero>`
|
||||
* :doc:`hybrid (k) <pair_hybrid>`
|
||||
* :doc:`hybrid/overlay (k) <pair_hybrid>`
|
||||
* :doc:`hybrid/scaled <pair_hybrid>`
|
||||
* :doc:`kim <pair_kim>`
|
||||
* :doc:`list <pair_list>`
|
||||
*
|
||||
@ -33,7 +34,6 @@ OPT.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* :doc:`adp (o) <pair_adp>`
|
||||
* :doc:`agni (o) <pair_agni>`
|
||||
* :doc:`airebo (io) <pair_airebo>`
|
||||
@ -69,6 +69,7 @@ OPT.
|
||||
* :doc:`comb3 <pair_comb>`
|
||||
* :doc:`cosine/squared <pair_cosine_squared>`
|
||||
* :doc:`coul/cut (gko) <pair_coul>`
|
||||
* :doc:`coul/cut/global (o) <pair_coul>`
|
||||
* :doc:`coul/cut/soft (o) <pair_fep_soft>`
|
||||
* :doc:`coul/debye (gko) <pair_coul>`
|
||||
* :doc:`coul/diel (o) <pair_coul_diel>`
|
||||
@ -96,6 +97,7 @@ OPT.
|
||||
* :doc:`eam/cd <pair_eam>`
|
||||
* :doc:`eam/cd/old <pair_eam>`
|
||||
* :doc:`eam/fs (gikot) <pair_eam>`
|
||||
* :doc:`eam/he <pair_eam>`
|
||||
* :doc:`edip (o) <pair_edip>`
|
||||
* :doc:`edip/multi <pair_edip>`
|
||||
* :doc:`edpd <pair_mesodpd>`
|
||||
@ -121,7 +123,7 @@ OPT.
|
||||
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
||||
* :doc:`lennard/mdf <pair_mdf>`
|
||||
* :doc:`line/lj <pair_line_lj>`
|
||||
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/charmm (giko) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/long/soft (o) <pair_fep_soft>`
|
||||
@ -162,6 +164,7 @@ OPT.
|
||||
* :doc:`lj/long/dipole/long <pair_dipole>`
|
||||
* :doc:`lj/long/tip4p/long (o) <pair_lj_long>`
|
||||
* :doc:`lj/mdf <pair_mdf>`
|
||||
* :doc:`lj/relres (o) <pair_lj_relres>`
|
||||
* :doc:`lj/sdk (gko) <pair_sdk>`
|
||||
* :doc:`lj/sdk/coul/long (go) <pair_sdk>`
|
||||
* :doc:`lj/sdk/coul/msm (o) <pair_sdk>`
|
||||
@ -185,7 +188,7 @@ OPT.
|
||||
* :doc:`mgpt <pair_mgpt>`
|
||||
* :doc:`mie/cut (g) <pair_mie>`
|
||||
* :doc:`mliap <pair_mliap>`
|
||||
* :doc:`mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>`
|
||||
* :doc:`mm3/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||
* :doc:`momb <pair_momb>`
|
||||
* :doc:`morse (gkot) <pair_morse>`
|
||||
* :doc:`morse/smooth/linear (o) <pair_morse>`
|
||||
@ -213,6 +216,7 @@ OPT.
|
||||
* :doc:`oxrna2/stk <pair_oxrna2>`
|
||||
* :doc:`oxrna2/xstk <pair_oxrna2>`
|
||||
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
||||
* :doc:`pace <pair_pace>`
|
||||
* :doc:`peri/eps <pair_peri>`
|
||||
* :doc:`peri/lps (o) <pair_peri>`
|
||||
* :doc:`peri/pmb (o) <pair_peri>`
|
||||
@ -262,6 +266,7 @@ OPT.
|
||||
* :doc:`ufm (got) <pair_ufm>`
|
||||
* :doc:`vashishta (gko) <pair_vashishta>`
|
||||
* :doc:`vashishta/table (o) <pair_vashishta>`
|
||||
* :doc:`wf/cut <pair_wf_cut>`
|
||||
* :doc:`yukawa (gko) <pair_yukawa>`
|
||||
* :doc:`yukawa/colloid (go) <pair_yukawa_colloid>`
|
||||
* :doc:`zbl (gko) <pair_zbl>`
|
||||
|
||||
@ -162,3 +162,26 @@ LAMMPS:
|
||||
triple quotes can be nested in the usual manner. See the doc pages
|
||||
for those commands for examples. Only one of level of nesting is
|
||||
allowed, but that should be sufficient for most use cases.
|
||||
|
||||
.. admonition:: ASCII versus UTF-8
|
||||
:class: note
|
||||
|
||||
LAMMPS expects and processes 7-bit ASCII format text internally.
|
||||
Many modern environments use UTF-8 encoding, which is a superset
|
||||
of the 7-bit ASCII character table and thus mostly compatible.
|
||||
However, there are several non-ASCII characters that can look
|
||||
very similar to their ASCII equivalents or are invisible (so they
|
||||
look like a blank), but are encoded differently. Web browsers,
|
||||
PDF viewers, document editors are known to sometimes replace one
|
||||
with the other for a better looking output. However, that can
|
||||
lead to problems, for instance, when using cut-n-paste of input
|
||||
file examples from web pages, or when using a document editor
|
||||
(not a dedicated plain text editor) for writing LAMMPS inputs.
|
||||
LAMMPS will try to detect this and substitute the non-ASCII
|
||||
characters with their ASCII equivalents where known. There also
|
||||
is going to be a warning printed, if this occurs. It is
|
||||
recommended to avoid such characters altogether in LAMMPS input,
|
||||
data and potential files. The replacement tables are likely
|
||||
incomplete and dependent on users reporting problems processing
|
||||
correctly looking input containing UTF-8 encoded non-ASCII
|
||||
characters.
|
||||
|
||||
@ -13,6 +13,8 @@ of time and requests from the LAMMPS user community.
|
||||
Developer_org
|
||||
Developer_flow
|
||||
Developer_write
|
||||
Developer_notes
|
||||
Developer_plugins
|
||||
Developer_unittest
|
||||
Classes
|
||||
Developer_utils
|
||||
|
||||
227
doc/src/Developer_notes.rst
Normal file
227
doc/src/Developer_notes.rst
Normal file
@ -0,0 +1,227 @@
|
||||
Notes for developers and code maintainers
|
||||
-----------------------------------------
|
||||
|
||||
This section documents how some of the code functionality within
|
||||
LAMMPS works at a conceptual level. Comments on code in source files
|
||||
typically document what a variable stores, what a small section of
|
||||
code does, or what a function does and its input/outputs. The topics
|
||||
on this page are intended to document code functionality at a higher level.
|
||||
|
||||
Fix contributions to instantaneous energy, virial, and cumulative energy
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Fixes can calculate contributions to the instantaneous energy and/or
|
||||
virial of the system, both in a global and peratom sense. Fixes that
|
||||
perform thermostatting or barostatting can calculate the cumulative
|
||||
energy they add to or subtract from the system, which is accessed by
|
||||
the *ecouple* and *econserve* thermodynamic keywords. This subsection
|
||||
explains how both work and what flags to set in a new fix to enable
|
||||
this functionality.
|
||||
|
||||
Let's start with thermostatting and barostatting fixes. Examples are
|
||||
the :doc:`fix langevin <fix_langevin>` and :doc:`fix npt <fix_nh>`
|
||||
commands. Here is what the fix needs to do:
|
||||
|
||||
* Set the variable *ecouple_flag* = 1 in the constructor. Also set
|
||||
*scalar_flag* = 1, *extscalar* = 1, and *global_freq* to a timestep
|
||||
increment which matches how often the fix is invoked.
|
||||
* Implement a compute_scalar() method that returns the cumulative
|
||||
energy added or subtracted by the fix, e.g. by rescaling the
|
||||
velocity of atoms. The sign convention is that subtracted energy is
|
||||
positive, added energy is negative. This must be the total energy
|
||||
added to the entire system, i.e. an "extensive" quantity, not a
|
||||
per-atom energy. Cumulative means the summed energy since the fix
|
||||
was instantiated, even across multiple runs. This is because the
|
||||
energy is used by the *econserve* thermodynamic keyword to check
|
||||
that the fix is conserving the total energy of the system,
|
||||
i.e. potential energy + kinetic energy + coupling energy = a
|
||||
constant.
|
||||
|
||||
And here is how the code operates:
|
||||
|
||||
* The Modify class makes a list of all fixes that set *ecouple_flag* = 1.
|
||||
* The :doc:`thermo_style custom <thermo_style>` command defines
|
||||
*ecouple* and *econserve* keywords.
|
||||
* These keywords sum the energy contributions from all the
|
||||
*ecouple_flag* = 1 fixes by invoking the energy_couple() method in
|
||||
the Modify class, which calls the compute_scalar() method of each
|
||||
fix in the list.
|
||||
|
||||
------------------
|
||||
|
||||
Next, here is how a fix contributes to the instantaneous energy and
|
||||
virial of the system. First, it sets any or all of these flags to a
|
||||
value of 1 in their constructor:
|
||||
|
||||
* *energy_global_flag* to contribute to global energy, example: :doc:`fix indent <fix_indent>`
|
||||
* *energy_peratom_flag* to contribute to peratom energy, :doc:`fix cmap <fix_cmap>`
|
||||
* *virial_global_flag* to contribute to global virial, example: :doc:`fix wall <fix_wall>`
|
||||
* *virial_peratom_flag* to contribute to peratom virial, example: :doc:`fix wall <fix_wall>`
|
||||
|
||||
The fix must also do the following:
|
||||
|
||||
* For global energy, implement a compute_scalar() method that returns
|
||||
the energy added or subtracted on this timestep. Here the sign
|
||||
convention is that added energy is positive, subtracted energy is
|
||||
negative.
|
||||
* For peratom energy, invoke the ev_init(eflag,vflag) function each
|
||||
time the fix is invoked, which initializes per-atom energy storage.
|
||||
The value of eflag may need to be stored from an earlier call to the
|
||||
fix during the same timestep. See how the :doc:`fix cmap
|
||||
<fix_cmap>` command does this in src/MOLECULE/fix_cmap.cpp. When an
|
||||
energy for one or more atoms is calculated, invoke the ev_tally()
|
||||
function to tally the contribution to each atom. Both the ev_init()
|
||||
and ev_tally() methods are in the parent Fix class.
|
||||
* For global and/or peratom virial, invoke the v_init(vflag) function
|
||||
each time the fix is invoked, which initializes virial storage.
|
||||
When forces on one or more atoms are calculated, invoke the
|
||||
v_tally() function to tally the contribution. Both the v_init() and
|
||||
v_tally() methods are in the parent Fix class. Note that there are
|
||||
several variants of v_tally(); choose the one appropriate to your
|
||||
fix.
|
||||
|
||||
.. note::
|
||||
|
||||
The ev_init() and ev_tally() methods also account for global and
|
||||
peratom virial contributions. Thus you do not need to invoke the
|
||||
v_init() and v_tally() methods, if the fix also calculates peratom
|
||||
energies.
|
||||
|
||||
The fix must also specify whether (by default) to include or exclude
|
||||
these contributions to the global/peratom energy/virial of the system.
|
||||
For the fix to include the contributions, set either of both of these
|
||||
variables in the constructor:
|
||||
|
||||
* *thermo_energy* = 1, for global and peratom energy
|
||||
* *thermo_virial* = 1, for global and peratom virial
|
||||
|
||||
Note that these variables are zeroed in fix.cpp. Thus if you don't
|
||||
set the variables, the contributions will be excluded (by default)
|
||||
|
||||
However, the user has ultimate control over whether to include or
|
||||
exclude the contributions of the fix via the :doc:`fix modify
|
||||
<fix_modify>` command:
|
||||
|
||||
* fix modify *energy yes* to include global and peratom energy contributions
|
||||
* fix modify *virial yes* to include global and peratom virial contributions
|
||||
|
||||
If the fix contributes to any of the global/peratom energy/virial
|
||||
values for the system, it should be explained on the fix doc page,
|
||||
along with the default values for the *energy yes/no* and *virial
|
||||
yes/no* settings of the :doc:`fix modify <fix_modify>` command.
|
||||
|
||||
Finally, these 4 contributions are included in the output of 4
|
||||
computes:
|
||||
|
||||
* global energy in :doc:`compute pe <compute_pe>`
|
||||
* peratom energy in :doc:`compute pe/atom <compute_pe_atom>`
|
||||
* global virial in :doc:`compute pressure <compute_pressure>`
|
||||
* peratom virial in :doc:`compute stress/atom <compute_stress_atom>`
|
||||
|
||||
These computes invoke a method of the Modify class to include
|
||||
contributions from fixes that have the corresponding flags set,
|
||||
e.g. *energy_peratom_flag* and *thermo_energy* for :doc:`compute
|
||||
pe/atom <compute_pe_atom>`.
|
||||
|
||||
Note that each compute has an optional keyword to either include or
|
||||
exclude all contributions from fixes. Also note that :doc:`compute pe
|
||||
<compute_pe>` and :doc:`compute pressure <compute_pressure>` are what
|
||||
is used (by default) by :doc:`thermodynamic output <thermo_style>` to
|
||||
calculate values for its *pe* and *press* keywords.
|
||||
|
||||
KSpace PPPM FFT grids
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The various :doc:`KSpace PPPM <kspace_style>` styles in LAMMPS use
|
||||
FFTs to solve Poisson's equation. This subsection describes:
|
||||
|
||||
* how FFT grids are defined
|
||||
* how they are decomposed across processors
|
||||
* how they are indexed by each processor
|
||||
* how particle charge and electric field values are mapped to/from
|
||||
the grid
|
||||
|
||||
An FFT grid cell is a 3d volume; grid points are corners of a grid
|
||||
cell and the code stores values assigned to grid points in vectors or
|
||||
3d arrays. A global 3d FFT grid has points indexed 0 to N-1 inclusive
|
||||
in each dimension.
|
||||
|
||||
Each processor owns two subsets of the grid, each subset is
|
||||
brick-shaped. Depending on how it is used, these subsets are
|
||||
allocated as a 1d vector or 3d array. Either way, the ordering of
|
||||
values within contiguous memory x fastest, then y, z slowest.
|
||||
|
||||
For the ``3d decomposition`` of the grid, the global grid is
|
||||
partitioned into bricks that correspond to the sub-domains of the
|
||||
simulation box that each processor owns. Often, this is a regular 3d
|
||||
array (Px by Py by Pz) of bricks, where P = number of processors =
|
||||
Px * Py * Pz. More generally it can be a tiled decomposition, where
|
||||
each processor owns a brick and the union of all the bricks is the
|
||||
global grid. Tiled decompositions are produced by load balancing with
|
||||
the RCB algorithm; see the :doc:`balance rcb <balance>` command.
|
||||
|
||||
For the ``FFT decompostion`` of the grid, each processor owns a brick
|
||||
that spans the entire x dimension of the grid while the y and z
|
||||
dimensions are partitioned as a regular 2d array (P1 by P2), where P =
|
||||
P1 * P2.
|
||||
|
||||
The following indices store the inclusive bounds of the brick a
|
||||
processor owns, within the global grid:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in = 3d decomposition brick
|
||||
nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft = FFT decomposition brick
|
||||
nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out = 3d decomposition brick + ghost cells
|
||||
|
||||
The ``in`` and ``fft`` indices are from 0 to N-1 inclusive in each
|
||||
dimension, where N is the grid size.
|
||||
|
||||
The ``out`` indices index an array which stores the ``in`` subset of
|
||||
the grid plus ghost cells that surround it. These indices can thus be
|
||||
< 0 or >= N.
|
||||
|
||||
The number of ghost cells a processor owns in each of the 6 directions
|
||||
is a function of:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
neighbor skin distance (since atoms can move outside a proc subdomain)
|
||||
qdist = offset or charge from atom due to TIP4P fictitious charge
|
||||
order = mapping stencil size
|
||||
shift = factor used when order is an even number (see below)
|
||||
|
||||
Here is an explanation of how the PPPM variables ``order``,
|
||||
``nlower`` / ``nupper``, ``shift``, and ``OFFSET`` work. They are the
|
||||
relevant variables that determine how atom charge is mapped to grid
|
||||
points and how field values are mapped from grid points to atoms:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
order = # of nearby grid points in each dim that atom charge/field are mapped to/from
|
||||
nlower,nupper = extent of stencil around the grid point an atom is assigned to
|
||||
OFFSET = large integer added/subtracted when mapping to avoid int(-0.75) = 0 when -1 is the desired result
|
||||
|
||||
The particle_map() method assigns each atom to a grid point.
|
||||
|
||||
If order is even, say 4:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
atom is assigned to grid point to its left (in each dim)
|
||||
shift = OFFSET
|
||||
nlower = -1, nupper = 2, which are offsets from assigned grid point
|
||||
window of mapping grid pts is thus 2 grid points to left of atom, 2 to right
|
||||
|
||||
If order is odd, say 5:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
atom is assigned to left/right grid pt it is closest to (in each dim)
|
||||
shift = OFFSET + 0.5
|
||||
nlower = 2, nupper = 2
|
||||
if point is in left half of cell, then window of affected grid pts is 3 grid points to left of atom, 2 to right
|
||||
if point is in right half of cell, then window of affected grid pts is 2 grid points to left of atom, 3 to right
|
||||
|
||||
These settings apply to each dimension, so that if order = 5, an
|
||||
atom's charge is mapped to 125 grid points that surround the atom.
|
||||
@ -1,68 +1,75 @@
|
||||
Source files
|
||||
------------
|
||||
|
||||
The source files of the LAMMPS code are found in two
|
||||
directories of the distribution: ``src`` and ``lib``.
|
||||
Most of the code is C++ but there are small numbers of files
|
||||
in several other languages.
|
||||
The source files of the LAMMPS code are found in two directories of the
|
||||
distribution: ``src`` and ``lib``. Most of the code is written in C++
|
||||
but there are small a number of files in several other languages like C,
|
||||
Fortran, Shell script, or Python.
|
||||
|
||||
The core of the code is located in the
|
||||
``src`` folder and its sub-directories.
|
||||
A sizable number of these files are in the ``src`` directory
|
||||
itself, but there are plenty of :doc:`packages <Packages>`, which can be
|
||||
included or excluded when LAMMPS is built. See the :doc:`Include
|
||||
packages in build <Build_package>` section of the manual for more
|
||||
information about that part of the build process. LAMMPS currently
|
||||
supports building with :doc:`conventional makefiles <Build_make>` and
|
||||
through :doc:`CMake <Build_cmake>` which differ in how packages are
|
||||
enabled or disabled for a LAMMPS binary. The source files for each
|
||||
The core of the code is located in the ``src`` folder and its
|
||||
sub-directories. A sizable number of these files are in the ``src``
|
||||
directory itself, but there are plenty of :doc:`packages <Packages>`,
|
||||
which can be included or excluded when LAMMPS is built. See the
|
||||
:doc:`Include packages in build <Build_package>` section of the manual
|
||||
for more information about that part of the build process. LAMMPS
|
||||
currently supports building with :doc:`conventional makefiles
|
||||
<Build_make>` and through :doc:`CMake <Build_cmake>`. Those procedures
|
||||
differ in how packages are enabled or disabled for inclusion into a
|
||||
LAMMPS binary so they cannot be mixed. The source files for each
|
||||
package are in all-uppercase sub-directories of the ``src`` folder, for
|
||||
example ``src/MOLECULE`` or ``src/USER-MISC``. The ``src/STUBS``
|
||||
sub-directory is not a package but contains a dummy MPI library, that is
|
||||
used when building a serial version of the code. The ``src/MAKE``
|
||||
directory contains makefiles with settings and flags for a variety of
|
||||
configuration and machines for the build process with traditional
|
||||
makefiles.
|
||||
directory and its sub-directories contain makefiles with settings and
|
||||
flags for a variety of configuration and machines for the build process
|
||||
with traditional makefiles.
|
||||
|
||||
The ``lib`` directory contains the source code for several supporting
|
||||
libraries or files with configuration settings to use globally installed
|
||||
libraries, that are required by some of the optional packages.
|
||||
Each sub-directory, like ``lib/poems`` or ``lib/gpu``, contains the
|
||||
source files, some of which are in different languages such as Fortran
|
||||
or CUDA. These libraries are linked to during a LAMMPS build, if the
|
||||
corresponding package is installed.
|
||||
libraries, that are required by some of the optional packages. They may
|
||||
include python scripts that can transparently download additional source
|
||||
code on request. Each sub-directory, like ``lib/poems`` or ``lib/gpu``,
|
||||
contains the source files, some of which are in different languages such
|
||||
as Fortran or CUDA. These libraries included in the LAMMPS build,
|
||||
if the corresponding package is installed.
|
||||
|
||||
LAMMPS C++ source files almost always come in pairs, such as
|
||||
``src/run.cpp`` (implementation file) and ``src/run.h`` (header file).
|
||||
Each pair of files defines a C++
|
||||
class, for example the :cpp:class:`LAMMPS_NS::Run` class which contains
|
||||
the code invoked by the :doc:`run <run>` command in a LAMMPS input script.
|
||||
As this example illustrates, source file and class names often have a
|
||||
one-to-one correspondence with a command used in a LAMMPS input script.
|
||||
Some source files and classes do not have a corresponding input script
|
||||
Each pair of files defines a C++ class, for example the
|
||||
:cpp:class:`LAMMPS_NS::Run` class which contains the code invoked by the
|
||||
:doc:`run <run>` command in a LAMMPS input script. As this example
|
||||
illustrates, source file and class names often have a one-to-one
|
||||
correspondence with a command used in a LAMMPS input script. Some
|
||||
source files and classes do not have a corresponding input script
|
||||
command, e.g. ``src/force.cpp`` and the :cpp:class:`LAMMPS_NS::Force`
|
||||
class. They are discussed in the next section.
|
||||
|
||||
A small number of C++ classes and utility functions are implemented with
|
||||
only a ``.h`` file. Examples are the Pointer class or the MathVec functions.
|
||||
The names of all source files are in lower case and may use the
|
||||
underscore character '_' to separate words. Outside of bundled libraries
|
||||
which may have different conventions, all C and C++ header files have a
|
||||
``.h`` extension, all C++ files have a ``.cpp`` extension, and C files a
|
||||
``.c`` extension. A small number of C++ classes and utility functions
|
||||
are implemented with only a ``.h`` file. Examples are the Pointers and
|
||||
Commands classes or the MathVec functions.
|
||||
|
||||
Class topology
|
||||
--------------
|
||||
|
||||
Though LAMMPS has a lot of source files and classes, its class topology
|
||||
is relative flat, as outlined in the :ref:`class-topology` figure. Each
|
||||
name refers to a class and has a pair of associated source files in the
|
||||
``src`` folder, for example the class :cpp:class:`LAMMPS_NS::Memory`
|
||||
corresponds to the files ``memory.cpp`` and ``memory.h``, or the class
|
||||
:cpp:class:`LAMMPS_NS::AtomVec` corresponds to the files
|
||||
``atom_vec.cpp`` and ``atom_vec.h``. Full lines in the figure represent
|
||||
compositing: that is the class to the left holds a pointer to an
|
||||
instance of the class to the right. Dashed lines instead represent
|
||||
inheritance: the class to the right is derived from the class on the
|
||||
left. Classes with a red boundary are not instantiated directly, but
|
||||
they represent the base classes for "styles". Those "styles" make up
|
||||
the bulk of the LAMMPS code and only a few typical examples are included
|
||||
in the figure for demonstration purposes.
|
||||
is not very deep, which can be seen from the :ref:`class-topology`
|
||||
figure. In that figure, each name refers to a class and has a pair of
|
||||
associated source files in the ``src`` folder, for example the class
|
||||
:cpp:class:`LAMMPS_NS::Memory` corresponds to the files ``memory.cpp``
|
||||
and ``memory.h``, or the class :cpp:class:`LAMMPS_NS::AtomVec`
|
||||
corresponds to the files ``atom_vec.cpp`` and ``atom_vec.h``. Full
|
||||
lines in the figure represent compositing: that is the class at the base
|
||||
of the arrow holds a pointer to an instance of the class at the tip.
|
||||
Dashed lines instead represent inheritance: the class to the tip of the
|
||||
arrow is derived from the class at the base. Classes with a red boundary
|
||||
are not instantiated directly, but they represent the base classes for
|
||||
"styles". Those "styles" make up the bulk of the LAMMPS code and only
|
||||
a few representative examples are included in the figure so it remains
|
||||
readable.
|
||||
|
||||
.. _class-topology:
|
||||
.. figure:: JPG/lammps-classes.png
|
||||
@ -82,69 +89,76 @@ in the figure for demonstration purposes.
|
||||
derived classes, which may also hold instances of other classes.
|
||||
|
||||
The :cpp:class:`LAMMPS_NS::LAMMPS` class is the topmost class and
|
||||
represents what is referred to an "instance" of LAMMPS. It is a
|
||||
composite holding references to instances of other core classes
|
||||
represents what is generally referred to an "instance" of LAMMPS. It is
|
||||
a composite holding pointers to instances of other core classes
|
||||
providing the core functionality of the MD engine in LAMMPS and through
|
||||
them abstractions of the required operations. The constructor of the
|
||||
LAMMPS class will instantiate those instances, process the command line
|
||||
flags, initialize MPI (if not already done) and set up file pointers for
|
||||
input and output. The destructor will shut everything down and free all
|
||||
input and output. The destructor will shut everything down and free all
|
||||
associated memory. Thus code for the standalone LAMMPS executable in
|
||||
``main.cpp`` simply initializes MPI, instantiates a single instance of
|
||||
LAMMPS, and passes it the command line flags and input script. It
|
||||
LAMMPS while passing it the command line flags and input script. It
|
||||
deletes the LAMMPS instance after the method reading the input returns
|
||||
and shuts down the MPI environment before it exits the executable.
|
||||
|
||||
The :cpp:class:`LAMMPS_NS::Pointers` is not shown in the
|
||||
:ref:`class-topology` figure, it holds references to members of the
|
||||
`LAMMPS_NS::LAMMPS`, so that all classes derived from
|
||||
:cpp:class:`LAMMPS_NS::Pointers` have direct access to those reference.
|
||||
From the class topology all classes with blue boundary are referenced in
|
||||
this class and all classes in the second and third columns, that are not
|
||||
listed as derived classes are instead derived from
|
||||
:cpp:class:`LAMMPS_NS::Pointers`.
|
||||
:ref:`class-topology` figure for clarity. It holds references to many
|
||||
of the members of the `LAMMPS_NS::LAMMPS`, so that all classes derived
|
||||
from :cpp:class:`LAMMPS_NS::Pointers` have direct access to those
|
||||
reference. From the class topology all classes with blue boundary are
|
||||
referenced in the Pointers class and all classes in the second and third
|
||||
columns, that are not listed as derived classes are instead derived from
|
||||
:cpp:class:`LAMMPS_NS::Pointers`. To initialize the pointer references
|
||||
in Pointers, a pointer to the LAMMPS class instance needs to be passed
|
||||
to the constructor and thus all constructors for classes derived from it
|
||||
must do so and pass this pointer to the constructor for Pointers.
|
||||
|
||||
Since all storage is encapsulated, the LAMMPS class can also be
|
||||
instantiated multiple times by a calling code, and that can be either
|
||||
simultaneously or consecutively. When running in parallel with MPI,
|
||||
care has to be taken, that suitable communicators are used to not
|
||||
create conflicts between different instances.
|
||||
Since all storage is supposed to be encapsulated (there are a few
|
||||
exceptions), the LAMMPS class can also be instantiated multiple times by
|
||||
a calling code. Outside of the aforementioned exceptions, those LAMMPS
|
||||
instances can be used alternately. As of the time of this writing
|
||||
(early 2021) LAMMPS is not yet sufficiently thread-safe for concurrent
|
||||
execution. When running in parallel with MPI, care has to be taken,
|
||||
that suitable copies of communicators are used to not create conflicts
|
||||
between different instances.
|
||||
|
||||
The LAMMPS class currently holds instances of 19 classes representing
|
||||
different core functionalities There are a handful of virtual parent
|
||||
classes in LAMMPS that define what LAMMPS calls ``styles``. They are
|
||||
shaded red in the :ref:`class-topology` figure. Each of these are
|
||||
The LAMMPS class currently (early 2021) holds instances of 19 classes
|
||||
representing the core functionality. There are a handful of virtual
|
||||
parent classes in LAMMPS that define what LAMMPS calls ``styles``. They
|
||||
are shaded red in the :ref:`class-topology` figure. Each of these are
|
||||
parents of a number of child classes that implement the interface
|
||||
defined by the parent class. There are two main categories of these
|
||||
``styles``: some may only have one instance active at a time (e.g. atom,
|
||||
pair, bond, angle, dihedral, improper, kspace, comm) and there is a
|
||||
dedicated pointer variable in the composite class that manages them.
|
||||
dedicated pointer variable for each of them in the composite class.
|
||||
Setups that require a mix of different such styles have to use a
|
||||
*hybrid* class that manages and forwards calls to the corresponding
|
||||
sub-styles for the designated subset of atoms or data. or the composite
|
||||
class may have lists of class instances, e.g. Modify handles lists of
|
||||
compute and fix styles, while Output handles dumps class instances.
|
||||
*hybrid* class that takes the place of the one allowed instance and then
|
||||
manages and forwards calls to the corresponding sub-styles for the
|
||||
designated subset of atoms or data. The composite class may also have
|
||||
lists of class instances, e.g. Modify handles lists of compute and fix
|
||||
styles, while Output handles a list of dump class instances.
|
||||
|
||||
The exception to this scheme are the ``command`` style classes. These
|
||||
implement specific commands that can be invoked before, after, or between
|
||||
runs or are commands which launch a simulation. For these an instance
|
||||
of the class is created, its command() method called and then, after
|
||||
completion, the class instance deleted. Examples for this are the
|
||||
create_box, create_atoms, minimize, run, or velocity command styles.
|
||||
The exception to this scheme are the ``command`` style classes. These
|
||||
implement specific commands that can be invoked before, after, or in
|
||||
between runs. For these an instance of the class is created, its
|
||||
command() method called and then, after completion, the class instance
|
||||
deleted. Examples for this are the create_box, create_atoms, minimize,
|
||||
run, set, or velocity command styles.
|
||||
|
||||
For all those ``styles`` certain naming conventions are employed: for
|
||||
the fix nve command the class is called FixNVE and the files are
|
||||
the fix nve command the class is called FixNVE and the source files are
|
||||
``fix_nve.h`` and ``fix_nve.cpp``. Similarly for fix ave/time we have
|
||||
FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names
|
||||
FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names
|
||||
are lower case and without spaces or special characters. A suffix or
|
||||
multiple appended with a forward slash '/' denotes a variant of the
|
||||
corresponding class without the suffix. To connect the style name and
|
||||
the class name, LAMMPS uses macros like the following ATOM\_CLASS,
|
||||
PAIR\_CLASS, BOND\_CLASS, REGION\_CLASS, FIX\_CLASS, COMPUTE\_CLASS,
|
||||
or DUMP\_CLASS in the corresponding header file. During compilation
|
||||
files with the pattern ``style_name.h`` are created that contain include
|
||||
statements including all headers of all styles of a given type that
|
||||
are currently active (or "installed).
|
||||
words are appended with a forward slash '/' which denotes a variant of
|
||||
the corresponding class without the suffix. To connect the style name
|
||||
and the class name, LAMMPS uses macros like: ``AtomStyle()``,
|
||||
``PairStyle()``, ``BondStyle()``, ``RegionStyle()``, and so on in the
|
||||
corresponding header file. During configuration or compilation files
|
||||
with the pattern ``style_<name>.h`` are created that consist of a list
|
||||
of include statements including all headers of all styles of a given
|
||||
type that are currently active (or "installed).
|
||||
|
||||
|
||||
More details on individual classes in the :ref:`class-topology` are as
|
||||
@ -152,20 +166,20 @@ follows:
|
||||
|
||||
- The Memory class handles allocation of all large vectors and arrays.
|
||||
|
||||
- The Error class prints all error and warning messages.
|
||||
- The Error class prints all (terminal) error and warning messages.
|
||||
|
||||
- The Universe class sets up partitions of processors so that multiple
|
||||
simulations can be run, each on a subset of the processors allocated
|
||||
for a run, e.g. by the mpirun command.
|
||||
- The Universe class sets up one or more partitions of processors so
|
||||
that one or multiple simulations can be run, on the processors
|
||||
allocated for a run, e.g. by the mpirun command.
|
||||
|
||||
- The Input class reads and processes input input strings and files,
|
||||
stores variables, and invokes :doc:`commands <Commands_all>`.
|
||||
|
||||
- As discussed above, command style classes are directly derived from
|
||||
the Pointers class. They provide input script commands that perform
|
||||
one-time operations before/after/between simulations or which invoke a
|
||||
simulation. They are instantiated from within the Input class,
|
||||
invoked, then immediately destructed.
|
||||
- Command style classes are derived from the Command class. They provide
|
||||
input script commands that perform one-time operations
|
||||
before/after/between simulations or which invoke a simulation. They
|
||||
are usually instantiated from within the Input class, its ``command``
|
||||
method invoked, and then immediately destructed.
|
||||
|
||||
- The Finish class is instantiated to print statistics to the screen
|
||||
after a simulation is performed, by commands like run and minimize.
|
||||
@ -241,7 +255,8 @@ follows:
|
||||
.. TODO section on "Spatial decomposition and parallel operations"
|
||||
.. diagram of 3d processor grid, brick vs. tiled. local vs. ghost
|
||||
.. atoms, 6-way communication with pack/unpack functions,
|
||||
.. PBC as part of the communication
|
||||
.. PBC as part of the communication, forward and reverse communication
|
||||
.. rendezvous communication, ring communication.
|
||||
|
||||
.. TODO section on "Fixes, Computes, and Variables"
|
||||
.. how and when data is computed and provided and how it is
|
||||
|
||||
251
doc/src/Developer_plugins.rst
Normal file
251
doc/src/Developer_plugins.rst
Normal file
@ -0,0 +1,251 @@
|
||||
Writing plugins
|
||||
---------------
|
||||
|
||||
Plugins provide a mechanism to add functionality to a LAMMPS executable
|
||||
without recompiling LAMMPS. The functionality for this and the
|
||||
:doc:`plugin command <plugin>` are implemented in the
|
||||
:ref:`PLUGIN package <PKG-PLUGIN>` which must be installed to use plugins.
|
||||
|
||||
Plugins use the operating system's capability to load dynamic shared
|
||||
object (DSO) files in a way similar shared libraries and then reference
|
||||
specific functions in those DSOs. Any DSO file with plugins has to include
|
||||
an initialization function with a specific name, "lammpsplugin_init", that
|
||||
has to follow specific rules described below. When loading the DSO with
|
||||
the "plugin" command, this function is looked up and called and will then
|
||||
register the contained plugin(s) with LAMMPS.
|
||||
|
||||
From the programmer perspective this can work because of the object
|
||||
oriented design of LAMMPS where all pair style commands are derived from
|
||||
the class Pair, all fix style commands from the class Fix and so on and
|
||||
usually only functions present in those base classes are called
|
||||
directly. When a :doc:`pair_style` command or :doc:`fix` command is
|
||||
issued a new instance of such a derived class is created. This is done
|
||||
by a so-called factory function which is mapped to the style name. Thus
|
||||
when, for example, the LAMMPS processes the command ``pair_style lj/cut
|
||||
2.5``, LAMMPS will look up the factory function for creating the
|
||||
``PairLJCut`` class and then execute it. The return value of that
|
||||
function is a ``Pair *`` pointer and the pointer will be assigned to the
|
||||
location for the currently active pair style.
|
||||
|
||||
A DSO file with a plugin thus has to implement such a factory function
|
||||
and register it with LAMMPS so that it gets added to the map of available
|
||||
styles of the given category. To register a plugin with LAMMPS an
|
||||
initialization function has to be present in the DSO file called
|
||||
``lammpsplugin_init`` which is called with three ``void *`` arguments:
|
||||
a pointer to the current LAMMPS instance, a pointer to the opened DSO
|
||||
handle, and a pointer to the registration function. The registration
|
||||
function takes two arguments: a pointer to a ``lammpsplugin_t`` struct
|
||||
with information about the plugin and a pointer to the current LAMMPS
|
||||
instance. Please see below for an example of how the registration is
|
||||
done.
|
||||
|
||||
Members of ``lammpsplugin_t``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
|
||||
* - Member
|
||||
- Description
|
||||
* - version
|
||||
- LAMMPS Version string the plugin was compiled for
|
||||
* - style
|
||||
- Style of the plugin (pair, bond, fix, command, etc.)
|
||||
* - name
|
||||
- Name of the plugin style
|
||||
* - info
|
||||
- String with information about the plugin
|
||||
* - author
|
||||
- String with the name and email of the author
|
||||
* - creator.v1
|
||||
- Pointer to factory function for pair, bond, angle, dihedral, improper or command styles
|
||||
* - creator.v2
|
||||
- Pointer to factory function for compute, fix, or region styles
|
||||
* - handle
|
||||
- Pointer to the open DSO file handle
|
||||
|
||||
Only one of the three alternate creator entries can be used at a time
|
||||
and which of those is determined by the style of plugin. The
|
||||
"creator.v1" element is for factory functions of supported styles
|
||||
computing forces (i.e. command, pair, bond, angle, dihedral, or
|
||||
improper styles) and the function takes as single argument the pointer
|
||||
to the LAMMPS instance. The factory function is cast to the
|
||||
``lammpsplugin_factory1`` type before assignment. The "creator.v2"
|
||||
element is for factory functions creating an instance of a fix, compute,
|
||||
or region style and takes three arguments: a pointer to the LAMMPS
|
||||
instance, an integer with the length of the argument list and a ``char
|
||||
**`` pointer to the list of arguments. The factory function pointer
|
||||
needs to be cast to the ``lammpsplugin_factory2`` type before
|
||||
assignment.
|
||||
|
||||
Pair style example
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As an example, a hypothetical pair style plugin "morse2" implemented in
|
||||
a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
||||
``pair_morse2.cpp`` with the factory function and initialization
|
||||
function would look like this:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
#include "pair_morse2.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
static Pair *morse2creator(LAMMPS *lmp)
|
||||
{
|
||||
return new PairMorse2(lmp);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||
lammpsplugin_t plugin;
|
||||
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "pair";
|
||||
plugin.name = "morse2";
|
||||
plugin.info = "Morse2 variant pair style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin,lmp);
|
||||
}
|
||||
|
||||
The factory function in this example is called ``morse2creator()``. It
|
||||
receives a pointer to the LAMMPS class as only argument and thus has to
|
||||
be assigned to the *creator.v1* member of the plugin struct and cast to
|
||||
the ``lammpsplugin_factory1`` function pointer type. It returns a
|
||||
pointer to the allocated class instance derived from the ``Pair`` class.
|
||||
This function may be declared static to avoid clashes with other
|
||||
plugins. The name of the derived class, ``PairMorse2``, however must be
|
||||
unique inside the entire LAMMPS executable.
|
||||
|
||||
Fix style example
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
If the factory function would be for a fix or compute, which take three
|
||||
arguments (a pointer to the LAMMPS class, the number of arguments and the
|
||||
list of argument strings), then the pointer type is ``lammpsplugin_factory2``
|
||||
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||
Below is an example for that:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
#include "fix_nve2.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
static Fix *nve2creator(LAMMPS *lmp, int argc, char **argv)
|
||||
{
|
||||
return new FixNVE2(lmp,argc,argv);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||
lammpsplugin_t plugin;
|
||||
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "fix";
|
||||
plugin.name = "nve2";
|
||||
plugin.info = "NVE2 variant fix style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v2 = (lammpsplugin_factory2 *) &nve2creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin,lmp);
|
||||
}
|
||||
|
||||
Command style example
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Command styles also use the first variant of factory function as
|
||||
demonstrated in the following example, which also shows that the
|
||||
implementation of the plugin class may be within the same source
|
||||
file as the plugin interface code:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
#include "command.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
class Hello : public Command {
|
||||
public:
|
||||
Hello(class LAMMPS *lmp) : Command(lmp) {};
|
||||
void command(int, char **);
|
||||
};
|
||||
}
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
void Hello::command(int argc, char **argv)
|
||||
{
|
||||
if (argc != 1) error->all(FLERR,"Illegal hello command");
|
||||
if (comm->me == 0)
|
||||
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
||||
}
|
||||
|
||||
static void hellocreator(LAMMPS *lmp)
|
||||
{
|
||||
return new Hello(lmp);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_t plugin;
|
||||
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "command";
|
||||
plugin.name = "hello";
|
||||
plugin.info = "Hello world command v1.1";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin,lmp);
|
||||
}
|
||||
|
||||
Additional Details
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The initialization function **must** be called ``lammpsplugin_init``, it
|
||||
**must** have C bindings and it takes three void pointers as arguments.
|
||||
The first is a pointer to the LAMMPS class that calls it and it needs to
|
||||
be passed to the registration function. The second argument is a
|
||||
pointer to the internal handle of the DSO file, this needs to be added
|
||||
to the plugin info struct, so that the DSO can be closed and unloaded
|
||||
when all its contained plugins are unloaded. The third argument is a
|
||||
function pointer to the registration function and needs to be stored
|
||||
in a variable of ``lammpsplugin_regfunc`` type and then called with a
|
||||
pointer to the ``lammpsplugin_t`` struct and the pointer to the LAMMPS
|
||||
instance as arguments to register a single plugin. There may be multiple
|
||||
calls to multiple plugins in the same initialization function.
|
||||
|
||||
To register a plugin a struct of the ``lammpsplugin_t`` needs to be filled
|
||||
with relevant info: current LAMMPS version string, kind of style, name of
|
||||
style, info string, author string, pointer to factory function, and the
|
||||
DSO handle. The registration function is called with a pointer to the address
|
||||
of this struct and the pointer of the LAMMPS class. The registration function
|
||||
will then add the factory function of the plugin style to the respective
|
||||
style map under the provided name. It will also make a copy of the struct
|
||||
in a list of all loaded plugins and update the reference counter for loaded
|
||||
plugins from this specific DSO file.
|
||||
|
||||
The pair style itself (i.e. the PairMorse2 class in this example) can be
|
||||
written just like any other pair style that is included in LAMMPS. For
|
||||
a plugin, the use of the ``PairStyle`` macro in the section encapsulated
|
||||
by ``#ifdef PAIR_CLASS`` is not needed, since the mapping of the class
|
||||
name to the style name is done by the plugin registration function with
|
||||
the information from the ``lammpsplugin_t`` struct. It may be included
|
||||
in case the new code is intended to be later included in LAMMPS directly.
|
||||
@ -4,10 +4,10 @@ Adding tests for unit testing
|
||||
This section discusses adding or expanding tests for the unit test
|
||||
infrastructure included into the LAMMPS source code distribution.
|
||||
Unlike example inputs, unit tests focus on testing the "local" behavior
|
||||
of individual features, tend to run very fast, and should be set up to
|
||||
cover as much of the added code as possible. When contributing code to
|
||||
the distribution, the LAMMPS developers will appreciate if additions
|
||||
to the integrated unit test facility are included.
|
||||
of individual features, tend to run fast, and should be set up to cover
|
||||
as much of the added code as possible. When contributing code to the
|
||||
distribution, the LAMMPS developers will appreciate if additions to the
|
||||
integrated unit test facility are included.
|
||||
|
||||
Given the complex nature of MD simulations where many operations can
|
||||
only be performed when suitable "real" simulation environment has been
|
||||
@ -50,6 +50,9 @@ available:
|
||||
* - File name:
|
||||
- Test name:
|
||||
- Description:
|
||||
* - ``test_argutils.cpp``
|
||||
- ArgInfo
|
||||
- Tests for ``ArgInfo`` class used by LAMMPS
|
||||
* - ``test_fmtlib.cpp``
|
||||
- FmtLib
|
||||
- Tests for ``fmtlib::`` functions used by LAMMPS
|
||||
@ -155,23 +158,27 @@ have the desired effect:
|
||||
{
|
||||
ASSERT_EQ(lmp->update->ntimestep, 0);
|
||||
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lmp->input->one("reset_timestep 10");
|
||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
command("reset_timestep 10");
|
||||
END_HIDE_OUTPUT();
|
||||
ASSERT_EQ(lmp->update->ntimestep, 10);
|
||||
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lmp->input->one("reset_timestep 0");
|
||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
command("reset_timestep 0");
|
||||
END_HIDE_OUTPUT();
|
||||
ASSERT_EQ(lmp->update->ntimestep, 0);
|
||||
|
||||
TEST_FAILURE(".*ERROR: Timestep must be >= 0.*", command("reset_timestep -10"););
|
||||
TEST_FAILURE(".*ERROR: Illegal reset_timestep .*", command("reset_timestep"););
|
||||
TEST_FAILURE(".*ERROR: Illegal reset_timestep .*", command("reset_timestep 10 10"););
|
||||
TEST_FAILURE(".*ERROR: Expected integer .*", command("reset_timestep xxx"););
|
||||
}
|
||||
|
||||
Please note the use of the (global) verbose variable to control whether
|
||||
the LAMMPS command will be silent by capturing the output or not. In
|
||||
the default case, verbose == false, the test output will be compact and
|
||||
not mixed with LAMMPS output. However setting the verbose flag (via
|
||||
setting the ``TEST_ARGS`` environment variable, ``TEST_ARGS=-v``) can be
|
||||
helpful to understand why tests fail unexpectedly.
|
||||
Please note the use of the ``BEGIN_HIDE_OUTPUT`` and ``END_HIDE_OUTPUT``
|
||||
functions that will capture output from running LAMMPS. This is normally
|
||||
discarded but by setting the verbose flag (via setting the ``TEST_ARGS``
|
||||
environment variable, ``TEST_ARGS=-v``) it can be printed and used to
|
||||
understand why tests fail unexpectedly.
|
||||
|
||||
Another complexity of these tests stems from the need to capture
|
||||
situations where LAMMPS will stop with an error, i.e. handle so-called
|
||||
@ -210,6 +217,12 @@ The following test programs are currently available:
|
||||
* - ``test_lattice_region.cpp``
|
||||
- LatticeRegion
|
||||
- Tests to validate the :doc:`lattice <lattice>` and :doc:`region <region>` commands
|
||||
* - ``test_groups.cpp``
|
||||
- GroupTest
|
||||
- Tests to validate the :doc:`group <group>` command
|
||||
* - ``test_variables.cpp``
|
||||
- VariableTest
|
||||
- Tests to validate the :doc:`variable <variable>` command
|
||||
* - ``test_kim_commands.cpp``
|
||||
- KimCommands
|
||||
- Tests for several commands from the :ref:`KIM package <PKG-KIM>`
|
||||
|
||||
@ -12,11 +12,18 @@ reduces redundant implementations and encourages consistent behavior.
|
||||
I/O with status check
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
These are wrappers around the corresponding C library calls like
|
||||
``fgets()`` or ``fread()``. They will check if there were errors
|
||||
on reading or an unexpected end-of-file state was reached. In that
|
||||
case, the functions will stop the calculation with an error message,
|
||||
indicating the name of the problematic file, if possible.
|
||||
The the first two functions are wrappers around the corresponding C
|
||||
library calls ``fgets()`` or ``fread()``. They will check if there
|
||||
were errors on reading or an unexpected end-of-file state was reached.
|
||||
In that case, the functions will stop with an error message, indicating
|
||||
the name of the problematic file, if possible unless the *error* argument
|
||||
is a NULL pointer.
|
||||
|
||||
The :cpp:func:`read_lines_from_file` function will read the requested
|
||||
number of lines of a maximum length into a buffer and will return 0
|
||||
if successful or 1 if not. It also guarantees that all lines are
|
||||
terminated with a newline character and the entire buffer with a
|
||||
NULL character.
|
||||
|
||||
----------
|
||||
|
||||
@ -26,6 +33,9 @@ indicating the name of the problematic file, if possible.
|
||||
.. doxygenfunction:: sfread
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: read_lines_from_file
|
||||
:project: progguide
|
||||
|
||||
----------
|
||||
|
||||
String to number conversions with validity check
|
||||
@ -71,12 +81,21 @@ and parsing files or arguments.
|
||||
|
||||
----------
|
||||
|
||||
.. doxygenfunction:: strdup
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: trim
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: trim_comment
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: has_utf8
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: utf8_subst
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: count_words(const char *text)
|
||||
:project: progguide
|
||||
|
||||
@ -92,9 +111,15 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: split_words
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: split_lines
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strmatch
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strfind
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: is_integer
|
||||
:project: progguide
|
||||
|
||||
@ -286,6 +311,50 @@ This code example should produce the following output:
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Argument parsing classes
|
||||
---------------------------
|
||||
|
||||
The purpose of argument parsing classes it to simplify and unify how
|
||||
arguments of commands in LAMMPS are parsed and to make abstractions of
|
||||
repetitive tasks.
|
||||
|
||||
The :cpp:class:`LAMMPS_NS::ArgInfo` class provides an abstraction
|
||||
for parsing references to compute or fix styles or variables. These
|
||||
would start with a "c\_", "f\_", "v\_" followed by the ID or name of
|
||||
than instance and may be postfixed with one or two array indices
|
||||
"[<number>]" with numbers > 0.
|
||||
|
||||
A typical code segment would look like this:
|
||||
|
||||
.. code-block:: C++
|
||||
:caption: Usage example for ArgInfo class
|
||||
|
||||
int nvalues = 0;
|
||||
for (iarg = 0; iarg < nargnew; iarg++) {
|
||||
ArgInfo argi(arg[iarg]);
|
||||
|
||||
which[nvalues] = argi.get_type();
|
||||
argindex[nvalues] = argi.get_index1();
|
||||
ids[nvalues] = argi.copy_name();
|
||||
|
||||
if ((which[nvalues] == ArgInfo::UNKNOWN)
|
||||
|| (which[nvalues] == ArgInfo::NONE)
|
||||
|| (argi.get_dim() > 1))
|
||||
error->all(FLERR,"Illegal compute XXX command");
|
||||
|
||||
nvalues++;
|
||||
}
|
||||
|
||||
----------
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::ArgInfo
|
||||
:project: progguide
|
||||
:members:
|
||||
|
||||
|
||||
----------
|
||||
|
||||
File reader classes
|
||||
-------------------
|
||||
|
||||
|
||||
@ -91,6 +91,7 @@ documentation for the formula it computes.
|
||||
* :doc:`bond_style <bond_harmonic>` harmonic
|
||||
* :doc:`bond_style <bond_morse>` morse
|
||||
|
||||
* :doc:`angle_style <angle_cosine_squared>` cosine/squared
|
||||
* :doc:`angle_style <angle_harmonic>` harmonic
|
||||
* :doc:`angle_style <angle_cosine>` cosine
|
||||
* :doc:`angle_style <angle_cosine_periodic>` cosine/periodic
|
||||
|
||||
@ -296,6 +296,8 @@ Some common CMake variables
|
||||
- Description
|
||||
* - ``CMAKE_INSTALL_PREFIX``
|
||||
- root directory of install location for ``make install`` (default: ``$HOME/.local``)
|
||||
* - ``LAMMPS_INSTALL_RPATH``
|
||||
- set or remove runtime path setting from binaries for ``make install`` (default: ``off``)
|
||||
* - ``CMAKE_BUILD_TYPE``
|
||||
- controls compilation options:
|
||||
one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel``
|
||||
@ -409,10 +411,10 @@ interface (``ccmake`` or ``cmake-gui``).
|
||||
.. note::
|
||||
|
||||
Using a preset to select a compiler package (``clang.cmake``,
|
||||
``gcc.cmake``, or ``intel.cmake``) are an exception to the option
|
||||
of updating the configuration incrementally, as they will trigger
|
||||
a reset of cached internal CMake settings and thus reset them to
|
||||
their default values.
|
||||
``gcc.cmake``, ``intel.cmake``, ``oneapi.cmake``, or ``pgi.cmake``)
|
||||
are an exception to the mechanism of updating the configuration incrementally,
|
||||
as they will trigger a reset of cached internal CMake settings and thus
|
||||
reset settings to their default values.
|
||||
|
||||
Compilation and build targets
|
||||
-----------------------------
|
||||
|
||||
@ -42,10 +42,11 @@ screening. It may be necessary to use the *extra/special/per/atom*
|
||||
keyword of the :doc:`read_data <read_data>` command. If using :doc:`fix shake <fix_shake>`, make sure no Drude particle is in this fix
|
||||
group.
|
||||
|
||||
There are two ways to thermostat the Drude particles at a low
|
||||
There are three ways to thermostat the Drude particles at a low
|
||||
temperature: use either :doc:`fix langevin/drude <fix_langevin_drude>`
|
||||
for a Langevin thermostat, or :doc:`fix drude/transform/\* <fix_drude_transform>` for a Nose-Hoover
|
||||
thermostat. The former requires use of the command :doc:`comm_modify vel yes <comm_modify>`. The latter requires two separate integration
|
||||
thermostat, or :doc:`fix tgnvt/drude <fix_tgnh_drude>` for a temperature-grouped Nose-Hoover thermostat.
|
||||
The first and third require use of the command :doc:`comm_modify vel yes <comm_modify>`. The second requires two separate integration
|
||||
fixes like *nvt* or *npt*\ . The correct temperatures of the reduced
|
||||
degrees of freedom can be calculated using the :doc:`compute temp/drude <compute_temp_drude>`. This requires also to use the
|
||||
command *comm_modify vel yes*.
|
||||
|
||||
@ -221,6 +221,14 @@ modification of forces but no position/velocity updates), the fix
|
||||
|
||||
fix NVE all nve
|
||||
|
||||
To avoid the flying ice cube artifact, where the atoms progressively freeze and the
|
||||
center of mass of the whole system drifts faster and faster, the *fix momentum*
|
||||
can be used. For instance:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix MOMENTUM all momentum 100 linear 1 1 1
|
||||
|
||||
Finally, do not forget to update the atom type elements if you use
|
||||
them in a *dump_modify ... element ...* command, by adding the element
|
||||
type of the DPs. Here for instance
|
||||
@ -376,14 +384,7 @@ For our phenol example, the groups would be defined as
|
||||
|
||||
Note that with the fixes *drude/transform*\ , it is not required to
|
||||
specify *comm_modify vel yes* because the fixes do it anyway (several
|
||||
times and for the forces also). To avoid the flying ice cube artifact
|
||||
:ref:`(Lamoureux and Roux) <Lamoureux2>`, where the atoms progressively freeze and the
|
||||
center of mass of the whole system drifts faster and faster, the *fix
|
||||
momentum* can be used. For instance:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix MOMENTUM all momentum 100 linear 1 1 1
|
||||
times and for the forces also).
|
||||
|
||||
It is a bit more tricky to run a NPT simulation with Nose-Hoover
|
||||
barostat and thermostat. First, the volume should be integrated only
|
||||
@ -404,6 +405,31 @@ instructions for thermostatting and barostatting will look like
|
||||
fix NVT DRUDES nvt temp 1. 1. 20
|
||||
fix INVERSE all drude/transform/inverse
|
||||
|
||||
Another option for thermalizing the Drude model is to use the
|
||||
temperature-grouped Nose-Hoover (TGNH) thermostat proposed by :ref:`(Son) <TGNH-SON>`.
|
||||
This is implemented as :doc:`fix tgnvt/drude <fix_tgnh_drude>` and :doc:`fix tgnpt/drude <fix_tgnh_drude>`.
|
||||
It separates the kinetic energy into three contributions:
|
||||
the molecular center of mass (COM) motion, the motion of atoms or atom-Drude pairs relative to molecular COMs,
|
||||
and the relative motion of atom-Drude pairs.
|
||||
An independent Nose-Hoover chain is applied to each type of motion.
|
||||
When TGNH is used, the temperatures of molecular, atomic and Drude motion can be printed out with :doc:`thermo_style` command.
|
||||
|
||||
NVT simulation with TGNH thermostat
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
comm_modify vel yes
|
||||
fix TGNVT all tgnvt/drude temp 300. 300. 100 1. 20
|
||||
thermo_style custom f_TGNVT[1] f_TGNVT[2] f_TGNVT[3]
|
||||
|
||||
NPT simulation with TGNH thermostat
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
comm_modify vel yes
|
||||
fix TGNPT all tgnpt/drude temp 300. 300. 100 1. 20 iso 1. 1. 500
|
||||
thermo_style custom f_TGNPT[1] f_TGNPT[2] f_TGNPT[3]
|
||||
|
||||
----------
|
||||
|
||||
**Rigid bodies**
|
||||
@ -480,3 +506,7 @@ NPT ensemble using Nose-Hoover thermostat:
|
||||
|
||||
**(SWM4-NDP)** Lamoureux, Harder, Vorobyov, Roux, MacKerell, Chem Phys
|
||||
Let, 418, 245-249 (2006)
|
||||
|
||||
.. _TGNH-Son:
|
||||
|
||||
**(Son)** Son, McDaniel, Cui and Yethiraj, J Phys Chem Lett, 10, 7523 (2019).
|
||||
|
||||
@ -18,12 +18,13 @@ This compute
|
||||
|
||||
calculates rotational kinetic energy which can be :doc:`output with thermodynamic info <Howto_output>`.
|
||||
|
||||
Use one of these 3 pair potentials, which compute forces and torques
|
||||
Use one of these 4 pair potentials, which compute forces and torques
|
||||
between interacting pairs of particles:
|
||||
|
||||
* :doc:`pair_style <pair_style>` gran/history
|
||||
* :doc:`pair_style <pair_style>` gran/no_history
|
||||
* :doc:`pair_style <pair_style>` gran/hertzian
|
||||
* :doc:`pair_style gran/history <pair_gran>`
|
||||
* :doc:`pair_style gran/no_history <pair_gran>`
|
||||
* :doc:`pair_style gran/hertzian <pair_gran>`
|
||||
* :doc:`pair_style granular <pair_granular>`
|
||||
|
||||
These commands implement fix options specific to granular systems:
|
||||
|
||||
@ -31,6 +32,7 @@ These commands implement fix options specific to granular systems:
|
||||
* :doc:`fix pour <fix_pour>`
|
||||
* :doc:`fix viscous <fix_viscous>`
|
||||
* :doc:`fix wall/gran <fix_wall_gran>`
|
||||
* :doc:`fix wall/gran/region <fix_wall_gran_region>`
|
||||
|
||||
The fix style *freeze* zeroes both the force and torque of frozen
|
||||
atoms, and should be used for granular system instead of the fix style
|
||||
|
||||
@ -9,8 +9,8 @@ Overview
|
||||
``PyLammps`` is a Python wrapper class for LAMMPS which can be created
|
||||
on its own or use an existing lammps Python object. It creates a simpler,
|
||||
more "pythonic" interface to common LAMMPS functionality, in contrast to
|
||||
the ``lammps.py`` wrapper for the C-style LAMMPS library interface which
|
||||
is written using `Python ctypes <ctypes_>`_. The ``lammps.py`` wrapper
|
||||
the ``lammps`` wrapper for the C-style LAMMPS library interface which
|
||||
is written using `Python ctypes <ctypes_>`_. The ``lammps`` wrapper
|
||||
is discussed on the :doc:`Python_head` doc page.
|
||||
|
||||
Unlike the flat ``ctypes`` interface, PyLammps exposes a discoverable
|
||||
|
||||
@ -21,8 +21,8 @@ orientations and their associated inter-atomic distances.
|
||||
|
||||
The command :doc:`fix precession/spin <fix_precession_spin>` allows to
|
||||
apply a constant magnetic torque on all the spins in the system. This
|
||||
torque can be an external magnetic field (Zeeman interaction), or an
|
||||
uniaxial magnetic anisotropy.
|
||||
torque can be an external magnetic field (Zeeman interaction), and an
|
||||
uniaxial or cubic magnetic anisotropy.
|
||||
|
||||
A Langevin thermostat can be applied to those magnetic spins using
|
||||
:doc:`fix langevin/spin <fix_langevin_spin>`. Typically, this thermostat
|
||||
|
||||
@ -86,33 +86,59 @@ check out any other desired branch) first.
|
||||
|
||||
Once you have updated your local files with a ``git pull`` (or ``git
|
||||
checkout``), you still need to re-build LAMMPS if any source files have
|
||||
changed. To do this, you should cd to the src directory and type:
|
||||
changed. How to do this depends on the build system you are using.
|
||||
|
||||
.. code-block:: bash
|
||||
.. tabs::
|
||||
|
||||
$ make purge # remove any deprecated src files
|
||||
$ make package-update # sync package files with src files
|
||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||
.. tab:: CMake build
|
||||
|
||||
just as described on the :doc:`Apply patch <Install_patch>` page,
|
||||
after a patch has been installed.
|
||||
Change to your build folder and type:
|
||||
|
||||
.. warning::
|
||||
.. code-block:: bash
|
||||
|
||||
If you wish to edit/change a src file that is from a
|
||||
package, you should edit the version of the file inside the package
|
||||
sub-directory with src, then re-install the package. The version in
|
||||
the source directory is merely a copy and will be wiped out if you type "make
|
||||
package-update".
|
||||
cmake . --build
|
||||
|
||||
.. warning::
|
||||
CMake should auto-detect whether it needs to re-run the CMake
|
||||
configuration step and otherwise redo the build for all files
|
||||
that have been changed or files that depend on changed files.
|
||||
In case some build options have been changed or renamed, you
|
||||
may have to update those by running:
|
||||
|
||||
The GitHub servers support both the "git://" and
|
||||
"https://" access protocols for anonymous read-only access. If you
|
||||
have a correspondingly configured GitHub account, you may also use
|
||||
SSH access with the URL "git@github.com:lammps/lammps.git".
|
||||
.. code-block:: bash
|
||||
|
||||
The LAMMPS GitHub project is managed by Christoph Junghans (LANL,
|
||||
junghans at lanl.gov), Axel Kohlmeyer (Temple U, akohlmey at
|
||||
gmail.com) and Richard Berger (Temple U, richard.berger at
|
||||
temple.edu).
|
||||
cmake .
|
||||
|
||||
and then rebuild.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
Switch to the src directory and type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make purge # remove any deprecated src files
|
||||
$ make package-update # sync package files with src files
|
||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||
|
||||
Just as described on the :doc:`Apply patch <Install_patch>` page,
|
||||
after a patch has been installed.
|
||||
|
||||
.. warning::
|
||||
|
||||
If you wish to edit/change a src file that is from a package,
|
||||
you should edit the version of the file inside the package
|
||||
sub-directory with src, then re-install the package. The
|
||||
version in the source directory is merely a copy and will be
|
||||
wiped out if you type "make package-update".
|
||||
|
||||
.. admonition:: Git protocols
|
||||
:class: note
|
||||
|
||||
The servers at github.com support the "git://" and "https://" access
|
||||
protocols for anonymous, read-only access. If you have a suitably
|
||||
configured GitHub account, you may also use SSH protocol with the
|
||||
URL "git@github.com:lammps/lammps.git".
|
||||
|
||||
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
||||
(Temple U, akohlmey at gmail.com) and Richard Berger (Temple U,
|
||||
richard.berger at temple.edu).
|
||||
|
||||
@ -43,24 +43,54 @@ up to date.
|
||||
* A list of updated files print out to the screen. The -b switch
|
||||
creates backup files of your originals (e.g. src/force.cpp.orig), so
|
||||
you can manually undo the patch if something goes wrong.
|
||||
* Type the following from the src directory, to enforce consistency
|
||||
between the src and package directories. This is OK to do even if you
|
||||
don't use one or more packages. If you are applying several patches
|
||||
successively, you only need to type this once at the end. The purge
|
||||
command removes deprecated src files if any were removed by the patch
|
||||
from package sub-directories.
|
||||
|
||||
.. code-block:: bash
|
||||
* Once you have updated your local files you need to re-build LAMMPS.
|
||||
If you are applying several patches successively, you only need to
|
||||
do the rebuild once at the end. How to do it depends on the build
|
||||
system you are using.
|
||||
|
||||
$ make purge
|
||||
$ make package-update
|
||||
.. tabs::
|
||||
|
||||
* Re-build LAMMPS via the "make" command.
|
||||
.. tab:: CMake build
|
||||
|
||||
.. warning::
|
||||
Change to your build folder and type:
|
||||
|
||||
If you wish to edit/change a source file that is part of a package,
|
||||
you should edit the version of the file inside the package folder in
|
||||
src, and then re-install or update the package. The version in the
|
||||
src directory is merely a copy and will be wiped out when you type
|
||||
"make package-update".
|
||||
.. code-block:: bash
|
||||
|
||||
cmake . --build
|
||||
|
||||
CMake should auto-detect whether it needs to re-run the CMake
|
||||
configuration step and otherwise redo the build for all files
|
||||
that have been changed or files that depend on changed files.
|
||||
In case some build options have been changed or renamed, you
|
||||
may have to update those by running:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake .
|
||||
|
||||
and then rebuild.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
Switch to the src directory and type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make purge # remove any deprecated src files
|
||||
$ make package-update # sync package files with src files
|
||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||
|
||||
to enforce consistency of the source between the src folder
|
||||
and package directories. This is OK to do even if you don't
|
||||
use any packages. The "make purge" command removes any deprecated
|
||||
src files if they were removed by the patch from a package
|
||||
sub-directory.
|
||||
|
||||
.. warning::
|
||||
|
||||
If you wish to edit/change a src file that is from a package,
|
||||
you should edit the version of the file inside the package
|
||||
sub-directory with src, then re-install the package. The
|
||||
version in the source directory is merely a copy and will be
|
||||
wiped out if you type "make package-update".
|
||||
|
||||
@ -33,22 +33,19 @@ in its name, e.g. lammps-23Jun18.
|
||||
|
||||
----------
|
||||
|
||||
You can also download a zip file via the "Clone or download" button on
|
||||
the `LAMMPS GitHub site <git_>`_. The file name will be lammps-master.zip
|
||||
which can be unzipped with the following command, to create
|
||||
a lammps-master dir:
|
||||
You can also download a compressed tar or zip archives from the
|
||||
"Assets" sections of the `LAMMPS GitHub releases site <git_>`_.
|
||||
The file name will be lammps-<version>.zip which can be unzipped
|
||||
with the following command, to create a lammps-<version> dir:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ unzip lammps*.zip
|
||||
|
||||
This version is the most up-to-date LAMMPS development version. It
|
||||
will have the date of the most recent patch release (see the file
|
||||
src/version.h). But it will also include any new bug-fixes or
|
||||
features added since the last patch release. They will be included in
|
||||
the next patch release tarball.
|
||||
This version corresponds to the selected LAMMPS patch or stable
|
||||
release.
|
||||
|
||||
.. _git: https://github.com/lammps/lammps
|
||||
.. _git: https://github.com/lammps/lammps/releases
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -38,17 +38,18 @@ In addition there are DOIs for individual stable releases. Currently there are:
|
||||
Home page
|
||||
^^^^^^^^^
|
||||
|
||||
The LAMMPS website at `https://lammps.sandia.gov/ <https://lammps.sandia.gov>`_ is the canonical
|
||||
location for information about LAMMPS and more detailed lists of publications
|
||||
using LAMMPS and contributing features.
|
||||
The LAMMPS website at `https://lammps.sandia.gov/
|
||||
<https://lammps.sandia.gov>`_ is the canonical location for information
|
||||
about LAMMPS and its features.
|
||||
|
||||
Citing contributions
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS has many features and uses previously published methods and
|
||||
algorithms or novel features. It also includes potential parameter
|
||||
filed for specific models. You can look up relevant publications either
|
||||
in the LAMMPS output to the screen, the ``log.cite`` file (which is
|
||||
populated with references to relevant papers through embedding them into
|
||||
the source code) and in the documentation of the :doc:`corresponding commands
|
||||
LAMMPS has many features and that use either previously published
|
||||
methods and algorithms or novel features. It also includes potential
|
||||
parameter filed for specific models. Where available, a reminder about
|
||||
references for optional features used in a specific run is printed to
|
||||
the screen and log file. Style and output location can be selected with
|
||||
the :ref:`-cite command-line switch <cite>`. Additional references are
|
||||
given in the documentation of the :doc:`corresponding commands
|
||||
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
|
||||
|
||||
@ -85,7 +85,7 @@ commands)
|
||||
* water potentials: TIP3P, TIP4P, SPC
|
||||
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim_init, kim_interactions, and kim_query <kim_commands>` commands
|
||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
|
||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||
* overlaid potentials: superposition of multiple pair potentials
|
||||
|
||||
|
||||
BIN
doc/src/JPG/WF_LJ.jpg
Normal file
BIN
doc/src/JPG/WF_LJ.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 292 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 286 KiB |
@ -14,6 +14,7 @@ This section documents the following functions:
|
||||
- :cpp:func:`lammps_config_has_package`
|
||||
- :cpp:func:`lammps_config_package_count`
|
||||
- :cpp:func:`lammps_config_package_name`
|
||||
- :cpp:func:`lammps_config_accelerator`
|
||||
- :cpp:func:`lammps_has_style`
|
||||
- :cpp:func:`lammps_style_count`
|
||||
- :cpp:func:`lammps_style_name`
|
||||
@ -126,6 +127,11 @@ approach.
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_config_accelerator
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_has_style
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ It documents the following functions:
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_create_atoms(void *handle, int n, int *id, int *type, double *x, double *v, int *image, int bexpand)
|
||||
.. doxygenfunction:: lammps_create_atoms(void *handle, int n, const int *id, const int *type, const double *x, const double *v, const int *image, int bexpand)
|
||||
:project: progguide
|
||||
|
||||
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
Input script command style
|
||||
==========================
|
||||
|
||||
New commands can be added to LAMMPS input scripts by adding new
|
||||
classes that have a "command" method. For example, the create_atoms,
|
||||
read_data, velocity, and run commands are all implemented in this
|
||||
fashion. When such a command is encountered in the LAMMPS input
|
||||
script, LAMMPS simply creates a class with the corresponding name,
|
||||
invokes the "command" method of the class, and passes it the arguments
|
||||
from the input script. The command method can perform whatever
|
||||
operations it wishes on LAMMPS data structures.
|
||||
New commands can be added to LAMMPS input scripts by adding new classes
|
||||
that are derived from the Command class and thus must have a "command"
|
||||
method. For example, the create_atoms, read_data, velocity, and run
|
||||
commands are all implemented in this fashion. When such a command is
|
||||
encountered in the LAMMPS input script, LAMMPS simply creates a class
|
||||
instance with the corresponding name, invokes the "command" method of
|
||||
the class, and passes it the arguments from the input script. The
|
||||
command method can perform whatever operations it wishes on LAMMPS data
|
||||
structures.
|
||||
|
||||
The single method your new class must define is as follows:
|
||||
|
||||
|
||||
@ -206,16 +206,22 @@ packages in the src directory for examples. If you are uncertain, please ask.
|
||||
algorithm/science behind the feature itself, or its initial usage, or
|
||||
its implementation in LAMMPS), you can add the citation to the \*.cpp
|
||||
source file. See src/USER-EFF/atom_vec_electron.cpp for an example.
|
||||
A LaTeX citation is stored in a variable at the top of the file and a
|
||||
single line of code that references the variable is added to the
|
||||
constructor of the class. Whenever a user invokes your feature from
|
||||
their input script, this will cause LAMMPS to output the citation to a
|
||||
log.cite file and prompt the user to examine the file. Note that you
|
||||
should only use this for a paper you or your group authored.
|
||||
E.g. adding a cite in the code for a paper by Nose and Hoover if you
|
||||
write a fix that implements their integrator is not the intended
|
||||
usage. That kind of citation should just be in the doc page you
|
||||
provide.
|
||||
A LaTeX citation is stored in a variable at the top of the file and
|
||||
a single line of code registering this variable is added to the
|
||||
constructor of the class. If there is additional functionality (which
|
||||
may have been added later) described in a different publication,
|
||||
additional citation descriptions may be added for as long as they
|
||||
are only registered when the corresponding keyword activating this
|
||||
functionality is used. With these options it is possible to have
|
||||
LAMMPS output a specific citation reminder whenever a user invokes
|
||||
your feature from their input script. Note that you should only use
|
||||
this for the most relevant paper for a feature and a publication that
|
||||
you or your group authored. E.g. adding a citation in the code for
|
||||
a paper by Nose and Hoover if you write a fix that implements their
|
||||
integrator is not the intended usage. That kind of citation should
|
||||
just be included in the documentation page you provide describing
|
||||
your contribution. If you are not sure what the best option would
|
||||
be, please contact the LAMMPS developers for advice.
|
||||
|
||||
Finally, as a general rule-of-thumb, the more clear and
|
||||
self-explanatory you make your documentation and README files, and the
|
||||
|
||||
@ -50,6 +50,7 @@ page gives those details.
|
||||
* :ref:`MSCG <PKG-MSCG>`
|
||||
* :ref:`OPT <PKG-OPT>`
|
||||
* :ref:`PERI <PKG-PERI>`
|
||||
* :ref:`PLUGIN <PKG-PLUGIN>`
|
||||
* :ref:`POEMS <PKG-POEMS>`
|
||||
* :ref:`PYTHON <PKG-PYTHON>`
|
||||
* :ref:`QEQ <PKG-QEQ>`
|
||||
@ -89,6 +90,7 @@ page gives those details.
|
||||
* :ref:`USER-MOLFILE <PKG-USER-MOLFILE>`
|
||||
* :ref:`USER-NETCDF <PKG-USER-NETCDF>`
|
||||
* :ref:`USER-OMP <PKG-USER-OMP>`
|
||||
* :ref:`USER-PACE <PKG-USER-PACE>`
|
||||
* :ref:`USER-PHONON <PKG-USER-PHONON>`
|
||||
* :ref:`USER-PLUMED <PKG-USER-PLUMED>`
|
||||
* :ref:`USER-PTM <PKG-USER-PTM>`
|
||||
@ -367,17 +369,19 @@ KIM package
|
||||
|
||||
**Contents:**
|
||||
|
||||
This package contains a set of commands that serve as a wrapper on the
|
||||
This package contains a command with a set of sub-commands that serve as a
|
||||
wrapper on the
|
||||
`Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_
|
||||
repository of interatomic models (IMs) enabling compatible ones to be used in
|
||||
LAMMPS simulations.
|
||||
|
||||
This includes :doc:`kim_init <kim_commands>`, and
|
||||
:doc:`kim_interactions <kim_commands>` commands to select, initialize and
|
||||
instantiate the IM, a :doc:`kim_query <kim_commands>` command to perform web
|
||||
|
||||
This includes :doc:`kim init <kim_commands>`, and
|
||||
:doc:`kim interactions <kim_commands>` commands to select, initialize and
|
||||
instantiate the IM, a :doc:`kim query <kim_commands>` command to perform web
|
||||
queries for material property predictions of OpenKIM IMs, a
|
||||
:doc:`kim_param <kim_commands>` command to access KIM Model Parameters from
|
||||
LAMMPS, and a :doc:`kim_property <kim_commands>` command to write material
|
||||
:doc:`kim param <kim_commands>` command to access KIM Model Parameters from
|
||||
LAMMPS, and a :doc:`kim property <kim_commands>` command to write material
|
||||
properties computed in LAMMPS to standard KIM property instance format.
|
||||
|
||||
Support for KIM IMs that conform to the
|
||||
@ -386,8 +390,8 @@ is provided by the :doc:`pair_style kim <pair_kim>` command.
|
||||
|
||||
.. note::
|
||||
|
||||
The command *pair_style kim* is called by *kim_interactions* and
|
||||
is not recommended to be directly used in input scripts.
|
||||
The command *pair_style kim* is called by *kim interactions* and is not
|
||||
recommended to be directly used in input scripts.
|
||||
|
||||
To use this package you must have the KIM API library available on your
|
||||
system. The KIM API is available for download on the
|
||||
@ -404,7 +408,7 @@ and is funded by the `National Science Foundation <https://www.nsf.gov/>`_.
|
||||
API and the *pair_style kim* command. Yaser Afshar (U Minnesota),
|
||||
Axel Kohlmeyer (Temple U), Ellad Tadmor (U Minnesota), and
|
||||
Daniel Karls (U Minnesota) contributed to the
|
||||
:doc:`kim_commands <kim_commands>` interface in close collaboration with
|
||||
:doc:`kim command <kim_commands>` interface in close collaboration with
|
||||
Ryan Elliott.
|
||||
|
||||
**Install:**
|
||||
@ -414,7 +418,7 @@ This package has :ref:`specific installation instructions <kim>` on the
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* :doc:`kim_commands <kim_commands>`
|
||||
* :doc:`kim command <kim_commands>`
|
||||
* :doc:`pair_style kim <pair_kim>`
|
||||
* src/KIM: filenames -> commands
|
||||
* src/KIM/README
|
||||
@ -582,7 +586,7 @@ MC package
|
||||
Several fixes and a pair style that have Monte Carlo (MC) or MC-like
|
||||
attributes. These include fixes for creating, breaking, and swapping
|
||||
bonds, for performing atomic swaps, and performing grand-canonical MC
|
||||
(GCMC) in conjunction with dynamics.
|
||||
(GCMC) or similar processes in conjunction with dynamics.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -590,8 +594,12 @@ bonds, for performing atomic swaps, and performing grand-canonical MC
|
||||
* :doc:`fix atom/swap <fix_atom_swap>`
|
||||
* :doc:`fix bond/break <fix_bond_break>`
|
||||
* :doc:`fix bond/create <fix_bond_create>`
|
||||
* :doc:`fix bond/create/angle <fix_bond_create>`
|
||||
* :doc:`fix bond/swap <fix_bond_swap>`
|
||||
* :doc:`fix charge/regulation <fix_charge_regulation>`
|
||||
* :doc:`fix gcmc <fix_gcmc>`
|
||||
* :doc:`fix tfmc <fix_tfmc>`
|
||||
* :doc:`fix widom <fix_widom>`
|
||||
* :doc:`pair_style dsmc <pair_dsmc>`
|
||||
* https://lammps.sandia.gov/movies.html#gcmc
|
||||
|
||||
@ -662,19 +670,31 @@ MLIAP package
|
||||
|
||||
**Contents:**
|
||||
|
||||
A general interface for machine-learning interatomic potentials.
|
||||
A general interface for machine-learning interatomic potentials, including PyTorch.
|
||||
|
||||
**Install:**
|
||||
|
||||
To use this package, also the :ref:`SNAP package <PKG-SNAP>` needs to be installed.
|
||||
To use this package, also the :ref:`SNAP package <PKG-SNAP>` package needs
|
||||
to be installed. To make the *mliappy* model available, also the
|
||||
:ref:`PYTHON package <PKG-PYTHON>` package needs to be installed, the version
|
||||
of Python must be 3.6 or later, and the `cython <https://cython.org/>`_ software
|
||||
must be installed.
|
||||
|
||||
**Author:** Aidan Thompson (Sandia).
|
||||
**Author:** Aidan Thompson (Sandia), Nicholas Lubbers (LANL).
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/MLIAP: filenames -> commands
|
||||
* src/MLIAP/README
|
||||
* :doc:`pair_style mliap <pair_mliap>`
|
||||
* examples/mliap
|
||||
* :doc:`compute_style mliap <compute_mliap>`
|
||||
* examples/mliap (see README)
|
||||
|
||||
When built with the *mliappy* model this package includes an extension for
|
||||
coupling with Python models, including PyTorch. In this case, the Python
|
||||
interpreter linked to LAMMPS will need the ``cython`` and ``numpy`` modules
|
||||
installed. The provided examples build models with PyTorch, which would
|
||||
therefore also needs to be installed to run those examples.
|
||||
|
||||
----------
|
||||
|
||||
@ -829,6 +849,28 @@ Foster (UTSA).
|
||||
|
||||
----------
|
||||
|
||||
.. _PKG-PLUGIN:
|
||||
|
||||
PLUGIN package
|
||||
--------------
|
||||
|
||||
**Contents:**
|
||||
|
||||
A :doc:`plugin <plugin>` command that can load and unload several
|
||||
kind of styles in LAMMPS from shared object files at runtime without
|
||||
having to recompile and relink LAMMPS.
|
||||
|
||||
**Authors:** Axel Kohlmeyer (Temple U)
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/PLUGIN: filenames -> commands
|
||||
* :doc:`plugin command <plugin>`
|
||||
* :doc:`Information on writing plugins <Developer_plugins>`
|
||||
* examples/plugin
|
||||
|
||||
----------
|
||||
|
||||
.. _PKG-POEMS:
|
||||
|
||||
POEMS package
|
||||
@ -1312,6 +1354,46 @@ This package has :ref:`specific installation instructions <user-colvars>` on the
|
||||
|
||||
----------
|
||||
|
||||
.. _PKG-USER-PACE:
|
||||
|
||||
USER-PACE package
|
||||
-------------------
|
||||
|
||||
**Contents:**
|
||||
|
||||
A pair style for the Atomic Cluster Expansion potential (ACE).
|
||||
ACE is a methodology for deriving a highly accurate classical potential
|
||||
fit to a large archive of quantum mechanical (DFT) data. The USER-PACE
|
||||
package provides an efficient implementation for running simulations
|
||||
with ACE potentials.
|
||||
|
||||
**Authors:**
|
||||
|
||||
This package was written by Yury Lysogorskiy^1,
|
||||
Cas van der Oord^2, Anton Bochkarev^1,
|
||||
Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1,
|
||||
Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1.
|
||||
|
||||
^1: Ruhr-University Bochum, Bochum, Germany
|
||||
|
||||
^2: University of Cambridge, Cambridge, United Kingdom
|
||||
|
||||
^3: Sandia National Laboratories, Albuquerque, New Mexico, USA
|
||||
|
||||
^4: University of British Columbia, Vancouver, BC, Canada
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <user-pace>` on the :doc:`Build extras <Build_extras>` page.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
* src/USER-PACE: filenames -> commands
|
||||
* :doc:`pair_style pace <pair_pace>`
|
||||
* examples/USER/pace
|
||||
|
||||
----------
|
||||
|
||||
.. _PKG-USER-PLUMED:
|
||||
|
||||
USER-PLUMED package
|
||||
@ -1418,8 +1500,8 @@ oscillators as a model of polarization. See the :doc:`Howto drude <Howto_drude>
|
||||
for an overview of how to use the package. There are auxiliary tools
|
||||
for using this package in tools/drude.
|
||||
|
||||
**Authors:** Alain Dequidt (U Blaise Pascal Clermont-Ferrand), Julien
|
||||
Devemy (CNRS), and Agilio Padua (U Blaise Pascal).
|
||||
**Authors:** Alain Dequidt (U Clermont Auvergne), Julien
|
||||
Devemy (CNRS), and Agilio Padua (ENS de Lyon).
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -1486,7 +1568,7 @@ methods for performing FEP simulations by using a :doc:`fix adapt/fep <fix_adapt
|
||||
which have a "soft" in their style name. There are auxiliary tools
|
||||
for using this package in tools/fep; see its README file.
|
||||
|
||||
**Author:** Agilio Padua (Universite Blaise Pascal Clermont-Ferrand)
|
||||
**Author:** Agilio Padua (ENS de Lyon)
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -2442,6 +2524,6 @@ which discuss the `QuickFF <quickff_>`_ methodology.
|
||||
* :doc:`bond_style mm3 <bond_mm3>`
|
||||
* :doc:`improper_style distharm <improper_distharm>`
|
||||
* :doc:`improper_style sqdistharm <improper_sqdistharm>`
|
||||
* :doc:`pair_style mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>`
|
||||
* :doc:`pair_style mm3/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||
* :doc:`pair_style lj/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||
* examples/USER/yaff
|
||||
|
||||
@ -71,6 +71,8 @@ package:
|
||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`PERI <PKG-PERI>` | Peridynamics models | :doc:`pair_style peri <pair_peri>` | peri | no |
|
||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`PLUGIN <PKG-PLUGIN>` | Plugin loader command | :doc:`plugin <plugin>` | plugins | no |
|
||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`POEMS <PKG-POEMS>` | coupled rigid body motion | :doc:`fix poems <fix_poems>` | rigid | int |
|
||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`PYTHON <PKG-PYTHON>` | embed Python code in an input script | :doc:`python <python>` | python | sys |
|
||||
|
||||
@ -81,6 +81,8 @@ package:
|
||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`USER-OMP <PKG-USER-OMP>` | OpenMP-enabled styles | :doc:`Speed omp <Speed_omp>` | `Benchmarks <https://lammps.sandia.gov/bench.html>`_ | no |
|
||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`USER-PACE <PKG-USER-PACE>` | Fast implementation of Atomic Cluster Expansion (ACE) potential | :doc:`pair pace <pair_pace>` | USER/pace | ext |
|
||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`USER-PHONON <PKG-USER-PHONON>` | phonon dynamical matrix | :doc:`fix phonon <fix_phonon>` | USER/phonon | no |
|
||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||
| :ref:`USER-PLUMED <PKG-USER-PLUMED>` | :ref:`PLUMED <PLUMED>` free energy library | :doc:`fix plumed <fix_plumed>` | USER/plumed | ext |
|
||||
|
||||
@ -50,7 +50,7 @@ against invalid accesses.
|
||||
|
||||
**Numpy Methods**:
|
||||
|
||||
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
||||
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
|
||||
|
||||
@ -39,7 +39,9 @@ about compile time settings and included packages and styles.
|
||||
* :py:attr:`lammps.has_jpeg_support <lammps.lammps.has_jpeg_support>`
|
||||
* :py:attr:`lammps.has_ffmpeg_support <lammps.lammps.has_ffmpeg_support>`
|
||||
|
||||
* :py:attr:`lammps.installed_packages <lammps.lammps.installed_pages>`
|
||||
* :py:attr:`lammps.installed_packages <lammps.lammps.installed_packages>`
|
||||
|
||||
* :py:meth:`lammps.get_accelerator_config <lammps.lammps.accelerator_config>`
|
||||
|
||||
* :py:meth:`lammps.has_style() <lammps.lammps.has_style()>`
|
||||
* :py:meth:`lammps.available_styles() <lammps.lammps.available_styles()>`
|
||||
|
||||
@ -9,7 +9,7 @@ This means you can extend the Python wrapper by following these steps:
|
||||
* Add a new interface function to ``src/library.cpp`` and
|
||||
``src/library.h``.
|
||||
* Rebuild LAMMPS as a shared library.
|
||||
* Add a wrapper method to ``python/lammps.py`` for this interface
|
||||
* Add a wrapper method to ``python/lammps/core.py`` for this interface
|
||||
function.
|
||||
* Define the corresponding ``argtypes`` list and ``restype``
|
||||
in the ``lammps.__init__()`` function.
|
||||
|
||||
11
doc/src/Python_formats.rst
Normal file
11
doc/src/Python_formats.rst
Normal file
@ -0,0 +1,11 @@
|
||||
Output Readers
|
||||
==============
|
||||
|
||||
.. py:module:: lammps.formats
|
||||
|
||||
The Python package contains the :py:mod:`lammps.formats` module, which
|
||||
provides classes to post-process some of the output files generated by LAMMPS.
|
||||
|
||||
.. automodule:: lammps.formats
|
||||
:members:
|
||||
:noindex:
|
||||
@ -13,6 +13,7 @@ together.
|
||||
Python_module
|
||||
Python_ext
|
||||
Python_call
|
||||
Python_formats
|
||||
Python_examples
|
||||
Python_error
|
||||
Python_trouble
|
||||
|
||||
@ -8,9 +8,9 @@ module. Because of the dynamic loading, it is required that LAMMPS is
|
||||
compiled in :ref:`"shared" mode <exe>`. It is also recommended to
|
||||
compile LAMMPS with :ref:`C++ exceptions <exceptions>` enabled.
|
||||
|
||||
Two files are necessary for Python to be able to invoke LAMMPS code:
|
||||
Two components are necessary for Python to be able to invoke LAMMPS code:
|
||||
|
||||
* The LAMMPS Python Module (``lammps.py``) from the ``python`` folder
|
||||
* The LAMMPS Python Package (``lammps``) from the ``python`` folder
|
||||
* The LAMMPS Shared Library (``liblammps.so``, ``liblammps.dylib`` or
|
||||
``liblammps.dll``) from the folder where you compiled LAMMPS.
|
||||
|
||||
@ -25,10 +25,10 @@ Installing the LAMMPS Python Module and Shared Library
|
||||
======================================================
|
||||
|
||||
Making LAMMPS usable within Python and vice versa requires putting the
|
||||
LAMMPS Python module file (``lammps.py``) into a location where the
|
||||
LAMMPS Python package (``lammps``) into a location where the
|
||||
Python interpreter can find it and installing the LAMMPS shared library
|
||||
into a folder that the dynamic loader searches or into the same folder
|
||||
where the ``lammps.py`` file is. There are multiple ways to achieve
|
||||
into a folder that the dynamic loader searches or inside of the installed
|
||||
``lammps`` package folder. There are multiple ways to achieve
|
||||
this.
|
||||
|
||||
#. Do a full LAMMPS installation of libraries, executables, selected
|
||||
@ -36,13 +36,13 @@ this.
|
||||
available via CMake), which can also be either system-wide or into
|
||||
user specific folders.
|
||||
|
||||
#. Install both files into a Python ``site-packages`` folder, either
|
||||
#. Install both components into a Python ``site-packages`` folder, either
|
||||
system-wide or in the corresponding user-specific folder. This way no
|
||||
additional environment variables need to be set, but the shared
|
||||
library is otherwise not accessible.
|
||||
|
||||
#. Do an installation into a virtual environment. This can either be
|
||||
an installation of the python module only or a full installation.
|
||||
#. Do an installation into a virtual environment. This can either be an
|
||||
installation of the Python package only or a full installation of LAMMPS.
|
||||
|
||||
#. Leave the files where they are in the source/development tree and
|
||||
adjust some environment variables.
|
||||
@ -69,7 +69,7 @@ this.
|
||||
cd build
|
||||
|
||||
# configure LAMMPS compilation
|
||||
cmake -C cmake/presets/minimal.cmake -D BUILD_SHARED_LIBS=on \
|
||||
cmake -C ../cmake/presets/minimal.cmake -D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on -D PKG_PYTHON=on ../cmake
|
||||
|
||||
# compile LAMMPS
|
||||
@ -81,40 +81,42 @@ this.
|
||||
|
||||
This leads to an installation to the following locations:
|
||||
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===========================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$HOME/.local/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$HOME/.local/lib/`` (32bit) | |
|
||||
| | * ``$HOME/.local/lib64/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``$HOME/.local/bin/`` | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``$HOME/.local/share/lammps/potentials/`` | Set ``LAMMPS_POTENTIALS`` environment variable to this path |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=================================================================+=============================================================+
|
||||
| LAMMPS Python package | * ``$HOME/.local/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$HOME/.local/lib/`` (32bit) | Set shared loader environment variable to this path |
|
||||
| | * ``$HOME/.local/lib64/`` (64bit) | (see below for more info on this) |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``$HOME/.local/bin/`` | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``$HOME/.local/share/lammps/potentials/`` | Set ``LAMMPS_POTENTIALS`` environment variable to this path |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
For a system-wide installation you need to set
|
||||
``CMAKE_INSTALL_PREFIX`` to a system folder like ``/usr`` (or
|
||||
``/usr/local``). The installation step (**not** the
|
||||
``/usr/local``); the default is ``${HOME}/.local``. The
|
||||
installation step for a system folder installation (**not** the
|
||||
configuration/compilation) needs to be done with superuser
|
||||
privilege, e.g. by using ``sudo cmake --install .``. The
|
||||
installation folders will then by changed to:
|
||||
installation folders will then be changed to (assuming ``/usr`` as
|
||||
prefix):
|
||||
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``/usr/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``/usr/lib/`` (32bit) | |
|
||||
| | * ``/usr/lib64/`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``/usr/bin/`` | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``/usr/share/lammps/potentials/`` | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=========================================================+=============================================================+
|
||||
| LAMMPS Python package | * ``/usr/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``/usr/lib/`` (32bit) | |
|
||||
| | * ``/usr/lib64/`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``/usr/bin/`` | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``/usr/share/lammps/potentials/`` | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
To be able to use the "user" installation you have to ensure that
|
||||
the folder containing the LAMMPS shared library is either included
|
||||
@ -146,7 +148,7 @@ this.
|
||||
necessary due to files installed in system folders that are loaded
|
||||
automatically when a login shell is started.
|
||||
|
||||
.. tab:: Python module only
|
||||
.. tab:: Python package only
|
||||
|
||||
Compile LAMMPS with either :doc:`CMake <Build_cmake>` or the
|
||||
:doc:`traditional make <Build_make>` procedure in :ref:`shared
|
||||
@ -157,37 +159,37 @@ this.
|
||||
|
||||
make install-python
|
||||
|
||||
This will try to install (only) the shared library and the python
|
||||
module into a system folder and if that fails (due to missing
|
||||
This will try to install (only) the shared library and the Python
|
||||
package into a system folder and if that fails (due to missing
|
||||
write permissions) will instead do the installation to a user
|
||||
folder under ``$HOME/.local``. For a system-wide installation you
|
||||
would have to gain superuser privilege, e.g. though ``sudo``
|
||||
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===========================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$HOME/.local/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$HOME/.local/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=================================================================+=============================================================+
|
||||
| LAMMPS Python package | * ``$HOME/.local/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$HOME/.local/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$HOME/.local/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
For a system-wide installation those folders would then become.
|
||||
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``/usr/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``/usr/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=========================================================+=============================================================+
|
||||
| LAMMPS Python package | * ``/usr/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``/usr/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``/usr/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+---------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
No environment variables need to be set for those, as those
|
||||
folders are searched by default by Python or the LAMMPS Python
|
||||
module.
|
||||
package.
|
||||
|
||||
For the traditional make process you can override the python
|
||||
version to version x.y when calling ``make`` with
|
||||
@ -199,9 +201,9 @@ this.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python install.py -m <python module> -l <shared library> -v <version.h file> [-d <pydir>]
|
||||
$ python install.py -p <python package> -l <shared library> -v <version.h file> [-d <pydir>]
|
||||
|
||||
* The ``-m`` flag points to the ``lammps.py`` python module file to be installed,
|
||||
* The ``-p`` flag points to the ``lammps`` Python package folder to be installed,
|
||||
* the ``-l`` flag points to the LAMMPS shared library file to be installed,
|
||||
* the ``-v`` flag points to the ``version.h`` file in the LAMMPS source
|
||||
* and the optional ``-d`` flag to a custom (legacy) installation folder
|
||||
@ -249,38 +251,38 @@ this.
|
||||
When using CMake to build LAMMPS, you need to set
|
||||
``CMAKE_INSTALL_PREFIX`` to the value of the ``$VIRTUAL_ENV``
|
||||
environment variable during the configuration step. For the
|
||||
traditional make procedure, not additional steps are needed.
|
||||
After compiling LAMMPS you can do a "Python module only"
|
||||
traditional make procedure, no additional steps are needed.
|
||||
After compiling LAMMPS you can do a "Python package only"
|
||||
installation with ``make install-python`` and the LAMMPS Python
|
||||
module and the shared library file are installed into the
|
||||
package and the shared library file are installed into the
|
||||
following locations:
|
||||
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===========================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=================================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
If you do a full installation (CMake only) with "install", this
|
||||
leads to the following installation locations:
|
||||
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+===========================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$VIRTUAL_ENV/lib/`` (32bit) | |
|
||||
| | * ``$VIRTUAL_ENV/lib64/`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``$VIRTUAL_ENV/bin/`` | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``$VIRTUAL_ENV/share/lammps/potentials/`` | |
|
||||
+------------------------+-----------------------------------------------------------+-------------------------------------------------------------+
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| File | Location | Notes |
|
||||
+========================+=================================================================+=============================================================+
|
||||
| LAMMPS Python Module | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version |
|
||||
| | * ``$VIRTUAL_ENV/lib64/pythonX.Y/site-packages/lammps`` (64bit) | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS shared library | * ``$VIRTUAL_ENV/lib/`` (32bit) | Set shared loader environment variable to this path |
|
||||
| | * ``$VIRTUAL_ENV/lib64/`` (64bit) | (see below for more info on this) |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS executable | * ``$VIRTUAL_ENV/bin/`` | |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
| LAMMPS potential files | * ``$VIRTUAL_ENV/share/lammps/potentials/`` | Set ``LAMMPS_POTENTIALS`` environment variable to this path |
|
||||
+------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+
|
||||
|
||||
In that case you need to modify the ``$HOME/myenv/bin/activate``
|
||||
script in a similar fashion you need to update your
|
||||
@ -296,15 +298,15 @@ this.
|
||||
echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH' >> $HOME/myenv/bin/activate
|
||||
|
||||
# MacOS
|
||||
echo 'export DYLD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH' >> $HOME/myenv/bin/activate
|
||||
echo 'export DYLD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$DYLD_LIBRARY_PATH' >> $HOME/myenv/bin/activate
|
||||
|
||||
.. tab:: In place usage
|
||||
|
||||
You can also :doc:`compile LAMMPS <Build>` as usual in
|
||||
:ref:`"shared" mode <exe>` leave the shared library and Python
|
||||
module files inside the source/compilation folders. Instead of
|
||||
package inside the source/compilation folders. Instead of
|
||||
copying the files where they can be found, you need to set the environment
|
||||
variables ``PYTHONPATH`` (for the Python module) and
|
||||
variables ``PYTHONPATH`` (for the Python package) and
|
||||
``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH`` on MacOS
|
||||
|
||||
For Bourne shells (bash, ksh and similar) the commands are:
|
||||
@ -325,6 +327,10 @@ this.
|
||||
You can make those changes permanent by editing your ``$HOME/.bashrc``
|
||||
or ``$HOME/.login`` files, respectively.
|
||||
|
||||
.. note::
|
||||
|
||||
The ``PYTHONPATH`` needs to point to the parent folder that contains the ``lammps`` package!
|
||||
|
||||
|
||||
To verify if LAMMPS can be successfully started from Python, start the
|
||||
Python interpreter, load the ``lammps`` Python module and create a
|
||||
@ -346,7 +352,7 @@ output similar to the following:
|
||||
.. note::
|
||||
|
||||
Unless you opted for "In place use", you will have to rerun the installation
|
||||
any time you recompile LAMMPS to ensure the latest Python module and shared
|
||||
any time you recompile LAMMPS to ensure the latest Python package and shared
|
||||
library are installed and used.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -3,12 +3,12 @@ The ``lammps`` Python module
|
||||
|
||||
.. py:module:: lammps
|
||||
|
||||
The LAMMPS Python interface is implemented as a module called
|
||||
:py:mod:`lammps` in the ``lammps.py`` file in the ``python`` folder of
|
||||
the LAMMPS source code distribution. After compilation of LAMMPS, the
|
||||
module can be installed into a Python system folder or a user folder
|
||||
with ``make install-python``. Components of the module can then loaded
|
||||
into a Python session with the ``import`` command.
|
||||
The LAMMPS Python interface is implemented as a module called :py:mod:`lammps`
|
||||
which is defined in the ``lammps`` package in the ``python`` folder of the
|
||||
LAMMPS source code distribution. After compilation of LAMMPS, the module can
|
||||
be installed into a Python system folder or a user folder with ``make
|
||||
install-python``. Components of the module can then loaded into a Python
|
||||
session with the ``import`` command.
|
||||
|
||||
There are multiple Python interface classes in the :py:mod:`lammps` module:
|
||||
|
||||
@ -26,6 +26,23 @@ There are multiple Python interface classes in the :py:mod:`lammps` module:
|
||||
|
||||
.. _mpi4py_url: https://mpi4py.readthedocs.io
|
||||
|
||||
.. admonition:: Version check
|
||||
:class: note
|
||||
|
||||
The :py:mod:`lammps` module stores the version number of the LAMMPS
|
||||
version it is installed from. When initializing the
|
||||
:py:class:`lammps <lammps.lammps>` class, this version is checked to
|
||||
be the same as the result from :py:func:`lammps.version`, the version
|
||||
of the LAMMPS shared library that the module interfaces to. If the
|
||||
they are not the same an AttributeError exception is raised since a
|
||||
mismatch of versions (e.g. due to incorrect use of the
|
||||
``LD_LIBRARY_PATH`` or ``PYTHONPATH`` environment variables can lead
|
||||
to crashes or data corruption and otherwise incorrect behavior.
|
||||
|
||||
.. automodule:: lammps
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
----------
|
||||
|
||||
The ``lammps`` class API
|
||||
@ -44,7 +61,7 @@ functions. Below is a detailed documentation of the API.
|
||||
.. autoclass:: lammps.lammps
|
||||
:members:
|
||||
|
||||
.. autoclass:: lammps.numpy_wrapper
|
||||
.. autoclass:: lammps.numpy_wrapper::numpy_wrapper
|
||||
:members:
|
||||
|
||||
----------
|
||||
@ -117,23 +134,23 @@ Style Constants
|
||||
to request from computes or fixes. See :cpp:enum:`_LMP_STYLE_CONST`
|
||||
for the equivalent constants in the C library interface. Used in
|
||||
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
||||
:py:func:`lammps.numpy.extract_compute() <numpy_wrapper.extract_compute>` and
|
||||
:py:func:`lammps.numpy.extract_fix() <numpy_wrapper.extract_fix>`.
|
||||
:py:func:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute>` and
|
||||
:py:func:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix>`.
|
||||
|
||||
.. _py_type_constants:
|
||||
|
||||
Type Constants
|
||||
--------------
|
||||
|
||||
.. py:data:: LMP_TYPE_SCALAR, LMP_TYLE_VECTOR, LMP_TYPE_ARRAY, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS
|
||||
.. py:data:: LMP_TYPE_SCALAR, LMP_TYPE_VECTOR, LMP_TYPE_ARRAY, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS
|
||||
:type: int
|
||||
|
||||
Constants in the :py:mod:`lammps` module to select what type of data
|
||||
to request from computes or fixes. See :cpp:enum:`_LMP_TYPE_CONST`
|
||||
for the equivalent constants in the C library interface. Used in
|
||||
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
||||
:py:func:`lammps.numpy.extract_compute() <numpy_wrapper.extract_compute>` and
|
||||
:py:func:`lammps.numpy.extract_fix() <numpy_wrapper.extract_fix>`.
|
||||
:py:func:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute>` and
|
||||
:py:func:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix>`.
|
||||
|
||||
.. _py_vartype_constants:
|
||||
|
||||
@ -153,6 +170,6 @@ Classes representing internal objects
|
||||
:members:
|
||||
:no-undoc-members:
|
||||
|
||||
.. autoclass:: lammps.NumPyNeighList
|
||||
.. autoclass:: lammps.numpy_wrapper::NumPyNeighList
|
||||
:members:
|
||||
:no-undoc-members:
|
||||
|
||||
@ -1,6 +1,43 @@
|
||||
Neighbor list access
|
||||
====================
|
||||
|
||||
Access to neighbor lists is handled through a couple of wrapper classes
|
||||
that allows to treat it like either a python list or a NumPy array. The
|
||||
access procedure is similar to that of the C-library interface: use one
|
||||
of the "find" functions to look up the index of the neighbor list in the
|
||||
global table of neighbor lists and then get access to the neighbor list
|
||||
data. The code sample below demonstrates reading the neighbor list data
|
||||
using the NumPy access method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from lammps import lammps
|
||||
import numpy as np
|
||||
|
||||
lmp = lammps()
|
||||
lmp.commands_string("""
|
||||
region box block -2 2 -2 2 -2 2
|
||||
lattice fcc 1.0
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
mass 1 1.0
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff 1 1 1.0 1.0
|
||||
run 0 post no""")
|
||||
|
||||
# look up the neighbor list
|
||||
nlidx = lmp.find_pair_neighlist('lj/cut')
|
||||
nl = lmp.numpy.get_neighlist(nlidx)
|
||||
tags = lmp.extract_atom('id')
|
||||
print("half neighbor list with {} entries".format(nl.size))
|
||||
# print neighbor list contents
|
||||
for i in range(0,nl.size):
|
||||
idx, nlist = nl.get(i)
|
||||
print("\natom {} with ID {} has {} neighbors:".format(idx,tags[idx],nlist.size))
|
||||
if nlist.size > 0:
|
||||
for n in np.nditer(nlist):
|
||||
print(" atom {} with ID {}".format(n,tags[n]))
|
||||
|
||||
**Methods:**
|
||||
|
||||
* :py:meth:`lammps.get_neighlist() <lammps.lammps.get_neighlist()>`: Get neighbor list for given index
|
||||
@ -14,5 +51,5 @@ Neighbor list access
|
||||
|
||||
**NumPy Methods:**
|
||||
|
||||
* :py:meth:`lammps.numpy.get_neighlist() <lammps.numpy_wrapper.get_neighlist()>`: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays
|
||||
* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() <lammps.numpy_wrapper.get_neighlist_element_neighbors()>`: Get element in neighbor list and its neighbors (as numpy array)
|
||||
* :py:meth:`lammps.numpy.get_neighlist() <lammps.numpy_wrapper.numpy_wrapper.get_neighlist()>`: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays
|
||||
* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() <lammps.numpy_wrapper.numpy_wrapper.get_neighlist_element_neighbors()>`: Get element in neighbor list and its neighbors (as numpy array)
|
||||
|
||||
@ -36,9 +36,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
||||
Python subscripting. The values will be zero for atoms not in the
|
||||
specified group.
|
||||
|
||||
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.extract_compute()>`,
|
||||
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.extract_fix()>`, and
|
||||
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.extract_variable()>` are
|
||||
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`,
|
||||
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`, and
|
||||
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>` are
|
||||
equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers.
|
||||
|
||||
The :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>` method sets an
|
||||
@ -54,9 +54,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
||||
|
||||
**NumPy Methods**:
|
||||
|
||||
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
||||
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
||||
|
||||
|
||||
.. tab:: PyLammps/IPyLammps API
|
||||
|
||||
@ -2,9 +2,9 @@ Overview
|
||||
========
|
||||
|
||||
The LAMMPS distribution includes a ``python`` directory with the Python
|
||||
code needed to run LAMMPS from Python. The ``python/lammps.py``
|
||||
contains :doc:`the "lammps" Python <Python_module>` that wraps the
|
||||
LAMMPS C-library interface. This file makes it is possible to do the
|
||||
code needed to run LAMMPS from Python. The ``python/lammps`` package
|
||||
contains :doc:`the "lammps" Python module <Python_module>` that wraps the
|
||||
LAMMPS C-library interface. This module makes it is possible to do the
|
||||
following either from a Python script, or interactively from a Python
|
||||
prompt:
|
||||
|
||||
@ -20,8 +20,8 @@ have a version of Python that extends Python to enable multiple
|
||||
instances of Python to read what you type.
|
||||
|
||||
To do all of this, you must build LAMMPS in :ref:`"shared" mode <exe>`
|
||||
and make certain that your Python interpreter can find the ``lammps.py``
|
||||
file and the LAMMPS shared library file.
|
||||
and make certain that your Python interpreter can find the ``lammps``
|
||||
Python package and the LAMMPS shared library file.
|
||||
|
||||
.. _ctypes: https://docs.python.org/3/library/ctypes.html
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ the constructor call as follows (see :ref:`python_create_lammps` for more detail
|
||||
>>> lmp = lammps(name='mpi')
|
||||
|
||||
You can also test the load directly in Python as follows, without
|
||||
first importing from the lammps.py file:
|
||||
first importing from the ``lammps`` module:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ letter abbreviation can be used:
|
||||
* :ref:`-k or -kokkos <run-kokkos>`
|
||||
* :ref:`-l or -log <log>`
|
||||
* :ref:`-m or -mpicolor <mpicolor>`
|
||||
* :ref:`-c or -cite <cite>`
|
||||
* :ref:`-nc or -nocite <nocite>`
|
||||
* :ref:`-pk or -package <package>`
|
||||
* :ref:`-p or -partition <partition>`
|
||||
@ -220,14 +221,31 @@ links with from the lib/message directory. See the
|
||||
|
||||
----------
|
||||
|
||||
.. _cite:
|
||||
|
||||
**-cite style or file name**
|
||||
|
||||
Select how and where to output a reminder about citing contributions
|
||||
to the LAMMPS code that were used during the run. Available styles are
|
||||
"both", "none", "screen", or "log". Any flag will be considered a file
|
||||
name to write the detailed citation info to. Default is the "log" style
|
||||
where there is a short summary in the screen output and detailed citations
|
||||
in BibTeX format in the logfile. The option "both" selects the detailed
|
||||
output for both, "none", the short output for both, and "screen" will
|
||||
write the detailed info to the screen and the short version to the log
|
||||
file. If a dedicated citation info file is requested, the screen and
|
||||
log file output will be in the short format (same as with "none").
|
||||
|
||||
See the :doc:`citation page <Intro_citing>` for more details on
|
||||
how to correctly reference and cite LAMMPS.
|
||||
|
||||
----------
|
||||
|
||||
.. _nocite:
|
||||
|
||||
**-nocite**
|
||||
|
||||
Disable writing the log.cite file which is normally written to list
|
||||
references for specific cite-able features used during a LAMMPS run.
|
||||
See the `citation page <https://lammps.sandia.gov/cite.html>`_ for more
|
||||
details.
|
||||
Disable generating a citation reminder (see above) at all.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
GPU package
|
||||
===========
|
||||
|
||||
The GPU package was developed by Mike Brown while at SNL and ORNL
|
||||
and his collaborators, particularly Trung Nguyen (now at Northwestern).
|
||||
It provides GPU versions of many pair styles and for parts of the
|
||||
:doc:`kspace_style pppm <kspace_style>` for long-range Coulombics.
|
||||
It has the following general features:
|
||||
The GPU package was developed by Mike Brown while at SNL and ORNL (now
|
||||
at Intel Corp.) and his collaborators, particularly Trung Nguyen (now at
|
||||
Northwestern). Support for AMD GPUs via HIP was added by Vsevolod Nikolskiy
|
||||
and coworkers at HSE University.
|
||||
|
||||
The GPU package provides GPU versions of many pair styles and for
|
||||
parts of the :doc:`kspace_style pppm <kspace_style>` for long-range
|
||||
Coulombics. It has the following general features:
|
||||
|
||||
* It is designed to exploit common GPU hardware configurations where one
|
||||
or more GPUs are coupled to many cores of one or more multi-core CPUs,
|
||||
@ -24,8 +27,9 @@ It has the following general features:
|
||||
force vectors.
|
||||
* LAMMPS-specific code is in the GPU package. It makes calls to a
|
||||
generic GPU library in the lib/gpu directory. This library provides
|
||||
NVIDIA support as well as more general OpenCL support, so that the
|
||||
same functionality is supported on a variety of hardware.
|
||||
either Nvidia support, AMD support, or more general OpenCL support
|
||||
(for Nvidia GPUs, AMD GPUs, Intel GPUs, and multi-core CPUs).
|
||||
so that the same functionality is supported on a variety of hardware.
|
||||
|
||||
**Required hardware/software:**
|
||||
|
||||
@ -45,12 +49,23 @@ to have the OpenCL headers and the (vendor neutral) OpenCL library installed.
|
||||
In OpenCL mode, the acceleration depends on having an `OpenCL Installable Client Driver (ICD) <https://www.khronos.org/news/permalink/opencl-installable-client-driver-icd-loader>`_
|
||||
installed. There can be multiple of them for the same or different hardware
|
||||
(GPUs, CPUs, Accelerators) installed at the same time. OpenCL refers to those
|
||||
as 'platforms'. The GPU library will select the **first** suitable platform,
|
||||
but this can be overridden using the device option of the :doc:`package <package>`
|
||||
as 'platforms'. The GPU library will try to auto-select the best suitable platform,
|
||||
but this can be overridden using the platform option of the :doc:`package <package>`
|
||||
command. run lammps/lib/gpu/ocl_get_devices to get a list of available
|
||||
platforms and devices with a suitable ICD available.
|
||||
|
||||
To compute and use this package in HIP mode, you have to have the AMD ROCm
|
||||
To compile and use this package for Intel GPUs, OpenCL or the Intel oneAPI
|
||||
HPC Toolkit can be installed using linux package managers. The latter also
|
||||
provides optimized C++, MPI, and many other libraries and tools. See:
|
||||
|
||||
* https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit/download.html
|
||||
|
||||
If you do not have a discrete GPU card installed, this package can still provide
|
||||
significant speedups on some CPUs that include integrated GPUs. Additionally, for
|
||||
many macs, OpenCL is already included with the OS and Makefiles are available
|
||||
in the lib/gpu directory.
|
||||
|
||||
To compile and use this package in HIP mode, you have to have the AMD ROCm
|
||||
software installed. Versions of ROCm older than 3.5 are currently deprecated
|
||||
by AMD.
|
||||
|
||||
@ -75,10 +90,20 @@ automatically if you create more MPI tasks/node than there are
|
||||
GPUs/mode. E.g. with 8 MPI tasks/node and 2 GPUs, each GPU will be
|
||||
shared by 4 MPI tasks.
|
||||
|
||||
The GPU package also has limited support for OpenMP for both
|
||||
multi-threading and vectorization of routines that are run on the CPUs.
|
||||
This requires that the GPU library and LAMMPS are built with flags to
|
||||
enable OpenMP support (e.g. -fopenmp). Some styles for time integration
|
||||
are also available in the GPU package. These run completely on the CPUs
|
||||
in full double precision, but exploit multi-threading and vectorization
|
||||
for faster performance.
|
||||
|
||||
Use the "-sf gpu" :doc:`command-line switch <Run_options>`, which will
|
||||
automatically append "gpu" to styles that support it. Use the "-pk
|
||||
gpu Ng" :doc:`command-line switch <Run_options>` to set Ng = # of
|
||||
GPUs/node to use.
|
||||
GPUs/node to use. If Ng is 0, the number is selected automatically as
|
||||
the number of matching GPUs that have the highest number of compute
|
||||
cores.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -87,8 +112,8 @@ GPUs/node to use.
|
||||
mpirun -np 48 -ppn 12 lmp_machine -sf gpu -pk gpu 2 -in in.script # ditto on 4 16-core nodes
|
||||
|
||||
Note that if the "-sf gpu" switch is used, it also issues a default
|
||||
:doc:`package gpu 1 <package>` command, which sets the number of
|
||||
GPUs/node to 1.
|
||||
:doc:`package gpu 0 <package>` command, which will result in
|
||||
automatic selection of the number of GPUs to use.
|
||||
|
||||
Using the "-pk" switch explicitly allows for setting of the number of
|
||||
GPUs/node to use and additional options. Its syntax is the same as
|
||||
@ -138,6 +163,13 @@ Likewise, you should experiment with the precision setting for the GPU
|
||||
library to see if single or mixed precision will give accurate
|
||||
results, since they will typically be faster.
|
||||
|
||||
MPI parallelism typically outperforms OpenMP parallelism, but in some
|
||||
cases using fewer MPI tasks and multiple OpenMP threads with the GPU
|
||||
package can give better performance. 3-body potentials can often perform
|
||||
better with multiple OMP threads because the inter-process communication
|
||||
is higher for these styles with the GPU package in order to allow
|
||||
deterministic results.
|
||||
|
||||
**Guidelines for best performance:**
|
||||
|
||||
* Using multiple MPI tasks per GPU will often give the best performance,
|
||||
@ -161,6 +193,12 @@ results, since they will typically be faster.
|
||||
:doc:`angle <angle_style>`, :doc:`dihedral <dihedral_style>`,
|
||||
:doc:`improper <improper_style>`, and :doc:`long-range <kspace_style>`
|
||||
calculations will not be included in the "Pair" time.
|
||||
* Since only part of the pppm kspace style is GPU accelerated, it
|
||||
may be faster to only use GPU acceleration for Pair styles with
|
||||
long-range electrostatics. See the "pair/only" keyword of the
|
||||
package command for a shortcut to do that. The work between kspace
|
||||
on the CPU and non-bonded interactions on the GPU can be balanced
|
||||
through adjusting the coulomb cutoff without loss of accuracy.
|
||||
* When the *mode* setting for the package gpu command is force/neigh,
|
||||
the time for neighbor list calculations on the GPU will be added into
|
||||
the "Pair" time, not the "Neigh" time. An additional breakdown of the
|
||||
|
||||
@ -26,6 +26,15 @@ task). These are Serial (MPI-only for CPUs and Intel Phi), OpenMP
|
||||
GPUs) and HIP (for AMD GPUs). You choose the mode at build time to
|
||||
produce an executable compatible with a specific hardware.
|
||||
|
||||
.. admonition:: C++14 support
|
||||
:class: note
|
||||
|
||||
Kokkos requires using a compiler that supports the c++14 standard. For
|
||||
some compilers, it may be necessary to add a flag to enable c++14 support.
|
||||
For example, the GNU compiler uses the -std=c++14 flag. For a list of
|
||||
compilers that have been tested with the Kokkos library, see the Kokkos
|
||||
`README <https://github.com/kokkos/kokkos/blob/master/README.md>`_.
|
||||
|
||||
.. admonition:: NVIDIA CUDA support
|
||||
:class: note
|
||||
|
||||
@ -38,14 +47,14 @@ produce an executable compatible with a specific hardware.
|
||||
:class: note
|
||||
|
||||
Kokkos with CUDA currently implicitly assumes that the MPI library is
|
||||
CUDA-aware. This is not always the case, especially when using
|
||||
GPU-aware. This is not always the case, especially when using
|
||||
pre-compiled MPI libraries provided by a Linux distribution. This is
|
||||
not a problem when using only a single GPU with a single MPI
|
||||
rank. When running with multiple MPI ranks, you may see segmentation
|
||||
faults without CUDA-aware MPI support. These can be avoided by adding
|
||||
the flags :doc:`-pk kokkos cuda/aware off <Run_options>` to the
|
||||
faults without GPU-aware MPI support. These can be avoided by adding
|
||||
the flags :doc:`-pk kokkos gpu/aware off <Run_options>` to the
|
||||
LAMMPS command line or by using the command :doc:`package kokkos
|
||||
cuda/aware off <package>` in the input file.
|
||||
gpu/aware off <package>` in the input file.
|
||||
|
||||
.. admonition:: AMD GPU support
|
||||
:class: note
|
||||
@ -242,8 +251,8 @@ case, also packing/unpacking communication buffers on the host may give
|
||||
speedup (see the KOKKOS :doc:`package <package>` command). Using CUDA MPS
|
||||
is recommended in this scenario.
|
||||
|
||||
Using a CUDA-aware MPI library is highly recommended. CUDA-aware MPI use can be
|
||||
avoided by using :doc:`-pk kokkos cuda/aware no <package>`. As above for
|
||||
Using a GPU-aware MPI library is highly recommended. GPU-aware MPI use can be
|
||||
avoided by using :doc:`-pk kokkos gpu/aware off <package>`. As above for
|
||||
multi-core CPUs (and no GPU), if N is the number of physical cores/node,
|
||||
then the number of MPI tasks/node should not exceed N.
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ These are the accelerator packages currently in LAMMPS, either as
|
||||
standard or user packages:
|
||||
|
||||
+-----------------------------------------+-------------------------------------------------------+
|
||||
| :doc:`GPU Package <Speed_gpu>` | for NVIDIA GPUs as well as OpenCL support |
|
||||
| :doc:`GPU Package <Speed_gpu>` | for GPUs via CUDA, OpenCL, or ROCm HIP |
|
||||
+-----------------------------------------+-------------------------------------------------------+
|
||||
| :doc:`USER-INTEL Package <Speed_intel>` | for Intel CPUs and Intel Xeon Phi |
|
||||
+-----------------------------------------+-------------------------------------------------------+
|
||||
@ -43,7 +43,7 @@ three kinds of hardware, via the listed packages:
|
||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||
| Many-core CPUs | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>`, :doc:`USER-OMP <Speed_omp>`, :doc:`OPT <Speed_opt>` packages |
|
||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||
| NVIDIA/AMD GPUs | :doc:`GPU <Speed_gpu>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
||||
| GPUs | :doc:`GPU <Speed_gpu>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||
| Intel Phi/AVX | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||
@ -154,8 +154,8 @@ Here is a brief summary of what the various packages provide. Details
|
||||
are in the individual accelerator sections.
|
||||
|
||||
* Styles with a "gpu" suffix are part of the GPU package and can be run
|
||||
on NVIDIA or AMD GPUs. The speed-up on a GPU depends on a variety of
|
||||
factors, discussed in the accelerator sections.
|
||||
on Intel, NVIDIA, or AMD GPUs. The speed-up on a GPU depends on a
|
||||
variety of factors, discussed in the accelerator sections.
|
||||
* Styles with an "intel" suffix are part of the USER-INTEL
|
||||
package. These styles support vectorized single and mixed precision
|
||||
calculations, in addition to full double precision. In extreme cases,
|
||||
|
||||
@ -93,6 +93,7 @@ Miscellaneous tools
|
||||
* :ref:`i-pi <ipi>`
|
||||
* :ref:`kate <kate>`
|
||||
* :ref:`LAMMPS shell <lammps_shell>`
|
||||
* :ref:`LAMMPS magic patterns for file(1) <magic>`
|
||||
* :ref:`singularity <singularity_tool>`
|
||||
* :ref:`SWIG interface <swig>`
|
||||
* :ref:`vim <vim>`
|
||||
@ -267,7 +268,7 @@ data file in the required format.
|
||||
See the header of the polarizer.py file for details.
|
||||
|
||||
The tool is authored by Agilio Padua and Alain Dequidt: agilio.padua
|
||||
at univ-bpclermont.fr, alain.dequidt at univ-bpclermont.fr
|
||||
at ens-lyon.fr, alain.dequidt at uca.fr
|
||||
|
||||
----------
|
||||
|
||||
@ -341,8 +342,7 @@ The tools/fep directory contains Python scripts useful for
|
||||
post-processing results from performing free-energy perturbation
|
||||
simulations using the USER-FEP package.
|
||||
|
||||
The scripts were contributed by Agilio Padua (Universite Blaise
|
||||
Pascal Clermont-Ferrand), agilio.padua at univ-bpclermont.fr.
|
||||
The scripts were contributed by Agilio Padua (ENS de Lyon), agilio.padua at ens-lyon.fr.
|
||||
|
||||
See README file in the tools/fep directory.
|
||||
|
||||
@ -642,6 +642,39 @@ This tool was written by Ara Kooser at Sandia (askoose at sandia.gov).
|
||||
|
||||
----------
|
||||
|
||||
.. _magic:
|
||||
|
||||
Magic patterns for the "file" command
|
||||
-------------------------------------
|
||||
|
||||
.. versionadded:: 10Mar2021
|
||||
|
||||
The file ``magic`` contains patterns that are used by the
|
||||
`file program <https://en.wikipedia.org/wiki/File_(command)>`_
|
||||
available on most Unix-like operating systems which enables it
|
||||
to detect various LAMMPS files and print some useful information
|
||||
about them. To enable these patterns, append or copy the contents
|
||||
of the file to either the file ``.magic`` in your home directory
|
||||
or (as administrator) to ``/etc/magic`` (for a system-wide
|
||||
installation). Afterwards the ``file`` command should be able to
|
||||
detect most LAMMPS restarts, dump, data and log files. Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ file *.*
|
||||
dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian
|
||||
mol-pair-wf_cut.restart: LAMMPS binary restart file (rev 2), Version 24 Dec 2020, Little Endian
|
||||
atom.bin: LAMMPS atom style binary dump (rev 2), Little Endian, First time step: 445570
|
||||
custom.bin: LAMMPS custom style binary dump (rev 2), Little Endian, First time step: 100
|
||||
bn1.lammpstrj: LAMMPS text mode dump, First time step: 5000
|
||||
data.fourmol: LAMMPS data file written by LAMMPS
|
||||
pnc.data: LAMMPS data file written by msi2lmp
|
||||
data.spce: LAMMPS data file written by TopoTools
|
||||
B.data: LAMMPS data file written by OVITO
|
||||
log.lammps: LAMMPS log file written by version 10 Feb 2021
|
||||
|
||||
----------
|
||||
|
||||
.. _matlab:
|
||||
|
||||
matlab tool
|
||||
|
||||
@ -24,20 +24,17 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
The *cosine/periodic* angle style uses the following potential, which
|
||||
is commonly used in the :doc:`DREIDING <Howto_bioFF>` force field,
|
||||
particularly for organometallic systems where :math:`n` = 4 might be used
|
||||
The *cosine/periodic* angle style uses the following potential, which may be
|
||||
particularly used for organometallic systems where :math:`n` = 4 might be used
|
||||
for an octahedral complex and :math:`n` = 3 might be used for a trigonal
|
||||
center:
|
||||
|
||||
.. math::
|
||||
|
||||
E = C \left[ 1 - B(-1)^n\cos\left( n\theta\right) \right]
|
||||
E = \frac{2.0}{n^2} * C \left[ 1 - B(-1)^n\cos\left( n\theta\right) \right]
|
||||
|
||||
where :math:`C`, :math:`B` and :math:`n` are coefficients defined for each angle type.
|
||||
|
||||
See :ref:`(Mayo) <cosine-Mayo>` for a description of the DREIDING force field
|
||||
|
||||
The following coefficients must be defined for each angle type via the
|
||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
@ -47,10 +44,9 @@ or :doc:`read_restart <read_restart>` commands:
|
||||
* :math:`B` = 1 or -1
|
||||
* :math:`n` = 1, 2, 3, 4, 5 or 6 for periodicity
|
||||
|
||||
Note that the prefactor :math:`C` is specified and not the overall force
|
||||
constant :math:`K = \frac{C}{n^2}`. When :math:`B = 1`, it leads to a minimum for the
|
||||
linear geometry. When :math:`B = -1`, it leads to a maximum for the linear
|
||||
geometry.
|
||||
Note that the prefactor :math:`C` is specified as coefficient and not the overall force
|
||||
constant :math:`K = \frac{2 C}{n^2}`. When :math:`B = 1`, it leads to a minimum for the
|
||||
linear geometry. When :math:`B = -1`, it leads to a maximum for the linear geometry.
|
||||
|
||||
----------
|
||||
|
||||
@ -75,9 +71,3 @@ Default
|
||||
|
||||
none
|
||||
|
||||
----------
|
||||
|
||||
.. _cosine-Mayo:
|
||||
|
||||
**(Mayo)** Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
|
||||
(1990).
|
||||
|
||||
@ -30,8 +30,11 @@ The *cosine/squared* angle style uses the potential
|
||||
|
||||
E = K [\cos(\theta) - \cos(\theta_0)]^2
|
||||
|
||||
where :math:`\theta_0` is the equilibrium value of the angle, and :math:`K` is a
|
||||
prefactor. Note that the usual 1/2 factor is included in :math:`K`.
|
||||
, which is commonly used in the :doc:`DREIDING <Howto_bioFF>` force field,
|
||||
where :math:`\theta_0` is the equilibrium value of the angle, and :math:`K`
|
||||
is a prefactor. Note that the usual 1/2 factor is included in :math:`K`.
|
||||
|
||||
See :ref:`(Mayo) <cosine-Mayo>` for a description of the DREIDING force field.
|
||||
|
||||
The following coefficients must be defined for each angle type via the
|
||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||
@ -66,3 +69,10 @@ Default
|
||||
"""""""
|
||||
|
||||
none
|
||||
|
||||
----------
|
||||
|
||||
.. _cosine-Mayo:
|
||||
|
||||
**(Mayo)** Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
|
||||
(1990).
|
||||
|
||||
@ -27,7 +27,7 @@ Syntax
|
||||
template-ID = ID of molecule template specified in a separate :doc:`molecule <molecule>` command
|
||||
*hybrid* args = list of one or more sub-styles, each with their args
|
||||
|
||||
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk*
|
||||
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk* or *spin/kk*
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -257,7 +257,7 @@ factor, similar to how the :doc:`fix balance shift <fix_balance>`
|
||||
command operates.
|
||||
|
||||
The *dimstr* argument is a string of characters, each of which must be
|
||||
an "x" or "y" or "z". Eacn character can appear zero or one time,
|
||||
an "x" or "y" or "z". Each character can appear zero or one time,
|
||||
since there is no advantage to balancing on a dimension more than
|
||||
once. You should normally only list dimensions where you expect there
|
||||
to be a density variation in the particles.
|
||||
@ -285,10 +285,10 @@ plane gets closer to the target value.
|
||||
|
||||
After the balanced plane positions are determined, if any pair of
|
||||
adjacent planes are closer together than the neighbor skin distance
|
||||
(as specified by the :doc`neigh_modify <neigh_modify>` command), then
|
||||
(as specified by the :doc:`neigh_modify <neigh_modify>` command), then
|
||||
the plane positions are shifted to separate them by at least this
|
||||
amount. This is to prevent particles being lost when dynamics are run
|
||||
with processor subdomains that are too narrow in one or more
|
||||
with processor sub-domains that are too narrow in one or more
|
||||
dimensions.
|
||||
|
||||
Once the re-balancing is complete and final processor sub-domains
|
||||
|
||||
@ -84,13 +84,15 @@ information is available, then also a heuristic based on that bond length
|
||||
is computed. It is used as communication cutoff, if there is no pair
|
||||
style present and no *comm_modify cutoff* command used. Otherwise a
|
||||
warning is printed, if this bond based estimate is larger than the
|
||||
communication cutoff used. A
|
||||
communication cutoff used.
|
||||
|
||||
The *cutoff/multi* option is equivalent to *cutoff*\ , but applies to
|
||||
communication mode *multi* instead. Since in this case the communication
|
||||
cutoffs are determined per atom type, a type specifier is needed and
|
||||
cutoff for one or multiple types can be extended. Also ranges of types
|
||||
using the usual asterisk notation can be given.
|
||||
using the usual asterisk notation can be given. For granular pair styles,
|
||||
the default cutoff is set to the sum of the current maximum atomic radii
|
||||
for each type.
|
||||
|
||||
These are simulation scenarios in which it may be useful or even
|
||||
necessary to set a ghost cutoff > neighbor cutoff:
|
||||
|
||||
@ -77,6 +77,7 @@ Commands
|
||||
pair_style
|
||||
pair_write
|
||||
partition
|
||||
plugin
|
||||
prd
|
||||
print
|
||||
processors
|
||||
|
||||
@ -46,11 +46,12 @@ the compute command was issued. The value of the displacement will be
|
||||
.. note::
|
||||
|
||||
Initial coordinates are stored in "unwrapped" form, by using the
|
||||
image flags associated with each atom. See the :doc:`dump custom <dump>` command for a discussion of "unwrapped" coordinates.
|
||||
See the Atoms section of the :doc:`read_data <read_data>` command for a
|
||||
discussion of image flags and how they are set for each atom. You can
|
||||
reset the image flags (e.g. to 0) before invoking this compute by
|
||||
using the :doc:`set image <set>` command.
|
||||
image flags associated with each atom. See the :doc:`dump custom
|
||||
<dump>` command for a discussion of "unwrapped" coordinates. See
|
||||
the Atoms section of the :doc:`read_data <read_data>` command for a
|
||||
discussion of image flags and how they are set for each atom. You
|
||||
can reset the image flags (e.g. to 0) before invoking this compute
|
||||
by using the :doc:`set image <set>` command.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ the meaning of these parameters:
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
||||
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
|
||||
@ -18,7 +18,7 @@ Syntax
|
||||
.. parsed-literal::
|
||||
|
||||
*model* values = style
|
||||
style = *linear* or *quadratic*
|
||||
style = *linear* or *quadratic* or *mliappy*
|
||||
*descriptor* values = style filename
|
||||
style = *sna*
|
||||
filename = name of file containing descriptor definitions
|
||||
@ -56,13 +56,15 @@ and it is also straightforward to add new descriptor styles.
|
||||
The compute *mliap* command must be followed by two keywords
|
||||
*model* and *descriptor* in either order.
|
||||
|
||||
The *model* keyword is followed by a model style, currently limited to
|
||||
either *linear* or *quadratic*.
|
||||
The *model* keyword is followed by the model style (*linear*, *quadratic* or *mliappy*).
|
||||
The *mliappy* model is only available
|
||||
if lammps is built with MLIAPPY package.
|
||||
|
||||
The *descriptor* keyword is followed by a descriptor style, and additional arguments.
|
||||
Currently the only descriptor style is *sna*, indicating the bispectrum component
|
||||
descriptors used by the Spectral Neighbor Analysis Potential (SNAP) potentials of
|
||||
:doc:`pair_style snap <pair_snap>`.
|
||||
The compute currently supports just one descriptor style, but it is
|
||||
is straightforward to add new descriptor styles.
|
||||
The SNAP descriptor style *sna* is the same as that used by :doc:`pair_style snap <pair_snap>`,
|
||||
including the linear, quadratic, and chem variants.
|
||||
A single additional argument specifies the descriptor filename
|
||||
containing the parameters and setting used by the SNAP descriptor.
|
||||
The descriptor filename usually ends in the *.mliap.descriptor* extension.
|
||||
@ -162,9 +164,10 @@ potentials, see the examples in `FitSNAP <https://github.com/FitSNAP/FitSNAP>`_.
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the MLIAP package. It is only enabled if
|
||||
LAMMPS was built with that package. In addition, building LAMMPS with the MLIAP package
|
||||
This compute is part of the MLIAP package. It is only enabled if LAMMPS
|
||||
was built with that package. In addition, building LAMMPS with the MLIAP package
|
||||
requires building LAMMPS with the SNAP package.
|
||||
The *mliappy* model requires building LAMMPS with the PYTHON package.
|
||||
See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
|
||||
Related commands
|
||||
|
||||
@ -115,8 +115,8 @@ The optional keyword *chunksize* is only applicable when using the
|
||||
the KOKKOS package and is ignored otherwise. This keyword controls
|
||||
the number of atoms in each pass used to compute the bond-orientational
|
||||
order parameters and is used to avoid running out of memory. For example
|
||||
if there are 4000 atoms in the simulation and the *chunksize*
|
||||
is set to 2000, the parameter calculation will be broken up
|
||||
if there are 32768 atoms in the simulation and the *chunksize*
|
||||
is set to 16384, the parameter calculation will be broken up
|
||||
into two passes.
|
||||
|
||||
The value of :math:`Q_l` is set to zero for atoms not in the
|
||||
@ -193,7 +193,7 @@ Default
|
||||
|
||||
The option defaults are *cutoff* = pair style cutoff, *nnn* = 12,
|
||||
*degrees* = 5 4 6 8 10 12 i.e. :math:`Q_4`, :math:`Q_6`, :math:`Q_8`, :math:`Q_{10}`, and :math:`Q_{12}`,
|
||||
*wl* = no, *wl/hat* = no, *components* off, and *chunksize* = 2000
|
||||
*wl* = no, *wl/hat* = no, *components* off, and *chunksize* = 16384
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -46,13 +46,14 @@ system volume (or area in 2d). The second term is the virial, equal to
|
||||
-dU/dV, computed for all pairwise as well as 2-body, 3-body, 4-body,
|
||||
many-body, and long-range interactions, where :math:`r_i` and
|
||||
:math:`f_i` are the position and force vector of atom *i*, and the black
|
||||
dot indicates a dot product. When periodic boundary conditions are
|
||||
used, N' necessarily includes periodic image (ghost) atoms outside the
|
||||
central box, and the position and force vectors of ghost atoms are thus
|
||||
included in the summation. When periodic boundary conditions are not
|
||||
used, N' = N = the number of atoms in the system. :doc:`Fixes <fix>`
|
||||
that impose constraints (e.g. the :doc:`fix shake <fix_shake>` command)
|
||||
also contribute to the virial term.
|
||||
dot indicates a dot product. This is computed in parallel for each
|
||||
sub-domain and then summed over all parallel processes. Thus N'
|
||||
necessarily includes atoms from neighboring sub-domains (so-called ghost
|
||||
atoms) and the position and force vectors of ghost atoms are thus
|
||||
included in the summation. Only when running in serial and without
|
||||
periodic boundary conditions is N' = N = the number of atoms in the
|
||||
system. :doc:`Fixes <fix>` that impose constraints (e.g. the :doc:`fix
|
||||
shake <fix_shake>` command) may also contribute to the virial term.
|
||||
|
||||
A symmetric pressure tensor, stored as a 6-element vector, is also
|
||||
calculated by this compute. The 6 components of the vector are
|
||||
@ -122,8 +123,11 @@ Output info
|
||||
This compute calculates a global scalar (the pressure) and a global
|
||||
vector of length 6 (pressure tensor), which can be accessed by indices
|
||||
1-6. These values can be used by any command that uses global scalar
|
||||
or vector values from a compute as input. See the :doc:`Howto output <Howto_output>` doc page for an overview of LAMMPS output
|
||||
options.
|
||||
or vector values from a compute as input. See the :doc:`Howto output
|
||||
<Howto_output>` doc page for an overview of LAMMPS output options.
|
||||
|
||||
The ordering of values in the symmetric pressure tensor is as follows:
|
||||
pxx, pyy, pzz, pxy, pxz, pyz.
|
||||
|
||||
The scalar and vector values calculated by this compute are
|
||||
"intensive". The scalar and vector values will be in pressure
|
||||
|
||||
@ -30,7 +30,7 @@ Examples
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute 1 all reduce/chunk/atom mychunk min c_cluster
|
||||
compute 1 all reduce/chunk mychunk min c_cluster
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
@ -216,6 +216,11 @@ an identical manner to compute *stress/atom*. See the :doc:`Howto
|
||||
output <Howto_output>` doc page for an overview of LAMMPS output
|
||||
options.
|
||||
|
||||
The ordering of the 6 columns for *stress/atom* is as follows: xx, yy,
|
||||
zz, xy, xz, yz. The ordering of the 9 columns for
|
||||
*centroid/stress/atom* is as follows: xx, yy, zz, xy, xz, yz, yx, zx,
|
||||
zy.
|
||||
|
||||
The per-atom array values will be in pressure\*volume :doc:`units
|
||||
<units>` as discussed above.
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ temp/chunk calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>
|
||||
|
||||
compute cc1 all chunk/atom molecule
|
||||
compute myChunk all temp/chunk cc1 temp
|
||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector
|
||||
fix 1 all ave/time 100 1 100 c_myChunk[1] file tmp.out mode vector
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -125,6 +125,16 @@ cannot appear in the neighbor list, to avoid creation of duplicate
|
||||
bonds. The neighbor list for all atom type pairs must also extend to
|
||||
a distance that encompasses the *rmax* for new bonds to create.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want to create bonds between pairs of 1-3 or 1-4 atoms in
|
||||
the current bond topology, then you need to use :doc:`special_bonds
|
||||
lj 0 1 1 <special_bonds>` to insure those pairs appear in the
|
||||
neighbor list. They will not appear with the default special_bonds
|
||||
settings which are zero for 1-2, 1-3, and 1-4 atoms. 1-3 or 1-4
|
||||
atoms are those which are 2 hops or 3 hops apart in the bond
|
||||
topology.
|
||||
|
||||
An additional requirement for this style is that your system must be
|
||||
ready to perform a simulation. This means, for example, that all
|
||||
:doc:`pair_style <pair_style>` coefficients be set via the
|
||||
|
||||
@ -13,7 +13,7 @@ Syntax
|
||||
* N = # of atom types to use in this simulation
|
||||
* region-ID = ID of region to use as simulation domain
|
||||
* zero or more keyword/value pairs may be appended
|
||||
* keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom*
|
||||
* keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom* or *extra/special/per/atom*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ more of (g,i,k,o,t) to indicate which accelerated styles exist.
|
||||
* :doc:`quadratic <dihedral_quadratic>` - dihedral with quadratic term in angle
|
||||
* :doc:`spherical <dihedral_spherical>` - dihedral which includes angle terms to avoid singularities
|
||||
* :doc:`table <dihedral_table>` - tabulated dihedral
|
||||
* :doc:`table/cut <dihedral_table_cut>` - tabulated dihedral with analytic cutoff
|
||||
* :doc:`table/cut <dihedral_table>` - tabulated dihedral with analytic cutoff
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -1,19 +1,24 @@
|
||||
.. index:: dihedral_style table
|
||||
.. index:: dihedral_style table/omp
|
||||
.. index:: dihedral_style table/cut
|
||||
|
||||
dihedral_style table command
|
||||
============================
|
||||
|
||||
Accelerator Variants: *table/omp*
|
||||
|
||||
dihedral_style table/cut command
|
||||
================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
dihedral_style table style Ntable
|
||||
dihedral_style style interpolation Ntable
|
||||
|
||||
* style = *linear* or *spline* = method of interpolation
|
||||
* style = *table* or *table/cut*
|
||||
* interpolation = *linear* or *spline* = method of interpolation
|
||||
* Ntable = size of the internal lookup table
|
||||
|
||||
Examples
|
||||
@ -26,13 +31,21 @@ Examples
|
||||
dihedral_coeff 1 file.table DIH_TABLE1
|
||||
dihedral_coeff 2 file.table DIH_TABLE2
|
||||
|
||||
dihedral_style table/cut spline 400
|
||||
dihedral_style table/cut linear 1000
|
||||
dihedral_coeff 1 aat 1.0 177 180 file.table DIH_TABLE1
|
||||
dihedral_coeff 2 aat 0.5 170 180 file.table DIH_TABLE2
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
The *table* dihedral style creates interpolation tables of length
|
||||
*Ntable* from dihedral potential and derivative values listed in a
|
||||
file(s) as a function of the dihedral angle "phi". The files are read
|
||||
by the :doc:`dihedral_coeff <dihedral_coeff>` command.
|
||||
The *table* and *table/cut* dihedral styles create interpolation tables
|
||||
of length *Ntable* from dihedral potential and derivative values listed
|
||||
in a file(s) as a function of the dihedral angle "phi". The files are
|
||||
read by the :doc:`dihedral_coeff <dihedral_coeff>` command. For
|
||||
dihedral style *table/cut* additionally an analytic cutoff that is
|
||||
quadratic in the bond-angle (theta) is applied in order to regularize
|
||||
the dihedral interaction.
|
||||
|
||||
The interpolation tables are created by fitting cubic splines to the
|
||||
file values and interpolating energy and derivative values at each of
|
||||
@ -51,16 +64,53 @@ interpolated table. For a given dihedral angle (phi), the appropriate
|
||||
coefficients are chosen from this list, and a cubic polynomial is used
|
||||
to compute the energy and the derivative at this angle.
|
||||
|
||||
The following coefficients must be defined for each dihedral type via
|
||||
the :doc:`dihedral_coeff <dihedral_coeff>` command as in the example
|
||||
above.
|
||||
For dihedral style *table* the following coefficients must be defined
|
||||
for each dihedral type via the :doc:`dihedral_coeff <dihedral_coeff>`
|
||||
command as in the example above.
|
||||
|
||||
* filename
|
||||
* keyword
|
||||
|
||||
The filename specifies a file containing tabulated energy and
|
||||
derivative values. The keyword specifies a section of the file. The
|
||||
format of this file is described below.
|
||||
The filename specifies a file containing tabulated energy and derivative
|
||||
values. The keyword specifies which section of the file to read. The
|
||||
format of this file is the same for both dihedral styles and described
|
||||
below.
|
||||
|
||||
For dihedral style *table/cut* the following coefficients must be
|
||||
defined for each dihedral type via the :doc:`dihedral_coeff
|
||||
<dihedral_coeff>` command as in the example above.
|
||||
|
||||
* style (aat)
|
||||
* cutoff prefactor
|
||||
* cutoff angle1
|
||||
* cutoff angle2
|
||||
* filename
|
||||
* keyword
|
||||
|
||||
The cutoff dihedral style uses a tabulated dihedral interaction with a
|
||||
cutoff function:
|
||||
|
||||
.. math::
|
||||
|
||||
f(\theta) & = K \qquad\qquad\qquad\qquad\qquad\qquad \theta < \theta_1 \\
|
||||
f(\theta) & = K \left(1-\frac{(\theta - \theta_1)^2}{(\theta_2 - \theta_1)^2}\right) \qquad \theta_1 < \theta < \theta_2
|
||||
|
||||
The cutoff specifies an prefactor to the cutoff function. While this
|
||||
value would ordinarily equal 1 there may be situations where the value
|
||||
should change.
|
||||
|
||||
The cutoff :math:`\theta_1` specifies the angle (in degrees) below which
|
||||
the dihedral interaction is unmodified, i.e. the cutoff function is 1.
|
||||
|
||||
The cutoff function is applied between :math:`\theta_1` and
|
||||
:math:`\theta_2`, which is the angle at which the cutoff function drops
|
||||
to zero. The value of zero effectively "turns off" the dihedral
|
||||
interaction.
|
||||
|
||||
The filename specifies a file containing tabulated energy and derivative
|
||||
values. The keyword specifies which section of the file to read. The
|
||||
format of this file is the same for both dihedral styles and described
|
||||
below.
|
||||
|
||||
----------
|
||||
|
||||
@ -182,18 +232,19 @@ that matches the specified keyword.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This dihedral style writes the settings for the "dihedral_style table"
|
||||
command to :doc:`binary restart files <restart>`, so a dihedral_style
|
||||
command does not need to specified in an input script that reads a
|
||||
restart file. However, the coefficient information is not stored in
|
||||
the restart file, since it is tabulated in the potential files. Thus,
|
||||
These dihedral styles write the settings for the "dihedral_style table"
|
||||
or "dihedral_style table/cut" command to :doc:`binary restart files
|
||||
<restart>`, so a dihedral_style command does not need to specified in an
|
||||
input script that reads a restart file. However, the coefficient
|
||||
information loaded from the table file(s) is not stored in the restart
|
||||
file, since it is tabulated in the potential files. Thus, suitable
|
||||
dihedral_coeff commands do need to be specified in the restart input
|
||||
script.
|
||||
script after reading the restart file.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This dihedral style can only be used if LAMMPS was built with the
|
||||
These dihedral styles can only be used if LAMMPS was built with the
|
||||
USER-MISC package. See the :doc:`Build package <Build_package>` doc
|
||||
page for more info.
|
||||
|
||||
|
||||
@ -1,229 +0,0 @@
|
||||
.. index:: dihedral_style table/cut
|
||||
|
||||
dihedral_style table/cut command
|
||||
================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
dihedral_style table/cut style Ntable
|
||||
|
||||
* style = *linear* or *spline* = method of interpolation
|
||||
* Ntable = size of the internal lookup table
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
dihedral_style table/cut spline 400
|
||||
dihedral_style table/cut linear 1000
|
||||
dihedral_coeff 1 aat 1.0 177 180 file.table DIH_TABLE1
|
||||
dihedral_coeff 2 aat 0.5 170 180 file.table DIH_TABLE2
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
The *table/cut* dihedral style creates interpolation tables of length
|
||||
*Ntable* from dihedral potential and derivative values listed in a
|
||||
file(s) as a function of the dihedral angle "phi". In addition, an
|
||||
analytic cutoff that is quadratic in the bond-angle (theta) is applied
|
||||
in order to regularize the dihedral interaction. The dihedral table
|
||||
files are read by the :doc:`dihedral_coeff <dihedral_coeff>` command.
|
||||
|
||||
The interpolation tables are created by fitting cubic splines to the
|
||||
file values and interpolating energy and derivative values at each of
|
||||
*Ntable* dihedral angles. During a simulation, these tables are used
|
||||
to interpolate energy and force values on individual atoms as
|
||||
needed. The interpolation is done in one of 2 styles: *linear* or
|
||||
*spline*\ .
|
||||
|
||||
For the *linear* style, the dihedral angle (phi) is used to find 2
|
||||
surrounding table values from which an energy or its derivative is
|
||||
computed by linear interpolation.
|
||||
|
||||
For the *spline* style, cubic spline coefficients are computed and
|
||||
stored at each of the *Ntable* evenly-spaced values in the
|
||||
interpolated table. For a given dihedral angle (phi), the appropriate
|
||||
coefficients are chosen from this list, and a cubic polynomial is used
|
||||
to compute the energy and the derivative at this angle.
|
||||
|
||||
The following coefficients must be defined for each dihedral type via
|
||||
the :doc:`dihedral_coeff <dihedral_coeff>` command as in the example
|
||||
above.
|
||||
|
||||
* style (aat)
|
||||
* cutoff prefactor
|
||||
* cutoff angle1
|
||||
* cutoff angle2
|
||||
* filename
|
||||
* keyword
|
||||
|
||||
The cutoff dihedral style uses a tabulated dihedral interaction with a
|
||||
cutoff function:
|
||||
|
||||
.. math::
|
||||
|
||||
f(\theta) & = K \qquad\qquad\qquad\qquad\qquad\qquad \theta < \theta_1 \\
|
||||
f(\theta) & = K \left(1-\frac{(\theta - \theta_1)^2}{(\theta_2 - \theta_1)^2}\right) \qquad \theta_1 < \theta < \theta_2
|
||||
|
||||
The cutoff specifies an prefactor to the cutoff function. While this value
|
||||
would ordinarily equal 1 there may be situations where the value should change.
|
||||
|
||||
The cutoff :math:`\theta_1` specifies the angle (in degrees) below which the dihedral
|
||||
interaction is unmodified, i.e. the cutoff function is 1.
|
||||
|
||||
The cutoff function is applied between :math:`\theta_1` and :math:`\theta_2`, which is
|
||||
the angle at which the cutoff function drops to zero. The value of zero effectively
|
||||
"turns off" the dihedral interaction.
|
||||
|
||||
The filename specifies a file containing tabulated energy and
|
||||
derivative values. The keyword specifies a section of the file. The
|
||||
format of this file is described below.
|
||||
|
||||
----------
|
||||
|
||||
The format of a tabulated file is as follows (without the
|
||||
parenthesized comments). It can begin with one or more comment
|
||||
or blank lines.
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
# Table of the potential and its negative derivative
|
||||
|
||||
DIH_TABLE1 (keyword is the first text on line)
|
||||
N 30 DEGREES (N, NOF, DEGREES, RADIANS, CHECKU/F)
|
||||
(blank line)
|
||||
1 -168.0 -1.40351172223 0.0423346818422
|
||||
2 -156.0 -1.70447981034 0.00811786522531
|
||||
3 -144.0 -1.62956100432 -0.0184129719987
|
||||
...
|
||||
30 180.0 -0.707106781187 0.0719306095245
|
||||
|
||||
# Example 2: table of the potential. Forces omitted
|
||||
|
||||
DIH_TABLE2
|
||||
N 30 NOF CHECKU testU.dat CHECKF testF.dat
|
||||
|
||||
1 -168.0 -1.40351172223
|
||||
2 -156.0 -1.70447981034
|
||||
3 -144.0 -1.62956100432
|
||||
...
|
||||
30 180.0 -0.707106781187
|
||||
|
||||
A section begins with a non-blank line whose first character is not a
|
||||
"#"; blank lines or lines starting with "#" can be used as comments
|
||||
between sections. The first line begins with a keyword which
|
||||
identifies the section. The line can contain additional text, but the
|
||||
initial text must match the argument specified in the
|
||||
:doc:`dihedral_coeff <dihedral_coeff>` command. The next line lists (in
|
||||
any order) one or more parameters for the table. Each parameter is a
|
||||
keyword followed by one or more numeric values.
|
||||
|
||||
Following a blank line, the next N lines list the tabulated values. On
|
||||
each line, the first value is the index from 1 to N, the second value is
|
||||
the angle value, the third value is the energy (in energy units), and
|
||||
the fourth is -dE/d(phi) also in energy units). The third term is the
|
||||
energy of the 4-atom configuration for the specified angle. The fourth
|
||||
term (when present) is the negative derivative of the energy with
|
||||
respect to the angle (in degrees, or radians depending on whether the
|
||||
user selected DEGREES or RADIANS). Thus the units of the last term
|
||||
are still energy, not force. The dihedral angle values must increase
|
||||
from one line to the next.
|
||||
|
||||
Dihedral table splines are cyclic. There is no discontinuity at 180
|
||||
degrees (or at any other angle). Although in the examples above, the
|
||||
angles range from -180 to 180 degrees, in general, the first angle in
|
||||
the list can have any value (positive, zero, or negative). However
|
||||
the *range* of angles represented in the table must be *strictly* less
|
||||
than 360 degrees (2pi radians) to avoid angle overlap. (You may not
|
||||
supply entries in the table for both 180 and -180, for example.) If
|
||||
the user's table covers only a narrow range of dihedral angles,
|
||||
strange numerical behavior can occur in the large remaining gap.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
The parameter "N" is required and its value is the number of table
|
||||
entries that follow. Note that this may be different than the N
|
||||
specified in the :doc:`dihedral_style table <dihedral_style>` command.
|
||||
Let *Ntable* is the number of table entries requested dihedral_style
|
||||
command, and let *Nfile* be the parameter following "N" in the
|
||||
tabulated file ("30" in the sparse example above). What LAMMPS does
|
||||
is a preliminary interpolation by creating splines using the *Nfile*
|
||||
tabulated values as nodal points. It uses these to interpolate as
|
||||
needed to generate energy and derivative values at *Ntable* different
|
||||
points (which are evenly spaced over a 360 degree range, even if the
|
||||
angles in the file are not). The resulting tables of length *Ntable*
|
||||
are then used as described above, when computing energy and force for
|
||||
individual dihedral angles and their atoms. This means that if you
|
||||
want the interpolation tables of length *Ntable* to match exactly what
|
||||
is in the tabulated file (with effectively nopreliminary
|
||||
interpolation), you should set *Ntable* = *Nfile*\ . To insure the
|
||||
nodal points in the user's file are aligned with the interpolated
|
||||
table entries, the angles in the table should be integer multiples of
|
||||
360/\ *Ntable* degrees, or 2\*PI/\ *Ntable* radians (depending on your
|
||||
choice of angle units).
|
||||
|
||||
The optional "NOF" keyword allows the user to omit the forces
|
||||
(negative energy derivatives) from the table file (normally located in
|
||||
the fourth column). In their place, forces will be calculated
|
||||
automatically by differentiating the potential energy function
|
||||
indicated by the third column of the table (using either linear or
|
||||
spline interpolation).
|
||||
|
||||
The optional "DEGREES" keyword allows the user to specify angles in
|
||||
degrees instead of radians (default).
|
||||
|
||||
The optional "RADIANS" keyword allows the user to specify angles in
|
||||
radians instead of degrees. (Note: This changes the way the forces
|
||||
are scaled in the fourth column of the data file.)
|
||||
|
||||
The optional "CHECKU" keyword is followed by a filename. This allows
|
||||
the user to save all of the *Ntable* different entries in the
|
||||
interpolated energy table to a file to make sure that the interpolated
|
||||
function agrees with the user's expectations. (Note: You can
|
||||
temporarily increase the *Ntable* parameter to a high value for this
|
||||
purpose. "\ *Ntable*\ " is explained above.)
|
||||
|
||||
The optional "CHECKF" keyword is analogous to the "CHECKU" keyword.
|
||||
It is followed by a filename, and it allows the user to check the
|
||||
interpolated force table. This option is available even if the user
|
||||
selected the "NOF" option.
|
||||
|
||||
Note that one file can contain many sections, each with a tabulated
|
||||
potential. LAMMPS reads the file section by section until it finds one
|
||||
that matches the specified keyword.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This dihedral style writes the settings for the "dihedral_style table/cut"
|
||||
command to :doc:`binary restart files <restart>`, so a dihedral_style
|
||||
command does not need to specified in an input script that reads a
|
||||
restart file. However, the coefficient information is not stored in
|
||||
the restart file, since it is tabulated in the potential files. Thus,
|
||||
dihedral_coeff commands do need to be specified in the restart input
|
||||
script.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This dihedral style can only be used if LAMMPS was built with the
|
||||
USER-MISC package. See the :doc:`Build package <Build_package>` doc
|
||||
page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`dihedral_coeff <dihedral_coeff>`, :doc:`dihedral_style table <dihedral_table>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
none
|
||||
|
||||
.. _dihedralcut-Salerno:
|
||||
|
||||
**(Salerno)** Salerno, Bernstein, J Chem Theory Comput, --, ---- (2018).
|
||||
@ -349,7 +349,7 @@ the box size stored with the snapshot.
|
||||
|
||||
The *xtc* style writes XTC files, a compressed trajectory format used
|
||||
by the GROMACS molecular dynamics package, and described
|
||||
`here <http://manual.gromacs.org/current/online/xtc.html>`_.
|
||||
`here <https://manual.gromacs.org/current/reference-manual/file-formats.html#xtc>`_.
|
||||
The precision used in XTC files can be adjusted via the
|
||||
:doc:`dump_modify <dump_modify>` command. The default value of 1000
|
||||
means that coordinates are stored to 1/1000 nanometer accuracy. XTC
|
||||
|
||||
@ -308,9 +308,9 @@ performed with dump style *xtc*\ .
|
||||
|
||||
----------
|
||||
|
||||
The *format* keyword can be used to change the default numeric format
|
||||
output by the text-based dump styles: *atom*\ , *custom*\ , *cfg*\ , and
|
||||
*xyz* styles, and their MPIIO variants. Only the *line* or *none*
|
||||
The *format* keyword can be used to change the default numeric format output
|
||||
by the text-based dump styles: *atom*\ , *local*\ , *custom*\ , *cfg*\ , and
|
||||
*xyz* styles, and their MPIIO variants. Only the *line* or *none*
|
||||
options can be used with the *atom* and *xyz* styles.
|
||||
|
||||
All the specified format strings are C-style formats, e.g. as used by
|
||||
@ -362,7 +362,7 @@ settings, reverting all values to their default format.
|
||||
|
||||
compute 1 all property/local batom1 batom2
|
||||
dump 1 all local 100 tmp.bonds index c_1[1] c_1[2]
|
||||
dump_modify 1 format "%d %0.0f %0.0f"
|
||||
dump_modify 1 format line "%d %0.0f %0.0f"
|
||||
|
||||
will output the two atom IDs for atoms in each bond as integers. If
|
||||
the dump_modify command were omitted, they would appear as
|
||||
|
||||
@ -189,6 +189,7 @@ accelerated styles exist.
|
||||
* :doc:`bond/react <fix_bond_react>` - apply topology changes to model reactions
|
||||
* :doc:`bond/swap <fix_bond_swap>` - Monte Carlo bond swapping
|
||||
* :doc:`box/relax <fix_box_relax>` - relax box size during energy minimization
|
||||
* :doc:`charge/regulation <fix_charge_regulation>` - Monte Carlo sampling of charge regulation
|
||||
* :doc:`client/md <fix_client_md>` - MD client for client/server simulations
|
||||
* :doc:`cmap <fix_cmap>` - enables CMAP cross-terms of the CHARMM force field
|
||||
* :doc:`colvars <fix_colvars>` - interface to the collective variables "Colvars" library
|
||||
@ -364,6 +365,8 @@ accelerated styles exist.
|
||||
* :doc:`temp/rescale <fix_temp_rescale>` - temperature control by velocity rescaling
|
||||
* :doc:`temp/rescale/eff <fix_temp_rescale_eff>` - temperature control by velocity rescaling in the electron force field model
|
||||
* :doc:`tfmc <fix_tfmc>` - perform force-bias Monte Carlo with time-stamped method
|
||||
* :doc:`tgnvt/drude <fix_tgnh_drude>` - NVT time integration for Drude polarizable model via temperature-grouped Nose-Hoover
|
||||
* :doc:`tgnpt/drude <fix_tgnh_drude>` - NPT time integration for Drude polarizable model via temperature-grouped Nose-Hoover
|
||||
* :doc:`thermal/conductivity <fix_thermal_conductivity>` - Muller-Plathe kinetic energy exchange for thermal conductivity calculation
|
||||
* :doc:`ti/spring <fix_ti_spring>` -
|
||||
* :doc:`tmd <fix_tmd>` - guide a group of atoms to a new configuration
|
||||
|
||||
@ -128,9 +128,9 @@ formulas for the meaning of these parameters:
|
||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||
| :doc:`born/coul/long, born/coul/msm <pair_born>` | coulombic_cutoff | type global |
|
||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
||||
| :doc:`buck, buck/coul/cut <pair_buck>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | coulombic_cutoff | type global |
|
||||
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | a,c,coulombic_cutoff | type pairs |
|
||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||
|
||||
@ -120,7 +120,7 @@ styles and their energy formulas for the meaning of these parameters:
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
||||
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||
|
||||
@ -118,32 +118,38 @@ converge properly.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential "energy" inferred by the added force to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
||||
needed so that the :doc:`minimize <minimize>` command can include the
|
||||
forces added by this fix in a consistent manner. I.e. there is a
|
||||
decrease in potential energy when atoms move in the direction of the
|
||||
added force.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy inferred by the added force to
|
||||
the global potential energy of the system as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify energy no <fix_modify>`. Note that this
|
||||
energy is a fictitious quantity but is needed so that the
|
||||
:doc:`minimize <minimize>` command can include the forces added by
|
||||
this fix in a consistent manner. I.e. there is a decrease in
|
||||
potential energy when atoms move in the direction of the added force.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the contribution due to the added forces on atoms to the
|
||||
system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The default is *virial no*
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||
this fix to add the contribution due to the added forces on atoms to
|
||||
both the global pressure and per-atom stress of the system via the
|
||||
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||
stress/atom <compute_stress_atom>` commands. The former can be
|
||||
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||
setting for this fix is :doc:`fix_modify virial no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||
integrator the fix is adding its forces. Default is the outermost
|
||||
level.
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||
<run_style>` integrator the fix is adding its forces. Default is the
|
||||
outermost level.
|
||||
|
||||
This fix computes a global scalar and a global 3-vector of forces,
|
||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
||||
The scalar is the potential energy discussed above. The vector is the
|
||||
total force on the group of atoms before the forces on individual
|
||||
atoms are changed by the fix. The scalar and vector values calculated
|
||||
by this fix are "extensive".
|
||||
which can be accessed by various :doc:`output commands
|
||||
<Howto_output>`. The scalar is the potential energy discussed above.
|
||||
The vector is the total force on the group of atoms before the forces
|
||||
on individual atoms are changed by the fix. The scalar and vector
|
||||
values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
@ -55,13 +55,15 @@ Restart, fix_modify, output, run start/stop, minimize info
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential "energy" inferred by the added forces to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
||||
needed so that the :doc:`minimize <minimize>` command can include the
|
||||
forces added by this fix in a consistent manner. I.e. there is a
|
||||
decrease in potential energy when atoms move in the direction of the
|
||||
added forces.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential "energy" inferred by the added torques
|
||||
to the global potential energy of the system as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify energy no <fix_modify>`. Note that this
|
||||
is a fictitious quantity but is needed so that the :doc:`minimize
|
||||
<minimize>` command can include the forces added by this fix in a
|
||||
consistent manner. I.e. there is a decrease in potential energy when
|
||||
atoms move in the direction of the added forces.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by
|
||||
this fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||
@ -78,16 +80,28 @@ No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
The forces due to this fix are imposed during an energy minimization,
|
||||
invoked by the :doc:`minimize <minimize>` command. You should not
|
||||
specify force components with a variable that has time-dependence for
|
||||
use with a minimizer, since the minimizer increments the timestep as
|
||||
the iteration count during the minimization.
|
||||
invoked by the :doc:`minimize <minimize>` command.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want the fictitious potential energy associated with the
|
||||
added forces to be included in the total potential energy of the
|
||||
system (the quantity being minimized), you MUST enable the
|
||||
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||
|
||||
.. note::
|
||||
|
||||
You should not specify force components with a variable that has
|
||||
time-dependence for use with a minimizer, since the minimizer
|
||||
increments the timestep as the iteration count during the
|
||||
minimization.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the USER-MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -122,10 +122,22 @@ Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. The :doc:`fix_modify <fix_modify>` options relevant to this
|
||||
fix are listed below. No global scalar or vector or per-atom quantities
|
||||
are stored by this fix for access by various :doc:`output commands
|
||||
<Howto_output>`. No parameter of this fix can be used with the
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is not supported by
|
||||
this fix, but this fix does add the kinetic energy imparted to atoms
|
||||
by the momentum coupling mode of the AtC package to the global
|
||||
potential energy of the system as part of :doc:`thermodynamic output
|
||||
<thermo_style>`.
|
||||
|
||||
Additional :doc:`fix_modify <fix_modify>` options relevant to this
|
||||
fix are listed below.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the energy
|
||||
discussed in the previous paragraph. The scalar value is "extensive".
|
||||
|
||||
No parameter of this fix can be used with the
|
||||
*start/stop* keywords of the :doc:`run <run>` command. This fix is not
|
||||
invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
@ -145,10 +157,10 @@ one, e.g. nve, nvt, etc. In addition, currently:
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
After specifying this fix in your input script, several other
|
||||
:doc:`fix_modify <fix_modify>` commands are used to setup the problem,
|
||||
e.g. define the finite element mesh and prescribe initial and boundary
|
||||
conditions.
|
||||
After specifying this fix in your input script, several
|
||||
:doc:`fix_modify AtC <fix_modify>` commands are used to setup the
|
||||
problem, e.g. define the finite element mesh and prescribe initial and
|
||||
boundary conditions. Each of these options has its own doc page.
|
||||
|
||||
*fix_modify* commands for setup:
|
||||
|
||||
@ -240,7 +252,8 @@ miscellaneous *fix_modify* commands:
|
||||
* :doc:`fix_modify AtC remove_species <atc_remove_species>`
|
||||
* :doc:`fix_modify AtC remove_molecule <atc_remove_molecule>`
|
||||
|
||||
Note: a set of example input files with the attendant material files are included in the ``examples/USER/atc`` folders.
|
||||
Note: a set of example input files with the attendant material files
|
||||
are included in the ``examples/USER/atc`` folders.
|
||||
|
||||
Default
|
||||
"""""""
|
||||
@ -252,30 +265,52 @@ For detailed exposition of the theory and algorithms please see:
|
||||
|
||||
.. _Wagner:
|
||||
|
||||
**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An atomistic-to-continuum coupling method for heat transfer in solids." Special Issue of Computer Methods and Applied Mechanics (2008) 197:3351.
|
||||
**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An
|
||||
atomistic-to-continuum coupling method for heat transfer in solids."
|
||||
Special Issue of Computer Methods and Applied Mechanics (2008)
|
||||
197:3351.
|
||||
|
||||
.. _Zimmeman2004:
|
||||
|
||||
**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004), 12:S319.
|
||||
**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE;
|
||||
Klein, PA; Bammann, DJ, "Calculation of stress in atomistic
|
||||
simulation." Special Issue of Modelling and Simulation in Materials
|
||||
Science and Engineering (2004), 12:S319.
|
||||
|
||||
.. _Zimmerman2010:
|
||||
|
||||
**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A material frame approach for evaluating continuum variables in atomistic simulations." Journal of Computational Physics (2010), 229:2364.
|
||||
**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A
|
||||
material frame approach for evaluating continuum variables in
|
||||
atomistic simulations." Journal of Computational Physics (2010),
|
||||
229:2364.
|
||||
|
||||
.. _Templeton2010:
|
||||
|
||||
**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application of a field-based method to spatially varying thermal transport problems in molecular dynamics." Modelling and Simulation in Materials Science and Engineering (2010), 18:085007.
|
||||
**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application
|
||||
of a field-based method to spatially varying thermal transport
|
||||
problems in molecular dynamics." Modelling and Simulation in
|
||||
Materials Science and Engineering (2010), 18:085007.
|
||||
|
||||
.. _Jones:
|
||||
|
||||
**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine, JA, "Electron transport enhanced molecular dynamics for metals and semi-metals." International Journal for Numerical Methods in Engineering (2010), 83:940.
|
||||
**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine,
|
||||
JA, "Electron transport enhanced molecular dynamics for metals and
|
||||
semi-metals." International Journal for Numerical Methods in
|
||||
Engineering (2010), 83:940.
|
||||
|
||||
.. _Templeton2011:
|
||||
|
||||
**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA; Wong, BM, "A long-range electric field solver for molecular dynamics based on atomistic-to-continuum modeling." Journal of Chemical Theory and Computation (2011), 7:1736.
|
||||
**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA;
|
||||
Wong, BM, "A long-range electric field solver for molecular dynamics
|
||||
based on atomistic-to-continuum modeling." Journal of Chemical Theory
|
||||
and Computation (2011), 7:1736.
|
||||
|
||||
.. _Mandadapu:
|
||||
|
||||
**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization as a field variable from molecular dynamics simulations." Journal of Chemical Physics (2013), 139:054115.
|
||||
**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization
|
||||
as a field variable from molecular dynamics simulations." Journal of
|
||||
Chemical Physics (2013), 139:054115.
|
||||
|
||||
Please refer to the standard finite element (FE) texts, e.g. T.J.R Hughes " The finite element method ", Dover 2003, for the basics of FE simulation.
|
||||
Please refer to the standard finite element (FE) texts, e.g. T.J.R
|
||||
Hughes " The finite element method ", Dover 2003, for the basics of FE
|
||||
simulation.
|
||||
|
||||
@ -307,7 +307,9 @@ atoms in the chunk. The averaged output value for the chunk on the
|
||||
average over atoms across the entire *Nfreq* timescale. For the
|
||||
*density/number* and *density/mass* values, the volume (bin volume or
|
||||
system volume) used in the final normalization will be the volume at
|
||||
the final *Nfreq* timestep.
|
||||
the final *Nfreq* timestep. For the *temp* values, degrees of freedom and
|
||||
kinetic energy are summed separately across the entire *Nfreq* timescale, and
|
||||
the output value is calculated by dividing those two sums.
|
||||
|
||||
If the *norm* setting is *sample*\ , the chunk value is summed over
|
||||
atoms for each sample, as is the count, and an "average sample value"
|
||||
|
||||
@ -93,7 +93,7 @@ from a compute, fix, or variable, then see the :doc:`fix ave/chunk <fix_ave_chun
|
||||
:doc:`fix ave/histo <fix_ave_histo>` commands. If you wish to convert a
|
||||
per-atom quantity into a single global value, see the :doc:`compute reduce <compute_reduce>` command.
|
||||
|
||||
The input values must either be all scalars. What kinds of
|
||||
The input values must be all scalars. What kinds of
|
||||
correlations between input values are calculated is determined by the
|
||||
*type* keyword as discussed below.
|
||||
|
||||
|
||||
@ -138,8 +138,8 @@ vector or columns of the array had been listed one by one. E.g. these
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute myCOM all com/chunk
|
||||
fix 1 all ave/histo 100 1 100 c_myCOM[*] file tmp1.com mode vector
|
||||
fix 2 all ave/histo 100 1 100 c_myCOM[1] c_myCOM[2] c_myCOM[3] file tmp2.com mode vector
|
||||
fix 1 all ave/histo 100 1 100 -10.0 10.0 100 c_myCOM[*] file tmp1.com mode vector
|
||||
fix 2 all ave/histo 100 1 100 -10.0 10.0 100 c_myCOM[1] c_myCOM[2] c_myCOM[3] file tmp2.com mode vector
|
||||
|
||||
If the fix ave/histo/weight command is used, exactly two values must
|
||||
be specified. If the values are vectors, they must be the same
|
||||
|
||||
@ -216,7 +216,7 @@ above. It changes the positions of cutting planes between processors
|
||||
in an iterative fashion, seeking to reduce the imbalance factor.
|
||||
|
||||
The *dimstr* argument is a string of characters, each of which must be
|
||||
an "x" or "y" or "z". Eacn character can appear zero or one time,
|
||||
an "x" or "y" or "z". Each character can appear zero or one time,
|
||||
since there is no advantage to balancing on a dimension more than
|
||||
once. You should normally only list dimensions where you expect there
|
||||
to be a density variation in the particles.
|
||||
|
||||
@ -75,6 +75,39 @@ Note that *V_avg* and *Coeff_i* should all be in the proper units, e.g. if you
|
||||
are using *units real*\ , *V_avg* should be in cubic angstroms, and the
|
||||
coefficients should all be in atmospheres \* cubic angstroms.
|
||||
|
||||
----------
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the cumulative global energy change to :doc:`binary
|
||||
restart files <restart>`. See the :doc:`read_restart <read_restart>`
|
||||
command for info on how to re-specify a fix in an input script that
|
||||
reads a restart file, so that the fix continues in an uninterrupted
|
||||
fashion.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *temp* option is supported by this
|
||||
fix. You can use it to assign a temperature :doc:`compute <compute>`
|
||||
you have defined to this fix which will be used in its thermostatting
|
||||
procedure, as described above. For consistency, the group used by
|
||||
this fix and by the compute should be the same.
|
||||
|
||||
The cumulative energy change in the system imposed by this fix is
|
||||
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||
doc page for details.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||
cumulative energy change due to this fix described in the previous
|
||||
paragraph. The scalar value calculated by this fix is "extensive".
|
||||
|
||||
This fix can ramp its target temperature over multiple runs, using the
|
||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||
:doc:`run <run>` command for details of how to do this.
|
||||
|
||||
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ Syntax
|
||||
* template-ID(post-reacted) = ID of a molecule template containing post-reaction topology
|
||||
* map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates
|
||||
* zero or more individual keyword/value pairs may be appended to each react argument
|
||||
* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges*
|
||||
* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* or *molecule* or *modify_create*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -59,6 +59,12 @@ Syntax
|
||||
off = allow both inter- and intramolecular reactions (default)
|
||||
inter = search for reactions between molecules with different IDs
|
||||
intra = search for reactions within the same molecule
|
||||
*modify_create* keyword values
|
||||
*fit* value = *all* or *fragmentID*
|
||||
all = use all eligible atoms for create-atoms fit (default)
|
||||
fragmentID = ID of molecule fragment used for create-atoms fit
|
||||
*overlap* value = R
|
||||
R = only insert atom/molecule if further than R from existing particles (distance units)
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -89,7 +95,9 @@ documentation. Topology changes are defined in pre- and post-reaction
|
||||
molecule templates and can include creation and deletion of bonds,
|
||||
angles, dihedrals, impropers, bond types, angle types, dihedral types,
|
||||
atom types, or atomic charges. In addition, reaction by-products or
|
||||
other molecules can be identified and deleted.
|
||||
other molecules can be identified and deleted. Finally, atoms can be
|
||||
created and inserted at specific positions relative to the reaction
|
||||
site.
|
||||
|
||||
Fix bond/react does not use quantum mechanical (eg. fix qmmm) or
|
||||
pairwise bond-order potential (eg. Tersoff or AIREBO) methods to
|
||||
@ -262,14 +270,14 @@ command page.
|
||||
|
||||
The post-reacted molecule template contains a sample of the reaction
|
||||
site and its surrounding topology after the reaction has occurred. It
|
||||
must contain the same number of atoms as the pre-reacted template. A
|
||||
one-to-one correspondence between the atom IDs in the pre- and
|
||||
post-reacted templates is specified in the map file as described
|
||||
below. Note that during a reaction, an atom, bond, etc. type may
|
||||
change to one that was previously not present in the simulation. These
|
||||
new types must also be defined during the setup of a given simulation.
|
||||
A discussion of correctly handling this is also provided on the
|
||||
:doc:`molecule <molecule>` command page.
|
||||
must contain the same number of atoms as the pre-reacted template
|
||||
(unless there are created atoms). A one-to-one correspondence between
|
||||
the atom IDs in the pre- and post-reacted templates is specified in
|
||||
the map file as described below. Note that during a reaction, an atom,
|
||||
bond, etc. type may change to one that was previously not present in
|
||||
the simulation. These new types must also be defined during the setup
|
||||
of a given simulation. A discussion of correctly handling this is also
|
||||
provided on the :doc:`molecule <molecule>` command page.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -283,7 +291,7 @@ A discussion of correctly handling this is also provided on the
|
||||
The map file is a text document with the following format:
|
||||
|
||||
A map file has a header and a body. The header of map file the
|
||||
contains one mandatory keyword and four optional keywords. The
|
||||
contains one mandatory keyword and five optional keywords. The
|
||||
mandatory keyword is 'equivalences':
|
||||
|
||||
.. parsed-literal::
|
||||
@ -296,11 +304,12 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and
|
||||
.. parsed-literal::
|
||||
|
||||
N *edgeIDs* = # of edge atoms N in the pre-reacted molecule template
|
||||
N *deleteIDs* = # of atoms N that are specified for deletion
|
||||
N *chiralIDs* = # of specified chiral centers N
|
||||
N *constraints* = # of specified reaction constraints N
|
||||
N *deleteIDs* = # of atoms N that are deleted
|
||||
N *createIDs* = # of atoms N that are created
|
||||
N *chiralIDs* = # of chiral centers N
|
||||
N *constraints* = # of reaction constraints N
|
||||
|
||||
The body of the map file contains two mandatory sections and four
|
||||
The body of the map file contains two mandatory sections and five
|
||||
optional sections. The first mandatory section begins with the keyword
|
||||
'InitiatorIDs' and lists the two atom IDs of the initiator atom pair
|
||||
in the pre-reacted molecule template. The second mandatory section
|
||||
@ -313,8 +322,10 @@ the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the
|
||||
pre-reacted molecule template. The second optional section begins with
|
||||
the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction
|
||||
template atoms to delete. The third optional section begins with the
|
||||
keyword 'CreateIDs' and lists the atom IDs of the post-reaction
|
||||
template atoms to create. The fourth optional section begins with the
|
||||
keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose
|
||||
handedness should be enforced. The fourth optional section begins with
|
||||
handedness should be enforced. The fifth optional section begins with
|
||||
the keyword 'Constraints' and lists additional criteria that must be
|
||||
satisfied in order for the reaction to occur. Currently, there are
|
||||
five types of constraints available, as discussed below: 'distance',
|
||||
@ -353,6 +364,38 @@ A sample map file is given below:
|
||||
|
||||
----------
|
||||
|
||||
A user-specified set of atoms can be deleted by listing their
|
||||
pre-reaction template IDs in the DeleteIDs section. A deleted atom
|
||||
must still be included in the post-reaction molecule template, in
|
||||
which it cannot be bonded to an atom that is not deleted. In addition
|
||||
to deleting unwanted reaction by-products, this feature can be used to
|
||||
remove specific topologies, such as small rings, that may be otherwise
|
||||
indistinguishable.
|
||||
|
||||
Atoms can be created by listing their post-reaction template IDs in
|
||||
the CreateIDs section. A created atom should not be included in the
|
||||
pre-reaction template. The inserted positions of created atoms are
|
||||
determined by the coordinates of the post-reaction template, after
|
||||
optimal translation and rotation of the post-reaction template to the
|
||||
reaction site (using a fit with atoms that are neither created nor
|
||||
deleted). The *modify_create* keyword can be used to modify the
|
||||
default behavior when creating atoms. The *modify_create* keyword has
|
||||
two sub-keywords, *fit* and *overlap*. One or more of the sub-keywords
|
||||
may be used after the *modify_create* keyword. The *fit* sub-keyword
|
||||
can be used to specify which post-reaction atoms are used for the
|
||||
optimal translation and rotation of the post-reaction template. The
|
||||
*fragmentID* value of the *fit* sub-keyword must be the name of a
|
||||
molecule fragment defined in the post-reaction :doc:`molecule
|
||||
<molecule>` template, and only atoms in this fragment are used for the
|
||||
fit. Atoms are created only if no current atom in the simulation is
|
||||
within a distance R of any created atom, including the effect of
|
||||
periodic boundary conditions if applicable. R is defined by the
|
||||
*overlap* sub-keyword. Note that the default value for R is 0.0, which
|
||||
will allow atoms to strongly overlap if you are inserting where other
|
||||
atoms are present. The velocity of each created atom is initialized in
|
||||
a random direction with a magnitude calculated from the instantaneous
|
||||
temperature of the reaction site.
|
||||
|
||||
The handedness of atoms that are chiral centers can be enforced by
|
||||
listing their IDs in the ChiralIDs section. A chiral atom must be
|
||||
bonded to four atoms with mutually different atom types. This feature
|
||||
@ -457,6 +500,23 @@ example, the molecule fragment could consist of only the backbone
|
||||
atoms of a polymer chain. This constraint can be used to enforce a
|
||||
specific relative position and orientation between reacting molecules.
|
||||
|
||||
By default, all constraints must be satisfied for the reaction to
|
||||
occur. In other words, constraints are evaluated as a series of
|
||||
logical values using the logical AND operator "&&". More complex logic
|
||||
can be achieved by explicitly adding the logical AND operator "&&" or
|
||||
the logical OR operator "||" after a given constraint command. If a
|
||||
logical operator is specified after a constraint, it must be placed
|
||||
after all constraint parameters, on the same line as the constraint
|
||||
(one per line). Similarly, parentheses can be used to group
|
||||
constraints. The expression that results from concatenating all
|
||||
constraints should be a valid logical expression that can be read by
|
||||
the :doc:`variable <variable>` command after converting each
|
||||
constraint to a logical value. Because exactly one constraint is
|
||||
allowed per line, having a valid logical expression implies that left
|
||||
parentheses "(" should only appear before a constraint, and right
|
||||
parentheses ")" should only appear after a constraint and before any
|
||||
logical operator.
|
||||
|
||||
Once a reaction site has been successfully identified, data structures
|
||||
within LAMMPS that store bond topology are updated to reflect the
|
||||
post-reacted molecule template. All force fields with fixed bonds,
|
||||
@ -511,15 +571,6 @@ the same molecule ID are considered for the reaction.
|
||||
|
||||
A few other considerations:
|
||||
|
||||
Many reactions result in one or more atoms that are considered
|
||||
unwanted by-products. Therefore, bond/react provides the option to
|
||||
delete a user-specified set of atoms. These pre-reaction atoms are
|
||||
identified in the map file. A deleted atom must still be included in
|
||||
the post-reaction molecule template, in which it cannot be bonded to
|
||||
an atom that is not deleted. In addition to deleting unwanted reaction
|
||||
by-products, this feature can be used to remove specific topologies,
|
||||
such as small rings, that may be otherwise indistinguishable.
|
||||
|
||||
Optionally, you can enforce additional behaviors on reacting atoms.
|
||||
For example, it may be beneficial to force reacting atoms to remain at
|
||||
a certain temperature. For this, you can use the internally-created
|
||||
@ -593,14 +644,14 @@ Default
|
||||
"""""""
|
||||
|
||||
The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60,
|
||||
reset_mol_ids = yes, custom_charges = no, molecule = off
|
||||
reset_mol_ids = yes, custom_charges = no, molecule = off, modify_create = no
|
||||
|
||||
----------
|
||||
|
||||
.. _Gissinger:
|
||||
|
||||
**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211 (2017).
|
||||
**(Gissinger2017)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017).
|
||||
|
||||
.. _Gissinger2020:
|
||||
|
||||
**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules (2020, in press).
|
||||
**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020).
|
||||
|
||||
276
doc/src/fix_charge_regulation.rst
Normal file
276
doc/src/fix_charge_regulation.rst
Normal file
@ -0,0 +1,276 @@
|
||||
|
||||
.. index:: fix charge/regulation
|
||||
|
||||
fix charge/regulation command
|
||||
=============================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID charge/regulation cation_type anion_type keyword value(s)
|
||||
|
||||
* ID, group-ID are documented in fix command
|
||||
* charge/regulation = style name of this fix command
|
||||
* cation_type = atom type of free cations
|
||||
* anion_type = atom type of free anions
|
||||
|
||||
* zero or more keyword/value pairs may be appended
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
keyword = *pH*, *pKa*, *pKb*, *pIp*, *pIm*, *pKs*, *acid_type*, *base_type*, *lunit_nm*, *temp*, *tempfixid*, *nevery*, *nmc*, *xrd*, *seed*, *tag*, *group*, *onlysalt*, *pmcmoves*
|
||||
*pH* value = pH of the solution
|
||||
*pKa* value = acid dissociation constant
|
||||
*pKb* value = base dissociation constant
|
||||
*pIp* value = chemical potential of free cations
|
||||
*pIm* value = chemical potential of free anions
|
||||
*pKs* value = solution self-dissociation constant
|
||||
*acid_type* = atom type of acid groups
|
||||
*base_type* = atom type of base groups
|
||||
*lunit_nm* value = unit length used by LAMMPS (# in the units of nanometers)
|
||||
*temp* value = temperature
|
||||
*tempfixid* value = fix ID of temperature thermostat
|
||||
*nevery* value = invoke this fix every nevery steps
|
||||
*nmc* value = number of charge regulation MC moves to attempt every nevery steps
|
||||
*xrd* value = cutoff distance for acid/base reaction
|
||||
*seed* value = random # seed (positive integer)
|
||||
*tag* value = yes or no (yes: The code assign unique tags to inserted ions; no: The tag of all inserted ions is "0")
|
||||
*group* value = group-ID, inserted ions are assigned to group group-ID. Can be used multiple times to assign inserted ions to multiple groups.
|
||||
*onlysalt* values = flag charge_cation charge_anion.
|
||||
flag = yes or no (yes: the fix performs only ion insertion/deletion, no: perform acid/base dissociation and ion insertion/deletion)
|
||||
charge_cation, charge_anion = value of cation/anion charge, must be an integer (only specify if flag = yes)
|
||||
*pmcmoves* values = pmcA pmcB pmcI - MC move fractions for acid ionization (pmcA), base ionization (pmcB) and free ion exchange (pmcI)
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix chareg all charge/regulation 1 2 acid_type 3 base_type 4 pKa 5 pKb 7 lb 1.0 nevery 200 nexchange 200 seed 123 tempfixid fT
|
||||
|
||||
fix chareg all charge/regulation 1 2 pIp 3 pIm 3 onlysalt yes 2 -1 seed 123 tag yes temp 1.0
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
This fix performs Monte Carlo (MC) sampling of charge regulation and
|
||||
exchange of ions with a reservoir as discussed in :ref:`(Curk1) <Curk1>`
|
||||
and :ref:`(Curk2) <Curk2>`. The implemented method is largely analogous
|
||||
to the grand-reaction ensemble method in :ref:`(Landsgesell)
|
||||
<Landsgesell>`. The implementation is parallelized, compatible with
|
||||
existing LAMMPS functionalities, and applicable to any system utilizing
|
||||
discrete, ionizable groups or surface sites.
|
||||
|
||||
Specifically, the fix implements the following three types of MC moves,
|
||||
which discretely change the charge state of individual particles and
|
||||
insert ions into the systems: :math:`\mathrm{A} \rightleftharpoons
|
||||
\mathrm{A}^-+\mathrm{X}^+`, :math:`\mathrm{B} \rightleftharpoons
|
||||
\mathrm{B}^++\mathrm{X}^-`, and :math:`\emptyset \rightleftharpoons
|
||||
Z^-\mathrm{X}^{Z^+}+Z^+\mathrm{X}^{-Z^-}`. In the former two types of
|
||||
reactions, Monte Carlo moves alter the charge value of specific atoms
|
||||
(:math:`\mathrm{A}`, :math:`\mathrm{B}`) and simultaneously insert a
|
||||
counterion to preserve the charge neutrality of the system, modeling the
|
||||
dissociation/association process. The last type of reaction performs
|
||||
grand canonical MC exchange of ion pairs with a (fictitious) reservoir.
|
||||
|
||||
In our implementation "acid" refers to particles that can attain charge
|
||||
:math:`q=\{0,-1\}` and "base" to particles with :math:`q=\{0,1\}`,
|
||||
whereas the MC exchange of free ions allows any integer charge values of
|
||||
:math:`{Z^+}` and :math:`{Z^-}`.
|
||||
|
||||
Here we provide several practical examples for modeling charge
|
||||
regulation effects in solvated systems. An acid ionization reaction
|
||||
(:math:`\mathrm{A} \rightleftharpoons \mathrm{A}^-+\mathrm{H}^+`) can be
|
||||
defined via a single line in the input file
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix acid_reaction all charge/regulation 2 3 acid_type 1 pH 7.0 pKa 5.0 pIp 7.0 pIm 7.0
|
||||
|
||||
where the fix attempts to charge :math:`\mathrm{A}` (discharge
|
||||
:math:`\mathrm{A}^-`) to :math:`\mathrm{A}^-` (:math:`\mathrm{A}`) and
|
||||
insert (delete) a proton (atom type 2). Besides, the fix implements
|
||||
self-ionization reaction of water :math:`\emptyset \rightleftharpoons
|
||||
\mathrm{H}^++\mathrm{OH}^-`. However, this approach is highly
|
||||
inefficient at :math:`\mathrm{pH} \approx 7` when the concentration of
|
||||
both protons and hydroxyl ions is low, resulting in a relatively low
|
||||
acceptance rate of MC moves.
|
||||
|
||||
A more efficient way is to allow salt ions to participate in ionization
|
||||
reactions, which can be easily achieved via
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix acid_reaction all charge/regulation 4 5 acid_type 1 pH 7.0 pKa 5.0 pIp 2.0 pIm 2.0
|
||||
|
||||
where particles of atom type 4 and 5 are the salt cations and anions,
|
||||
both at chemical potential pI=2.0, see :ref:`(Curk1) <Curk1>` and
|
||||
:ref:`(Landsgesell) <Landsgesell>` for more details.
|
||||
|
||||
|
||||
Similarly, we could have simultaneously added a base ionization reaction
|
||||
(:math:`\mathrm{B} \rightleftharpoons \mathrm{B}^++\mathrm{OH}^-`)
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix base_reaction all charge/regulation 2 3 base_type 6 pH 7.0 pKb 6.0 pIp 7.0 pIm 7.0
|
||||
|
||||
where the fix will attempt to charge :math:`\mathrm{B}` (discharge
|
||||
:math:`\mathrm{B}^+`) to :math:`\mathrm{B}^+` (:math:`\mathrm{B}`) and
|
||||
insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3. If
|
||||
neither the acid or the base type is specified, for example,
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix salt_reaction all charge/regulation 4 5 pIp 2.0 pIm 2.0
|
||||
|
||||
the fix simply inserts or deletes an ion pair of a free cation (atom
|
||||
type 4) and a free anion (atom type 5) as done in a conventional
|
||||
grand-canonical MC simulation.
|
||||
|
||||
|
||||
The fix is compatible with LAMMPS sub-packages such as *molecule* or
|
||||
*rigid*. That said, the acid and base particles can be part of larger
|
||||
molecules or rigid bodies. Free ions that are inserted to or deleted
|
||||
from the system must be defined as single particles (no bonded
|
||||
interactions allowed) and cannot be part of larger molecules or rigid
|
||||
bodies. If *molecule* package is used, all inserted ions have a molecule
|
||||
ID equal to zero.
|
||||
|
||||
Note that LAMMPS implicitly assumes a constant number of particles
|
||||
(degrees of freedom). Since using this fix alters the total number of
|
||||
particles during the simulation, any thermostat used by LAMMPS, such as
|
||||
NVT or Langevin, must use a dynamic calculation of system
|
||||
temperature. This can be achieved by specifying a dynamic temperature
|
||||
compute (e.g. dtemp) and using it with the desired thermostat, e.g. a
|
||||
Langevin thermostat:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute dtemp all temp
|
||||
compute_modify dtemp dynamic yes
|
||||
fix fT all langevin 1.0 1.0 1.0 123
|
||||
fix_modify fT temp dtemp
|
||||
|
||||
The chemical potential units (e.g. pH) are in the standard log10
|
||||
representation assuming reference concentration :math:`\rho_0 =
|
||||
\mathrm{mol}/\mathrm{l}`. Therefore, to perform the internal unit
|
||||
conversion, the length (in nanometers) of the LAMMPS unit length must be
|
||||
specified via *lunit_nm* (default is set to the Bjerrum length in water
|
||||
at room temperature *lunit_nm* = 0.71nm). For example, in the dilute
|
||||
ideal solution limit, the concentration of free ions will be
|
||||
:math:`c_\mathrm{I} = 10^{-\mathrm{pIp}}\mathrm{mol}/\mathrm{l}`.
|
||||
|
||||
The temperature used in MC acceptance probability is set by *temp*. This
|
||||
temperature should be the same as the temperature set by the molecular
|
||||
dynamics thermostat. For most purposes, it is probably best to use
|
||||
*tempfixid* keyword which dynamically sets the temperature equal to the
|
||||
chosen MD thermostat temperature, in the example above we assumed the
|
||||
thermostat fix-ID is *fT*. The inserted particles attain a random
|
||||
velocity corresponding to the specified temperature. Using *tempfixid*
|
||||
overrides any fixed temperature set by *temp*.
|
||||
|
||||
The *xrd* keyword can be used to restrict the inserted/deleted
|
||||
counterions to a specific radial distance from an acid or base particle
|
||||
that is currently participating in a reaction. This can be used to
|
||||
simulate more realist reaction dynamics. If *xrd* = 0 or *xrd* > *L* /
|
||||
2, where *L* is the smallest box dimension, the radial restriction is
|
||||
automatically turned off and free ion can be inserted or deleted
|
||||
anywhere in the simulation box.
|
||||
|
||||
If the *tag yes* is used, every inserted atom gets a unique tag ID,
|
||||
otherwise, the tag of every inserted atom is set to 0. *tag yes* might
|
||||
cause an integer overflow in very long simulations since the tags are
|
||||
unique to every particle and thus increase with every successful
|
||||
particle insertion.
|
||||
|
||||
The *pmcmoves* keyword sets the relative probability of attempting the
|
||||
three types of MC moves (reactions): acid charging, base charging, and
|
||||
ion pair exchange. The fix only attempts to perform particle charging
|
||||
MC moves if *acid_type* or *base_type* is defined. Otherwise fix only
|
||||
performs free ion insertion/deletion. For example, if *acid_type* is not
|
||||
defined, *pmcA* is automatically set to 0. The vector *pmcmoves* is
|
||||
automatically normalized, for example, if set to *pmcmoves* 0 0.33 0.33,
|
||||
the vector would be normalized to [0,0.5,0.5].
|
||||
|
||||
The *only_salt* option can be used to perform multivalent
|
||||
grand-canonical ion-exchange moves. If *only_salt yes* is used, no
|
||||
charge exchange is performed, only ion insertion/deletion (*pmcmoves* is
|
||||
set to [0,0,1]), but ions can be multivalent. In the example above, an
|
||||
MC move would consist of three ion insertion/deletion to preserve the
|
||||
charge neutrality of the system.
|
||||
|
||||
The *group* keyword can be used to add inserted particles to a specific
|
||||
group-ID. All inserted particles are automatically added to group *all*.
|
||||
|
||||
|
||||
Output
|
||||
""""""
|
||||
|
||||
This fix computes a global vector of length 8, which can be accessed by
|
||||
various output commands. The vector values are the following global
|
||||
quantities:
|
||||
|
||||
* 1 = cumulative MC attempts
|
||||
* 2 = cumulative MC successes
|
||||
* 3 = current # of neutral acid atoms
|
||||
* 4 = current # of -1 charged acid atoms
|
||||
* 5 = current # of neutral base atoms
|
||||
* 6 = current # of +1 charged base atoms
|
||||
* 7 = current # of free cations
|
||||
* 8 = current # of free anions
|
||||
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the MC package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
The :doc:`atom_style <atom_style>`, used must contain the charge
|
||||
property, for example, the style could be *charge* or *full*. Only
|
||||
usable for 3D simulations. Atoms specified as free ions cannot be part
|
||||
of rigid bodies or molecules and cannot have bonding interactions. The
|
||||
scheme is limited to integer charges, any atoms with non-integer charges
|
||||
will not be considered by the fix.
|
||||
|
||||
All interaction potentials used must be continuous, otherwise the MD
|
||||
integration and the particle exchange MC moves do not correspond to the
|
||||
same equilibrium ensemble. For example, if an lj/cut pair style is used,
|
||||
the LJ potential must be shifted so that it vanishes at the cutoff. This
|
||||
can be easily achieved using the :doc:`pair_modify <pair_modify>`
|
||||
command, i.e., by using: *pair_modify shift yes*.
|
||||
|
||||
.. note::
|
||||
|
||||
Region restrictions are not yet implemented.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`fix gcmc <fix_gcmc>`,
|
||||
:doc:`fix atom/swap <fix_atom_swap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
pH = 7.0; pKa = 100.0; pKb = 100.0; pIp = 5.0; pIm = 5.0; pKs = 14.0;
|
||||
acid_type = -1; base_type = -1; lunit_nm = 0.71; temp = 1.0; nevery =
|
||||
100; nmc = 100; xrd = 0; seed = 0; tag = no; onlysalt = no, pmcmoves =
|
||||
[1/3, 1/3, 1/3], group-ID = all
|
||||
|
||||
----------
|
||||
|
||||
.. _Curk1:
|
||||
|
||||
**(Curk1)** T. Curk, J. Yuan, and E. Luijten, "Coarse-grained simulation of charge regulation using LAMMPS", preprint (2021).
|
||||
|
||||
.. _Curk2:
|
||||
|
||||
**(Curk2)** T. Curk and E. Luijten, "Charge-regulation effects in nanoparticle self-assembly", PRL (2021)
|
||||
|
||||
.. _Landsgesell:
|
||||
|
||||
**(Landsgesell)** J. Landsgesell, P. Hebbeker, O. Rud, R. Lunkad, P. Kosovan, and C. Holm, "Grand-reaction method for simulations of ionization equilibria coupled to ion partitioning", Macromolecules 53, 3007-3020 (2020).
|
||||
@ -47,14 +47,15 @@ for running *ab initio* MD with quantum forces.
|
||||
The group associated with this fix is ignored.
|
||||
|
||||
The protocol and :doc:`units <units>` for message format and content
|
||||
that LAMMPS exchanges with the server code is defined on the :doc:`server md <server_md>` doc page.
|
||||
that LAMMPS exchanges with the server code is defined on the
|
||||
:doc:`server md <server_md>` doc page.
|
||||
|
||||
Note that when using LAMMPS as an MD client, your LAMMPS input script
|
||||
should not normally contain force field commands, like a
|
||||
:doc:`pair_style <pair_style>`, :doc:`bond_style <bond_style>`, or
|
||||
:doc:`kspace_style <kspace_style>` command. However it is possible for
|
||||
a server code to only compute a portion of the full force-field, while
|
||||
LAMMPS computes the remaining part. Your LAMMPS script can also
|
||||
:doc:`kspace_style <kspace_style>` command. However it is possible
|
||||
for a server code to only compute a portion of the full force-field,
|
||||
while LAMMPS computes the remaining part. Your LAMMPS script can also
|
||||
specify boundary conditions or force constraints in the usual way,
|
||||
which will be added to the per-atom forces returned by the server
|
||||
code.
|
||||
@ -69,16 +70,21 @@ LAMMPS and another code in tandem to perform a coupled simulation.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential energy computed by the server application to
|
||||
the system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy set by the server application to
|
||||
the global potential energy of the system as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify energy yes <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the server application's contribution to the system's
|
||||
virial as part of :doc:`thermodynamic output <thermo_style>`. The
|
||||
default is *virial yes*
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||
this fix to add the contribution computed by the server application to
|
||||
the global pressure of the system via the :doc:`compute pressure
|
||||
<compute_pressure>` command. This can be accessed by
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||
@ -86,13 +92,16 @@ energy discussed above. The scalar value calculated by this fix is
|
||||
"extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the MESSAGE package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
A script that uses this command must also use the
|
||||
:doc:`message <message>` command to setup and shut down the messaging
|
||||
|
||||
@ -29,11 +29,12 @@ Description
|
||||
This command enables CMAP cross-terms to be added to simulations which
|
||||
use the CHARMM force field. These are relevant for any CHARMM model
|
||||
of a peptide or protein sequences that is 3 or more amino-acid
|
||||
residues long; see :ref:`(Buck) <Buck>` and :ref:`(Brooks) <Brooks2>` for details,
|
||||
including the analytic energy expressions for CMAP interactions. The
|
||||
CMAP cross-terms add additional potential energy contributions to pairs
|
||||
of overlapping phi-psi dihedrals of amino-acids, which are important
|
||||
to properly represent their conformational behavior.
|
||||
residues long; see :ref:`(Buck) <Buck>` and :ref:`(Brooks) <Brooks2>`
|
||||
for details, including the analytic energy expressions for CMAP
|
||||
interactions. The CMAP cross-terms add additional potential energy
|
||||
contributions to pairs of overlapping phi-psi dihedrals of
|
||||
amino-acids, which are important to properly represent their
|
||||
conformational behavior.
|
||||
|
||||
The examples/cmap directory has a sample input script and data file
|
||||
for a small peptide, that illustrates use of the fix cmap command.
|
||||
@ -93,19 +94,27 @@ the note below about how to include the CMAP energy when performing an
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the list of CMAP cross-terms to :doc:`binary restart files <restart>`. See the :doc:`read_restart <read_restart>` command
|
||||
This fix writes the list of CMAP cross-terms to :doc:`binary restart
|
||||
files <restart>`. See the :doc:`read_restart <read_restart>` command
|
||||
for info on how to re-specify a fix in an input script that reads a
|
||||
restart file, so that the operation of the fix continues in an
|
||||
uninterrupted fashion.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential "energy" of the CMAP interactions system's
|
||||
potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy of the CMAP interactions to both
|
||||
the global potential energy and peratom potential energies of the
|
||||
system as part of :doc:`thermodynamic output <thermo_style>` or
|
||||
output by the :doc:`compute pe/atom <compute_pe_atom>` command. The
|
||||
default setting for this fix is :doc:`fix_modify energy yes
|
||||
<fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the contribution due to the interaction between atoms to
|
||||
the system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The default is *virial yes*
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||
this fix to add the contribution due to the CMAP interactions to both
|
||||
the global pressure and per-atom stress of the system via the
|
||||
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||
stress/atom <compute_stress_atom>` commands. The former can be
|
||||
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||
setting for this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||
@ -118,11 +127,16 @@ the :doc:`run <run>` command.
|
||||
The forces due to this fix are imposed during an energy minimization,
|
||||
invoked by the :doc:`minimize <minimize>` command.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||
<run_style>` integrator the fix is adding its forces. Default is the
|
||||
outermost level.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want the potential energy associated with the CMAP terms
|
||||
forces to be included in the total potential energy of the system (the
|
||||
quantity being minimized), you MUST enable the
|
||||
forces to be included in the total potential energy of the system
|
||||
(the quantity being minimized), you MUST not disable the
|
||||
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||
|
||||
Restrictions
|
||||
|
||||
@ -35,12 +35,12 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
This fix interfaces LAMMPS to the collective variables "Colvars"
|
||||
library, which allows to calculate potentials of mean force
|
||||
(PMFs) for any set of colvars, using different sampling methods:
|
||||
currently implemented are the Adaptive Biasing Force (ABF) method,
|
||||
metadynamics, Steered Molecular Dynamics (SMD) and Umbrella Sampling
|
||||
(US) via a flexible harmonic restraint bias.
|
||||
This fix interfaces LAMMPS to the collective variables (Colvars)
|
||||
library, which allows to calculate potentials of mean force (PMFs) for
|
||||
any set of colvars, using different sampling methods: currently
|
||||
implemented are the Adaptive Biasing Force (ABF) method, metadynamics,
|
||||
Steered Molecular Dynamics (SMD) and Umbrella Sampling (US) via a
|
||||
flexible harmonic restraint bias.
|
||||
|
||||
This documentation describes only the fix colvars command itself and
|
||||
LAMMPS specific parts of the code. The full documentation of the
|
||||
@ -98,9 +98,11 @@ This fix writes the current status of the colvars module into
|
||||
mode status file that is written by the colvars module itself and the
|
||||
kind of information in both files is identical.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the energy change from the biasing force added by the fix
|
||||
to the system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the energy change from the biasing force added by
|
||||
Colvars to the global potential energy of the system as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||
|
||||
The *fix_modify configfile <config file>* option allows to add settings
|
||||
from an additional config file to the colvars module. This option can
|
||||
@ -113,15 +115,16 @@ in a pair of double quotes ("), or can span multiple lines when bracketed
|
||||
by a pair of triple double quotes (""", like python embedded documentation).
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
||||
energy change due to this fix. The scalar value calculated by this
|
||||
fix is "extensive".
|
||||
:doc:`output commands <Howto_output>`. The scalar is the Colvars
|
||||
energy mentioned above. The scalar value calculated by this fix is
|
||||
"extensive".
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the USER-COLVARS package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
There can only be one colvars fix active at a time. Since the interface
|
||||
communicates only the minimum amount of information and colvars module
|
||||
|
||||
@ -41,12 +41,12 @@ Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix should be invoked before any other commands that implement
|
||||
the Drude oscillator model, such as :doc:`fix langevin/drude <fix_langevin_drude>`, :doc:`fix drude/transform <fix_drude_transform>`, :doc:`compute temp/drude <compute_temp_drude>`, :doc:`pair_style thole <pair_thole>`.
|
||||
the Drude oscillator model, such as :doc:`fix langevin/drude <fix_langevin_drude>`, :doc:`fix tgnvt/drude <fix_tgnh_drude>`, :doc:`fix drude/transform <fix_drude_transform>`, :doc:`compute temp/drude <compute_temp_drude>`, :doc:`pair_style thole <pair_thole>`.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`fix langevin/drude <fix_langevin_drude>`, :doc:`fix drude/transform <fix_drude_transform>`, :doc:`compute temp/drude <compute_temp_drude>`, :doc:`pair_style thole <pair_thole>`
|
||||
:doc:`fix langevin/drude <fix_langevin_drude>`, :doc:`fix tgnvt/drude <fix_tgnh_drude>`, :doc:`fix drude/transform <fix_drude_transform>`, :doc:`compute temp/drude <compute_temp_drude>`, :doc:`pair_style thole <pair_thole>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -100,9 +100,9 @@ minimize the orientation of dipoles in an applied electric field.
|
||||
|
||||
The *energy* keyword specifies the name of an atom-style
|
||||
:doc:`variable <variable>` which is used to compute the energy of each
|
||||
atom as function of its position. Like variables used for *ex*\ , *ey*\ ,
|
||||
*ez*\ , the energy variable is specified as v_name, where name is the
|
||||
variable name.
|
||||
atom as function of its position. Like variables used for *ex*\ ,
|
||||
*ey*\ , *ez*\ , the energy variable is specified as v_name, where name
|
||||
is the variable name.
|
||||
|
||||
Note that when the *energy* keyword is used during an energy
|
||||
minimization, you must insure that the formula defined for the
|
||||
@ -117,31 +117,38 @@ minimization will not converge properly.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential "energy" inferred by the added force due to
|
||||
the electric field to the system's potential energy as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. This is a fictitious
|
||||
quantity but is needed so that the :doc:`minimize <minimize>` command
|
||||
can include the forces added by this fix in a consistent manner.
|
||||
I.e. there is a decrease in potential energy when atoms move in the
|
||||
direction of the added force due to the electric field.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy inferred by the added force due
|
||||
to the electric field to the global potential energy of the system as
|
||||
part of :doc:`thermodynamic output <thermo_style>`. The default
|
||||
setting for this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||
Note that this energy is a fictitious quantity but is needed so that
|
||||
the :doc:`minimize <minimize>` command can include the forces added by
|
||||
this fix in a consistent manner. I.e. there is a decrease in
|
||||
potential energy when atoms move in the direction of the added force
|
||||
due to the electric field.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the contribution due to the added forces on atoms to the
|
||||
system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The default is *virial no*
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||
this fix to add the contribution due to the added forces on atoms to
|
||||
both the global pressure and per-atom stress of the system via the
|
||||
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||
stress/atom <compute_stress_atom>` commands. The former can be
|
||||
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||
setting for this fix is :doc:`fix_modify virial no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||
integrator the fix adding its forces. Default is the outermost level.
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||
<run_style>` integrator the fix adding its forces. Default is the
|
||||
outermost level.
|
||||
|
||||
This fix computes a global scalar and a global 3-vector of forces,
|
||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
||||
The scalar is the potential energy discussed above. The vector is the
|
||||
total force added to the group of atoms. The scalar and vector values
|
||||
calculated by this fix are "extensive".
|
||||
which can be accessed by various :doc:`output commands
|
||||
<Howto_output>`. The scalar is the potential energy discussed above.
|
||||
The vector is the total force added to the group of atoms. The scalar
|
||||
and vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
@ -84,7 +84,8 @@ code `Quest <quest_>`_.
|
||||
|
||||
If mode is *pf/array* then the fix simply stores force values in an
|
||||
array. The fix adds these forces to each atom in the group, once
|
||||
every *Napply* steps, similar to the way the :doc:`fix addforce <fix_addforce>` command works.
|
||||
every *Napply* steps, similar to the way the :doc:`fix addforce
|
||||
<fix_addforce>` command works.
|
||||
|
||||
The name of the public force array provided by the FixExternal
|
||||
class is
|
||||
@ -150,19 +151,27 @@ of properties that the caller code may want to communicate to LAMMPS
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the potential "energy" set by the external driver to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
||||
needed so that the :doc:`minimize <minimize>` command can include the
|
||||
forces added by this fix in a consistent manner. I.e. there is a
|
||||
decrease in potential energy when atoms move in the direction of the
|
||||
added force.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy set by the external driver to
|
||||
both the global potential energy and peratom potential energies of the
|
||||
system as part of :doc:`thermodynamic output <thermo_style>` or output
|
||||
by the :doc:`compute pe/atom <compute_pe_atom>` command. The default
|
||||
setting for this fix is :doc:`fix_modify energy yes <fix_modify>`.
|
||||
Note that this energy may be a fictitious quantity but it is needed so
|
||||
that the :doc:`minimize <minimize>` command can include the forces
|
||||
added by this fix in a consistent manner. I.e. there is a decrease in
|
||||
potential energy when atoms move in the direction of the added force.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
||||
fix to add the contribution due to the interactions computed by the
|
||||
external program to the system's virial as part of :doc:`thermodynamic output <thermo_style>`. The default is *virial yes*
|
||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||
this fix to add the contribution computed by the external program to
|
||||
both the global pressure and per-atom stress of the system via the
|
||||
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||
stress/atom <compute_stress_atom>` commands. The former can be
|
||||
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||
setting for this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||
@ -178,7 +187,7 @@ invoked by the :doc:`minimize <minimize>` command.
|
||||
|
||||
If you want the fictitious potential energy associated with the
|
||||
added forces to be included in the total potential energy of the
|
||||
system (the quantity being minimized), you MUST enable the
|
||||
system (the quantity being minimized), you MUST not disable the
|
||||
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||
|
||||
Restrictions
|
||||
|
||||
@ -76,28 +76,31 @@ Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The instantaneous values of the extended variables are written to
|
||||
:doc:`binary restart files <restart>`. Because the state of the random
|
||||
number generator is not saved in restart files, this means you cannot
|
||||
do "exact" restarts with this fix, where the simulation continues on
|
||||
the same as if no restart had taken place. However, in a statistical
|
||||
sense, a restarted simulation should produce the same behavior.
|
||||
Note however that you should use a different seed each time you
|
||||
restart, otherwise the same sequence of random numbers will be used
|
||||
each time, which might lead to stochastic synchronization and
|
||||
:doc:`binary restart files <restart>`. Because the state of the
|
||||
random number generator is not saved in restart files, this means you
|
||||
cannot do "exact" restarts with this fix, where the simulation
|
||||
continues on the same as if no restart had taken place. However, in a
|
||||
statistical sense, a restarted simulation should produce the same
|
||||
behavior. Note however that you should use a different seed each time
|
||||
you restart, otherwise the same sequence of random numbers will be
|
||||
used each time, which might lead to stochastic synchronization and
|
||||
subtle artifacts in the sampling.
|
||||
|
||||
The cumulative energy change in the system imposed by this fix is
|
||||
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||
doc page for details.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||
cumulative energy change due to this fix described in the previous
|
||||
paragraph. The scalar value calculated by this fix is "extensive".
|
||||
|
||||
This fix can ramp its target temperature over multiple runs, using the
|
||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||
:doc:`run <run>` command for details of how to do this.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the energy change induced by Langevin thermostatting to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
||||
energy change due to this fix. The scalar value calculated by this
|
||||
fix is "extensive".
|
||||
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -55,17 +55,22 @@ momentum.
|
||||
GD applies an external fluctuating gravitational field that acts as a
|
||||
driving force to keep the system away from equilibrium. To maintain
|
||||
steady state, a profile-unbiased thermostat must be implemented to
|
||||
dissipate the heat that is added by the driving force. :doc:`Compute temp/profile <compute_temp_profile>` can be used to implement a
|
||||
dissipate the heat that is added by the driving force. :doc:`Compute
|
||||
temp/profile <compute_temp_profile>` can be used to implement a
|
||||
profile-unbiased thermostat.
|
||||
|
||||
A common use of this fix is to compute a pressure drop across a pipe,
|
||||
pore, or membrane. The pressure profile can be computed in LAMMPS with
|
||||
:doc:`compute stress/atom <compute_stress_atom>` and :doc:`fix ave/chunk <fix_ave_chunk>`, or with the hardy method in :doc:`fix atc <fix_atc>`. Note that the simple :doc:`compute stress/atom <compute_stress_atom>` method is only accurate away
|
||||
from inhomogeneities in the fluid, such as fixed wall atoms. Further,
|
||||
the computed pressure profile must be corrected for the acceleration
|
||||
:doc:`compute stress/atom <compute_stress_atom>` and :doc:`fix
|
||||
ave/chunk <fix_ave_chunk>`, or with the hardy method in :doc:`fix atc
|
||||
<fix_atc>`. Note that the simple :doc:`compute stress/atom
|
||||
<compute_stress_atom>` method is only accurate away from
|
||||
inhomogeneities in the fluid, such as fixed wall atoms. Further, the
|
||||
computed pressure profile must be corrected for the acceleration
|
||||
applied by GD before computing a pressure drop or comparing it to
|
||||
other methods, such as the pump method :ref:`(Zhu) <Zhu>`. The pressure
|
||||
correction is discussed and described in :ref:`(Strong) <Strong>`.
|
||||
other methods, such as the pump method :ref:`(Zhu) <Zhu>`. The
|
||||
pressure correction is discussed and described in :ref:`(Strong)
|
||||
<Strong>`.
|
||||
|
||||
For a complete example including the considerations discussed
|
||||
above, see the examples/USER/flow_gauss directory.
|
||||
@ -102,14 +107,15 @@ computed by the fix will return zero.
|
||||
of wall atoms fixed, such as :doc:`fix spring/self <fix_spring_self>`.
|
||||
|
||||
If this fix is used in a simulation with the :doc:`rRESPA <run_style>`
|
||||
integrator, the applied acceleration must be computed and applied at the same
|
||||
rRESPA level as the interactions between the flowing fluid and the obstacle.
|
||||
The rRESPA level at which the acceleration is applied can be changed using
|
||||
the :doc:`fix_modify <fix_modify>` *respa* option discussed below. If the
|
||||
flowing fluid and the obstacle interact through multiple interactions that are
|
||||
computed at different rRESPA levels, then there must be a separate flow/gauss
|
||||
fix for each level. For example, if the flowing fluid and obstacle interact
|
||||
through pairwise and long-range Coulomb interactions, which are computed at
|
||||
integrator, the applied acceleration must be computed and applied at
|
||||
the same rRESPA level as the interactions between the flowing fluid
|
||||
and the obstacle. The rRESPA level at which the acceleration is
|
||||
applied can be changed using the :doc:`fix_modify <fix_modify>`
|
||||
*respa* option discussed below. If the flowing fluid and the obstacle
|
||||
interact through multiple interactions that are computed at different
|
||||
rRESPA levels, then there must be a separate flow/gauss fix for each
|
||||
level. For example, if the flowing fluid and obstacle interact through
|
||||
pairwise and long-range Coulomb interactions, which are computed at
|
||||
rRESPA levels 3 and 4, respectively, then there must be two separate
|
||||
flow/gauss fixes, one that specifies *fix_modify respa 3* and one with
|
||||
*fix_modify respa 4*.
|
||||
@ -119,38 +125,49 @@ flow/gauss fixes, one that specifies *fix_modify respa 3* and one with
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix is part of the USER-MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to subtract the work done from the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the potential energy added by the fix to the global
|
||||
potential energy of the system as part of :doc:`thermodynamic output
|
||||
<thermo_style>`. The default setting for this fix is :doc:`fix_modify
|
||||
energy no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows the user to set at which level of the :doc:`rRESPA <run_style>`
|
||||
integrator the fix computes and adds the external acceleration. Default is the
|
||||
outermost level.
|
||||
fix. This allows the user to set at which level of the :doc:`rRESPA
|
||||
<run_style>` integrator the fix computes and adds the external
|
||||
acceleration. Default is the outermost level.
|
||||
|
||||
This fix computes a global scalar and a global 3-vector of forces,
|
||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
||||
The scalar is the negative of the work done on the system, see above
|
||||
discussion. The vector is the total force that this fix applied to
|
||||
the group of atoms on the current timestep. The scalar and vector
|
||||
values calculated by this fix are "extensive".
|
||||
which can be accessed by various :doc:`output commands
|
||||
<Howto_output>`. The scalar is the negative of the work done on the
|
||||
system, see the discussion above. It is only calculated if the
|
||||
*energy* keyword is enabled or :doc:`fix_modify energy yes
|
||||
<fix_modify>` is set.
|
||||
|
||||
The vector is the total force that this fix applied to the group of
|
||||
atoms on the current timestep. The scalar and vector values
|
||||
calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
none
|
||||
|
||||
This fix is part of the USER-MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`fix addforce <fix_addforce>`, :doc:`compute temp/profile <compute_temp_profile>`, :doc:`velocity <velocity>`
|
||||
:doc:`fix addforce <fix_addforce>`,
|
||||
:doc:`compute temp/profile <compute_temp_profile>`,
|
||||
:doc:`velocity <velocity>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -398,12 +398,13 @@ adds all inserted atoms of the specified type to the
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
|
||||
number generator seed, the next timestep for MC exchanges, the number
|
||||
of MC step attempts and successes etc. See
|
||||
the :doc:`read_restart <read_restart>` command for info on how to
|
||||
re-specify a fix in an input script that reads a restart file, so that
|
||||
the operation of the fix continues in an uninterrupted fashion.
|
||||
This fix writes the state of the fix to :doc:`binary restart files
|
||||
<restart>`. This includes information about the random number
|
||||
generator seed, the next timestep for MC exchanges, the number of MC
|
||||
step attempts and successes etc. See the :doc:`read_restart
|
||||
<read_restart>` command for info on how to re-specify a fix in an
|
||||
input script that reads a restart file, so that the operation of the
|
||||
fix continues in an uninterrupted fashion.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -411,8 +412,8 @@ the operation of the fix continues in an uninterrupted fashion.
|
||||
after reading the restart with :doc:`reset_timestep <reset_timestep>`.
|
||||
The fix will try to detect it and stop with an error.
|
||||
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to this
|
||||
fix.
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to
|
||||
this fix.
|
||||
|
||||
This fix computes a global vector of length 8, which can be accessed
|
||||
by various :doc:`output commands <Howto_output>`. The vector values are
|
||||
@ -430,7 +431,8 @@ the following global cumulative quantities:
|
||||
The vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -103,28 +103,31 @@ Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The instantaneous values of the extended variables are written to
|
||||
:doc:`binary restart files <restart>`. Because the state of the random
|
||||
number generator is not saved in restart files, this means you cannot
|
||||
do "exact" restarts with this fix, where the simulation continues on
|
||||
the same as if no restart had taken place. However, in a statistical
|
||||
sense, a restarted simulation should produce the same behavior.
|
||||
Note however that you should use a different seed each time you
|
||||
restart, otherwise the same sequence of random numbers will be used
|
||||
each time, which might lead to stochastic synchronization and
|
||||
:doc:`binary restart files <restart>`. Because the state of the
|
||||
random number generator is not saved in restart files, this means you
|
||||
cannot do "exact" restarts with this fix, where the simulation
|
||||
continues on the same as if no restart had taken place. However, in a
|
||||
statistical sense, a restarted simulation should produce the same
|
||||
behavior. Note however that you should use a different seed each time
|
||||
you restart, otherwise the same sequence of random numbers will be
|
||||
used each time, which might lead to stochastic synchronization and
|
||||
subtle artifacts in the sampling.
|
||||
|
||||
The cumulative energy change in the system imposed by this fix is
|
||||
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||
doc page for details.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||
cumulative energy change due to this fix described in the previous
|
||||
paragraph. The scalar value calculated by this fix is "extensive".
|
||||
|
||||
This fix can ramp its target temperature over multiple runs, using the
|
||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||
:doc:`run <run>` command for details of how to do this.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the energy change induced by Langevin thermostatting to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
||||
energy change due to this fix. The scalar value calculated by this
|
||||
fix is "extensive".
|
||||
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -103,23 +103,27 @@ Restart, fix_modify, output, run start/stop, minimize info
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the gravitational potential energy of the system to the
|
||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the gravitational potential energy of the system to
|
||||
the global potential energy of the system as part of
|
||||
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||
this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||
integrator the fix is adding its forces. Default is the outermost level.
|
||||
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||
<run_style>` integrator the fix is adding its forces. Default is the
|
||||
outermost level.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. This scalar is the gravitational
|
||||
potential energy of the particles in the defined field, namely mass \*
|
||||
(g dot x) for each particles, where x and mass are the particles
|
||||
position and mass, and g is the gravitational field. The scalar value
|
||||
calculated by this fix is "extensive".
|
||||
:doc:`output commands <Howto_output>`. This scalar is the
|
||||
gravitational potential energy of the particles in the defined field,
|
||||
namely mass \* (g dot x) for each particles, where x and mass are the
|
||||
particles position and mass, and g is the gravitational field. The
|
||||
scalar value calculated by this fix is "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -115,6 +115,18 @@ The version with "bondmax" will just run somewhat faster, due to less
|
||||
overhead in computing bond lengths and not storing them in a separate
|
||||
compute.
|
||||
|
||||
A variable can be used to implement a large variety of conditions,
|
||||
including to stop when a specific file exists. Example:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable exit equal is_file(EXIT)
|
||||
fix 10 all halt 100 v_exit != 0 error soft
|
||||
|
||||
Will stop the current run command when a file ``EXIT`` is created
|
||||
in the current working directory. The condition can be cleared
|
||||
by removing the file through the :doc:`shell <shell>` command.
|
||||
|
||||
The choice of operators listed above are the usual comparison
|
||||
operators. The XOR operation (exclusive or) is also included as "\|\^".
|
||||
In this context, XOR means that if either the attribute or avalue is
|
||||
|
||||
@ -200,16 +200,20 @@ algorithm.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`.
|
||||
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
||||
fix to add the energy of the bias potential to the system's
|
||||
potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||
this fix to add the energy of the bias potential to the global
|
||||
potential energy of the system as part of :doc:`thermodynamic output
|
||||
<thermo_style>`. The default setting for this fix is :doc:`fix_modify
|
||||
energy no <fix_modify>`.
|
||||
|
||||
This fix computes a global scalar and global vector of length 12, which
|
||||
can be accessed by various :doc:`output commands <Howto_output>`. The
|
||||
scalar is the magnitude of the bias potential (energy units) applied on
|
||||
the current timestep. The vector stores the following quantities:
|
||||
This fix computes a global scalar and global vector of length 12,
|
||||
which can be accessed by various :doc:`output commands
|
||||
<Howto_output>`. The scalar is the magnitude of the bias potential
|
||||
(energy units) applied on the current timestep. The vector stores the
|
||||
following quantities:
|
||||
|
||||
* 1 = boost factor on this step (unitless)
|
||||
* 2 = max strain :math:`E_{ij}` of any bond on this step (absolute value, unitless)
|
||||
@ -253,7 +257,8 @@ The scalar and vector values calculated by this fix are all
|
||||
"intensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user