Merge branch 'develop' of github.com:lammps/lammps into kk_update_4.6.0

This commit is contained in:
Stan Moore
2025-03-31 11:46:30 -06:00
964 changed files with 75097 additions and 22481 deletions

2
.github/CODEOWNERS vendored
View File

@ -72,6 +72,8 @@ src/EXTRA-COMMAND/ndx_group.* @akohlmey
src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel
src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps
src/EXTRA-FIX/fix_deform_pressure.* @jtclemm src/EXTRA-FIX/fix_deform_pressure.* @jtclemm
src/EXTRA-PAIR/pair_dispersion_d3.* @soniasolomoni @arthurfl
src/EXTRA-PAIR/d3_parameters.h @soniasolomoni @arthurfl
src/MISC/*_tracker.* @jtclemm src/MISC/*_tracker.* @jtclemm
src/MC/fix_gcmc.* @athomps src/MC/fix_gcmc.* @athomps
src/MC/fix_sgcmc.* @athomps src/MC/fix_sgcmc.* @athomps

View File

@ -1,42 +1,54 @@
# LAMMPS Release Steps # LAMMPS Release Steps
The following notes chronicle the current steps for preparing and publishing LAMMPS releases. For The following notes chronicle the current steps for preparing and
definitions of LAMMPS versions and releases mean, please refer to [the corresponding section in the publishing LAMMPS releases. For definitions of LAMMPS versions and
LAMMPS manual](https://docs.lammps.org/Manual_version.html). releases, please refer to [the corresponding section in the LAMMPS
manual](https://docs.lammps.org/Manual_version.html).
## LAMMPS Feature Release ## LAMMPS Feature Release
A LAMMPS feature release is currently prepared after about 500 to 750 commits to the 'develop' A LAMMPS feature release is currently prepared after about 500 to 750
branch or after a period of four weeks up to two months. This is not a fixed rule, though, since commits to the 'develop' branch or after a period of four weeks up to
external circumstances can cause delays in preparing a release, or pull requests that are desired to two months. This is not a fixed rule, though, since external
be merged for the release are not yet completed. circumstances can cause delays in preparing a release, or pull requests
that are desired to be merged for the release are not yet completed.
### Preparing a 'next\_release' branch ### Preparing a 'next\_release' branch
Create a 'next\_release' branch off 'develop' and make the following changes: Create a 'next\_release' branch off 'develop' and make the following changes:
- set the LAMMPS\_VERSION define to the planned release date in src/version.h in the format - set the LAMMPS\_VERSION define to the planned release date in
"D Mmm YYYY" or "DD Mmm YYYY" src/version.h in the format "D Mmm YYYY" or "DD Mmm YYYY"
- remove the LAMMPS\_UPDATE define in src/version.h - remove the LAMMPS\_UPDATE define in src/version.h
- update the release date in doc/lammps.1 - update the release date in doc/lammps.1
- update all TBD arguments for ..versionadded::, ..versionchanged:: ..deprecated:: to the - update all TBD arguments for ..versionadded::, ..versionchanged::
planned release date in the format "DMmmYYYY" or "DDMmmYYYY" ..deprecated:: to the planned release date in the format "DMmmYYYY" or
- check release notes for merged new features and check if ..versionadded:: or ..versionchanged:: "DDMmmYYYY"
are missing and need to be added - check release notes for merged new features and check if
Submit this pull request, rebase if needed. This is the last pull request merged for the release ..versionadded:: or ..versionchanged:: are missing and need to be
and should not contain any other changes. (Exceptions: this document, last minute trivial(!) changes). added
This PR shall not be merged before **all** pending tests have completed and cleared. If needed, a Submit this pull request. This is the last pull request merged for the
bugfix pull request should be created and merged to clear all tests. release and should not contain any other changes. (Exceptions: this
document, last minute trivial(!) changes).
This PR shall not be merged before **all** pending tests have completed
and cleared. We currently use a mix of automated tests running on
either Temple's Jenkins cluster or GitHub workflows. Those include time
consuming tests not run on pull requests. If needed, a bug-fix pull
request should be created and merged to clear all tests.
### Create release on GitHub ### Create release on GitHub
When all pending pull requests for the release are merged and have cleared testing, the When all pending pull requests for the release are merged and have
'next\_release' branch is merged into 'develop'. cleared testing, the 'next\_release' branch is merged into 'develop'.
Check out 'develop' locally, pull the latest changes, merge them into 'release', apply a suitable Check out or update the 'develop' branch locally, pull the latest
release tag (for historical reasons the tag starts with "patch_" followed by the date, and finally changes, merge them into 'release' with a fast forward(!) merge, and
push everything back to GitHub. Example: apply a suitable release tag (for historical reasons the tag starts with
"patch_" followed by the date, and finally push everything back to
GitHub. There should be no commits made to 'release' but only
fast forward merges. Example:
``` ```
git checkout develop git checkout develop
@ -44,65 +56,315 @@ git pull
git checkout release git checkout release
git pull git pull
git merge --ff-only develop git merge --ff-only develop
git tag -s -m "LAMMPS feature release 19 November 2024" patch_19Nov2024 git tag -s -m "LAMMPS feature release 4 February 2025" patch_4Feb2025
git push git@github.com:lammps/lammps.git --tags develop release git push git@github.com:lammps/lammps.git --tags develop release
``` ```
Go to https://github.com/lammps/lammps/releases and create a new (draft) release page or check the Applying this tag will trigger two actions on the Temple Jenkins cluster:
existing draft for any necessary changes from pull requests that were merged but are not listed. - The online manual at https://docs.lammps.org/ will be updated to the
Then select the applied tag for the release in the "Choose a tag" dropdown list. Go to the bottom of state of the 'release' branch. Merges to the 'develop' branch will
the list and select the "Set as pre-release" checkbox. The "Set as the latest release" button is trigger updating https://docs.lammps.org/latest/ so by reviewing the
version of the manual under the "latest" URL, it is possible to preview
what the updated release documentation will look like.
- A downloadable tar archive of the LAMMPS distribution that includes the
html format documentation and a PDF of the manual will be created and
uploaded to the download server at https://download.lammps.org/tars
Note that the file is added, but the `index.html` file is not updated,
so it is not yet publicly visible.
Go to https://github.com/lammps/lammps/releases and create a new (draft)
release page with a summary of all the changes included and references
to the pull requests they were merged from or check the existing draft
for any necessary changes from pull requests that were merged but are
not listed. Then select the applied tag for the release in the "Choose
a tag" drop-down list. Go to the bottom of the list and select the "Set
as pre-release" checkbox. The "Set as the latest release" button is
reserved for stable releases and updates to them. reserved for stable releases and updates to them.
If everything is in order, you can click on the "Publish release" button. Otherwise, click on "Save If everything is in order, you can click on the "Publish release"
draft" and finish pending tasks until you can return to edit the release page and publish it. button. Otherwise, click on "Save draft" and finish pending tasks until
you can return to edit the release page and publish it.
### Update download website, prepare pre-compiled packages, update packages to GitHub ### Prepare pre-compiled packages, update packages to GitHub
Publishing the release on GitHub will trigger the Temple Jenkins cluster to update A suitable build environment is provided with the
the https://docs.lammps.org/ website with the documentation for the new feature release https://download.lammps.org/static/fedora41_musl_mingw.sif container
and it will create a tarball for download (which contains the translated manual). image. The corresponding container build definition file is maintained
in the tools/singularity folder of the LAMMPS source distribution.
Build a fully static LAMMPS installation using a musl-libc cross-compiler, install into a #### Fully portable static Linux x86_64 non-MPI binaries
lammps-static folder, and create a tarball called lammps-linux-x86_64-19Nov2024.tar.gz (or using a
corresponding date with a future release) from the lammps-static folder and upload it to GitHub The following commands use the Fedora container to build a fully static
LAMMPS installation using a musl-libc cross-compiler, install it into a
`lammps-static` folder, and create a tarball called
`lammps-linux-x86_64-4Feb2025.tar.gz` (or using a corresponding date
with a future release) from the `lammps-static` folder.
``` sh
rm -rf release-packages
mkdir release-packages
cd release-packages
wget https://download.lammps.org/static/fedora41_musl.sif
apptainer shell fedora41_musl.sif
git clone -b release --depth 10 https://github.com/lammps/lammps.git lammps-release
cmake -S lammps-release/cmake -B build-release -G Ninja -D CMAKE_INSTALL_PREFIX=$PWD/lammps-static -D CMAKE_TOOLCHAIN_FILE=/usr/musl/share/cmake/linux-musl.cmake -C lammps-release/cmake/presets/most.cmake -C lammps-release/cmake/presets/kokkos-openmp.cmake -D DOWNLOAD_POTENTIALS=OFF -D BUILD_MPI=OFF -D BUILD_TESTING=OFF -D CMAKE_BUILD_TYPE=Release -D PKG_ATC=ON -D PKG_AWPMD=ON -D PKG_MANIFOLD=ON -D PKG_MESONT=ON -D PKG_MGPT=ON -D PKG_ML-PACE=ON -D PKG_ML-RANN=ON -D PKG_MOLFILE=ON -D PKG_PTM=ON -D PKG_QTB=ON -D PKG_SMTBQ=ON
cmake --build build-release --target all
cmake --build build-release --target install
/usr/musl/bin/x86_64-linux-musl-strip lammps-static/bin/*
tar -czvvf ../lammps-linux-x86_64-4Feb2025.tar.gz lammps-static
exit # fedora 41 container
cd ..
```
The resulting tar archive can be uploaded to the GitHub release page with:
``` sh
gh release upload patch_4Feb2025 lammps-linux-x86_64-4Feb2025.tar.gz
```
#### Linux x86_64 Flatpak bundle with GUI included
Make sure you have the `flatpak` and `flatpak-builder` packages
installed locally (they require binaries that run with elevated
privileges and thus cannot be used from the container) and build a
LAMMPS and LAMMPS-GUI flatpak bundle in the `release-packages` folder
with: with:
``` ``` sh
gh release upload patch_19Nov2024 ~/Downloads/lammps-linux-x86_64-19Nov2024.tar.gz cd release-packages
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak-builder --force-clean --verbose --repo=$PWD/flatpak-repo --install-deps-from=flathub --state-dir=$PWD --user --ccache --default-branch=release flatpak-build lammps-release/tools/lammps-gui/org.lammps.lammps-gui.yml
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo --verbose $PWD/flatpak-repo ../LAMMPS-Linux-x86_64-GUI-4Feb2025.flatpak org.lammps.lammps-gui release
cd ..
``` ```
The resulting flatpak bundle file can be uploaded to the GitHub release page with:
``` sh
gh release upload patch_4Feb2025 LAMMPS-Linux-x86_64-GUI-4Feb2025.flatpak
```
#### LAMMPS Source tarball
The container for the static binary can also be used to prepare the source
tarball including the HTML and PDF manual (this is currently done automatically
when the releases is created and the tarball uploaded to https://download.lammps.org/tars/).
The steps are as follows:
``` sh
cd release-packages
apptainer shell fedora41_musl_mingw.sif
cd lammps-release
rm -f ../release.tar*
git archive --output=../release.tar --prefix=lammps-4Feb2025/ HEAD
cd doc
make clean-all
make html pdf
tar -rf ../../release.tar --transform 's,^,lammps-4Feb2025/doc/,' html Manual.pdf
gzip -9v ../../release.tar
mv ../../release.tar.gz ../../lammps-src-4Feb2025.tar.gz
exit # fedora41 container
cd ..
```
The resulting source tarball can be uploaded to the GitHub release page with:
``` sh
gh release upload patch_4Feb2025 lammps-src-4Feb2025.tar.gz
```
#### Build Windows Installer Packages with MinGW Linux-to-Windows Cross-compiler
The various Windows installer packages can also be built with
apptainer container image.
``` sh
cd release-packages
apptainer shell fedora41_musl_mingw.sif
git clone --depth 10 https://github.com/lammps/lammps-packages.git lammps-packages
cd lammps-packages/mingw-cross
ln -sf ../../lammps-release lammps
./buildall.sh release >& mk.log & less +F mk.log
```
The installer with the GUI included can be uploaded to the GitHub release page with:
``` sh
ln -sf LAMMPS-64bit-GUI-4Feb2025.exe LAMMPS-Win10-64bit-GUI-4Feb2025.exe
gh release upload patch_4Feb2025 LAMMPS-Win10-64bit-GUI-4Feb2025.exe
```
The symbolic link is used to have a consistent naming scheme for the packages
attached to the GitHub release page.
#### Clean up:
``` sh
cd ..
rm -r release-packages
```
#### Build Multi-arch App-bundle for macOS
Building app-bundles for macOS is not as easily automated and portable
as some of the other steps. It requires a machine actually running
macOS. In that machine the Xcode compiler package needs to be
installed. This also includes tools for building and manipulating disk
images. This compiler supports building executables for both, the
x86_64 and the arm64 architectures. This requires building with CMake
and using the CMake settings:
``` sh
-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64
-D CMAKE_OSX_DEPLOYMENT_TARGET=11.0
```
This will add the compiler flags `-arch arm64 -arch x86_64
-mmacosx-version-min=11.0` and thus produce object for both
architectures and support for macOS versions back to version 11 (aka Big
Sur). With these settings the following libraries should be compiled
and installed (e.g. to `$HOME/.local`) as static libraries only:
- libomp taken from the LLVM/Clang source distribution (to support OpenMP)
- jpeg
- zlib
- png
- Qt (for LAMMPS-GUI)
When configuring LAMMPS the `cmake/presets/clang.cmake` should be used
and as many packages as possible enabled. For LAMMPS-GUI, MPI should be
disabled with `-D BUILD_MPI=OFF` and LAMMPS-GUI enabled with
`-D BUILD_LAMMPS_GUI=ON`. If the CMake configuration is successful,
settings for building a macOS app-bundle are enabled and with `cmake
--build build --target dmg` extra steps will be executed that will build
a macOS application installer image under the name
`LAMMPS_GUI-macOS-multiarch-4Feb2025.dmg`
The application image can be uploaded to the GitHub release page with:
``` sh
ln -sf LAMMPS_GUI-macOS-multiarch-4Feb2025.dmg LAMMPS-macOS-multiarch-GUI-4Feb2025.dmg
gh release upload patch_4Feb2025 LAMMPS-macOS-multiarch-GUI-4Feb2025.dmg
```
The symbolic link is used to have a consistent naming scheme for the packages
attached to the GitHub release page.
We are currently building the application images on macOS 12 (aka Monterey).
#### Build Linux x86_64 binary tarball on Ubuntu 20.04LTS
While the flatpak Linux version uses portable runtime libraries provided
by the flatpak environment, we also build regular Linux executables that
use a wrapper script and matching shared libraries in a tarball. To be
compatible with many Linux distributions, one has to build this on a
very old Linux distribution, since most Linux system libraries are
usually backward compatible but not forward compatible. This is
currently done on an Ubuntu 20.04LTS system. Once LAMMPS moves to
require CMake 3.20 and C++17, we will have to move to Ubuntu 22.04LTS.
This installation (either on a real or a virtual machine) should have
the packages installed that are indicated in
`tools/singularity/ubuntu20.04.def` plus Qt version 5.x with development
headers, so that LAMMPS-GUI can be compiled.
Also the building of the binary tarball and setup of the bundled
libraries and wrapper scripts is automated and can executed with `cmake
--build build --target tgz`. This should produce a file
`LAMMPS_GUI-Linux-amd64-4Feb2025.tar.gz` which can be uploaded to the
GitHub release page with:
``` sh
ln -sf LAMMPS_GUI-Linux-amd64-4Feb2025.tar.gz LAMMPS-Linux-x86_64-GUI-4Feb2025.tar.gz
gh release upload patch_4Feb2025 LAMMPS-Linux-x86_64-GUI-4Feb2025.tar.gz
```
### Update download page on LAMMPS website
Check out the LAMMPS website repo
https://github.com/lammps/lammps-website.git and edit the file
`src/download.txt` for the new release. Test translation with `make
html` and review `html/download.html` Then add and commit to git and
push the changes to GitHub. The Temple Jenkis cluster will
automatically update https://www.lammps.org/download.html accordingly.
Also notify Steve of the release so he can update `src/bug.txt` on the
website from the available release notes.
## LAMMPS Stable Release ## LAMMPS Stable Release
A LAMMPS stable release is prepared about once per year in the months July, August, or September. A LAMMPS stable release is prepared about once per year in the months
One (or two, if needed) feature releases before the stable release shall contain only bug fixes July, August, or September. One (or two, if needed) feature releases
or minor feature updates in optional packages. Also substantial changes to the core of the code before the stable release shall contain only bug fixes or minor feature
shall be applied rather toward the beginning of a development cycle between two stable releases updates in optional packages. Also substantial changes to the core of
than toward the end. The intention is to stablilize significant change to the core and have the code shall be applied rather toward the beginning of a development
outside users and developers try them out during the development cycle; the sooner the changes cycle between two stable releases than toward the end. The intention is
are included, the better chances for spotting peripheral bugs and issues. to stablilize significant change to the core and have outside users and
developers try them out during the development cycle; the sooner the
changes are included, the better chances for spotting peripheral bugs
and issues.
### Prerequesites ### Prerequesites
Before making a stable release all remaining backported bugfixes shall be released as a (final) Before making a stable release all remaining backported bugfixes shall
stable update release (see below). be released as a (final) stable update release (see below).
A LAMMPS stable release process starts like a feature release (see above), only that this feature A LAMMPS stable release process starts like a feature release (see
release is called a "Stable Release Candidate" and no assets are uploaded to GitHub. above), only that this feature release is called a "Stable Release
Candidate" and no assets are uploaded to GitHub.
### Synchronize 'maintenance' branch with 'release' ### Synchronize 'maintenance' branch with 'release'
The state of the 'release' branch is then transferred to the 'maintenance' branch (which will The state of the 'release' branch is then transferred to the
have diverged significantly from 'release' due to the selectively backported bug fixes). 'maintenance' branch (which will have diverged significantly from
'release' due to the selectively backported bug fixes).
### Fast-forward merge of 'maintenance' into 'stable' and apply tag ### Fast-forward merge of 'maintenance' into 'stable' and apply tag
At this point it should be possible to do a fast-forward merge of 'maintenance' to 'stable' At this point it should be possible to do a fast-forward merge of
and then apply the stable\_DMmmYYYY tag. 'maintenance' to 'stable' and then apply the stable\_DMmmYYYY tag.
### Push branches and tags ### Push branches and tags
## LAMMPS Stable Update Release ## LAMMPS Stable Update Release
After making a stable release, bugfixes from the 'develop' branch
are selectively backported to the 'maintenance' branch. This is
done with "git cherry-pick \<commit hash\>' wherever possible.
The LAMMPS\_UPDATE define in "src/version.h" is set to "Maintenance".
### Prerequesites
When a sufficient number of bugfixes has accumulated or an urgent
or important bugfix needs to be distributed a new stable update
release is made. To make this publicly visible a pull request
is submitted that will merge 'maintenance' into 'stable'. Before
merging, set LAMMPS\_UPDATE in "src/version.h" to "Update #" with
"#" indicating the update count (1, 2, and so on).
Also draft suitable release notes under https://github.com/lammps/lammps/releases
### Fast-forward merge of 'maintenance' into 'stable', apply tag, and publish
Do a fast-forward merge of 'maintenance' to 'stable' and then
apply the stable\_DMmmYYYY\_update# tag and push branch and tag
to GitHub. The corresponding pull request will be automatically
closed. Example:
```
git checkout maintenance
git pull
git checkout stable
git pull
git merge --ff-only maintenance
git tag -s -m 'Update 2 for Stable LAMMPS version 29 August 2024' stable_29Aug2024_update2
git push git@github.com:lammps/lammps.git --tags maintenance stable
```
Associate draft release notes with new tag and publish as "latest release".
On https://ci.lammps.org/ go to "dev", "stable" and manually execute
the "update\_release" task. This will update https://docs.lammps.org/stable
and prepare a stable tarball.
### Build and upload binary packages and source tarball to GitHub
The build procedure is the same as for the feature releases, only
that packages are built from the 'stable' branch.

View File

@ -77,7 +77,7 @@ jobs:
-D PKG_MDI=on \ -D PKG_MDI=on \
-D PKG_MANIFOLD=on \ -D PKG_MANIFOLD=on \
-D PKG_ML-PACE=on \ -D PKG_ML-PACE=on \
-D PKG_ML-RANN=off \ -D PKG_ML-RANN=on \
-D PKG_MOLFILE=on \ -D PKG_MOLFILE=on \
-D PKG_RHEO=on \ -D PKG_RHEO=on \
-D PKG_PTM=on \ -D PKG_PTM=on \

15
README
View File

@ -23,17 +23,20 @@ more information about the code and its uses.
The LAMMPS distribution includes the following files and directories: The LAMMPS distribution includes the following files and directories:
README this file README this file
LICENSE the GNU General Public License (GPL) LICENSE the GNU General Public License (GPLv2)
bench benchmark problems CITATION.cff Citation information for LAMMPS in CFF format
bench benchmark inputs
cmake CMake build files cmake CMake build files
doc documentation doc documentation
examples simple test problems examples example inputs for many LAMMPS commands
fortran Fortran wrapper for LAMMPS fortran Fortran 2003 module for LAMMPS
lib additional provided or external libraries lib additional provided or external libraries
potentials interatomic potential files potentials interatomic potential files
python Python wrappers for LAMMPS python Python module for LAMMPS
src source files src source files
tools pre- and post-processing tools tools pre- and post-processing tools
unittest test programs for use with CTest
.github Git and GitHub related files and tools
Point your browser at any of these files to get started: Point your browser at any of these files to get started:
@ -42,6 +45,8 @@ https://docs.lammps.org/Intro.html hi-level introduction
https://docs.lammps.org/Build.html how to build LAMMPS https://docs.lammps.org/Build.html how to build LAMMPS
https://docs.lammps.org/Run_head.html how to run LAMMPS https://docs.lammps.org/Run_head.html how to run LAMMPS
https://docs.lammps.org/Commands_all.html Table of available commands https://docs.lammps.org/Commands_all.html Table of available commands
https://docs.lammps.org/Howto.html Short tutorials and HowTo discussions
https://docs.lammps.org/Errors.html How to interpret and debug errors
https://docs.lammps.org/Library.html LAMMPS library interfaces https://docs.lammps.org/Library.html LAMMPS library interfaces
https://docs.lammps.org/Modify.html how to modify and extend LAMMPS https://docs.lammps.org/Modify.html how to modify and extend LAMMPS
https://docs.lammps.org/Developer.html LAMMPS developer info https://docs.lammps.org/Developer.html LAMMPS developer info

View File

@ -209,7 +209,7 @@ endif()
######################################################################## ########################################################################
# User input options # # User input options #
######################################################################## ########################################################################
# backward compatibility with CMake before 3.12 and older LAMMPS documentation # backward compatibility with older LAMMPS documentation
if (PYTHON_EXECUTABLE) if (PYTHON_EXECUTABLE)
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}") set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
endif() endif()
@ -225,6 +225,12 @@ if(DEFINED ENV{VIRTUAL_ENV} AND NOT Python_EXECUTABLE)
" Setting Python interpreter to: ${Python_EXECUTABLE}") " Setting Python interpreter to: ${Python_EXECUTABLE}")
endif() endif()
find_package(Python COMPONENTS Interpreter QUIET)
# NOTE: RHEL 8.0 and Ubuntu 18.04LTS ship with Python 3.6, Python 3.8 was EOL in 2024
if(Python_VERSION VERSION_LESS 3.6)
message(FATAL_ERROR "LAMMPS requires Python 3.6 or later")
endif()
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically") set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
mark_as_advanced(LAMMPS_MACHINE) mark_as_advanced(LAMMPS_MACHINE)
if(LAMMPS_MACHINE) if(LAMMPS_MACHINE)
@ -425,8 +431,8 @@ else()
target_link_libraries(lammps PUBLIC mpi_stubs) target_link_libraries(lammps PUBLIC mpi_stubs)
endif() endif()
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) set(LAMMPS_SIZES_VALUES smallbig bigbig)
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
@ -930,7 +936,7 @@ endif()
include(Testing) include(Testing)
include(CodeCoverage) include(CodeCoverage)
include(CodingStandard) include(CodingStandard)
find_package(ClangFormat 11.0) find_package(ClangFormat 11.0 QUIET)
if(ClangFormat_FOUND) if(ClangFormat_FOUND)
add_custom_target(format-src add_custom_target(format-src

View File

@ -7,76 +7,76 @@
# For Python coverage the coverage package needs to be installed # For Python coverage the coverage package needs to be installed
############################################################################### ###############################################################################
if(ENABLE_COVERAGE) if(ENABLE_COVERAGE)
find_program(GCOVR_BINARY gcovr) find_program(GCOVR_BINARY gcovr)
find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY) find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY)
find_program(COVERAGE_BINARY coverage) find_program(COVERAGE_BINARY coverage)
find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY) find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY)
if(GCOVR_FOUND) if(GCOVR_FOUND)
get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE) get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE)
add_custom_target( add_custom_target(
gen_coverage_xml gen_coverage_xml
COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating XML coverage report..." COMMENT "Generating XML coverage report..."
) )
set(COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/coverage_html) set(COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/coverage_html)
add_custom_target(coverage_html_folder add_custom_target(coverage_html_folder
COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_HTML_DIR}) COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_HTML_DIR})
add_custom_target( add_custom_target(
gen_coverage_html gen_coverage_html
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o ${COVERAGE_HTML_DIR}/index.html COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o ${COVERAGE_HTML_DIR}/index.html
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating HTML coverage report..." COMMENT "Generating HTML coverage report..."
) )
add_dependencies(gen_coverage_html coverage_html_folder) add_dependencies(gen_coverage_html coverage_html_folder)
add_custom_target(clean_coverage_html add_custom_target(clean_coverage_html
${CMAKE_COMMAND} -E remove_directory ${COVERAGE_HTML_DIR} ${CMAKE_COMMAND} -E remove_directory ${COVERAGE_HTML_DIR}
COMMENT "Deleting HTML coverage report..." COMMENT "Deleting HTML coverage report..."
) )
add_custom_target(reset_coverage add_custom_target(reset_coverage
${CMAKE_COMMAND} -E remove -f */*.gcda */*/*.gcda */*/*/*.gcda ${CMAKE_COMMAND} -E remove -f */*.gcda */*/*.gcda */*/*/*.gcda
*/*/*/*/*.gcda */*/*/*/*/*.gcda */*/*/*/*/*/*.gcda */*/*/*/*.gcda */*/*/*/*/*.gcda */*/*/*/*/*/*.gcda
*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*.gcda
*/*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*/*.gcda
WORKIND_DIRECTORY ${CMAKE_BINARY_DIR} WORKIND_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Deleting coverage data files..." COMMENT "Deleting coverage data files..."
) )
add_dependencies(reset_coverage clean_coverage_html) add_dependencies(reset_coverage clean_coverage_html)
endif() endif()
if(COVERAGE_FOUND) if(COVERAGE_FOUND)
set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html) set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html)
configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY) configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} combine COMMAND ${COVERAGE_BINARY} combine
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Combine Python coverage files..." COMMENT "Combine Python coverage files..."
) )
add_custom_target( add_custom_target(
gen_python_coverage_html gen_python_coverage_html
COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR} COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating HTML Python coverage report..." COMMENT "Generating HTML Python coverage report..."
) )
add_custom_target( add_custom_target(
gen_python_coverage_xml gen_python_coverage_xml
COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating XML Python coverage report..." COMMENT "Generating XML Python coverage report..."
) )
endif() endif()
endif() endif()

View File

@ -1,40 +1,39 @@
# use default (or custom) Python executable, if version is sufficient # use default (or custom) Python executable.
if(Python_VERSION VERSION_GREATER_EQUAL 3.6) # Python version check is in main CMakeLists.txt file
if(Python_EXECUTABLE)
set(Python3_EXECUTABLE ${Python_EXECUTABLE}) set(Python3_EXECUTABLE ${Python_EXECUTABLE})
endif() endif()
find_package(Python3 COMPONENTS Interpreter) find_package(Python3 COMPONENTS Interpreter)
if(Python3_EXECUTABLE) if(Python3_EXECUTABLE)
if(Python3_VERSION VERSION_GREATER_EQUAL 3.6) add_custom_target(
add_custom_target( check-whitespace
check-whitespace ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Check for whitespace errors")
COMMENT "Check for whitespace errors") add_custom_target(
add_custom_target( check-homepage
check-homepage ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Check for homepage URL errors")
COMMENT "Check for homepage URL errors") add_custom_target(
add_custom_target( check-permissions
check-permissions ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Check for permission errors")
COMMENT "Check for permission errors") add_custom_target(
add_custom_target( fix-whitespace
fix-whitespace ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Fix whitespace errors")
COMMENT "Fix whitespace errors") add_custom_target(
add_custom_target( fix-homepage
fix-homepage ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py -f .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py -f . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Fix homepage URL errors")
COMMENT "Fix homepage URL errors") add_custom_target(
add_custom_target( fix-permissions
fix-permissions ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f .
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f . WORKING_DIRECTORY ${LAMMPS_DIR}
WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Fix permission errors")
COMMENT "Fix permission errors")
endif()
endif() endif()

View File

@ -13,7 +13,7 @@ if(BUILD_DOC)
endif() endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter) find_package(Python3 REQUIRED COMPONENTS Interpreter)
if(Python3_VERSION VERSION_LESS 3.8) if(Python3_VERSION VERSION_LESS 3.8)
message(FATAL_ERROR "Python 3.8 and up is required to build the HTML documentation") message(FATAL_ERROR "Python 3.8 and up is required to build the LAMMPS HTML documentation")
endif() endif()
set(VIRTUALENV ${Python3_EXECUTABLE} -m venv) set(VIRTUALENV ${Python3_EXECUTABLE} -m venv)
@ -65,8 +65,8 @@ if(BUILD_DOC)
find_package(Sphinx) find_package(Sphinx)
endif() endif()
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball") set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.2.2.tar.gz" CACHE STRING "URL for MathJax tarball")
set(MATHJAX_MD5 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball") set(MATHJAX_MD5 "08dd6ef33ca08870220d9aade2a62845" CACHE STRING "MD5 checksum of MathJax tarball")
mark_as_advanced(MATHJAX_URL) mark_as_advanced(MATHJAX_URL)
GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK) GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK)

View File

@ -34,8 +34,26 @@ if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif() endif()
# C++11 is required if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11) if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
if(CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "C++ standard must be set to at least 11")
endif()
if(CMAKE_CXX_STANDARD LESS 17)
message(WARNING "Selecting C++17 standard is preferred over C++${CMAKE_CXX_STANDARD}")
endif()
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
set(CMAKE_CXX_STANDARD 17)
endif()
# turn off C++17 check in lmptype.h
if(LAMMPS_CXX11)
add_compile_definitions(LAMMPS_CXX11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Need -restrict with Intel compilers # Need -restrict with Intel compilers
@ -242,8 +260,8 @@ endif()
################ ################
# integer size selection # integer size selection
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) set(LAMMPS_SIZES_VALUES smallbig bigbig)
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)

View File

@ -24,9 +24,7 @@ if(MLIAP_ENABLE_PYTHON)
if(NOT PKG_PYTHON) if(NOT PKG_PYTHON)
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP") message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
endif() endif()
if(Python_VERSION VERSION_LESS 3.6) # Python version check is in main CMakeLists.txt file
message(FATAL_ERROR "Python support in ML-IAP requires Python 3.6 or later")
endif()
set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython) set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython)
file(GLOB MLIAP_CYTHON_SRC CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/ML-IAP/*.pyx) file(GLOB MLIAP_CYTHON_SRC CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/ML-IAP/*.pyx)

View File

@ -37,7 +37,7 @@ if(DOWNLOAD_QUIP)
endforeach() endforeach()
# Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment # Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment
set(temp "${temp} -L/_DUMMY_PATH_\n") set(temp "${temp} -L/_DUMMY_PATH_\n")
set(temp "${temp}PYTHON=python\nPIP=pip\nEXTRA_LINKOPTS=\n") set(temp "${temp}PYTHON=${Python_EXECUTABLE}\nPIP=pip\nEXTRA_LINKOPTS=\n")
set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n") set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n")
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n") set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n") set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n")

View File

@ -40,6 +40,13 @@ mark_as_advanced(PLUMED_URL)
mark_as_advanced(PLUMED_MD5) mark_as_advanced(PLUMED_MD5)
GetFallbackURL(PLUMED_URL PLUMED_FALLBACK) GetFallbackURL(PLUMED_URL PLUMED_FALLBACK)
# adjust C++ standard support for self-compiled Plumed2
if(CMAKE_CXX_STANDARD GREATER 11)
set(PLUMED_CXX_STANDARD 14)
else()
set(PLUMED_CXX_STANDARD 11)
endif()
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING)) if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(CROSS_CONFIGURE mingw64-configure) set(CROSS_CONFIGURE mingw64-configure)
@ -55,7 +62,7 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
URL_MD5 ${PLUMED_MD5} URL_MD5 ${PLUMED_MD5}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CROSS_CONFIGURE} --disable-shared --disable-bsymbolic CONFIGURE_COMMAND ${CROSS_CONFIGURE} --disable-shared --disable-bsymbolic
--disable-python --enable-cxx=11 --disable-python --enable-cxx=${PLUMED_CXX_STANDARD}
--enable-modules=-adjmat:+crystallization:-dimred:+drr:+eds:-fisst:+funnel:+logmfd:+manyrestraints:+maze:+opes:+multicolvar:-pamm:-piv:+s2cm:-sasa:-ves --enable-modules=-adjmat:+crystallization:-dimred:+drr:+eds:-fisst:+funnel:+logmfd:+manyrestraints:+maze:+opes:+multicolvar:-pamm:-piv:+s2cm:-sasa:-ves
${PLUMED_CONFIG_OMP} ${PLUMED_CONFIG_OMP}
${PLUMED_CONFIG_MPI} ${PLUMED_CONFIG_MPI}
@ -142,7 +149,7 @@ else()
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
${CONFIGURE_REQUEST_PIC} ${CONFIGURE_REQUEST_PIC}
--enable-modules=all --enable-modules=all
--enable-cxx=11 --enable-cxx=${PLUMED_CXX_STANDARD}
--disable-python --disable-python
${PLUMED_CONFIG_MPI} ${PLUMED_CONFIG_MPI}
${PLUMED_CONFIG_OMP} ${PLUMED_CONFIG_OMP}

View File

@ -1,6 +1,6 @@
if(NOT Python_INTERPRETER) if(NOT Python_INTERPRETER)
# backward compatibility with CMake before 3.12 and older LAMMPS documentation # backward compatibility with older LAMMPS documentation
if(PYTHON_EXECUTABLE) if(PYTHON_EXECUTABLE)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
endif() endif()

View File

@ -1,6 +1,5 @@
# preset that enables KOKKOS and selects CUDA compilation with OpenMP # preset that enables KOKKOS and selects CUDA compilation with OpenMP
# enabled as well. This preselects CC 5.0 as default GPU arch, since # enabled as well. The GPU architecture *must* match your hardware
# that is compatible with all higher CC, but not the default CC 3.5
set(PKG_KOKKOS ON CACHE BOOL "" FORCE) set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE) set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE) set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)

View File

@ -17,9 +17,11 @@ MATHJAXTAG = 3.2.2
PYTHON = $(word 3,$(shell type python3)) PYTHON = $(word 3,$(shell type python3))
DOXYGEN = $(word 3,$(shell type doxygen)) DOXYGEN = $(word 3,$(shell type doxygen))
PANDOC = $(word 3,$(shell type pandoc))
HAS_PYTHON3 = NO HAS_PYTHON3 = NO
HAS_DOXYGEN = NO HAS_DOXYGEN = NO
HAS_PDFLATEX = NO HAS_PDFLATEX = NO
HAS_PANDOC = NO
ifeq ($(shell type python3 >/dev/null 2>&1; echo $$?), 0) ifeq ($(shell type python3 >/dev/null 2>&1; echo $$?), 0)
HAS_PYTHON3 = YES HAS_PYTHON3 = YES
@ -31,10 +33,14 @@ endif
ifeq ($(shell type pdflatex >/dev/null 2>&1; echo $$?), 0) ifeq ($(shell type pdflatex >/dev/null 2>&1; echo $$?), 0)
ifeq ($(shell type latexmk >/dev/null 2>&1; echo $$?), 0) ifeq ($(shell type latexmk >/dev/null 2>&1; echo $$?), 0)
HAS_PDFLATEX = YES HAS_PDFLATEX = YES
endif endif
endif endif
ifeq ($(shell type pandoc >/dev/null 2>&1; echo $$?), 0)
HAS_PANDOC = YES
endif
# override settings for PIP commands # override settings for PIP commands
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org # PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
@ -45,8 +51,9 @@ SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocess
# we only want to use explicitly listed files. # we only want to use explicitly listed files.
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//') DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml .PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml fasthtml-init
FASTHTMLFILES = $(patsubst $(RSTDIR)/%.rst,fasthtml/%.html,$(wildcard $(RSTDIR)/*rst))
# ------------------------------------------ # ------------------------------------------
help: help:
@ -116,25 +123,23 @@ html: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJ
@rm -rf html/PDF/.[sg]* @rm -rf html/PDF/.[sg]*
@echo "Build finished. The HTML pages are in doc/html." @echo "Build finished. The HTML pages are in doc/html."
fasthtml: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) fasthtml: fasthtml-init $(FASTHTMLFILES)
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
@$(MAKE) $(MFLAGS) -C graphviz all
@mkdir -p fasthtml
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
deactivate ;\
)
@rm -rf fasthtml/_sources
@rm -rf fasthtml/PDF
@rm -rf fasthtml/USER
@rm -rf fasthtml/JPG
@cp -r src/PDF fasthtml/PDF
@rm -rf fasthtml/PDF/.[sg]*
@echo "Fast HTML build finished. The HTML pages are in doc/fasthtml." @echo "Fast HTML build finished. The HTML pages are in doc/fasthtml."
fasthtml-init:
@mkdir -p fasthtml/JPG
@cp src/JPG/*.* fasthtml/JPG
@cp $(RSTDIR)/accel_styles.rst $(RSTDIR)/lepton_expression.rst fasthtml/
@cp $(BUILDDIR)/utils/pandoc.css fasthtml/
fasthtml/%.html: $(RSTDIR)/%.rst
@if [ "$(HAS_PANDOC)" == "NO" ] ; then echo "Make 'fasthtml' requires the 'pandoc' software" 1>&2; exit 1; fi
@mkdir -p fasthtml
@echo converting $< to $@
@sed -e 's/\\AA/\\mathring{\\mathrm{A}}/g' $< > fasthtml/$*.temp.rst
@pandoc -s --mathml --css="pandoc.css" --template=$(BUILDDIR)/utils/pandoc.html --metadata title="$@" -o $@ fasthtml/$*.temp.rst
@rm -f fasthtml/$*.temp.rst
spelling: xmlgen globbed-tocs $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt spelling: xmlgen globbed-tocs $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
@(\ @(\

View File

@ -22,12 +22,12 @@ doxygen-warn.log logfile with warnings from running doxygen
and: and:
github-development-workflow.md notes on the LAMMPS development workflow github-development-workflow.md notes on the LAMMPS development workflow
include-file-conventions.md notes on LAMMPS' include file conventions
documentation_conventions.md notes on writing documentation for LAMMPS documentation_conventions.md notes on writing documentation for LAMMPS
If you downloaded a LAMMPS tarball from www.lammps.org, then the html If you downloaded a LAMMPS tarball from www.lammps.org, then the html
folder and the PDF manual should be included. If you downloaded LAMMPS folder and the PDF manual should be included. If you downloaded LAMMPS
from GitHub then you either need to build them. using GitHub then you either need to build them yourself or read the
online version at https://docs.lammps.org/
You can build the HTML and PDF files yourself, by typing "make html" You can build the HTML and PDF files yourself, by typing "make html"
or by "make pdf", respectively. This requires various tools and files. or by "make pdf", respectively. This requires various tools and files.
@ -39,10 +39,10 @@ environment and local folders.
Installing prerequisites for the documentation build Installing prerequisites for the documentation build
To run the HTML documention build toolchain, python 3.x, doxygen, git, To run the HTML documention build toolchain, python 3.8 or later,
and the venv python module have to be installed if not already available. doxygen 1.8.10 or later, git, and the venv python module have to be
Also internet access is initially required to download external files installed if not already available. Also internet access is initially
and tools. required to download external files and tools.
Building the PDF format manual requires in addition a compatible LaTeX Building the PDF format manual requires in addition a compatible LaTeX
installation with support for PDFLaTeX and several add-on LaTeX packages installation with support for PDFLaTeX and several add-on LaTeX packages
@ -52,16 +52,24 @@ installed. This includes:
- babel - babel
- capt-of - capt-of
- cmap - cmap
- dvipng
- ellipse
- fncychap - fncychap
- fontawesom
- framed - framed
- geometry - geometry
- gyre
- hyperref - hyperref
- hypcap - hypcap
- needspace - needspace
- pict2e
- times - times
- tabulary - tabulary
- titlesec
- upquote - upquote
- wrapfig - wrapfig
- xindy
Also the latexmk script is required to run PDFLaTeX and related tools. Also the latexmk script is required to run PDFLaTeX and related tools.
the required number of times to have self-consistent output and include the required number of times to have self-consistent output and include
updated bibliography and indices. updated bibliography and indices.

View File

@ -1,7 +1,7 @@
.TH LAMMPS "1" "19 November 2024" "2024-11-19" .TH LAMMPS "1" "4 February 2025" "2025-02-04"
.SH NAME .SH NAME
.B LAMMPS .B LAMMPS
\- Molecular Dynamics Simulator. Version 19 November 2024 \- Molecular Dynamics Simulator. Version 4 February 2025
.SH SYNOPSIS .SH SYNOPSIS
.B lmp .B lmp
@ -311,7 +311,7 @@ the chapter on errors in the
manual gives some additional information about error messages, if possible. manual gives some additional information about error messages, if possible.
.SH COPYRIGHT .SH COPYRIGHT
© 2003--2024 Sandia Corporation © 2003--2025 Sandia Corporation
This package is free software; you can redistribute it and/or modify This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as it under the terms of the GNU General Public License version 2 as

View File

@ -14,6 +14,29 @@ As an alternative, you can download a package with pre-built executables
or automated build trees, as described in the :doc:`Install <Install>` or automated build trees, as described in the :doc:`Install <Install>`
section of the manual. section of the manual.
Prerequisites
-------------
Which software you need to compile and use LAMMPS strongly depends on
which :doc:`features and settings <Build_settings>` and which
:doc:`optional packages <Packages_list>` you are trying to include.
Common to all is that you need a C++ and C compiler, where the C++
compiler has to support at least the C++11 standard (note that some
compilers require command-line flag to activate C++11 support).
Furthermore, if you are building with CMake, you need at least CMake
version 3.20 and a compatible build tool (make or ninja-build); if you
are building the the legacy GNU make based build system you need GNU
make (other make variants are not going to work since the build system
uses features unique to GNU make) and a Unix-like build environment with
a Bourne shell, and shell tools like "sed", "grep", "touch", "test",
"tr", "cp", "mv", "rm", "ln", "diff" and so on. Parts of LAMMPS
interface with or use Python version 3.6 or later.
The LAMMPS developers aim to keep LAMMPS very portable and usable -
at least in parts - on most operating systems commonly used for
running MD simulations. Please see the :doc:`section on portablility
<Intro_portability>` for more details.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1

View File

@ -52,9 +52,9 @@ software or for people that want to modify or extend LAMMPS.
compilers can be configured and built concurrently from the same compilers can be configured and built concurrently from the same
source tree. source tree.
- Simplified packaging of LAMMPS for Linux distributions, environment - Simplified packaging of LAMMPS for Linux distributions, environment
modules, or automated build tools like `Homebrew <https://brew.sh/>`_. modules, or automated build tools like `Spack <https://spack.io>`_
- Integration of automated unit and regression testing (the LAMMPS side or `Homebrew <https://brew.sh/>`_.
of this is still under active development). - Integration of automated unit and regression testing.
.. _cmake_build: .. _cmake_build:
@ -119,6 +119,13 @@ configured) and additional files like LAMMPS API headers, manpages,
potential and force field files. The location of the installation tree potential and force field files. The location of the installation tree
defaults to ``${HOME}/.local``. defaults to ``${HOME}/.local``.
.. note::
If you have set `-D CMAKE_INSTALL_PREFIX` to install LAMMPS into a
system location on a Linux machine , you may also have to run (as
root) the `ldconfig` program to update the cache file for fast lookup
of system shared libraries.
.. _cmake_options: .. _cmake_options:
Configuration and build options Configuration and build options

View File

@ -255,11 +255,10 @@ Traditional make
Before building LAMMPS, you must build the GPU library in ``lib/gpu``\ . Before building LAMMPS, you must build the GPU library in ``lib/gpu``\ .
You can do this manually if you prefer; follow the instructions in You can do this manually if you prefer; follow the instructions in
``lib/gpu/README``. Note that the GPU library uses MPI calls, so you must ``lib/gpu/README``. Note that the GPU library uses MPI calls, so you
use the same MPI library (or the STUBS library) settings as the main must use the same MPI library (or the STUBS library) settings as the
LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ , main LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG`` or
``-DLAMMPS_SMALLBIG``\ , or ``-DLAMMPS_SMALLSMALL`` settings in whichever ``-DLAMMPS_SMALLBIG`` settings in whichever Makefile you use.
Makefile you use.
You can also build the library in one step from the ``lammps/src`` dir, You can also build the library in one step from the ``lammps/src`` dir,
using a command like these, which simply invokes the ``lib/gpu/Install.py`` using a command like these, which simply invokes the ``lib/gpu/Install.py``
@ -1139,11 +1138,10 @@ POEMS package
PYTHON package PYTHON package
--------------------------- ---------------------------
Building with the PYTHON package requires you have a the Python development Building with the PYTHON package requires you have a the Python
headers and library available on your system, which needs to be a Python 2.7 development headers and library available on your system, which
version or a Python 3.x version. Since support for Python 2.x has ended, needs to be Python version 3.6 or later. See ``lib/python/README``
using Python 3.x is strongly recommended. See ``lib/python/README`` for for additional details.
additional details.
.. tabs:: .. tabs::
@ -1159,7 +1157,7 @@ additional details.
set the Python_EXECUTABLE variable to specify which Python set the Python_EXECUTABLE variable to specify which Python
interpreter should be used. Note note that you will also need to interpreter should be used. Note note that you will also need to
have the development headers installed for this version, have the development headers installed for this version,
e.g. python2-devel. e.g. python3-devel.
.. tab:: Traditional make .. tab:: Traditional make

View File

@ -30,9 +30,9 @@ additional tools to be available and functioning.
* A Bourne shell compatible "Unix" shell program (frequently this is ``bash``) * A Bourne shell compatible "Unix" shell program (frequently this is ``bash``)
* A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname`` * A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname``
* Python (optional, required for ``make lib-<pkg>`` in the ``src`` * Python (optional, required for ``make lib-<pkg>`` in the ``src``
folder). Python scripts are currently tested with python 2.7 and folder). Python scripts are currently tested with 3.6 to 3.11.
3.6 to 3.11. The procedure for :doc:`building the documentation The procedure for :doc:`building the documentation <Build_manual>`
<Build_manual>` *requires* Python 3.5 or later. *requires* Python 3.8 or later.
Getting started Getting started
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^

View File

@ -78,8 +78,7 @@ folder. The following ``make`` commands are available:
make epub # generate LAMMPS.epub in ePUB format using Sphinx make epub # generate LAMMPS.epub in ePUB format using Sphinx
make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert
make fasthtml # generate approximate HTML in fasthtml dir using Sphinx make fasthtml # generate approximate HTML in fasthtml dir using pandoc
# some Sphinx extensions do not work correctly with this
make clean # remove intermediate RST files created by HTML build make clean # remove intermediate RST files created by HTML build
make clean-all # remove entire build folder and any cached data make clean-all # remove entire build folder and any cached data
@ -116,9 +115,9 @@ environment variable.
Prerequisites for HTML Prerequisites for HTML
---------------------- ----------------------
To run the HTML documentation build toolchain, python 3, git, doxygen, To run the HTML documentation build toolchain, Python 3.8 or later, git,
and virtualenv have to be installed locally. Here are instructions for doxygen, and virtualenv have to be installed locally. Here are
common setups: instructions for common setups:
.. tabs:: .. tabs::
@ -128,13 +127,7 @@ common setups:
sudo apt-get install git doxygen sudo apt-get install git doxygen
.. tab:: RHEL or CentOS (Version 7.x) .. tab:: Fedora or RHEL/AlmaLinux/RockyLinux (8.x or later)
.. code-block:: bash
sudo yum install git doxygen
.. tab:: Fedora or RHEL/CentOS (8.x or later)
.. code-block:: bash .. code-block:: bash
@ -154,7 +147,36 @@ Prerequisites for PDF
In addition to the tools needed for building the HTML format manual, In addition to the tools needed for building the HTML format manual,
a working LaTeX installation with support for PDFLaTeX and a selection a working LaTeX installation with support for PDFLaTeX and a selection
of LaTeX styles/packages are required. To run the PDFLaTeX translation of LaTeX styles/packages are required. Apart from LaTeX packages that
are usually installed by default, the following packages are required:
.. table_from_list::
:columns: 11
- amsmath
- anysize
- babel
- capt-of
- cmap
- dvipng
- ellipse
- fncychap
- fontawesome
- framed
- geometry
- gyre
- hyperref
- hypcap
- needspace
- pict2e
- times
- tabulary
- titlesec
- upquote
- wrapfig
- xindy
To run the PDFLaTeX translation
the ``latexmk`` script needs to be installed as well. the ``latexmk`` script needs to be installed as well.
Prerequisites for ePUB and MOBI Prerequisites for ePUB and MOBI
@ -182,12 +204,42 @@ documentation is required and either existing files in the ``src``
folder need to be updated or new files added. These files are written in folder need to be updated or new files added. These files are written in
`reStructuredText <rst_>`_ markup for translation with the Sphinx tool. `reStructuredText <rst_>`_ markup for translation with the Sphinx tool.
Testing your contribution
^^^^^^^^^^^^^^^^^^^^^^^^^
Before contributing any documentation, please check that both the HTML Before contributing any documentation, please check that both the HTML
and the PDF format documentation can translate without errors. During and the PDF format documentation can translate without errors and that
testing the html translation, you may use the ``make fasthtml`` command there are no spelling issues. This is done with ``make html``, ``make pdf``,
which does an approximate translation (i.e. not all Sphinx features and and ``make spelling``, respectively.
extensions will work), but runs very fast because it will only translate
files that have been changed since the last ``make fasthtml`` command. Fast and approximate translation to HTML
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Translating the full manual to HTML or PDF can take a long time. Thus
there is a fast and approximate way to translate the reStructuredText to
HTML as a quick-n-dirty way of checking your manual page.
This translation uses `Pandoc <https://pandoc.org>`_ instead of Sphinx
and thus all special Sphinx features (cross-references, advanced tables,
embedding of Python docstrings or doxygen documentation, and so on) will
not render correctly. Most embedded math should render correctly. This
is a **very fast** way to check the syntax and layout of a documentation
file translated to HTML while writing or updating it.
To translate **all** manual pages, you can type ``make fasthtml`` at the
command line. The translated HTML files are then in the ``fasthtml``
folder. All subsequent ``make fasthtml`` commands will only translate
``.rst`` files that have been changed. The ``make fasthtml`` command
can be parallelized with make using the `-j` flag. You can also
directly translate only individual pages: e.g. to translate only the
``doc/src/pair_lj.rst`` page type ``make fasthtml/pair_lj.html``
After writing the documentation is completed, you will still need
to verify with ``make html`` and ``make pdf`` that it translates
correctly in both formats.
Tests for consistency, completeness, and other known issues
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please also check the output to the console for any warnings or problems. There will Please also check the output to the console for any warnings or problems. There will
be multiple tests run automatically: be multiple tests run automatically:

View File

@ -8,12 +8,13 @@ Optional build settings
LAMMPS can be built with several optional settings. Each subsection LAMMPS can be built with several optional settings. Each subsection
explains how to do this for building both with CMake and make. explains how to do this for building both with CMake and make.
* `C++11 standard compliance`_ when building all of LAMMPS * `C++11 and C++17 standard compliance`_ when building all of LAMMPS
* `FFT library`_ for use with the :doc:`kspace_style pppm <kspace_style>` command * `FFT library`_ for use with the :doc:`kspace_style pppm <kspace_style>` command
* `Size of LAMMPS integer types and size limits`_ * `Size of LAMMPS integer types and size limits`_
* `Read or write compressed files`_ * `Read or write compressed files`_
* `Output of JPEG, PNG, and movie files`_ via the :doc:`dump image <dump_image>` or :doc:`dump movie <dump_image>` commands * `Output of JPEG, PNG, and movie files`_ via the :doc:`dump image <dump_image>` or :doc:`dump movie <dump_image>` commands
* `Support for downloading files`_ * `Support for downloading files from the input`_
* `Prevent download of large potential files`_
* `Memory allocation alignment`_ * `Memory allocation alignment`_
* `Workaround for long long integers`_ * `Workaround for long long integers`_
* `Exception handling when using LAMMPS as a library`_ to capture errors * `Exception handling when using LAMMPS as a library`_ to capture errors
@ -23,14 +24,15 @@ explains how to do this for building both with CMake and make.
.. _cxx11: .. _cxx11:
C++11 standard compliance C++11 and C++17 standard compliance
------------------------- -----------------------------------
A C++11 standard compatible compiler is a requirement for compiling LAMMPS. A C++11 standard compatible compiler is currently the minimum
LAMMPS version 3 March 2020 is the last version compatible with the previous requirement for compiling LAMMPS. LAMMPS version 3 March 2020 is the
C++98 standard for the core code and most packages. Most currently used last version compatible with the previous C++98 standard for the core
C++ compilers are compatible with C++11, but some older ones may need extra code and most packages. Most currently used C++ compilers are compatible
flags to enable C++11 compliance. Example for GNU c++ 4.8.x: with C++11, but some older ones may need extra flags to enable C++11
compliance. Example for GNU c++ 4.8.x:
.. code-block:: make .. code-block:: make
@ -40,6 +42,17 @@ Individual packages may require compliance with a later C++ standard
like C++14 or C++17. These requirements will be documented with the like C++14 or C++17. These requirements will be documented with the
:doc:`individual packages <Packages_details>`. :doc:`individual packages <Packages_details>`.
.. versionchanged:: 4Feb2025
Starting with LAMMPS version 4 February 2025 we are starting a
transition to require the C++17 standard. Most current compilers are
compatible and if the C++17 standard is available by default, LAMMPS
will enable C++17 and will compile normally. If the chosen compiler is
not compatible with C++17, but only supports C++11, then the define
-DLAMMPS_CXX11 is required to fall back to compiling with a C++11
compiler. After the next stable release of LAMMPS in summer 2025, the
LAMMPS development branch and future releases will require C++17.
---------- ----------
.. _fft: .. _fft:
@ -303,7 +316,7 @@ large counters can become before "rolling over". The default setting of
.. code-block:: bash .. code-block:: bash
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall -D LAMMPS_SIZES=value # smallbig (default) or bigbig
If the variable is not set explicitly, "smallbig" is used. If the variable is not set explicitly, "smallbig" is used.
@ -314,7 +327,7 @@ large counters can become before "rolling over". The default setting of
.. code-block:: make .. code-block:: make
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
@ -323,34 +336,27 @@ LAMMPS system size restrictions
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
:widths: 18 27 28 27 :widths: 27 36 37
:align: center :align: center
* - * -
- smallbig - smallbig
- bigbig - bigbig
- smallsmall
* - Total atom count * - Total atom count
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`) - :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`) - :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
- :math:`2^{31}` atoms (= :math:`2.147 \cdot 10^9`)
* - Total timesteps * - Total timesteps
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`) - :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`) - :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
- :math:`2^{31}` steps (= :math:`2.147 \cdot 10^9`)
* - Atom ID values * - Atom ID values
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)` - :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
- :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})` - :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})`
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
* - Image flag values * - Image flag values
- :math:`-512 \le i \le 511` - :math:`-512 \le i \le 511`
- :math:`- 1\,048\,576 \le i \le 1\,048\,575` - :math:`- 1\,048\,576 \le i \le 1\,048\,575`
- :math:`-512 \le i \le 511`
The "bigbig" setting increases the size of image flags and atom IDs over The "bigbig" setting increases the size of image flags and atom IDs over
"smallbig" and the "smallsmall" setting is only needed if your machine the default "smallbig" setting.
does not support 64-bit integers or incurs performance penalties when
using them.
These are limits for the core of the LAMMPS code, specific features or These are limits for the core of the LAMMPS code, specific features or
some styles may impose additional limits. The :ref:`ATC some styles may impose additional limits. The :ref:`ATC
@ -504,8 +510,8 @@ during a run.
.. _libcurl: .. _libcurl:
Support for downloading files Support for downloading files from the input
----------------------------- --------------------------------------------
.. versionadded:: 29Aug2024 .. versionadded:: 29Aug2024
@ -548,6 +554,25 @@ LAMMPS is compiled accordingly which needs the following settings:
---------- ----------
.. _download_pot:
Prevent download of large potential files
-----------------------------------------
.. versionadded:: 8Feb2023
LAMMPS bundles a selection of potential files in the ``potentials``
folder as examples of how those kinds of potential files look like and
for use with the provided input examples in the ``examples`` tree. To
keep the size of the distributed LAMMPS source package small, very large
potential files (> 5 MBytes) are not bundled, but only downloaded on
demand when the :doc:`corresponding package <Packages_list>` is
installed. This automatic download can be prevented when :doc:`building
LAMMPS with CMake <Build_cmake>` by adding the setting `-D
DOWNLOAD_POTENTIALS=off` when configuring.
----------
.. _align: .. _align:
Memory allocation alignment Memory allocation alignment

View File

@ -140,6 +140,7 @@ additional letter in parenthesis: k = KOKKOS.
* :doc:`plugin <plugin>` * :doc:`plugin <plugin>`
* :doc:`prd <prd>` * :doc:`prd <prd>`
* :doc:`python <python>` * :doc:`python <python>`
* :doc:`region2vmd <region2vmd>`
* :doc:`tad <tad>` * :doc:`tad <tad>`
* :doc:`temper <temper>` * :doc:`temper <temper>`
* :doc:`temper/grem <temper_grem>` * :doc:`temper/grem <temper_grem>`

View File

@ -23,6 +23,7 @@ OPT.
* *
* :doc:`bpm/rotational <bond_bpm_rotational>` * :doc:`bpm/rotational <bond_bpm_rotational>`
* :doc:`bpm/spring <bond_bpm_spring>` * :doc:`bpm/spring <bond_bpm_spring>`
* :doc:`bpm/spring/plastic <bond_bpm_spring_plastic>`
* :doc:`class2 (ko) <bond_class2>` * :doc:`class2 (ko) <bond_class2>`
* :doc:`fene (iko) <bond_fene>` * :doc:`fene (iko) <bond_fene>`
* :doc:`fene/expand (o) <bond_fene_expand>` * :doc:`fene/expand (o) <bond_fene_expand>`

View File

@ -178,6 +178,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`ti <compute_ti>` * :doc:`ti <compute_ti>`
* :doc:`torque/chunk <compute_torque_chunk>` * :doc:`torque/chunk <compute_torque_chunk>`
* :doc:`vacf <compute_vacf>` * :doc:`vacf <compute_vacf>`
* :doc:`vacf/chunk <compute_vacf_chunk>`
* :doc:`vcm/chunk <compute_vcm_chunk>` * :doc:`vcm/chunk <compute_vcm_chunk>`
* :doc:`viscosity/cos <compute_viscosity_cos>` * :doc:`viscosity/cos <compute_viscosity_cos>`
* :doc:`voronoi/atom <compute_voronoi_atom>` * :doc:`voronoi/atom <compute_voronoi_atom>`

View File

@ -162,6 +162,8 @@ OPT.
* :doc:`phonon <fix_phonon>` * :doc:`phonon <fix_phonon>`
* :doc:`pimd/langevin <fix_pimd>` * :doc:`pimd/langevin <fix_pimd>`
* :doc:`pimd/nvt <fix_pimd>` * :doc:`pimd/nvt <fix_pimd>`
* :doc:`pimd/langevin/bosonic <fix_pimd>`
* :doc:`pimd/nvt/bosonic <fix_pimd>`
* :doc:`planeforce <fix_planeforce>` * :doc:`planeforce <fix_planeforce>`
* :doc:`plumed <fix_plumed>` * :doc:`plumed <fix_plumed>`
* :doc:`poems <fix_poems>` * :doc:`poems <fix_poems>`

View File

@ -87,7 +87,7 @@ Minimize style fire/old
.. deprecated:: 8Feb2023 .. deprecated:: 8Feb2023
Minimize style *fire/old* has been removed. Its functionality can be Minimize style *fire/old* has been removed. Its functionality can be
reproduced with *fire* with specific options. Please see the reproduced with style *fire* with specific options. Please see the
:doc:`min_modify command <min_modify>` documentation for details. :doc:`min_modify command <min_modify>` documentation for details.
Pair style mesont/tpm, compute style mesont, atom style mesont Pair style mesont/tpm, compute style mesont, atom style mesont
@ -170,6 +170,18 @@ performance characteristics on NVIDIA GPUs. Both, the KOKKOS
and the :ref:`GPU package <PKG-GPU>` are maintained and the :ref:`GPU package <PKG-GPU>` are maintained
and allow running LAMMPS with GPU acceleration. and allow running LAMMPS with GPU acceleration.
Compute atom/molecule
_____________________
.. deprecated:: 11 Dec2015
The atom/molecule command has been removed from LAMMPS since it was superseded
by the more general and extensible "chunk infrastructure". Here the system is
partitioned in one of many possible ways - including using molecule IDs -
through the :doc:`compute chunk/atom <compute_chunk_atom>` command and then
summing is done using :doc:`compute reduce/chunk <compute_reduce_chunk>` Please
refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
Fix ave/spatial and fix ave/spatial/sphere Fix ave/spatial and fix ave/spatial/sphere
------------------------------------------ ------------------------------------------

View File

@ -24,4 +24,5 @@ of time and requests from the LAMMPS user community.
Classes Classes
Developer_platform Developer_platform
Developer_utils Developer_utils
Developer_internal
Developer_grid Developer_grid

View File

@ -0,0 +1,113 @@
Internal Styles
---------------
LAMMPS has a number of styles that are not meant to be used in an input
file and thus are not documented in the :doc:`LAMMPS command
documentation <Commands_all>`. The differentiation between user
commands and internal commands is through the case of the command name:
user commands and styles are all lower case, internal styles are all
upper case. Internal styles are not called from the input file, but
their classes are instantiated by other styles. Often they are
created by other styles to store internal data or to perform actions
regularly at specific steps of the simulation.
The paragraphs below document some of those styles that have general
utility and may be used to avoid redundant implementation.
DEPRECATED Styles
^^^^^^^^^^^^^^^^^
The styles called DEPRECATED (e.g. pair, bond, fix, compute, region, etc.)
have the purpose to inform users that a specific style has been removed
or renamed. This is achieved by creating an alias for the deprecated
style to the corresponding class. For example, the fix style DEPRECATED
is aliased to fix style ave/spatial and fix style ave/spatial/sphere with
the following code:
.. code-block:: c++
FixStyle(DEPRECATED,FixDeprecated);
FixStyle(ave/spatial,FixDeprecated);
FixStyle(ave/spatial/sphere,FixDeprecated);
The individual class will then determine based on the style name
what action to perform:
- inform that the style has been removed and what style replaces it, if any, and then error out
- inform that the style has been renamed and then either execute the replacement or error out
- inform that the style is no longer required, and it is thus ignored and continue
There is also a section in the user's guide for :doc:`removed commands
and packages <Commands_removed>` with additional explanations.
Internal fix styles
^^^^^^^^^^^^^^^^^^^
fix DUMMY
"""""""""
Most fix classes cannot be instantiated before the simulation box has
been created since they access data that is only available then.
However, in some cases it is required that a fix must be at or close to
the top of the list of all fixes. In those cases an instance of the
DUMMY fix style may be created by calling ``Modify::add_fix()`` and then
later replaced by calling ``Modify::replace_fix()``.
fix STORE/ATOM
""""""""""""""
Fix STORE/ATOM can be used as persistent storage of per-atom data.
**Syntax**
.. code-block:: LAMMPS
fix ID group-ID STORE/ATOM N1 N2 gflag rflag
* ID, group-ID are documented in :doc:`fix <fix>` command
* STORE/ATOM = style name of this fix command
* N1 = 1, N2 = 0 : data is per-atom vector = single value per atom
* N1 > 1, N2 = 0 : data is per-atom array = N1 values per atom
* N1 > 0, N2 > 0 : data is per-atom tensor = N1xN2 values per atom
* gflag = 1 communicate per-atom values with ghost atoms, 0 do not update ghost atom data
* rflag = 1 store per-atom value in restart file, 0 do not store data in restart
Similar functionality is also available through using custom per-atom
properties with :doc:`fix property/atom <fix_property_atom>`. The
choice between the two fixes should be based on whether the user should
be able to access this per-atom data: if yes, then fix property/atom is
preferred, otherwise fix STORE/ATOM.
fix STORE/GLOBAL
""""""""""""""""
Fix STORE/GLOBAL can be used as persistent storage of global data with support for restarts
**Syntax**
.. code-block:: LAMMPS
fix ID group-ID STORE/GLOBAL N1 N2
* ID, group-ID are documented in :doc:`fix <fix>` command
* STORE/GLOBAL = style name of this fix command
* N1 >=1 : number of global items to store
* N2 = 1 : data is global vector of length N1
* N2 > 1 : data is global N1xN2 array
fix STORE/LOCAL
"""""""""""""""
Fix STORE/LOCAL can be used as persistent storage for local data
**Syntax**
.. code-block:: LAMMPS
fix ID group-ID STORE/LOCAL Nreset Nvalues
* ID, group-ID are documented in :doc:`fix <fix>` command
* STORE/LOCAL = style name of this fix command
* Nreset = frequency at which local data is available
* Nvalues = number of values per local item, that is the number of columns

View File

@ -270,7 +270,10 @@ There are multiple "signatures" that can be called:
- ``Error::all(FLERR, idx, "Error message")``: this is for argument - ``Error::all(FLERR, idx, "Error message")``: this is for argument
parsing where "idx" is the index (starting at 0) of the argument for a parsing where "idx" is the index (starting at 0) of the argument for a
LAMMPS command that is causing the failure (use -1 for the command LAMMPS command that is causing the failure (use -1 for the command
itself). The output may also include the last input line *before* and itself). For index 0, you need to use the constant ``Error::ARGZERO``
to work around the inability of some compilers to disambiguate between
a NULL pointer and an integer constant 0, even with an added type cast.
The output may also include the last input line *before* and
*after*, if they differ due to substituting variables. A textual *after*, if they differ due to substituting variables. A textual
indicator is pointing to the specific word that failed. Using the indicator is pointing to the specific word that failed. Using the
constant ``Error::NOPOINTER`` in place of the *idx* argument will constant ``Error::NOPOINTER`` in place of the *idx* argument will

View File

@ -1,12 +1,244 @@
Error and warning details Errors and warnings details
========================= ===========================
Many errors or warnings are self-explanatory and thus straightforward to Many errors and warnings that LAMMPS outputs are self-explanatory and
resolve. However, there are also cases, where there is no single cause thus straightforward to resolve. However, there are also cases where
and explanation, where LAMMPS can only detect symptoms of an error but there is no single cause or simple explanation that can be provided in a
not the exact cause, or where the explanation needs to be more detailed than short message printed by LAMMPS. Therefore, more detailed discussions
what can be fit into a message printed by the program. The following are of such scenarios are provided here; first on a more general level and
discussions of such cases. then for specific errors. In the latter cases, LAMMPS will output a
short message and then provide a URL that links to a specific section on
this page.
.. contents::
------
General troubleshooting advice
------------------------------
Below are suggestions that can help to understand the causes of problems
with simulations leading to errors or unexpected results.
.. _hint01:
Create a small test system
^^^^^^^^^^^^^^^^^^^^^^^^^^
Debugging problems often requires running a simulation many times with
small modifications, thus it can be a huge time saver to first assemble
a small test system input that has the same issue, but will take much
time until it triggers the error condition. Also, it will be easier to
see what happens.
.. _hint02:
Visualize your trajectory
^^^^^^^^^^^^^^^^^^^^^^^^^
To better understand what is causing problems, it is often very useful
to visualize the system close to the point of failure. It may be
necessary to have LAMMPS output trajectory frames rather frequently. To
avoid gigantic files, you can use :doc:`dump_modify delay <dump_modify>`
to delay output until the critical section is reached, and you can use a
smaller test system (see above).
.. _hint03:
Parallel versus serial
^^^^^^^^^^^^^^^^^^^^^^
Issues where something is "lost" or "missing" often exhibit that issue
only when running in parallel. That doesn't mean there is no problem,
only the symptoms are not triggering an error quickly. Correspondingly,
errors may be triggered faster with more processors and thus smaller
sub-domains.
.. _hint04:
Segmentation Fault
^^^^^^^^^^^^^^^^^^
A segmentation fault is an error reported by the **operating system**
and not LAMMPS itself. It happens when a process tries to access a
memory address that is not available. This can have **many** reasons:
memory has not been allocated, a memory buffer is not large enough, a
memory address is computed from an incorrect index, a memory buffer is
used after it has been freed, some general memory corruption. When
investigating a segmentation fault (aka segfault), it is important to
determine which process is causing it; it may not always be LAMMPS. For
example, some MPI library implementations report a segmentation fault
from their "mpirun" or "mpiexec" command when the application has been
terminated unexpectedly.
While a segmentation fault is likely an indication of a bug in LAMMPS,
it need not always be; it can also be the consequence of too aggressive
simulation settings. For time critical code paths, LAMMPS will assume
the user has chosen the settings carefully and will not make any checks
to avoid to avoid performance penalties.
A crucial step in resolving a segmentation fault is to identify the
exact location in the code where it happens. Please see `Errors_debug`
for a couple of examples showing how to do this on a Linux machine.
With this information -- a simple way to reproduce the segmentation
fault and the exact :doc:`LAMMPS version <Manual_version>` and platform
you are running on -- you can contact the LAMMPS developers or post in
the LAMMPS forum to get assistance.
.. _hint05:
Fast moving atoms
^^^^^^^^^^^^^^^^^
Fast moving atoms may be "lost" or "missing" when their velocity becomes
so large that they can cross a sub-domain within one timestep. This
often happens when atoms are too close, but atoms may also "move" too
fast from sub-domain to sub-domain if the box changes rapidly.
E.g. when setting a large an initial box with :doc:`shrink-wrap boundary
conditions <boundary>` that collapses on the first step (in this case
the solution is often using 'm' instead of 's' as a boundary condition).
To reduce the impact of "close contacts", one can remove those atoms or
molecules with something like :doc:`delete_atoms overlap 0.1 all all
<delete_atoms>`. With periodic boundaries, a close contact pair of
atoms may be on opposite sides of the simulation box. Another option
would be to first run a minimization (aka quench) before starting
the MD. Reducing the time step can also help. Many times, one just
needs to "ease" the system into a balanced state and can then switch to
more aggressive settings.
The speed of atoms during an MD run depends on the steepness of the
potential function and their mass. Since the positions and velocities
of atoms are computed with finite timesteps, the timestep needs to be
small enough for stable numeric integration of the trajectory. If the
timestep is too large during initialization (or other instances of
extreme dynamics), using :doc:`fix nve/limit <fix_nve_limit>` or
:doc:`fix dt/reset <fix_dt_reset>` temporarily can help to avoid too
large updates or adapt the timestep according to the displacements.
.. _hint06:
Ignoring lost atoms
^^^^^^^^^^^^^^^^^^^
It is tempting to use the :doc:`thermo_modify lost ignore
<thermo_modify>` to avoid LAMMPS aborting with an error on lost atoms.
This setting should, however, *only* be used when atoms *should* leave
the system. In general, ignoring a problem does not solve it.
.. _hint07:
Pressure, forces, positions becoming NaN or Inf
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some potentials can overflow or have a division by zero with close
contacts or bad geometries (for the given force styles in use) leading
to forces that can no longer be represented as numbers. Those will show
as "NaN" or "Inf". On most machines, the program will continue, but
there is no way to recover from it and those NaN or Inf values will
propagate. So-called :doc:`"soft-core" potentials <pair_fep_soft>` or
the :doc:`"soft" repulsive-only pair style <pair_soft>` are less prone
for this behavior (depending on the settings in use) and can be used at
the beginning of a simulation. Also, single precision numbers can
overflow much faster, so for the GPU or INTEL package it may be
beneficial to run with double precision initially before switching to
mixed or single precision for faster execution when the system has
relaxed.
.. _hint08:
Communication cutoff
^^^^^^^^^^^^^^^^^^^^
The communication cutoff determines the "overlap" between sub-domains
and atoms in these regions are referred to in LAMMPS as "ghost atoms".
This region has to be large enough to contain all atoms of a bond,
angle, dihedral, or improper with just one atom in the actual
sub-domain. Typically, this cutoff is set to the largest cutoff from
the :doc:`pair style(s) <pair_style>` plus the :doc:`neighbor list skin
distance <neighbor>` and will typically be sufficient for all bonded
interactions. But if the pair style cutoff is small, this may not be
enough. LAMMPS will print a warning in this case using some heuristic
based on the equilibrium bond length, but that still may not be
sufficient for cases where the force constants are small and thus bonds
may be stretched very far. The communication cutoff can be adjusted
with :doc:`comm_modify cutoff \<value\> <comm_modify>`, but setting this
too large will waste CPU time and memory.
.. _hint09:
Neighbor list settings
^^^^^^^^^^^^^^^^^^^^^^
Every time LAMMPS rebuilds the neighbor lists, LAMMPS will also check
for "lost" or "missing" atoms. Thus it can help to use very
conservative :doc:`neighbor list settings <neigh_modify>` and then
examine the neighbor list statistics if the neighbor list rebuild can be
safely delayed. Rebuilding the neighbor list less frequently
(i.e. through increasing the *delay* or *every*) setting has diminishing
returns and increasing risks.
.. _hint10:
Units
^^^^^
A frequent cause for a variety of problems is due to using the wrong
:doc:`units <units>` settings for a particular potentials, especially
when reading them from a potential file. Most of the (example)
potentials bundled with LAMMPS have a "UNITS:" tag that allows LAMMPS to
check of the units are consistent with what is intended, but potential
files from publications or potential parameter databases may lack this
metadata information and thus will not error out or warn when using the
wrong setting. Most potential files usually use "metal" units, but some
are parameterized for other settings, most notably :doc:`ReaxFF
potentials <pair_reaxff>` that use "real" units.
Also, individual parameters for :doc:`pair_coeff <pair_coeff>` commands
taken from publications or other MD software may need to be converted
and sometimes in unexpected ways. Thus some careful checking is
recommended.
.. _hint11:
No error message printed
^^^^^^^^^^^^^^^^^^^^^^^^
In some cases -- especially when running in parallel with MPI -- LAMMPS
may stop without displaying an error. But the fact that nothing was
displayed does not mean there was not an error message. Instead it is
highly likely that the message was written to a buffer and LAMMPS was
aborted before the buffer was output. Usually, output buffers are
output for every line of output, but sometimes this is delayed until
4096 or 8192 bytes of output have been accumulated. This buffering for
screen and logfile output can be disabled by using the :ref:`-nb
or -nonbuf <nonbuf>` command-line flag. This is most often needed when
debugging crashing multi-replica calculations.
.. _hint12:
Errors before or after the simulation box is created
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As critical step in a LAMMPS input is when the simulation box is
defined, either with a :doc:`create_box command <create_box>`, a
:doc:`read_data command <read_data>`, or a :doc:`read_restart command
<read_restart>`. After this step, certain settings are locked in (e.g.
units, or number of atom, bond, angle, dihedral, improper types) and
cannot be changed after that. Consequently, commands that change such
settings (e.g. :doc:`units <units>`) are only allowed before the box is
defined. Very few commands can be used before and after, like
:doc:`pair_style <pair_style>` (but not :doc:`pair_coeff <pair_coeff>`).
Most LAMMPS commands must be used after the simulation box is created.
Consequently, LAMMPS will stop with an error, if a command is used in
the wrong place. This is not always obvious. So index or string style
:doc:`variables <variable>` can be expanded anywhere in the input, but
equal style (or similar) variables can only be expanded before the box
is defined if they do not reference anything that cannot be defined
before the box (e.g. a compute or fix reference or a thermo keyword).
------
.. _err0001: .. _err0001:
@ -23,19 +255,20 @@ The header section informs LAMMPS how many entries or lines are expected
in the various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of in the various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of
the data file. If there is a mismatch, LAMMPS will either keep reading the data file. If there is a mismatch, LAMMPS will either keep reading
beyond the end of a section or stop reading before the section has beyond the end of a section or stop reading before the section has
ended. In that case the next line will not contain a recognized keyword. ended. In that case the next line will not contain a recognized
keyword.
Such a mismatch can also happen when the first line of the data Such a mismatch can also happen when the first line of the data is *not*
is *not* a comment as required by the format, but a line with a valid a comment as required by the format, but a line with a valid header
header keyword. That would result in LAMMPS expecting, for instance, keyword. That would result in LAMMPS expecting, for instance, 0 atoms
0 atoms because the "atoms" header line is the first line and thus because the "atoms" header line is the first line and thus treated as a
treated as a comment. comment.
Another possibility to trigger this error is to have a keyword in the Another possibility to trigger this error is to have a keyword in the
data file that corresponds to a fix (e.g. :doc:`fix cmap <fix_cmap>`) data file that corresponds to a fix (e.g. :doc:`fix cmap <fix_cmap>`)
but the :doc:`read_data <read_data>` command is missing the (optional) but the :doc:`read_data <read_data>` command is missing the (optional)
arguments that identify the fix and the header keyword and section arguments that identify the fix and its header and section keywords.
keyword or those arguments are inconsistent with the keywords in the Alternatively, those arguments are inconsistent with the keywords in the
data file. data file.
.. _err0002: .. _err0002:
@ -45,35 +278,676 @@ Incorrect format in ... section of data file
This error happens when LAMMPS reads the contents of a section of a This error happens when LAMMPS reads the contents of a section of a
:doc:`data file <read_data>` and the number of parameters in the line :doc:`data file <read_data>` and the number of parameters in the line
differs from what is expected. This most commonly happens, when the differs from what is expected. This most commonly happens when the atom
atom style is different from what is expected for a specific data file style is different from what is expected for a specific data file since
since changing the atom style usually changes the format of the line. changing the atom style usually changes the format of the line.
This error can also happen when the number of entries indicated in the This error can also occur when the number of entries indicated in the
header of a data file (e.g. the number of atoms) is larger than the header of a data file (e.g. the number of atoms) is larger than the
number of lines provided (e.g. in the corresponding Atoms section) number of lines provided (e.g. in the corresponding Atoms section)
and then LAMMPS will continue reading into the next section and that causing LAMMPS to continue reading into the next section which has a
would have a completely different format. completely different format.
.. _err0003: .. _err0003:
Illegal variable command: expected X arguments but found Y Illegal variable command: expected X arguments but found Y
---------------------------------------------------------- ----------------------------------------------------------
This error indicates that there are the wrong number of arguments for a This error indicates that a variable command has the wrong number of
specific variable command, but a common reason for that is a variable arguments. A common reason for this is that the variable expression has
expression that has whitespace but is not enclosed in single or double whitespace, but is not enclosed in single or double quotes.
quotes.
To explain, the LAMMPS input parser reads and processes lines. The To explain, the LAMMPS input parser reads and processes lines. The
resulting line is broken down into "words". Those are usually resulting line is broken down into "words". Those are usually
individual commands, labels, names, values separated by whitespace (a individual commands, labels, names, and values separated by whitespace
space or tab character). For "words" that may contain whitespace, they (a space or tab character). For "words" that may contain whitespace,
have to be enclosed in single (') or double (") quotes. The parser will they have to be enclosed in single (') or double (") quotes. The parser
then remove the outermost pair of quotes and then pass that string as will then remove the outermost pair of quotes and pass that string as
"word" to the variable command. "word" to the variable command.
Thus missing quotes or accidental extra whitespace will lead to the Thus missing quotes or accidental extra whitespace will trigger this
error shown in the header because the unquoted whitespace will result error because the unquoted whitespace will result in the text being
in the text being broken into more "words", i.e. the variable expression broken into more "words", i.e. the variable expression being split.
being split.
.. _err0004:
Out of range atoms - cannot compute ...
---------------------------------------
The PPPM (and also PPPMDisp and MSM) methods need to assemble a grid of
electron density data derived from the (partial) charges assigned to the
atoms. These charges are smeared out across multiple grid points (see
:doc:`kspace_modify order <kspace_modify>`). When running in parallel
with MPI, LAMMPS uses a :doc:`domain decomposition scheme
<Developer_par_part>` where each processor manages a subset of atoms and
thus also a grid representing the density. The processor's grid covers
the actual volume of the sub-domain and some extra space corresponding
to the :doc:`neighbor list skin <neighbor>`. These are then
:doc:`combined and redistributed <Developer_par_long>` for parallel
processing of the long-range component of the Coulomb interaction.
The ``Out of range atoms`` error can happen when atoms move too fast,
the neighbor list skin is too small, or the neighbor lists are not
updated frequently enough. The smeared charges cannot then be fully
assigned to the density grid for all atoms. LAMMPS checks for this
condition and stops with an error. Most of the time, this is an
indication of a system with very high forces, often at the beginning of
a simulation or when boundary conditions are changed. The error becomes
more likely with more MPI processes.
There are multiple options to explore for avoiding the error. The best
choice depends strongly on the individual system, and often a
combination of changes is required. For example, more conservative MD
parameter settings can be used (larger neighbor skin, shorter time step,
more frequent neighbor list updates). Sometimes, it helps to revisit
the system generation and avoid close contacts when building it.
Otherwise one can use the :doc:`delete_atoms overlap<delete_atoms>`
command to delete those close contact atoms or run a minimization before
the MD. It can also help to temporarily use a cutoff-Coulomb pair style
and no kspace style until the system has somewhat equilibrated and then
switch to the long-range solver.
.. _err0005:
Bond (or angle, dihedral, improper, cmap, or shake) atoms missing
-----------------------------------------------------------------
The second atom needed to compute a particular bond (or the third or
fourth atom for angle, dihedral, or improper) is missing on the
indicated timestep and processor. Typically, this is because the two
bonded atoms have become too far apart relative to the communication
cutoff distance for ghost atoms. By default, the communication cutoff
is set by the pair cutoff. However, to accommodate larger distances
between topologically connected atoms, it can be manually adjusted using
:doc:`comm_modify <comm_modify>` at the cost of increased communication
and more ghost atoms. However, missing bond atoms may also indicate
that there are unstable dynamics which caused the atoms to blow apart.
In this scenario, increasing the communication distance will not solve
the underlying issue. Rather, see :ref:`Fast moving atoms <hint05>` and
:ref:`Neighbor list settings <hint09>` in the general troubleshooting
section above for ideas to fix unstable dynamics.
If atoms are intended to be lost during a simulation (e.g. due to open
boundary conditions or :doc:`fix evaporate <fix_evaporate>`) such that
two bonded atoms may be lost at different times from each other, this
error can be converted to a warning or turned off using the *lost/bond*
keyword in the :doc:`thermo_modify <thermo_modify>` command.
.. _err0006:
Non-numeric atom coords or pressure or box dimensions - simulation unstable
---------------------------------------------------------------------------
This error usually occurs due to overly aggressive simulation settings
or issues with the system geometry or the potential. See
:ref:`Pressure, forces, positions becoming NaN or Inf <hint07>` above in
the general troubleshooting section. This error is more likely to
happen during equilibration, so it can help to do a minimization before
or even add a second or third minimization after running a few
equilibration MD steps. It also is more likely when directly using a
Nose-Hoover (or other) barostat, and thus it may be advisable to run
with only a thermostat for a bit until the potential energy has
stabilized.
.. _err007:
Fix used in ... not computed at compatible time
-----------------------------------------------
Many fix styles are invoked only every *nevery* timesteps, which means
their data is only valid on those steps. When data from a fix is used
as input for a compute, a dump, another fix, or thermo output, it must
read that data at timesteps when the fix in question was invoked, i.e.
on timesteps that are multiples of its *nevery* setting. If this is not
the case, LAMMPS will stop with an error. To remedy this, it may be
required to change the output frequency or the *nevery* setting of the
fix.
.. _err0008:
Lost atoms ...
--------------
A simulation stopping with an error due to lost atoms can have multiple
causes. By default, LAMMPS checks for whether the total number of atoms
is consistent with the sum of atoms "owned" by MPI processors every time
that thermodynamic output is written. In the majority of cases, lost
atoms are unexpected and a result of extremely high velocities causing
instabilities in the system. Such velocities can result from a variety
of issues. For ideas on how to track down issues with unexpected lost
atoms, see :ref:`Fast moving atoms <hint05>` and :ref:`Neighbor list
settings <hint09>` in the general troubleshooting section above. In
specific situations however, losing atoms is expected material behavior
(e.g. with sputtering and surface evaporation simulations), and an
unwanted crash can be avoided by changing the :doc:`thermo_modify lost
<thermo_modify>` keyword from the default 'error' to 'warn' or 'ignore'
(though heed the advice in :ref:`Ignoring lost atoms <hint06>` above!).
.. _err0009:
Too many neighbor bins
----------------------
The simulation box is or has become too large relative to the size of a
neighbor bin (which in turn depends on the largest pair-wise cutoff by
default) such that LAMMPS is unable to store the needed number of bins.
This typically implies the simulation box has expanded too far. That
can occur when some atoms move rapidly apart with shrink-wrap boundaries
or when a fix (like fix deform or a barostat) excessively grows the
simulation box. This can also happen if the largest pair-wise cutoff is
small. In this case, the error can be avoided by using the
:doc:`neigh_modify command <neigh_modify>` to set the bin width to a
suitably large value.
.. _err0010:
Unrecognized ... style ... is part of ... package which is not enabled in this LAMMPS binary
--------------------------------------------------------------------------------------------
The LAMMPS executable (binary) being used was not compiled with a
package containing the specified style. This indicates that the
executable needs to be re-built after enabling the correct package in
the relevant Makefile or CMake build directory. See
:doc:`Section 3. Build LAMMPS <Build>` for more details. One can check
if the expected package and pair style is present in the executable by
running it with the ``-help`` (or ``-h``) flag on the command line. One
common oversight, especially for beginner LAMMPS users, is enabling the
package but forgetting to run commands to rebuild (e.g., to run the
final ``make`` or ``cmake`` command).
If this error occurs with an executable that the user does not control
(e.g., through a module on HPC clusters), the user will need to get in
contact with the relevant person or people who can update the
executable.
.. _err011:
Energy or stress was not tallied by pair style
----------------------------------------------
This warning can be printed by computes from the :ref:`TALLY package
<PKG-TALLY>`. Those use a callback mechanism that only work for regular
pair-wise additive pair styles like :doc:`Lennard-Jones <pair_lj>`,
:doc:`Morse <pair_morse>`, :doc:`Born-Meyer-Huggins <pair_born>`, and
similar. Such required callbacks have not been implemented for
many-body potentials so one would have to implement them to add
compatibility with these computes (which may be difficult to do in a
generic fashion). Whether this warning indicates that contributions to
the computed properties are missing depends on the groups used. At any
rate, careful testing of the results is advised when this warning
appears.
.. _err0012:
fmt::format_error
-----------------
LAMMPS uses the `{fmt} library <https://fmt.dev>`_ for advanced string
formatting tasks. This is similar to the ``printf()`` family of
functions from the standard C library, but more flexible. If there is a
bug in the LAMMPS code and the format string does not match the list of
arguments or has some other error, this error message will be shown.
You should contact the LAMMPS developers and report the bug as a `GitHub
Bug Report Issue <https://github.com/lammps/lammps/issues>`_ along with
sufficient information to easily reproduce it.
.. _err0013:
Substitution for illegal variable
---------------------------------
A variable in an input script or a variable expression was not found in
the list of valid variables. The most common reason for this is a typo
somewhere in the input file such that the expression uses an invalid
variable name. The second most common reason is omitting the curly
braces for a direct variable with a name that is not a single letter.
For example:
.. code-block:: LAMMPS
variable cutoff index 10.0
pair_style lj/cut ${cutoff} # this is correct
pair_style lj/cut $cutoff # this is incorrect, LAMMPS looks for 'c' instead of 'cutoff'
variable c index 5.0 # if $c is defined, LAMMPS subsitutes only '$c' and reads: 5utoff
Another potential source of this error may be invalid command line
variables (-var or -v argument) used when launching LAMMPS from an
interactive shell or shell scripts. An uncommon source for this error
is using the :doc:`next command <next>` to advance through a list of
values provided by an index style variable. If there is no remaining
element in the list, LAMMPS will delete the variable and any following
expansion or reference attempt will trigger the error.
Users with harder-to-track variable errors might also find reading the
:doc:`Parsing rules for input scripts <Commands_parse>` helpful.
.. _err0014:
Bond atom missing in image check or box size check
--------------------------------------------------
This can be either an error or a warning depending on your
:doc:`thermo_modify settings <thermo_modify>`. It is flagged in a part
of the LAMMPS code where it updates the domain decomposition and before
it builds the neighbor lists. It checks that both atoms of a bond are
within the communication cutoff of a subdomain. It is usually caused by
atoms moving too fast (see the :ref:`paragraph on fast moving atoms
<hint05>`), or by the :doc:`communication cutoff being too small
<comm_modify>`, or by waiting too long between :doc:`sub-domain and
neighbor list updates <neigh_modify>`.
.. _err0015:
Cannot use neighbor bins - box size \<\< cutoff
-----------------------------------------------
LAMMPS is unable to build neighbor bins since the size of the box is
much smaller than an interaction cutoff in at least one of its
dimensions. Typically, this error is triggered when the simulation box
has one very thin dimension. If a cubic neighbor bin had to fit exactly
within the thin dimension, then an inordinate amount of bins would be
created to fill space. This error can be avoided using the generally
slower :doc:`nsq neighbor style <neighbor>` or by increasing the size of
the smallest box lengths.
.. _err0016:
Did not assign all atoms correctly
----------------------------------
This error happens most commonly when :doc:`reading a data file
<read_data>` under :doc:`non-periodic boundary conditions<boundary>`.
Only atoms with positions **inside** the simulation box will be read and
thus any atoms outside the box will be skipped and the total atom count
will not match, which triggers the error. This does not happen with
periodic boundary conditions where atoms outside the principal box will
be "wrapped" into the principal box and their image flags set
accordingly.
Similar errors can happen with the :doc:`replicate command<replicate>`
or the :doc:`read_restart command<read_restart>`. In these cases the
cause may be a problematic geometry, an insufficient communication
cutoff, or a bug in the LAMMPS source code. In these cases it is
advisable to set up :ref:`small test case <hint01>` for testing and
debugging. This will be required in case you need to get help from a
LAMMPS developer.
.. _err0017:
Domain too large for neighbor bins
----------------------------------
The domain has become extremely large so that neighbor bins cannot be
used. Too many neighbor bins would need to be created to fill space.
Most likely, one or more atoms have been blown a great distance out of
the simulation box or a fix (like fix deform or a barostat) has
excessively grown the simulation box.
.. _err0018:
Step X: (h)bondchk failed
-------------------------
This error is a consequence of the heuristic memory allocations for
buffers of the regular ReaxFF version. In ReaxFF simulations, the lists
of bonds and hydrogen bonds can change due to chemical reactions. The
default approach, however, assumes that these changes are not very
large, so it allocates buffers for the current system setup plus a
safety margin. This can be adjusted with the :doc:`safezone, mincap,
and minhbonds settings of the pair style <pair_reaxff>`, but only to
some extent. When equilibrating a new system, or simulating a sparse
system in parallel, this can be difficult to control and become
wasteful. A simple workaround is often to break a simulation down in
multiple chunks. A better approach, however, is to compile and use the
KOKKOS package version of ReaxFF (you do not need a GPU for that, but
can also compile it in serial or OpenMP mode), which uses a more robust
memory allocation approach.
.. _err0019:
Numeric index X is out of bounds
--------------------------------
This error most commonly happens when setting force field coefficients
with either the :doc:`pair_coeff <pair_coeff>`, the :doc:`bond_coeff
<bond_coeff>`, the :doc:`angle_coeff <angle_coeff>`, the
:doc:`dihedral_coeff <dihedral_coeff>`, or the :doc:`improper_coeff
<improper_coeff>` command. These commands accept type labels, explicit
numbers, and wildcards for ranges of numbers. If the numeric value of
any of these is outside the valid range (defined by the number of
corresponding types), LAMMPS will stop with this error. A few other
commands and styles also allow ranges of numbers and check using the
same method and thus print the same kind of error.
The cause is almost always a typo in the input or a logic error when
defining the values or ranges. So one needs to carefully review the
input. Along with the error, LAMMPS will print the valid range as a
hint.
.. _err0020:
Compute, fix, or variable vector or array is accessed out-of-range
------------------------------------------------------------------
When accessing an individual element of a global vector or array or a
per-atom vector or array provided by a compute or fix or atom-style or
vector-style variable or data from a specific atom, an index in square
brackets ("[ ]") (or two indices) must be provided to determine which
element to access and it must be in a valid range or else LAMMPS would
access invalid data or crash with a segmentation fault. In the two most
common cases, where this data is accessed, :doc:`variable expressions
<variable>` and :doc:`thermodynamic output <thermo_style>`, LAMMPS will
check for valid indices and stop with an error otherwise.
While LAMMPS is written in C++ (which uses 0 based indexing) these
indices start at 1 (i.e. similar to Fortran). Any index smaller than 1
or larger than the maximum allowed value should trigger this error.
Since this kind of error frequently happens with rather complex
expressions, it is recommended to test these with small test systems,
where the values can be tracked with output files for all relevant
properties at every step.
.. _err0021:
Incorrect args for pair coefficients (also bond/angle/dihedral/improper coefficients)
-------------------------------------------------------------------------------------
The parameters in the :doc:`pair_coeff <pair_coeff>` command for a
specified :doc:`pair_style <pair_style>` have a missing or erroneous
argument. The same applies when seeing this error for :doc:`bond_coeff
<bond_coeff>`, :doc:`angle_coeff <angle_coeff>`, :doc:`dihedral_coeff
<dihedral_coeff>`, or :doc:`improper_coeff <improper_coeff>` and their
respective style commands when using the MOLECULE or EXTRA-MOLECULE
packages. The cases below describe some ways to approach pair
coefficient errors, but the same strategies apply to bonded systems as
well.
Outside of normal typos, this error can have several sources. In all
cases, the first step is to compare the command arguments to the
expected format found in the corresponding :doc:`pair_style
<pair_style>` page. This can reveal cases where, for example, a pair
style was changed, but the pair coefficients were not updated. This can
happen especially with pair style variants such as :doc:`pair_style eam
<pair_eam>` vs. :doc:`pair_style eam/alloy <pair_style>` that look very
similar but accept different parameters (the latter 'eam/alloy' variant
takes element type names while 'eam' does not).
Another common source of coefficient errors is when using multiple pair
styles with commands such as :doc:`pair_style hybrid <pair_hybrid>`.
Using hybrid pair styles requires adding an extra "label" argument in
the coefficient commands that designates which pair style the command
line refers to. Moreover, if the same pair style is used multiple
times, this label must be followed by an additional numeric argument.
Also, different pair styles may require different arguments.
This error message might also require a close look at other LAMMPS input
files that are read in by the input script, such as data files or
restart files.
.. _err0022:
Energy was not tallied on needed timestep (also virial, per-atom energy, per-atom virial)
-----------------------------------------------------------------------------------------
This error is generated when LAMMPS attempts to access an out-of-date or
non-existent energy, pressure, or virial. For efficiency reasons,
LAMMPS does *not* calculate these quantities when the forces are
calculated on every timestep or iteration. Global quantities are only
calculated when they are needed for :doc:`thermo <thermo_style>` output
(at the beginning, end, and at regular intervals specified by the
:doc:`thermo <thermo>` command). Similarly, per-atom quantities are
only calculated if they are needed to write per-atom energy or virial to
a dump file. This system works fine for simple input scripts. However,
the many user-specified `variable`, `fix`, and `compute` commands that
LAMMPS provides make it difficult to anticipate when a quantity will be
requested. In some use cases, LAMMPS will figure out that a quantity is
needed and arrange for it to be calculated on that timestep e.g. if it
is requested by :doc:`fix ave/time <fix_ave_time>` or similar commands.
If that fails, it can be detected by a mismatch between the current
timestep and when a quantity was last calculated, in which case an error
message of this type is generated.
The most common cause of this type of error is requesting a quantity
before the start of the simulation.
.. code-block:: LAMMPS
# run 0 post no # this will fix the error
variable e equal pe # requesting energy compute
print "Potential energy = $e" # this will generate the error
run 1000 # start of simulation
This situation can be avoided by adding in a "run 0" command, as
explained in more detail in the "Variable Accuracy" section of the
:doc:`variable <variable>` doc page.
Another cause is requesting a quantity on a timestep that is not a
thermo or dump output timestep. This can often be remedied by
increasing the frequency of thermo or dump output.
.. _err0023:
Molecule auto special bond generation overflow
----------------------------------------------
In order to correctly apply the :doc:`special_bonds <special_bonds>`
settings (also known as "exclusions"), LAMMPS needs to maintain for each
atom a list of atoms that are connected to this atom, either directly
with a bond or indirectly through bonding with an intermediate atom(s).
The purpose is to either remove or tag those pairs of atoms in the
neighbor list. This information is stored with individual atoms and
thus the maximum number of such "special" neighbors is set when the
simulation box is created. When reading (relative) geometry and
topology of a 'molecule' from a :doc:`molecule file <molecule>`, LAMMPS
will build the list of such "special" neighbors for the molecule atom
(if not given in the molecule file explicitly). The error is triggered
when the resulting list is too long for the space reserved when creating
the simulation box. The solution is to increase the corresponding
setting. Overestimating this value will only consume more memory, and
is thus a safe choice.
.. _err0024:
Molecule topology/atom exceeds system topology/atom
---------------------------------------------------
LAMMPS uses :doc:`domain decomposition <Developer_par_part>` to
distribute data (i.e. atoms) across the MPI processes in parallel runs.
This includes topology data about bonds, angles, dihedrals, impropers
and :doc:`"special" neighbors <special_bonds>`. This information is
stored with either one or all atoms involved in such a topology entry
(which of the two option applies depends on the :doc:`newton <newton>`
setting for bonds). When reading a data file, LAMMPS analyzes the
requirements for this file and then the values are "locked in" and
cannot be extended.
So loading a molecule file that requires more of the topology per atom
storage or adding a data file with such needs will lead to an error. To
avoid the error, one or more of the `extra/XXX/per/atom` keywords are
required to extend the corresponding storage. It is no problem to
choose those numbers generously and have more storage reserved than
actually needed, but having these numbers set too small will lead to an
error.
.. _err0025:
Molecule topology type exceeds system topology type
---------------------------------------------------
The total number of atom, bond, angle, dihedral, and improper types is
"locked in" when LAMMPS creates the simulation box. This can happen
through either the :doc:`create_box <create_box>`, the :doc:`read_data
<read_data>`, or the :doc:`read_restart <read_restart>` command. After
this it is not possible to refer to an additional type. So loading a
molecule file that uses additional types or adding a data file that
would require additional types will lead to an error. To avoid the
error, one or more of the `extra/XXX/types` keywords are required to
extend the maximum number of the individual types.
.. _err0026:
Molecule attributes do not match system attributes
--------------------------------------------------
Choosing an :doc:`atom_style <atom_style>` in LAMMPS determines which
per-atom properties are available. In a :doc:`molecule file
<molecule>`, however, it is possible to add sections (for example Masses
or Charges) that are not supported by the atom style. Masses for
example, are usually not a per-atom property, but defined through the
atom type. Thus it would not be required to have a Masses section and
the included data would be ignored. LAMMPS prints this warning to
inform about this case.
.. _err0027:
Inconsistent image flags
------------------------
This warning happens when the distance between the *unwrapped* x-, y-,
or z-components of the coordinates of a bond is larger than half the box
with periodic boundaries or larger than the box with non-periodic
boundaries. It means that the positions and image flags have become
inconsistent. LAMMPS will still compute bonded interactions based on
the closest periodic images of the atoms and thus in most cases the
results will be correct. However they can cause problems when such
atoms are used with the fix rigid or replicate commands. Thus, it is
good practice to update the system so that the message does not appear.
It will help with future manipulations of the system.
There is one case where this warning *must* appear: when you have a
chain of connected bonds that pass through the entire box and connect
back to the first atom in the chain through periodic boundaries,
i.e. some kind of "infinite polymer". In that case, the bond image
flags *must* be inconsistent for the one bond that reaches back to the
beginning of the chain.
.. _err0028:
No fixes with time integration, atoms won't move
------------------------------------------------
This warning will be issued if LAMMPS encounters a :doc:`run <run>`
command that does not have a preceding :doc:`fix <fix>` command that
updates atom/object positions and velocities per step. In other words,
there are no fixes detected that perform velocity-Verlet time
integration, such as :doc:`fix nve <fix_nve>`. Note that this alert
does not mean that there are no active fixes. LAMMPS has a very wide
variety of fixes, many of which do not move objects but also operate
through steps, such as printing outputs (e.g. :doc:`fix print
<fix_print>`), performing calculations (e.g. :doc:`fix ave/time
<fix_ave_time>`), or changing other system parameters (e.g. :doc:`fix
dt/reset <fix_dt_reset>`). It is up to the user to determine whether
the lack of a time-integrating fix is intentional or not.
.. _err0029:
System is not charge neutral, net charge = ...
----------------------------------------------
the sum of charges in the system is not zero. When a system is not
charge-neutral, methods that evolve/manipulate per-atom charges,
evaluate Coulomb interactions, evaluate Coulomb forces, or
evaluate/manipulate other properties relying on per-atom charges may
raise this warning. A non-zero net charge most commonly arises after
setting per-atom charges :doc:`set <set>` such that the sum is non-zero
or by reading in a system through :doc:`read_data <read_data>` where the
per-atom charges do not sum to zero. However, a loss of charge
neutrality may occur in other less common ways, like when charge
equilibration methods (e.g., :doc:`fix qeq <fix_qeq>`) fail.
A similar warning/error may be raised when using certain charge
equilibration methods: :doc:`fix qeq <fix_qeq>`, :doc:`fix qeq/comb
<fix_qeq_comb>`, :doc:`fix qeq/reaxff <fix_qeq_reaxff>`, and :doc:`fix
qtpie/reaxff <fix_qtpie_reaxff>`. In such cases, this warning/error
will be raised for the fix :doc:`group <group>` when the group has a
non-zero net charge.
When the system is expected to be charge-neutral, this warning often
arises due to an error in the lammps input (e.g., an incorrect :doc:`set
<set>` command, error in the data file read by :doc:`read_data
<read_data>`, incorrectly grouping atoms with charge, etc.). If the
system is NOT expected to be charge-neutral, the user should make sure
that the method(s) used are appropriate for systems with a non-zero net
charge. Some commonly used fixes for charge equilibration :doc:`fix qeq
<fix_qeq>`, pair styles that include charge interactions
:doc:`pair_style coul/XXX <pair_coul>`, and kspace methods
:doc:`kspace_style <kspace_style>` can, in theory, support systems with
non-zero net charge. However, non-zero net charge can lead to spurious
artifacts. The severity of these artifacts depends on the magnitude of
total charge, system size, and methods used. Before running simulations
or calculations for systems with non-zero net charge, users should test
for artifacts and convergence of properties.
.. _err0030:
Variable evaluation before simulation box is defined
----------------------------------------------------
This error happens, when trying to expand or use an equal- or atom-style
variable (or an equivalent style), where the expression contains a
reference to something (e.g. a compute reference, a property of an atom,
or a thermo keyword) that is not allowed to be used before the
simulation box is defined. See the paragraph on :ref:`errors before or
after the simulation box is created <hint12>` for additional
information.
.. _err0031:
Invalid thermo keyword 'X' in variable formula
----------------------------------------------
This error message is often misleading. It is caused when evaluating a
:doc:`variable command <variable>` expression and LAMMPS comes across a
string that it does not recognize. LAMMPS first checks if a string is a
reference to a compute, fix, custom property, or another variable by
looking at the first 2-3 characters (and if it is, it checks whether the
referenced item exists). Next LAMMPS checks if the string matches one
of the available functions or constants. If that fails, LAMMPS will
assume that this string is a :doc:`thermo keyword <thermo_style>` and
let the code for printing thermodynamic output return the corresponding
value. However, if this fails too, since the string is not a thermo
keyword, LAMMPS stops with the 'Invalid thermo keyword' error. But it
is also possible, that there is just a typo in the name of a valid
variable function. Thus it is recommended to check the failing variable
expression very carefully.
.. _err0032:
One or more atoms are time integrated more than once
----------------------------------------------------
This is probably an error since you typically do not want to advance the
positions or velocities of an atom more than once per timestep. This
typically happens when there are multiple fix commands that advance atom
positions with overlapping groups. Also, for some fix styles it is not
immediately obvious that they include time integration. Please check
the documentation carefully.
.. _err0033:
XXX command before simulation box is defined
--------------------------------------------
This error occurs when trying to execute a LAMMPS command that requires
information about the system dimensions, or the number atom, bond,
angle, dihedral, or improper types, or the number of atoms or similar
data that is only available *after* the simulation box has been created.
See the paragraph on :ref:`errors before or after the simulation box is
created <hint12>` for additional information.
.. _err0034:
XXX command after simulation box is defined
--------------------------------------------
This error occurs when trying to execute a LAMMPS command that changes a
global setting *after* it is locked in when the simulation box is
created (for instance defining the :doc:`atom style <atom_style>`,
:doc:`dimension <dimension>`, :doc:`newton <newton>`, or :doc:`units
<units>` setting). These settings may only be changed *before* the
simulation box has been created. See the paragraph on :ref:`errors
before or after the simulation box is created <hint12>` for additional
information.

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,15 @@
Warning messages Warning messages
================ ================
This is an alphabetic list of the WARNING messages LAMMPS prints out This is an alphabetic list of some of the WARNING messages LAMMPS prints
and the reason why. If the explanation here is not sufficient, the out and the reason why. If the explanation here is not sufficient, the
documentation for the offending command may help. Warning messages documentation for the offending command may help. This is a historic
also list the source file and line number where the warning was list and no longer updated. Instead the LAMMPS developers are trying
generated. For example, a message like this: to provide more details right with the error message or link to a
paragraph with :doc:`detailed explanations <Errors_details>`.
Warning messages also list the source file and line number where the
warning was generated. For example, a message like this:
.. parsed-literal:: .. parsed-literal::
@ -14,7 +18,7 @@ generated. For example, a message like this:
means that line #187 in the file src/domain.cpp generated the error. means that line #187 in the file src/domain.cpp generated the error.
Looking in the source code may help you figure out what went wrong. Looking in the source code may help you figure out what went wrong.
Doc page with :doc:`ERROR messages <Errors_messages>` Please also see the page with :doc:`Error messages <Errors_messages>`
---------- ----------
@ -28,16 +32,10 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
cutoff is set too short or the angle has blown apart and an atom is cutoff is set too short or the angle has blown apart and an atom is
too far away. too far away.
*Angle style in data file differs from currently defined angle style*
Self-explanatory.
*Angles are defined but no angle style is set* *Angles are defined but no angle style is set*
The topology contains angles, but there are no angle forces computed The topology contains angles, but there are no angle forces computed
since there was no angle_style command. since there was no angle_style command.
*Atom style in data file differs from currently defined atom style*
Self-explanatory.
*Bond atom missing in box size check* *Bond atom missing in box size check*
The second atom needed to compute a particular bond is missing on this The second atom needed to compute a particular bond is missing on this
processor. Typically this is because the pairwise cutoff is set too processor. Typically this is because the pairwise cutoff is set too
@ -53,9 +51,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
processor. Typically this is because the pairwise cutoff is set too processor. Typically this is because the pairwise cutoff is set too
short or the bond has blown apart and an atom is too far away. short or the bond has blown apart and an atom is too far away.
*Bond style in data file differs from currently defined bond style*
Self-explanatory.
*Bonds are defined but no bond style is set* *Bonds are defined but no bond style is set*
The topology contains bonds, but there are no bond forces computed The topology contains bonds, but there are no bond forces computed
since there was no bond_style command. since there was no bond_style command.
@ -68,9 +63,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
length, multiplying by the number of bonds in the interaction (e.g. 3 length, multiplying by the number of bonds in the interaction (e.g. 3
for a dihedral) and adding a small amount of stretch. for a dihedral) and adding a small amount of stretch.
*Both groups in compute group/group have a net charge; the Kspace boundary correction to energy will be non-zero*
Self-explanatory.
*Calling write_dump before a full system init.* *Calling write_dump before a full system init.*
The write_dump command is used before the system has been fully The write_dump command is used before the system has been fully
initialized as part of a 'run' or 'minimize' command. Not all dump initialized as part of a 'run' or 'minimize' command. Not all dump
@ -86,18 +78,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
This means the temperature associated with the rigid bodies may be This means the temperature associated with the rigid bodies may be
incorrect on this timestep. incorrect on this timestep.
*Cannot include log terms without 1/r terms; setting flagHI to 1*
Self-explanatory.
*Cannot include log terms without 1/r terms; setting flagHI to 1.*
Self-explanatory.
*Charges are set, but coulombic solver is not used*
Self-explanatory.
*Charges did not converge at step %ld: %lg*
Self-explanatory.
*Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost* *Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost*
The communication cutoff defaults to the maximum of what is inferred from The communication cutoff defaults to the maximum of what is inferred from
pair and bond styles (will be zero, if none are defined) and what is specified pair and bond styles (will be zero, if none are defined) and what is specified
@ -123,9 +103,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
is not changed automatically and the warning may be ignored depending is not changed automatically and the warning may be ignored depending
on the specific system being simulated. on the specific system being simulated.
*Communication cutoff is too small for SNAP micro load balancing, increased to %lf*
Self-explanatory.
*Compute cna/atom cutoff may be too large to find ghost atom neighbors* *Compute cna/atom cutoff may be too large to find ghost atom neighbors*
The neighbor cutoff used may not encompass enough ghost atoms The neighbor cutoff used may not encompass enough ghost atoms
to perform this operation correctly. to perform this operation correctly.
@ -158,9 +135,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
Conformation of the 4 listed dihedral atoms is extreme; you may want Conformation of the 4 listed dihedral atoms is extreme; you may want
to check your simulation geometry. to check your simulation geometry.
*Dihedral style in data file differs from currently defined dihedral style*
Self-explanatory.
*Dihedrals are defined but no dihedral style is set* *Dihedrals are defined but no dihedral style is set*
The topology contains dihedrals, but there are no dihedral forces computed The topology contains dihedrals, but there are no dihedral forces computed
since there was no dihedral_style command. since there was no dihedral_style command.
@ -177,9 +151,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*Estimated error in splitting of dispersion coeffs is %g* *Estimated error in splitting of dispersion coeffs is %g*
Error is greater than 0.0001 percent. Error is greater than 0.0001 percent.
*Ewald/disp Newton solver failed, using old method to estimate g_ewald*
Self-explanatory. Choosing a different cutoff value may help.
*FENE bond too long* *FENE bond too long*
A FENE bond has stretched dangerously far. It's interaction strength A FENE bond has stretched dangerously far. It's interaction strength
will be truncated to attempt to prevent the bond from blowing up. will be truncated to attempt to prevent the bond from blowing up.
@ -192,9 +163,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
A FENE bond has stretched dangerously far. It's interaction strength A FENE bond has stretched dangerously far. It's interaction strength
will be truncated to attempt to prevent the bond from blowing up. will be truncated to attempt to prevent the bond from blowing up.
*Fix halt condition for fix-id %s met on step %ld with value %g*
Self explanatory.
*Fix SRD walls overlap but fix srd overlap not set* *Fix SRD walls overlap but fix srd overlap not set*
You likely want to set this in your input script. You likely want to set this in your input script.
@ -238,21 +206,12 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*Fix property/atom mol or charge w/out ghost communication* *Fix property/atom mol or charge w/out ghost communication*
A model typically needs these properties defined for ghost atoms. A model typically needs these properties defined for ghost atoms.
*Fix qeq CG convergence failed (%g) after %d iterations at %ld step*
Self-explanatory.
*Fix qeq has non-zero lower Taper radius cutoff* *Fix qeq has non-zero lower Taper radius cutoff*
Absolute value must be <= 0.01. Absolute value must be <= 0.01.
*Fix qeq has very low Taper radius cutoff* *Fix qeq has very low Taper radius cutoff*
Value should typically be >= 5.0. Value should typically be >= 5.0.
*Fix qeq/dynamic tolerance may be too small for damped dynamics*
Self-explanatory.
*Fix qeq/fire tolerance may be too small for damped fires*
Self-explanatory.
*Fix rattle should come after all other integration fixes* *Fix rattle should come after all other integration fixes*
This fix is designed to work after all other integration fixes change This fix is designed to work after all other integration fixes change
atom positions. Thus it should be the last integration fix specified. atom positions. Thus it should be the last integration fix specified.
@ -285,9 +244,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
The user-specified force accuracy cannot be achieved unless the table The user-specified force accuracy cannot be achieved unless the table
feature is disabled by using 'pair_modify table 0'. feature is disabled by using 'pair_modify table 0'.
*Geometric mixing assumed for 1/r\^6 coefficients*
Self-explanatory.
*Group for fix_modify temp != fix group* *Group for fix_modify temp != fix group*
The fix_modify command is specifying a temperature computation that The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix computes a temperature on a different group of atoms than the fix
@ -310,46 +266,14 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
Conformation of the 4 listed improper atoms is extreme; you may want Conformation of the 4 listed improper atoms is extreme; you may want
to check your simulation geometry. to check your simulation geometry.
*Improper style in data file differs from currently defined improper style*
Self-explanatory.
*Impropers are defined but no improper style is set* *Impropers are defined but no improper style is set*
The topology contains impropers, but there are no improper forces computed The topology contains impropers, but there are no improper forces computed
since there was no improper_style command. since there was no improper_style command.
*Inconsistent image flags*
The image flags for a pair on bonded atoms appear to be inconsistent.
Inconsistent means that when the coordinates of the two atoms are
unwrapped using the image flags, the two atoms are far apart.
Specifically they are further apart than half a periodic box length.
Or they are more than a box length apart in a non-periodic dimension.
This is usually due to the initial data file not having correct image
flags for the two atoms in a bond that straddles a periodic boundary.
They should be different by 1 in that case. This is a warning because
inconsistent image flags will not cause problems for dynamics or most
LAMMPS simulations. However they can cause problems when such atoms
are used with the fix rigid or replicate commands. Note that if you
have an infinite periodic crystal with bonds then it is impossible to
have fully consistent image flags, since some bonds will cross
periodic boundaries and connect two atoms with the same image
flag.
*Increasing communication cutoff for GPU style* *Increasing communication cutoff for GPU style*
The pair style has increased the communication cutoff to be consistent with The pair style has increased the communication cutoff to be consistent with
the communication cutoff requirements for this pair style when run on the GPU. the communication cutoff requirements for this pair style when run on the GPU.
*KIM Model does not provide 'energy'; Potential energy will be zero*
Self-explanatory.
*KIM Model does not provide 'forces'; Forces will be zero*
Self-explanatory.
*KIM Model does not provide 'particleEnergy'; energy per atom will be zero*
Self-explanatory.
*KIM Model does not provide 'particleVirial'; virial per atom will be zero*
Self-explanatory.
*Kspace_modify slab param < 2.0 may cause unphysical behavior* *Kspace_modify slab param < 2.0 may cause unphysical behavior*
The kspace_modify slab parameter should be larger to ensure periodic The kspace_modify slab parameter should be larger to ensure periodic
grids padded with empty space do not overlap. grids padded with empty space do not overlap.
@ -401,20 +325,10 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
box, or moved further than one processor's subdomain away before box, or moved further than one processor's subdomain away before
reneighboring. reneighboring.
*MSM mesh too small, increasing to 2 points in each direction*
Self-explanatory.
*Mismatch between velocity and compute groups* *Mismatch between velocity and compute groups*
The temperature computation used by the velocity command will not be The temperature computation used by the velocity command will not be
on the same group of atoms that velocities are being set for. on the same group of atoms that velocities are being set for.
*Mixing forced for lj coefficients*
Self-explanatory.
*Molecule attributes do not match system attributes*
An attribute is specified (e.g. diameter, charge) that is
not defined for the specified atom style.
*Molecule has bond topology but no special bond settings* *Molecule has bond topology but no special bond settings*
This means the bonded atoms will not be excluded in pairwise This means the bonded atoms will not be excluded in pairwise
interactions. interactions.
@ -449,9 +363,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*More than one compute damage/atom* *More than one compute damage/atom*
It is not efficient to use compute ke/atom more than once. It is not efficient to use compute ke/atom more than once.
*More than one compute dilatation/atom*
Self-explanatory.
*More than one compute erotate/sphere/atom* *More than one compute erotate/sphere/atom*
It is not efficient to use compute erorate/sphere/atom more than once. It is not efficient to use compute erorate/sphere/atom more than once.
@ -464,24 +375,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*More than one compute orientorder/atom* *More than one compute orientorder/atom*
It is not efficient to use compute orientorder/atom more than once. It is not efficient to use compute orientorder/atom more than once.
*More than one compute plasticity/atom*
Self-explanatory.
*More than one compute sna/atom*
Self-explanatory.
*More than one compute sna/grid*
Self-explanatory.
*More than one compute sna/grid/local*
Self-explanatory.
*More than one compute snad/atom*
Self-explanatory.
*More than one compute snav/atom*
Self-explanatory.
*More than one fix poems* *More than one fix poems*
It is not efficient to use fix poems more than once. It is not efficient to use fix poems more than once.
@ -557,21 +450,12 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*Pair COMB charge %.10f with force %.10f hit min barrier* *Pair COMB charge %.10f with force %.10f hit min barrier*
Something is possibly wrong with your model. Something is possibly wrong with your model.
*Pair brownian needs newton pair on for momentum conservation*
Self-explanatory.
*Pair dpd needs newton pair on for momentum conservation*
Self-explanatory.
*Pair dsmc: num_of_collisions > number_of_A* *Pair dsmc: num_of_collisions > number_of_A*
Collision model in DSMC is breaking down. Collision model in DSMC is breaking down.
*Pair dsmc: num_of_collisions > number_of_B* *Pair dsmc: num_of_collisions > number_of_B*
Collision model in DSMC is breaking down. Collision model in DSMC is breaking down.
*Pair style in data file differs from currently defined pair style*
Self-explanatory.
*Pair style restartinfo set but has no restart support* *Pair style restartinfo set but has no restart support*
This pair style has a bug, where it does not support reading and This pair style has a bug, where it does not support reading and
writing information to a restart file, but does not set the member writing information to a restart file, but does not set the member
@ -681,9 +565,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
cluster specified by the fix shake command is numerically suspect. LAMMPS cluster specified by the fix shake command is numerically suspect. LAMMPS
will set it to 0.0 and continue. will set it to 0.0 and continue.
*Shell command '%s' failed with error '%s'*
Self-explanatory.
*Shell command returned with non-zero status* *Shell command returned with non-zero status*
This may indicate the shell command did not operate as expected. This may indicate the shell command did not operate as expected.
@ -694,15 +575,9 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
This will lead to invalid constraint forces in the SHAKE/RATTLE This will lead to invalid constraint forces in the SHAKE/RATTLE
computation. computation.
*Simulations might be very slow because of large number of structure factors*
Self-explanatory.
*Slab correction not needed for MSM* *Slab correction not needed for MSM*
Slab correction is intended to be used with Ewald or PPPM and is not needed by MSM. Slab correction is intended to be used with Ewald or PPPM and is not needed by MSM.
*Specifying an 'subset' value of '0' is equivalent to no 'subset' keyword*
Self-explanatory.
*System is not charge neutral, net charge = %g* *System is not charge neutral, net charge = %g*
The total charge on all atoms on the system is not 0.0. The total charge on all atoms on the system is not 0.0.
For some KSpace solvers this is only a warning. For some KSpace solvers this is only a warning.
@ -734,9 +609,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
assumed to also be for all atoms. Thus the pressure printed by thermo assumed to also be for all atoms. Thus the pressure printed by thermo
could be inaccurate. could be inaccurate.
*The fix ave/spatial command has been replaced by the more flexible fix ave/chunk and compute chunk/atom commands -- fix ave/spatial will be removed in the summer of 2015*
Self-explanatory.
*The minimizer does not re-orient dipoles when using fix efield* *The minimizer does not re-orient dipoles when using fix efield*
This means that only the atom coordinates will be minimized, This means that only the atom coordinates will be minimized,
not the orientation of the dipoles. not the orientation of the dipoles.
@ -745,9 +617,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
More than the maximum # of neighbors was found multiple times. This More than the maximum # of neighbors was found multiple times. This
was unexpected. was unexpected.
*Too many inner timesteps in fix ttm*
Self-explanatory.
*Too many neighbors in CNA for %d atoms* *Too many neighbors in CNA for %d atoms*
More than the maximum # of neighbors was found multiple times. This More than the maximum # of neighbors was found multiple times. This
was unexpected. was unexpected.
@ -775,24 +644,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
The deformation will heat the SRD particles so this can The deformation will heat the SRD particles so this can
be dangerous. be dangerous.
*Using kspace solver on system with no charge*
Self-explanatory.
*Using largest cut-off for lj/long/dipole/long long long*
Self-explanatory.
*Using largest cutoff for buck/long/coul/long*
Self-explanatory.
*Using largest cutoff for lj/long/coul/long*
Self-explanatory.
*Using largest cutoff for pair_style lj/long/tip4p/long*
Self-explanatory.
*Using package gpu without any pair style defined*
Self-explanatory.
*Using pair potential shift with pair_modify compute no* *Using pair potential shift with pair_modify compute no*
The shift effects will thus not be computed. The shift effects will thus not be computed.

View File

@ -54,7 +54,7 @@ Lowercase directories
+-------------+------------------------------------------------------------------+ +-------------+------------------------------------------------------------------+
| body | body particles, 2d system | | body | body particles, 2d system |
+-------------+------------------------------------------------------------------+ +-------------+------------------------------------------------------------------+
| bpm | BPM simulations of pouring elastic grains and plate impact | | bpm | simulations of solid elastic/plastic deformation and fracture |
+-------------+------------------------------------------------------------------+ +-------------+------------------------------------------------------------------+
| cmap | CMAP 5-body contributions to CHARMM force field | | cmap | CMAP 5-body contributions to CHARMM force field |
+-------------+------------------------------------------------------------------+ +-------------+------------------------------------------------------------------+

View File

@ -1470,7 +1470,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
LAMMPS equal style variable string, evaluates it and returns the resulting LAMMPS equal style variable string, evaluates it and returns the resulting
scalar value as a floating-point number. scalar value as a floating-point number.
.. versionadded:: TBD .. versionadded:: 4Feb2025
:p character(len=\*) expr: string to be evaluated :p character(len=\*) expr: string to be evaluated
:to: :cpp:func:`lammps_eval` :to: :cpp:func:`lammps_eval`
@ -1482,7 +1482,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
Clear whether a compute has been invoked Clear whether a compute has been invoked
.. versionadded:: TBD .. versionadded:: 4Feb2025
:to: :cpp:func:`lammps_clearstep_compute` :to: :cpp:func:`lammps_clearstep_compute`
@ -1493,7 +1493,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
Add timestep to list of future compute invocations Add timestep to list of future compute invocations
if the compute has been invoked on the current timestep if the compute has been invoked on the current timestep
.. versionadded:: TBD .. versionadded:: 4Feb2025
overloaded for 32-bit and 64-bit integer arguments overloaded for 32-bit and 64-bit integer arguments
@ -1506,7 +1506,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
Add timestep to list of future compute invocations Add timestep to list of future compute invocations
.. versionadded:: TBD .. versionadded:: 4Feb2025
overloaded for 32-bit and 64-bit integer arguments overloaded for 32-bit and 64-bit integer arguments
@ -2773,8 +2773,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
END SUBROUTINE external_callback END SUBROUTINE external_callback
END INTERFACE END INTERFACE
where ``c_bigint`` is ``c_int`` if ``-DLAMMPS_SMALLSMALL`` was used and where ``c_bigint`` is ``c_int64_t`` and ``c_tagint`` is ``c_int64_t`` if
``c_int64_t`` otherwise; and ``c_tagint`` is ``c_int64_t`` if
``-DLAMMPS_BIGBIG`` was used and ``c_int`` otherwise. ``-DLAMMPS_BIGBIG`` was used and ``c_int`` otherwise.
The argument *caller* to :f:subr:`set_fix_external_callback` is unlimited The argument *caller* to :f:subr:`set_fix_external_callback` is unlimited

View File

@ -40,6 +40,7 @@ Settings howto
Howto_walls Howto_walls
Howto_nemd Howto_nemd
Howto_dispersion Howto_dispersion
Howto_bulk2slab
Analysis howto Analysis howto
============== ==============

View File

@ -42,12 +42,14 @@ such as those created by pouring grains using :doc:`fix pour
---------- ----------
Currently, there are two types of bonds included in the BPM package. The Currently, there are three types of bonds included in the BPM package. The
first bond style, :doc:`bond bpm/spring <bond_bpm_spring>`, only applies first bond style, :doc:`bond bpm/spring <bond_bpm_spring>`, only applies
pairwise, central body forces. Point particles must have :doc:`bond atom pairwise, central body forces. Point particles must have :doc:`bond atom
style <atom_style>` and may be thought of as nodes in a spring style <atom_style>` and may be thought of as nodes in a spring
network. An optional multibody term can be used to adjust the network's network. An optional multibody term can be used to adjust the network's
Poisson's ratio. Alternatively, the second bond style, :doc:`bond bpm/rotational Poisson's ratio. The :doc:`bpm/spring/plastic <bond_bpm_spring_plastic>`
bond style is similar except it adds a plastic yield strain.
Alternatively, the third bond style, :doc:`bond bpm/rotational
<bond_bpm_rotational>`, resolves tangential forces and torques arising <bond_bpm_rotational>`, resolves tangential forces and torques arising
with the shearing, bending, and twisting of the bond due to rotation or with the shearing, bending, and twisting of the bond due to rotation or
displacement of particles. Particles are similar to those used in the displacement of particles. Particles are similar to those used in the

160
doc/src/Howto_bulk2slab.rst Normal file
View File

@ -0,0 +1,160 @@
===========================
Convert bulk system to slab
===========================
A regularly encountered simulation problem is how to convert a bulk
system that has been run for a while to equilibrate into a slab system
with some vacuum space and free surfaces. The challenge here is that
one cannot just change the box dimensions with the :doc:`change_box
command <change_box>` or edit the box boundaries in a data file because
some atoms will have non-zero image flags from diffusing around.
Changing the box dimensions results in an undesired displacement of
those atoms, since the image flags indicate how many times the box
length in x-, y-, or z-direction needs to be added or subtracted to get
the "unwrapped" coordinates. By changing the box dimension this
distance is changed and thus those atoms move unphysically relative to
their neighbors with zero image flags. Setting image flags forcibly to
zero creates problems because that could break apart molecules by having
one atom of a bond on the top of the system and the other at the bottom.
.. _bulk2slab:
.. figure:: JPG/rhodo-both.jpg
:figwidth: 80%
:figclass: align-center
Snapshots of the bulk Rhodopsin in lipid layer and water system (right)
and the generated slab geometry (left)
.. admonition:: Disclaimer
:class: note
The following workflow will work for many bulk systems, but not all.
Some systems cannot be converted (e.g. polymers with bonds to the
same molecule across periodic boundaries, sometimes called "infinite
polymers"). The amount of vacuum that needs to be added depends on
the length of the molecules where the system is split (the example
here splits where there is water with short molecules). In some
cases, the system may need to be re-centered in the box first using
the :doc:`displace_atoms command <displace_atoms>`. Also, the time
spent on strong thermalization and equilibration will depend on the
specific system and its thermodynamic conditions.
Below is a suggested workflow using the :doc:`Rhodopsin benchmark input
<Speed_bench>` for demonstration. The figure shows the state *before*
the procedure on the left (with unwrapped atoms that have diffused out
of the box) and *after* on the right (with the vacuum added above and
below). The procedure is implemented by modifying a copy of the
``in.rhodo`` input file. The first lines up to and including the
:doc:`read_data command <read_data>` remain unchanged. Then we insert
the following lines to add vacuum to the z direction above and below the
system:
.. code-block:: LAMMPS
variable delta index 10.0
reset_atoms image all
write_dump all custom rhodo-unwrap.lammpstrj id xu yu zu
change_box all z final $(zlo-2.0*v_delta) $(zhi+2.0*v_delta) &
boundary p p f
read_dump rhodo-unwrap.lammpstrj 0 x y z box no replace yes
kspace_modify slab 3.0
Specifically, the :doc:`variable delta <variable>` (set to 10.0)
represents a distance that determines the amount of vacuum added: we add
twice its value in each direction to the z-dimension; thus in total
:math:`40 \AA` get added. The :doc:`reset_atoms image all
<reset_atoms>` command shall reset any image flags to become either 0 or
:math:`\pm 1` and thus have the minimum distance from the center of the
simulation box, but the correct relative distance for bonded atoms.
The :doc:`write_dump command <write_dump>` then writes out the resulting
*unwrapped* coordinates of the system. After expanding the box,
coordinates that were outside the box should now be inside and the
unwrapped coordinates will become "wrapped", while atoms outside the
periodic boundaries will be wrapped back into the box and their image
flags in those directions restored.
The :doc:`change_box command <change_box>` adds the desired
distance to the low and high box boundary in z-direction and then changes
the :doc:`boundary to "p p f" <boundary>` which will force the image
flags in z-direction to zero and create an undesired displacement for
the atoms with non-zero image flags.
With the :doc:`read_dump command <read_dump>` we read back and replace
partially incorrect coordinates with the previously saved, unwrapped
coordinates. It is important to ignore the box dimensions stored in the
dump file. We want to preserve the expanded box. Finally, we turn on
the slab correction for the PPPM long-range solver with the
:doc:`kspace_modify command <kspace_modify>` as required when using a
long range Coulomb solver for non-periodic z-dimension.
Next we replace the :doc:`fix npt command <fix_nh>` with:
.. code-block:: LAMMPS
fix 2 nvt temp 300.0 300.0 10.0
We now have an open system and thus the adjustment of the cell in
z-direction is no longer required. Since splitting the bulk water
region where the vacuum is inserted, creates surface atoms with high
potential energy, we reduce the thermostat time constant from 100.0 to
10.0 to remove excess kinetic energy resulting from that change faster.
Also the high potential energy of the surface atoms can cause that some
of them are ejected from the slab. In order to suppress that, we add
soft harmonic walls to push back any atoms that want to leave the slab.
To determine the position of the wall, we first need to to determine the
extent of the atoms in z-direction and then place the harmonic walls
based on that information:
.. code-block:: LAMMPS
compute zmin all reduce min z
compute zmax all reduce max z
thermo_style custom zlo c_zmin zhi c_zmax
run 0 post no
fix 3 all wall/harmonic zhi $(c_zmax+v_delta) 10.0 0.0 ${delta} &
zlo $(c_zmin-v_delta) 10.0 0.0 ${delta}
The two :doc:`compute reduce <compute_reduce>` command determine the
minimum and maximum z-coordinate across all atoms. In order to trigger
the execution of the compute commands we need to "consume" them. This
is done with the :doc:`thermo_style custom <thermo_style>` command
followed by the :doc:`run 0 <run>` command. This avoids and error
accessing the min/max values determined by the compute commands to
compute the location of the wall in lower and upper direction. This
uses the previously defined *delta* variable to determine the distance
of the wall from the extent of the system and the cutoff for the wall
interaction. This way only atoms that move beyond the min/max values in
z-direction will experience a restoring force, nudging them back to the
slab. The force constant of :math:`10.0 \frac{\mathrm{kcal/mol}}{\AA}`
was determined empirically.
Adding these "restoring" soft walls assist in making the free surfaces
above and below the slab flat, instead of having rugged or ondulated
surfaces. The impact of the walls can be changed by adjusting the force
constant, cutoff, and position of the wall.
Finally, we replace the :doc:`run 100 <run>` of the original input with:
.. code-block:: LAMMPS
run 1000 post no
unfix 3
fix 2 all nvt temp 300.0 300.0 100.0
run 1000 post no
write_data data.rhodo-slab
This runs the system converted to a slab first for 1000 MD steps using
the walls and stronger Nose-Hoover thermostat. Then the walls are
removed with :doc:`unfix 3 <unfix>` and the thermostat time constant
reset to 100.0 and the system run for another 1000 steps. Finally the
resulting slab geometry is written to a new data file
``data.rhodo-slab`` with a :doc:`write_data command <write_data>`. The
number of MD steps required to reach a proper equilibrium state is very
likely larger. The number of 1000 steps (corresponding to 2
picoseconds) was chosen for demonstration purposes, so that the
procedure can be easily and quickly tested.

View File

@ -487,10 +487,10 @@ updates are back-ported from the *develop* branch to the *maintenance*
branch and occasionally merged to *stable* as an update release. branch and occasionally merged to *stable* as an update release.
Furthermore, the naming of the release tags now follow the pattern Furthermore, the naming of the release tags now follow the pattern
"patch_<Day><Month><Year>" to simplify comparisons between releases. "patch\_<Day><Month><Year>" to simplify comparisons between releases.
For stable releases additional "stable_<Day><Month><Year>" tags are For stable releases additional "stable\_<Day><Month><Year>" tags are
applied and update releases are tagged with applied and update releases are tagged with
"stable_<Day><Month><Year>_update<Number>", Finally, all releases and "stable\_<Day><Month><Year>\_update<Number>", Finally, all releases and
submissions are subject to automatic testing and code checks to make submissions are subject to automatic testing and code checks to make
sure they compile with a variety of compilers and popular operating sure they compile with a variety of compilers and popular operating
systems. Some unit and regression testing is applied as well. systems. Some unit and regression testing is applied as well.

View File

@ -2,14 +2,18 @@ Moltemplate Tutorial
==================== ====================
In this tutorial, we are going to use the tool :ref:`Moltemplate In this tutorial, we are going to use the tool :ref:`Moltemplate
<moltemplate>` to set up a classical molecular dynamic simulation using <Moltemplate1>` from https://moltemplate.org/ to set up a classical
the :ref:`OPLS-AA force field <OPLSAA96>`. The first molecular dynamic simulation using the :ref:`OPLS-AA force field
task is to describe an organic compound and create a complete input deck <oplsaa2024>`. The first task is to describe an organic compound and
for LAMMPS. The second task is to map the OPLS-AA force field to a create a complete input deck for LAMMPS. The second task is to use
molecular sample created with an external tool, e.g. PACKMOL, and moltemplate to build a polymer. The third task is to map the OPLS-AA
exported as a PDB file. The files used in this tutorial can be found force field to a molecular sample created with an external tool,
in the ``tools/moltemplate/tutorial-files`` folder of the LAMMPS e.g. PACKMOL, and exported as a PDB file. The files used in this
source code distribution. tutorial can be found in the ``tools/moltemplate/tutorial-files`` folder
of the LAMMPS source code distribution.
Many more examples can be found here: https://moltemplate.org/examples.html
Simulating an organic solvent Simulating an organic solvent
""""""""""""""""""""""""""""" """""""""""""""""""""""""""""
@ -17,14 +21,13 @@ Simulating an organic solvent
This example aims to create a cubic box of the organic solvent This example aims to create a cubic box of the organic solvent
formamide. formamide.
The first step is to create a molecular topology in the The first step is to create a molecular topology in the LAMMPS-template
LAMMPS-template (LT) file format representing a single molecule, which (LT) file format representing a single molecule, which will be
will be stored in a Moltemplate object called ``_FAM inherits OPLSAA {}``. stored in a Moltemplate object called ``_FAM inherits OPLSAA {}``.
This command states that the object ``_FAM`` is based on an existing This command states that the object ``_FAM`` is based on an existing
object called ``OPLSAA``, which contains OPLS-AA parameters, atom type object called ``OPLSAA``, which contains OPLS-AA parameters, atom type
definitions, partial charges, masses and bond-angle rules for many organic definitions, partial charges, masses and bond-angle rules for many organic
and biological compounds. and biological compounds.
The atomic structure is the starting point to populate the command The atomic structure is the starting point to populate the command
``write('Data Atoms') {}``, which will write the ``Atoms`` section in the ``write('Data Atoms') {}``, which will write the ``Atoms`` section in the
LAMMPS data file. The OPLS-AA force field uses the ``atom_style full``, LAMMPS data file. The OPLS-AA force field uses the ``atom_style full``,
@ -36,21 +39,23 @@ to the ``molID``, except that the same variable is used for the whole
molecule. The atom types are assigned using ``@``-type variables. The molecule. The atom types are assigned using ``@``-type variables. The
assignment of atom types (e.g. ``@atom:177``, ``@atom:178``) is done using assignment of atom types (e.g. ``@atom:177``, ``@atom:178``) is done using
the OPLS-AA atom types defined in the "In Charges" section of the file the OPLS-AA atom types defined in the "In Charges" section of the file
``oplsaa.lt``, looking for a reasonable match with the description of the atom. ``oplsaa2024.lt``, looking for a reasonable match with the description of the atom.
The resulting file (``formamide.lt``) follows: The resulting file (``formamide.lt``) follows:
.. code-block:: bash .. code-block:: bash
import /usr/local/moltemplate/moltemplate/force_fields/oplsaa2024.lt # defines OPLSAA
_FAM inherits OPLSAA { _FAM inherits OPLSAA {
# atomID molID atomType charge coordX coordY coordZ # atomID molID atomType charge coordX coordY coordZ
write('Data Atoms') { write('Data Atoms') {
$atom:C00 $mol @atom:177 0.00 0.100 0.490 0.0 $atom:C00 $mol @atom:235 0.00 0.100 0.490 0.0
$atom:O01 $mol @atom:178 0.00 1.091 -0.250 0.0 $atom:O01 $mol @atom:236 0.00 1.091 -0.250 0.0
$atom:N02 $mol @atom:179 0.00 -1.121 -0.181 0.0 $atom:N02 $mol @atom:237 0.00 -1.121 -0.181 0.0
$atom:H03 $mol @atom:182 0.00 -2.013 0.272 0.0 $atom:H03 $mol @atom:240 0.00 -2.013 0.272 0.0
$atom:H04 $mol @atom:182 0.00 -1.056 -1.190 0.0 $atom:H04 $mol @atom:240 0.00 -1.056 -1.190 0.0
$atom:H05 $mol @atom:221 0.00 0.144 1.570 0.0 $atom:H05 $mol @atom:279 0.00 0.144 1.570 0.0
} }
# A list of the bonds in the molecule: # A list of the bonds in the molecule:
@ -64,16 +69,17 @@ The resulting file (``formamide.lt``) follows:
} }
} }
You don't have to specify the charge in this example because they will You don't have to specify the charge in this example because the OPLSAA
be assigned according to the atom type. Analogously, only a force-field assigns charge according to the atom type. (This is not true
"Data Bond List" section is needed as the atom type will determine the when using other force fields.) A "Data Bond List" section is needed as
bond type. The other bonded interactions (e.g. angles, the atom type will determine the bond type. The other bonded interactions
dihedrals, and impropers) will be automatically generated by (e.g. angles, dihedrals, and impropers) will be automatically generated by
Moltemplate. Moltemplate.
If the simulation is non-neutral, or Moltemplate complains that you have If the simulation is not charge-neutral, or Moltemplate complains that
missing bond, angle, or dihedral types, this means at least one of your you have missing bond, angle, or dihedral types, this probably means that
atom types is incorrect. at least one of your atom types is incorrect (or that perhaps there is no
suitable atom type currently defined in the ``oplsaa2024.lt`` file).
The second step is to create a master file with instructions to build a The second step is to create a master file with instructions to build a
starting structure and the LAMMPS commands to run an NPT simulation. The starting structure and the LAMMPS commands to run an NPT simulation. The
@ -81,11 +87,9 @@ master file (``solv_01.lt``) follows:
.. code-block:: bash .. code-block:: bash
# Import the force field. import formamide.lt # Defines "_FAM" and OPLSAA
import /usr/local/moltemplate/moltemplate/force_fields/oplsaa.lt
import formamide.lt # after oplsaa.lt, as it depends on it.
# Create the input sample. # Distribute the molecules on a 5x5x5 cubic grid with spacing 4.6
solv = new _FAM [5].move( 4.6, 0, 0) solv = new _FAM [5].move( 4.6, 0, 0)
[5].move( 0, 4.6, 0) [5].move( 0, 4.6, 0)
[5].move( 0, 0, 4.6) [5].move( 0, 0, 4.6)
@ -98,8 +102,11 @@ master file (``solv_01.lt``) follows:
-11.5 11.5 zlo zhi -11.5 11.5 zlo zhi
} }
# Create an input deck for LAMMPS. # Note: The lines below in the "In Run" section are often omitted.
write_once("In Init"){
write_once("In Run"){
# Create an input deck for LAMMPS.
# Run an NPT simulation.
# Input variables. # Input variables.
variable run string solv_01 # output name variable run string solv_01 # output name
variable ts equal 1 # timestep variable ts equal 1 # timestep
@ -109,12 +116,6 @@ master file (``solv_01.lt``) follows:
variable equi equal 5000 # Equilibration steps variable equi equal 5000 # Equilibration steps
variable prod equal 30000 # Production steps variable prod equal 30000 # Production steps
# PBC (set them before the creation of the box).
boundary p p p
}
# Run an NPT simulation.
write_once("In Run"){
# Derived variables. # Derived variables.
variable tcouple equal \$\{ts\}*100 variable tcouple equal \$\{ts\}*100
variable pcouple equal \$\{ts\}*1000 variable pcouple equal \$\{ts\}*1000
@ -143,7 +144,7 @@ master file (``solv_01.lt``) follows:
unfix NPT unfix NPT
} }
The first two commands insert the content of files ``oplsaa.lt`` and The first two commands insert the content of files ``oplsaa2024.lt`` and
``formamide.lt`` into the master file. At this point, we can use the ``formamide.lt`` into the master file. At this point, we can use the
command ``solv = new _FAM [N]`` to create N copies of a molecule of type command ``solv = new _FAM [N]`` to create N copies of a molecule of type
``_FAM``. In this case, we create an array of 5*5*5 molecules on a cubic ``_FAM``. In this case, we create an array of 5*5*5 molecules on a cubic
@ -153,21 +154,37 @@ the sample was created from scratch, we also specify the simulation box
size in the "Data Boundary" section. size in the "Data Boundary" section.
The LAMMPS setting for the force field are specified in the file The LAMMPS setting for the force field are specified in the file
``oplsaa.lt`` and are written automatically in the input deck. We also ``oplsaa2024.lt`` and are written automatically in the input deck. We also
specify the boundary conditions and a set of variables in specify the boundary conditions and a set of variables in
the "In Init" section. The remaining commands to run an NPT simulation the "In Init" section.
The remaining commands to run an NPT simulation
are written in the "In Run" section. Note that in this script, LAMMPS are written in the "In Run" section. Note that in this script, LAMMPS
variables are protected with the escape character ``\`` to distinguish variables are protected with the escape character ``\`` to distinguish
them from Moltemplate variables, e.g. ``\$\{run\}`` is a LAMMPS them from Moltemplate variables, e.g. ``\$\{run\}`` is a LAMMPS
variable that is written in the input deck as ``${run}``. variable that is written in the input deck as ``${run}``.
(Note: Moltemplate can be slow to run, so you need to change you run
settings frequently, I recommended moving those commands (from "In Run")
out of your .lt files and into a separate file. Moltemplate creates a
file named ``run.in.EXAMPLE`` for this purpose. You can put your run
settings and fixes that file and then invoke LAMMPS using
``mpirun -np 4 lmp -in run.in.EXAMPLE`` instead.)
Compile the master file with: Compile the master file with:
.. code-block:: bash .. code-block:: bash
moltemplate.sh -overlay-all solv_01.lt moltemplate.sh solv_01.lt
cleanup_moltemplate.sh # <-- optional: see below
And execute the simulation with the following: (Note: The optional "cleanup_moltemplate.sh" command deletes
unused atom types, which sometimes makes LAMMPS run faster.
But it does not work with many-body pair styles or dreiding-style h-bonds.
Fortunately most force fields, including OPLSAA, don't use those features.)
Then execute the simulation with the following:
.. code-block:: bash .. code-block:: bash
@ -180,15 +197,116 @@ And execute the simulation with the following:
Snapshot of the sample at the beginning and end of the simulation. Snapshot of the sample at the beginning and end of the simulation.
Rendered with Ovito. Rendered with Ovito.
Building a simple polymer
"""""""""""""""""""""""""
Moltemplate is particularly useful for building polymers (and other molecules
with sub-units). As an simple example, consider butane:
.. figure:: JPG/butane.jpg
The ``butane.lt`` file below defines Butane as a polymer containing
4 monomers (of type ``CH3``, ``CH2``, ``CH2``, ``CH3``).
.. code-block:: bash
import /usr/local/moltemplate/moltemplate/force_fields/oplsaa2024.lt # defines OPLSAA
CH3 inherits OPLSAA {
# atomID molID atomType charge coordX coordY coordZ
write("Data Atoms") {
$atom:c $mol:... @atom:54 0.0 0.000000 0.4431163 0.000000
$atom:h1 $mol:... @atom:60 0.0 0.000000 1.0741603 0.892431
$atom:h2 $mol:... @atom:60 0.0 0.000000 1.0741603 -0.892431
$atom:h3 $mol:... @atom:60 0.0 -0.892431 -0.1879277 0.000000
}
# (Using "$mol:..." indicates this object ("CH3") is part of a larger
# molecule. Moltemplate will share the molecule-ID with that molecule.)
# A list of the bonds within the "CH3" molecular sub-unit:
# BondID AtomID1 AtomID2
write('Data Bond List') {
$bond:ch1 $atom:c $atom:h1
$bond:ch2 $atom:c $atom:h2
$bond:ch3 $atom:c $atom:h3
}
}
CH2 inherits OPLSAA {
# atomID molID atomType charge coordX coordY coordZ
write("Data Atoms") {
$atom:c $mol:... @atom:57 0.0 0.000000 0.4431163 0.000000
$atom:h1 $mol:... @atom:60 0.0 0.000000 1.0741603 0.892431
$atom:h2 $mol:... @atom:60 0.0 0.000000 1.0741603 -0.892431
}
# A list of the bonds within the "CH2" molecular sub-unit:
# BondID AtomID1 AtomID2
write('Data Bond List') {
$bond:ch1 $atom:c $atom:h1
$bond:ch2 $atom:c $atom:h2
}
}
Butane inherits OPLSAA {
create_var {$mol} # optional:force all monomers to share the same molecule-ID
# - Create 4 monomers
# - Move them along the X axis using ".move()",
# - Rotate them 180 degrees with respect to the previous monomer
monomer1 = new CH3
monomer2 = new CH2.rot(180,1,0,0).move(1.2533223,0,0)
monomer3 = new CH2.move(2.5066446,0,0)
monomer4 = new CH3.rot(180,0,0,1).move(3.7599669,0,0)
# A list of the bonds connecting different monomers together:
write('Data Bond List') {
$bond:b1 $atom:monomer1/c $atom:monomer2/c
$bond:b2 $atom:monomer2/c $atom:monomer3/c
$bond:b3 $atom:monomer3/c $atom:monomer4/c
}
}
Again, you don't have to specify the charge in this example because OPLSAA
assigns charges according to the atom type.
This ``Butane`` object is a molecule which can be used anywhere other molecules
can be used. (You can arrange ``Butane`` molecules on a lattice, as we did previously.
You can also modify individual butane molecules by adding or deleting atoms or bonds.
You can add bonds between specific butane molecules or use ``Butane`` as a
subunit to define even larger molecules. See the moltemplate manual for details.)
How to build a complex polymer
""""""""""""""""""""""""""""""""""""""""""
A similar procedure can be used to create more complicated polymers,
such as the NIPAM polymer example shown below. For details, see:
https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/NIPAM_polymer+water+ions
Mapping an existing structure Mapping an existing structure
""""""""""""""""""""""""""""" """""""""""""""""""""""""""""
Another helpful way to use Moltemplate is mapping an existing molecular Another helpful way to use Moltemplate is mapping an existing molecular
sample to a force field. This is useful when a complex sample is sample to a force field. This is useful when a complex sample is assembled
assembled from different simulations or created with specialized from different simulations or created with specialized software (e.g. PACKMOL).
software (e.g. PACKMOL). As in the previous example, all molecular (Note: The previous link shows how to build this entire system from scratch
species in the sample must be defined using single-molecule Moltemplate using only moltemplate. However here we will assume instead that we obtained
objects. For this example, we use a short polymer in a box containing a PDB file for this system using PACKMOL.)
As in the previous examples, all molecular species in the sample
are defined using single-molecule Moltemplate objects.
For this example, we use a short polymer in a box containing
water molecules and ions in the PDB file ``model.pdb``. water molecules and ions in the PDB file ``model.pdb``.
It is essential to understand that the order of atoms in the PDB file It is essential to understand that the order of atoms in the PDB file
@ -246,25 +364,25 @@ The resulting master LT file defining short annealing at a fixed volume
.. code-block:: bash .. code-block:: bash
# Use the OPLS-AA force field for all species. # Use the OPLS-AA force field for all species.
import /usr/local/moltemplate/moltemplate/force_fields/oplsaa.lt import /usr/local/moltemplate/moltemplate/force_fields/oplsaa2024.lt
import PolyNIPAM.lt import PolyNIPAM.lt
# Define the SPC water and ions as in the OPLS-AA # Define the SPC water and ions as in the OPLS-AA
Ca inherits OPLSAA { Ca inherits OPLSAA {
write("Data Atoms"){ write("Data Atoms"){
$atom:a1 $mol:. @atom:354 0.0 0.00000 0.00000 0.000000 $atom:a1 $mol:. @atom:412 0.0 0.00000 0.00000 0.000000
} }
} }
Cl inherits OPLSAA { Cl inherits OPLSAA {
write("Data Atoms"){ write("Data Atoms"){
$atom:a1 $mol:. @atom:344 0.0 0.00000 0.00000 0.000000 $atom:a1 $mol:. @atom:401 0.0 0.00000 0.00000 0.000000
} }
} }
SPC inherits OPLSAA { SPC inherits OPLSAA {
write("Data Atoms"){ write("Data Atoms"){
$atom:O $mol:. @atom:76 0. 0.0000000 0.00000 0.000000 $atom:O $mol:. @atom:9991 0. 0.0000000 0.00000 0.0000000
$atom:H1 $mol:. @atom:77 0. 0.8164904 0.00000 0.5773590 $atom:H1 $mol:. @atom:9990 0. 0.8164904 0.00000 0.5773590
$atom:H2 $mol:. @atom:77 0. -0.8164904 0.00000 0.5773590 $atom:H2 $mol:. @atom:9990 0. -0.8164904 0.00000 0.5773590
} }
write("Data Bond List") { write("Data Bond List") {
$bond:OH1 $atom:O $atom:H1 $bond:OH1 $atom:O $atom:H1
@ -285,8 +403,15 @@ The resulting master LT file defining short annealing at a fixed volume
0 26 zlo zhi 0 26 zlo zhi
} }
# Define the input variables.
write_once("In Init"){ write_once("In Init"){
boundary p p p # "p p p" is the default. This line is optional.
neighbor 3 bin # (This line is also optional in this example.)
}
# Note: The lines below in the "In Run" section are often omitted.
# Run an NVT simulation.
write_once("In Run"){
# Input variables. # Input variables.
variable run string sample01 # output name variable run string sample01 # output name
variable ts equal 2 # timestep variable ts equal 2 # timestep
@ -294,13 +419,6 @@ The resulting master LT file defining short annealing at a fixed volume
variable p equal 1. # equilibrium pressure variable p equal 1. # equilibrium pressure
variable equi equal 30000 # equilibration steps variable equi equal 30000 # equilibration steps
# PBC (set them before the creation of the box).
boundary p p p
neighbor 3 bin
}
# Run an NVT simulation.
write_once("In Run"){
# Set the output. # Set the output.
thermo 1000 thermo 1000
thermo_style custom step etotal evdwl ecoul elong ebond eangle & thermo_style custom step etotal evdwl ecoul elong ebond eangle &
@ -314,8 +432,8 @@ The resulting master LT file defining short annealing at a fixed volume
write_data \$\{run\}.min write_data \$\{run\}.min
# Set the constrains. # Set the constrains.
group watergroup type @atom:76 @atom:77 group watergroup type @atom:9991 @atom:9990
fix 0 watergroup shake 0.0001 10 0 b @bond:042_043 a @angle:043_042_043 fix 0 watergroup shake 0.0001 10 0 b @bond:spcO_spcH a @angle:spcH_spcO_spcH
# Short annealing. # Short annealing.
timestep \$\{ts\} timestep \$\{ts\}
@ -327,7 +445,7 @@ The resulting master LT file defining short annealing at a fixed volume
In this example, the water model is SPC and it is defined in the In this example, the water model is SPC and it is defined in the
``oplsaa.lt`` file with atom types ``@atom:76`` and ``@atom:77``. For ``oplsaa2024.lt`` file with atom types ``@atom:9991`` and ``@atom:9990``. For
water we also use the ``group`` and ``fix shake`` commands with water we also use the ``group`` and ``fix shake`` commands with
Moltemplate ``@``-type variables, to ensure consistency with the Moltemplate ``@``-type variables, to ensure consistency with the
numerical values assigned during compilation. To identify the bond and numerical values assigned during compilation. To identify the bond and
@ -336,19 +454,20 @@ are:
.. code-block:: bash .. code-block:: bash
replace{ @atom:76 @atom:76_b042_a042_d042_i042 } replace{ @atom:9991 @atom:9991_bspcO_aspcO_dspcO_ispcO }
replace{ @atom:77 @atom:77_b043_a043_d043_i043 } replace{ @atom:9990 @atom:9990_bspcH_aspcH_dspcH_ispcH }
From which we can identify the following "Data Bonds By Type": From which we can identify the following "Data Bonds By Type":
``@bond:042_043 @atom:*_b042*_a*_d*_i* @atom:*_b043*_a*_d*_i*`` and ``@bond:spcO_spcH @atom:*_bspcO*_a*_d*_i* @atom:*_bspcH*_a*_d*_i*``
"Data Angles By Type": ``@angle:043_042_043 @atom:*_b*_a043*_d*_i* and "Data Angles By Type":
@atom:*_b*_a042*_d*_i* @atom:*_b*_a043*_d*_i*`` ``@angle:spcH_spcO_spcH @atom:*_b*_aspcH*_d*_i* @atom:*_b*_aspcO*_d*_i* @atom:*_b*_aspcH*_d*_i*``
Compile the master file with: Compile the master file with:
.. code-block:: bash .. code-block:: bash
moltemplate.sh -overlay-all -pdb model.pdb sample01.lt moltemplate.sh -pdb model.pdb sample01.lt
cleanup_moltemplate.sh
And execute the simulation with the following: And execute the simulation with the following:
@ -363,8 +482,13 @@ And execute the simulation with the following:
Sample visualized with Ovito loading the trajectory into the DATA Sample visualized with Ovito loading the trajectory into the DATA
file written after minimization. file written after minimization.
------------ ------------
.. _OPLSAA96: .. _oplsaa2024:
**(OPLS-AA)** Jorgensen, Maxwell, Tirado-Rives, J Am Chem Soc, 118(45), 11225-11236 (1996). **(OPLS-AA)** Jorgensen, W.L., Ghahremanpour, M.M., Saar, A., Tirado-Rives, J., J. Phys. Chem. B, 128(1), 250-262 (2024).
.. _Moltemplate1:
**(Moltemplate)** Jewett et al., J. Mol. Biol., 433(11), 166841 (2021)

View File

@ -197,7 +197,7 @@ The LPS model has a force scalar state
.. math:: .. math::
\underline{t} = \frac{3K\theta}{m}\underline{\omega}\,\underline{x} + \underline{t} = \frac{3K\theta}{m}\underline{\omega}\,\underline{x} +
\alpha \underline{\omega}\,\underline{e}^{\rm d}, \qquad\qquad\textrm{(3)} \alpha \underline{\omega}\,\underline{e}^\mathrm{d}, \qquad\qquad\textrm{(3)}
with :math:`K` the bulk modulus and :math:`\alpha` related to the shear with :math:`K` the bulk modulus and :math:`\alpha` related to the shear
modulus :math:`G` as modulus :math:`G` as
@ -242,14 +242,14 @@ scalar state are defined, respectively, as
.. math:: .. math::
\underline{e}^{\rm i}=\frac{\theta \underline{x}}{3}, \qquad \underline{e}^\mathrm{i}=\frac{\theta \underline{x}}{3}, \qquad
\underline{e}^{\rm d} = \underline{e}- \underline{e}^{\rm i}, \underline{e}^\mathrm{d} = \underline{e}- \underline{e}^\mathrm{i},
where the arguments of the state functions and the vectors on which they where the arguments of the state functions and the vectors on which they
operate are omitted for simplicity. We note that the LPS model is linear operate are omitted for simplicity. We note that the LPS model is linear
in the dilatation :math:`\theta`, and in the deviatoric part of the in the dilatation :math:`\theta`, and in the deviatoric part of the
extension :math:`\underline{e}^{\rm d}`. extension :math:`\underline{e}^\mathrm{d}`.
.. note:: .. note::

View File

@ -62,17 +62,17 @@ with :ref:`PNG, JPEG and FFMPEG output support <graphics>` enabled.
cd $LAMMPS_DIR/src cd $LAMMPS_DIR/src
# add packages if necessary # add LAMMPS packages if necessary
make yes-MOLECULE make yes-MOLECULE
make yes-PYTHON make yes-PYTHON
# compile shared library using Makefile # compile shared library using Makefile
make mpi mode=shlib LMP_INC="-DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG" JPG_LIB="-lpng -ljpeg" make mpi mode=shlib LMP_INC="-DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG" JPG_LIB="-lpng -ljpeg"
Step 2: Installing the LAMMPS Python package Step 2: Installing the LAMMPS Python module
"""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""
Next install the LAMMPS Python package into your current Python installation with: Next install the LAMMPS Python module into your current Python installation with:
.. code-block:: bash .. code-block:: bash
@ -89,6 +89,29 @@ privileges) or into your personal Python module folder.
Recompiling the shared library requires re-installing the Python Recompiling the shared library requires re-installing the Python
package. package.
.. _externally_managed:
.. admonition:: Handling an "externally-managed-environment" Error
:class: Hint
Some Python installations made through Linux distributions
(e.g. Ubuntu 24.04LTS or later) will prevent installing the LAMMPS
Python module into a system folder or a corresponding folder of the
individual user as attempted by ``make install-python`` with an error
stating that an *externally managed* python installation must be only
managed by the same package package management tool. This is an
optional setting, so not all Linux distributions follow it currently
(Spring 2025). The reasoning and explanations for this error can be
found in the `Python Packaging User Guide
<https://packaging.python.org/en/latest/specifications/externally-managed-environments/>`_
These guidelines suggest to create a virtual environment and install
the LAMMPS Python module there (see below). This is generally a good
idea and the LAMMPS developers recommend this, too. If, however, you
want to proceed and install the LAMMPS Python module regardless, you
can install the "wheel" file (see above) manually with the ``pip``
command by adding the ``--break-system-packages`` flag.
Installation inside of a virtual environment Installation inside of a virtual environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -249,23 +249,23 @@ as follows:
.. math:: .. math::
a = & {\rm lx} \\ a = & \mathrm{lx} \\
b^2 = & {\rm ly}^2 + {\rm xy}^2 \\ b^2 = & \mathrm{ly}^2 + \mathrm{xy}^2 \\
c^2 = & {\rm lz}^2 + {\rm xz}^2 + {\rm yz}^2 \\ c^2 = & \mathrm{lz}^2 + \mathrm{xz}^2 + \mathrm{yz}^2 \\
\cos{\alpha} = & \frac{{\rm xy}*{\rm xz} + {\rm ly}*{\rm yz}}{b*c} \\ \cos{\alpha} = & \frac{\mathrm{xy}*\mathrm{xz} + \mathrm{ly}*\mathrm{yz}}{b*c} \\
\cos{\beta} = & \frac{\rm xz}{c} \\ \cos{\beta} = & \frac{\mathrm{xz}}{c} \\
\cos{\gamma} = & \frac{\rm xy}{b} \\ \cos{\gamma} = & \frac{\mathrm{xy}}{b} \\
The inverse relationship can be written as follows: The inverse relationship can be written as follows:
.. math:: .. math::
{\rm lx} = & a \\ \mathrm{lx} = & a \\
{\rm xy} = & b \cos{\gamma} \\ \mathrm{xy} = & b \cos{\gamma} \\
{\rm xz} = & c \cos{\beta}\\ \mathrm{xz} = & c \cos{\beta}\\
{\rm ly}^2 = & b^2 - {\rm xy}^2 \\ \mathrm{ly}^2 = & b^2 - \mathrm{xy}^2 \\
{\rm yz} = & \frac{b*c \cos{\alpha} - {\rm xy}*{\rm xz}}{\rm ly} \\ \mathrm{yz} = & \frac{b*c \cos{\alpha} - \mathrm{xy}*\mathrm{xz}}{\mathrm{ly}} \\
{\rm lz}^2 = & c^2 - {\rm xz}^2 - {\rm yz}^2 \\ \mathrm{lz}^2 = & c^2 - \mathrm{xz}^2 - \mathrm{yz}^2 \\
The values of *a*, *b*, *c*, :math:`\alpha` , :math:`\beta`, and The values of *a*, *b*, *c*, :math:`\alpha` , :math:`\beta`, and
:math:`\gamma` can be printed out or accessed by computes using the :math:`\gamma` can be printed out or accessed by computes using the

View File

@ -5,8 +5,7 @@ LAMMPS can be downloaded, built, and configured for macOS with `Homebrew
<homebrew_>`_. (Alternatively, see the installation instructions for <homebrew_>`_. (Alternatively, see the installation instructions for
:doc:`downloading an executable via Conda <Install_conda>`.) The :doc:`downloading an executable via Conda <Install_conda>`.) The
following LAMMPS packages are unavailable at this time because of following LAMMPS packages are unavailable at this time because of
additional requirements not yet met: GPU, KOKKOS, MSCG, POEMS, additional requirements not yet met: GPU, KOKKOS.
VORONOI.
After installing Homebrew, you can install LAMMPS on your system with After installing Homebrew, you can install LAMMPS on your system with
the following commands: the following commands:

View File

@ -13,10 +13,14 @@ Programming language standards
Most of the C++ code currently requires a compiler compatible with the Most of the C++ code currently requires a compiler compatible with the
C++11 standard, the KOKKOS package currently requires C++17. Most of C++11 standard, the KOKKOS package currently requires C++17. Most of
the Python code is written to be compatible with Python 3.5 or later or the Python code is written to be compatible with Python 3.6 or later.
Python 2.7. Some Python scripts *require* Python 3 and a few others
still need to be ported from Python 2 to Python 3.
.. deprecated:: TBD
Python 2.x is no longer supported and trying to use it, e.g. for the
LAMMPS Python module should result in an error. If you come across
some part of the LAMMPS distribution that is not (yet) compatible with
Python 3, please notify the LAMMPS developers.
Build systems Build systems
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
@ -24,8 +28,8 @@ Build systems
LAMMPS can be compiled from source code using a (traditional) build LAMMPS can be compiled from source code using a (traditional) build
system based on shell scripts, a few shell utilities (grep, sed, cat, system based on shell scripts, a few shell utilities (grep, sed, cat,
tr) and the GNU make program. This requires running within a Bourne tr) and the GNU make program. This requires running within a Bourne
shell (``/bin/sh``). Alternatively, a build system with different back ends shell (``/bin/sh``). Alternatively, a build system with different back
can be created using CMake. CMake must be at least version 3.16. ends can be created using CMake. CMake must be at least version 3.16.
Operating systems Operating systems
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 94 KiB

BIN
doc/src/JPG/butane.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
doc/src/JPG/rhodo-both.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

View File

@ -19,9 +19,9 @@ there are now a few requirements for including new changes or extensions.
be added. be added.
- New features should also be implemented and documented not just - New features should also be implemented and documented not just
for the C interface, but also the Python and Fortran interfaces. for the C interface, but also the Python and Fortran interfaces.
- All additions should work and be compatible with ``-DLAMMPS_BIGBIG``, - All additions should work and be compatible with
``-DLAMMPS_SMALLBIG``, ``-DLAMMPS_SMALLSMALL`` as well as when ``-DLAMMPS_BIGBIG``, ``-DLAMMPS_SMALLBIG`` as well as when compiling
compiling with and without MPI support. with and without MPI support.
- The ``library.h`` file should be kept compatible to C code at - The ``library.h`` file should be kept compatible to C code at
a level similar to C89. Its interfaces may not reference any a level similar to C89. Its interfaces may not reference any
custom data types (e.g. ``bigint``, ``tagint``, and so on) that custom data types (e.g. ``bigint``, ``tagint``, and so on) that

View File

@ -20,6 +20,7 @@ functions. They do not directly call the LAMMPS library.
- :cpp:func:`lammps_force_timeout` - :cpp:func:`lammps_force_timeout`
- :cpp:func:`lammps_has_error` - :cpp:func:`lammps_has_error`
- :cpp:func:`lammps_get_last_error_message` - :cpp:func:`lammps_get_last_error_message`
- :cpp:func:`lammps_set_show_error`
- :cpp:func:`lammps_python_api_version` - :cpp:func:`lammps_python_api_version`
The :cpp:func:`lammps_free` function is a clean-up function to free The :cpp:func:`lammps_free` function is a clean-up function to free
@ -110,6 +111,11 @@ where such memory buffers were allocated that require the use of
----------------------- -----------------------
.. doxygenfunction:: lammps_set_show_error
:project: progguide
-----------------------
.. doxygenfunction:: lammps_python_api_version .. doxygenfunction:: lammps_python_api_version
:project: progguide :project: progguide

View File

@ -189,10 +189,8 @@ of the contribution. As of January 2023, all previously included
Fortran code for the LAMMPS executable has been replaced by equivalent Fortran code for the LAMMPS executable has been replaced by equivalent
C++ code. C++ code.
Python code must be compatible with Python 3.5 and later. Large parts Python code currently must be compatible with Python 3.6. If a later
of LAMMPS (including the :ref:`PYTHON package <PKG-PYTHON>`) are also version or Python is required, it needs to be documented.
compatible with Python 2.7. Compatibility with Python 2.7 is desirable,
but compatibility with Python 3.5 is **required**.
Compatibility with older programming language standards is very Compatibility with older programming language standards is very
important to maintain portability and availability of LAMMPS on many important to maintain portability and availability of LAMMPS on many

View File

@ -2428,7 +2428,7 @@ ways to use LAMMPS and Python together.
Building with the PYTHON package assumes you have a Python development Building with the PYTHON package assumes you have a Python development
environment (headers and libraries) available on your system, which needs environment (headers and libraries) available on your system, which needs
to be either Python version 2.7 or Python 3.5 and later. to be Python version 3.6 or later.
**Install:** **Install:**

View File

@ -7,6 +7,10 @@ LAMMPS shared library through the Python `ctypes <ctypes_>`_
module. Because of the dynamic loading, it is required that LAMMPS is module. Because of the dynamic loading, it is required that LAMMPS is
compiled in :ref:`"shared" mode <exe>`. compiled in :ref:`"shared" mode <exe>`.
.. versionchanged:: TBD
LAMMPS currently only supports Python version 3.6 or later.
Two components 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 Package (``lammps``) from the ``python`` folder * The LAMMPS Python Package (``lammps``) from the ``python`` folder
@ -106,13 +110,16 @@ folder that the dynamic loader searches or inside of the installed
.. code-block:: bash .. code-block:: bash
python install.py -p <python package> -l <shared library> -v <version.h file> [-n] python install.py -p <python package> -l <shared library> -v <version.h file> [-n] [-f]
* The ``-p`` flag points to the ``lammps`` Python package folder 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 ``-l`` flag points to the LAMMPS shared library file to be installed,
* the ``-v`` flag points to the LAMMPS version header file to extract the version date, * the ``-v`` flag points to the LAMMPS version header file to extract the version date,
* and the optional ``-n`` instructs the script to only build a wheel file * the optional ``-n`` instructs the script to only build a wheel file but not attempt
but not attempt to install it. to install it,
* and the optional ``-f`` argument instructs the script to force installation even if
pip would otherwise refuse installation with an
:ref:`error about externally managed environments <externally_managed>`.
.. tab:: Virtual environment .. tab:: Virtual environment
@ -136,11 +143,6 @@ folder that the dynamic loader searches or inside of the installed
# create virtual environment in folder $HOME/myenv # create virtual environment in folder $HOME/myenv
python3 -m venv $HOME/myenv python3 -m venv $HOME/myenv
For Python versions prior 3.3 you can use `virtualenv
<https://packaging.python.org/en/latest/key_projects/#virtualenv>`_
command instead of "python3 -m venv". This step has to be done
only once.
To activate the virtual environment type: To activate the virtual environment type:
.. code-block:: bash .. code-block:: bash
@ -199,6 +201,10 @@ folder that the dynamic loader searches or inside of the installed
The ``PYTHONPATH`` needs to point to the parent folder that contains the ``lammps`` package! The ``PYTHONPATH`` needs to point to the parent folder that contains the ``lammps`` package!
In case you run into an "externally-managed-environment" error when
trying to install the LAMMPS Python module, please refer to
:ref:`corresponding paragraph <externally_managed>` in the Python HOWTO
page to learn about options for handling this error.
To verify if LAMMPS can be successfully started from Python, start the To verify if LAMMPS can be successfully started from Python, start the
Python interpreter, load the ``lammps`` Python module and create a Python interpreter, load the ``lammps`` Python module and create a
@ -245,14 +251,14 @@ make MPI calls directly from Python in your script, if you desire.
We have tested this with `MPI for Python <https://mpi4py.readthedocs.io/>`_ We have tested this with `MPI for Python <https://mpi4py.readthedocs.io/>`_
(aka mpi4py) and you will find installation instruction for it below. (aka mpi4py) and you will find installation instruction for it below.
Installation of mpi4py (version 3.0.3 as of Sep 2020) can be done as Installation of mpi4py (version 4.0.1 as of Feb 2025) can be done as
follows: follows:
- Via ``pip`` into a local user folder with: - Via ``pip`` into a local user folder with:
.. code-block:: bash .. code-block:: bash
pip install --user mpi4py python3 -m pip install --user mpi4py
- Via ``dnf`` into a system folder for RedHat/Fedora systems: - Via ``dnf`` into a system folder for RedHat/Fedora systems:
@ -261,20 +267,20 @@ follows:
# for use with OpenMPI # for use with OpenMPI
sudo dnf install python3-mpi4py-openmpi sudo dnf install python3-mpi4py-openmpi
# for use with MPICH # for use with MPICH
sudo dnf install python3-mpi4py-openmpi sudo dnf install python3-mpi4py-mpich
- Via ``pip`` into a virtual environment (see above): - Via ``pip`` into a virtual environment (see above):
.. code-block:: console .. code-block:: console
$ source $HOME/myenv/activate $ source $HOME/myenv/activate
(myenv)$ pip install mpi4py (myenv)$ python -m pip install mpi4py
- Via ``pip`` into a system folder (not recommended): - Via ``pip`` into a system folder (not recommended):
.. code-block:: bash .. code-block:: bash
sudo pip install mpi4py sudo python3 -m pip install mpi4py
For more detailed installation instructions and additional options, For more detailed installation instructions and additional options,
please see the `mpi4py installation <https://mpi4py.readthedocs.io/en/stable/install.html>`_ page. please see the `mpi4py installation <https://mpi4py.readthedocs.io/en/stable/install.html>`_ page.

View File

@ -44,15 +44,11 @@ Below is an example output for Python version 3.8.5.
.. warning:: .. warning::
The options described in this section of the manual for using Python The options described in this section of the manual for using Python
with LAMMPS currently support either Python 2 or 3. Specifically with LAMMPS support only Python 3.6 or later. For use with Python
version 2.7 or later and 3.6 or later. Since the Python community no 2.x you will need to use an older LAMMPS version like 29 Aug 2024
longer maintains Python 2 (see `this notice or older. If you notice Python code in the LAMMPS distribution that
<https://www.python.org/doc/sunset-python-2/>`_), we recommend use of is not compatible with Python 3, please contact the LAMMPS developers
Python 3 with LAMMPS. While Python 2 code should continue to work, or submit `and issue on GitHub <https://github.com/lammps/lammps/issues>`_
that is not something we can guarantee long-term. If you notice
Python code in the LAMMPS distribution that is not compatible with
Python 3, please contact the LAMMPS developers or submit `and issue
on GitHub <https://github.com/lammps/lammps/issues>`_
--------- ---------

416
doc/src/Run_formats.rst Normal file
View File

@ -0,0 +1,416 @@
File formats used by LAMMPS
===========================
This page provides a general overview of the kinds of files and file
formats that LAMMPS is reading and writing.
.. contents:: On this page
:depth: 2
:backlinks: top
-------------------
Character Encoding
^^^^^^^^^^^^^^^^^^
For processing text files, the LAMMPS source code assumes `ASCII
character encoding <https://en.wikipedia.org/wiki/ASCII>`_ which
represents the digits 0 to 9, the lower and upper case letters a to z,
some common punctuation and other symbols and a few whitespace
characters including a regular "space character", "line feed", "carriage
return", "tabulator". These characters are all represented by single
bytes with a value smaller than 128 and only 95 of those 128 values
represent printable characters. This list is sufficient to represent
most English text, but misses accented characters or umlauts or Greek
symbols and more.
Modern text often uses `UTF-8 character encoding
<https://en.wikipedia.org/wiki/UTF-8>`_ instead. This encoding is a way
to represent many more different characters as defined by the Unicode
standard. UFT-8 is compatible with ASCII, since the first 128 values
are identical with the ASCII encoding. It is important to note,
however, that there are Unicode characters that *look* similar to ASCII
characters, but have a different binary representation. As a general
rule, these characters may not be correctly recognized by LAMMPS. For
some parts of LAMMPS' text processing, translation tables with known
"lookalike" characters are used. The tables are used to substitute
non-ASCII characters with their ASCII equivalents. Non-ASCII lookalike
characters are often used by web browsers or PDF viewers to improve the
readability of text. Thus, when using copy and paste to transfer text
from such an application to your input file, you may unintentionally
create text that is not exclusively using ASCII encoding and may cause
errors when LAMMPS is trying to read it.
Lines with non-printable and non-ASCII characters in text files can be
detected for example with a (Linux) command like the following:
.. code-block:: bash
env LC_ALL=C grep -n '[^ -~]' some_file.txt
Number Formatting
^^^^^^^^^^^^^^^^^
Different countries and languages have different conventions to format
numbers. While in some regions commas are used for fractions and points
to indicate thousand, million and so on, this is reversed in other
regions. Modern operating systems have facilities to adjust input and
output accordingly that are collectively referred to as "native language
support" (NLS). The exact rules are often applied according to the
value of the ``$LANG`` environment variable (e.g. "en_US.utf8" for
English text in UTF-8 encoding).
For the sake of simplicity of the implementation and transferability of
results, LAMMPS does not support this and instead expects numbers being
formatted in the generic or "C" locale. The "C" locale has no
punctuation for thousand, million and so on and uses a decimal point for
fractions. One thousand would be represented as "1000.0" and not as
"1,000.0" nor as "1.000,0". Having native language support enabled for
a locale other than "C" will result in different behavior when
converting or formatting numbers that can trigger unexpected errors.
LAMMPS also only accepts integer numbers when an integer is required, so
using floating point equivalents like "1.0" are not accepted; you *must*
use "1" instead.
For floating point numbers in scientific notation, the Fortran double
precision notation "1.1d3" is not accepted; you have to use "1100",
"1100.0" or "1.1e3".
Input file
^^^^^^^^^^
A LAMMPS input file is a text file with commands. It is read
line-by-line and each line is processed *immediately*. Before looking
for commands and executing them, there is a pre-processing step where
comments (non-quoted text starting with a pound sign '#') are removed,
``${variable}`` and ``$(expression)`` constructs are expanded or
evaluated, and lines that end in the ampersand character '&' are
combined with the next line (similar to Fortran 90 free-format source
code). After the pre-processing, lines are split into "words" and
evaluated. The first word must be a :doc:`command <Commands_all>` and
all following words are arguments. Below are some example lines:
.. code-block:: LAMMPS
# full line comment
# some global settings
units lj
atom_style atomic
# ^^ command ^^ argument(s)
variable x index 1 # may be overridden from command line with -var x <value>
variable xx equal 20*$x # variable "xx" is always 20 times "x"
lattice fcc 0.8442
# example of a command written across multiple lines
# the "region" command uses spacing from "lattice" command, unless "units box" is specified
region box block 0.0 ${xx} &
0.0 40.0 &
0.0 30.0
# create simulation box and fill with atoms according to lattice setting
create_box 1 box
create_atoms 1 box
# set force field and parameters
mass 1 1.0
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
# run simulation
fix 1 all nve
run 1000
The pivotal command in this example input is the :doc:`create_box
command <create_box>`. It defines the simulation system and many
parameters that go with it: units, atom style, number of atom types (and
other types) and more. Those settings are *locked in* after the box is
created. Commands that change these kind of settings are only allowed
**before** a simulation box is created and many other commands are only
allowed **after** the simulation box is defined (e.g. :doc:`pair_coeff
<pair_coeff>`). Very few commands (e.g. :doc:`pair_style <pair_style>`)
may be used in either part of the input. The :doc:`read_data
<read_data>` and :doc:`read_restart <read_restart>` commands also create
the system box and thus have a similar pivotal function.
The LAMMPS input syntax has minimal support for conditionals and loops,
but if more complex operations are required, it is recommended to use
the library interface, e.g. :doc:`from Python using the LAMMPS Python
module <Python_run>`.
There is a frequent misconception about the :doc:`if command <if>`:
this is a command for conditional execution **outside** a run or
minimization. To trigger actions on specific conditions **during**
a run is a non-trivial operation that usually requires adopting one
of the available "fix" commands or creating a new "fix" command.
LAMMPS commands change the internal state and thus the order of commands
matters and reordering them can produce different results. For example,
the region defined by the :doc:`region command <region>` in the example
above depends on the :doc:`lattice setting <lattice>` and thus its
dimensions will be different depending on the order of the two commands.
Each line must have an "end-of-line" character (line feed or carriage
return plus line feed). Some text editors do not automatically insert
one which may cause LAMMPS to ignore the last command. It is thus
recommended to always have an empty line at the end of an input file.
The specific details describing how LAMMPS input is processed and parsed
are explained in :doc:`Commands_parse`.
Data file
^^^^^^^^^
A LAMMPS data file contains a description of a system suitable for
reading with the :doc:`read_data command <read_data>`. Data files are
commonly used for setting up complex molecular systems that can be
difficult to achieve with the commands :doc:`create_box <create_box>`
and :doc:`create_atoms <create_atoms>` alone. Also, data files can be
used as a portable alternatives to a :doc:`binary restart file
<restart>`. A restart file can be converted into a data file from the
:doc:`command line <Run_options>`.
Data files have a header section at the very beginning of the file and
multiple titled sections such as "Atoms", Masses", "Pair Coeffs", and so
on. Header keywords can only be used *before* the first title section.
The data file **always** starts with a "title" line, which will be
**ignored** by LAMMPS. Omitting the title line can lead to unexpected
behavior because a line of the header with an actual setting may be
ignored. In this case, the mistakenly ignored line often contains the
"atoms" keyword, which results in LAMMPS assuming that there are no
atoms in the data file and thus throwing an error on the contents of the
"Atoms" section. The title line may contain some keywords that can be
used by external programs to convey information about the system
(included as comments), that is not required and not read by LAMMPS.
The line following a section title is also **ignored**. An error will
occur if an empty line is not placed after a section title. The number
of lines in titled sections depends on header keywords, like the number
of atom types, the number of atoms, the number of bond types, the number
of bonds, and so on. The data in those sections has to be complete. A
special case are the "Pair Coeffs" and "PairIJ Coeffs" sections; the
former is for force fields and pair styles that use mixing of non-bonded
potential parameters, the latter for pair styles and force fields
requiring explicit coefficients. Thus with *N* being the number of atom
types, the "Pair Coeffs" section has *N* entries while "PairIJ Coeffs"
has :math:`N \cdot (N-1)` entries. Internally, these sections will be
converted to :doc:`pair_coeff <pair_coeff>` commands. Thus the
corresponding :doc:`pair style <pair_style>` must have been set *before*
the :doc:`read_data command <read_data>` reads the data file.
Data files may contain comments, which start with the pound sign '#'.
There must be at least one blank between a valid keyword and the pound
sign. Below is a simple example case of a data file for :doc:`atom style
full <atom_style>`.
.. code-block:: bash
LAMMPS Title line (ignored)
# full line comment
10 atoms # comment
4 atom types
-36.840194 64.211560 xlo xhi
-41.013691 68.385058 ylo yhi
-29.768095 57.139462 zlo zhi
Masses
1 12.0110
2 12.0110
3 15.9990
4 1.0080
Pair Coeffs # this section is optional
1 0.110000 3.563595 0.110000 3.563595
2 0.080000 3.670503 0.010000 3.385415
3 0.120000 3.029056 0.120000 2.494516
4 0.022000 2.351973 0.022000 2.351973
Atoms # full
1 1 1 0.560 43.99993 58.52678 36.78550 0 0 0
2 1 2 -0.270 45.10395 58.23499 35.86693 0 0 0
3 1 3 -0.510 43.81519 59.54928 37.43995 0 0 0
4 1 4 0.090 45.71714 57.34797 36.13434 0 0 0
5 1 4 0.090 45.72261 59.13657 35.67007 0 0 0
6 1 4 0.090 44.66624 58.09539 34.85538 0 0 0
7 1 3 -0.470 43.28193 57.47427 36.91953 0 0 0
8 1 4 0.070 42.07157 57.45486 37.62418 0 0 0
9 1 1 0.510 42.19985 57.57789 39.12163 0 0 0
10 1 1 0.510 41.88641 58.62251 39.70398 0 0 0
# ^^atomID ^^molID ^^type ^^charge ^^xcoord ^^ycoord ^^ycoord ^^image^^flags (optional)
Velocities # this section is optional
1 0.0050731 -0.00398928 0.00391473
2 -0.0175184 0.0173484 -0.00489207
3 0.00597225 -0.00202006 0.00166454
4 -0.010395 -0.0082582 0.00316419
5 -0.00390877 0.00470331 -0.00226911
6 -0.00111157 -0.00374545 -0.0169374
7 0.00209054 -0.00594936 -0.000124563
8 0.00635002 -0.0120093 -0.0110999
9 -0.004955 -0.0123375 0.000403422
10 0.00265028 -0.00189329 -0.00293198
The common problem is processing the "Atoms" section, since its format
depends on the :doc:`atom style <atom_style>` used, and that setting
must be done in the input file *before* reading the data file. To
assist with detecting incompatible data files, a comment is appended to
the "Atoms" title indicating the atom style used (or intended) when
*writing* the data file. For example, below is an "Atoms" section for
:doc:`atom style charge <atom_style>`, which omits the molecule ID
column.
.. code-block:: bash
Atoms # charge
1 1 0.560 43.99993 58.52678 36.78550
2 2 -0.270 45.10395 58.23499 35.86693
3 3 -0.510 43.81519 59.54928 37.43995
4 4 0.090 45.71714 57.34797 36.13434
5 4 0.090 45.72261 59.13657 35.67007
6 4 0.090 44.66624 58.09539 34.85538
7 3 -0.470 43.28193 57.47427 36.91953
8 4 0.070 42.07157 57.45486 37.62418
9 1 0.510 42.19985 57.57789 39.12163
10 1 0.510 41.88641 58.62251 39.70398
# ^^atomID ^^type ^^charge ^^xcoord ^^ycoord ^^ycoord
Another source of confusion about the "Atoms" section format is the
ordering of columns. The three atom style variants `atom_style full`,
`atom_style hybrid charge molecular`, and `atom_style hybrid molecular
charge` all carry the same per-atom information. However, in data files,
the Atoms section has the columns 'Atom-ID Molecule-ID Atom-type Charge
X Y Z' for atom style full, but for hybrid atom styles the first columns
are always 'Atom-ID Atom-type X Y Z' followed by any *additional* data
added by the hybrid styles, for example, 'Charge Molecule-ID' for the
first hybrid style and 'Molecule-ID Charge' in the second hybrid style
variant. Finally, an alternative to a hybrid atom style is to use fix
property/atom, e.g. to add molecule IDs to atom style charge. In this
case the "Atoms" section is formatted according to atom style charge and
a new section, "Molecules" is added that contains lines with 'Atom-ID
Molecule-ID', one for each atom in the system. For adding charges to
atom style molecular with fix property/atom, the "Atoms" section is now
formatted according to the atom style and a "Charges" section is added.
Molecule file
^^^^^^^^^^^^^
Molecule files for use with the :doc:`molecule command <molecule>` look
quite similar to data files but they do not have a compatible format,
i.e., one cannot use a data file as molecule file and vice versa. Below
is a simple example for a water molecule (SPC/E model). Same as a data
file, there is an ignored title line and you can use comments. However,
there is no information about the number of types or the box dimensions.
These parameters are set when the simulation box is created. Thus the
header only has the count of atoms, bonds, and so on.
Molecule files have a header followed by sections (just as in data
files), but the section names are different than those of a data file.
There is no "Atoms" section and the section formats in molecule files is
independent of the atom style. Its information is split across multiple
sections, like "Coords", "Types", and "Charges". Note that no "Masses"
section is needed here. The atom masses are by default tied to the atom
type and set with a data file or the :doc:`mass command <mass>`. A
"Masses" section would only be required for atom styles with per-atom
masses, e.g. atom style sphere, where in data files you would provide
the density and the diameter instead of the mass.
Since the entire file is a 'molecule', LAMMPS will assign a new
molecule-ID (if supported by the atom style) when atoms are instantiated
from a molecule file, e.g. with the :doc:`create_atoms command
<create_atoms>`. It is possible to include a "Molecules" section to
indicate that the atoms belong to multiple 'molecules'. Atom-IDs and
molecule-IDs in the molecule file are relative for the file
(i.e. starting from 1) and will be translated into actual atom-IDs also
when the atoms from the molecule are created.
.. code-block:: bash
# Water molecule. SPC/E model.
3 atoms
2 bonds
1 angles
Coords
1 1.12456 0.09298 1.27452
2 1.53683 0.75606 1.89928
3 0.49482 0.56390 0.65678
Types
1 1
2 2
3 2
Charges
1 -0.8472
2 0.4236
3 0.4236
Bonds
1 1 1 2
2 1 1 3
Angles
1 1 2 1 3
There are also optional sections, e.g. about :doc:`SHAKE <fix_shake>`
and :doc:`special bonds <special_bonds>`. Those sections are only needed
if the molecule command is issued *before* the simulation box is
defined. Otherwise, the molecule command can derive the required
settings internally.
Restart file
^^^^^^^^^^^^
LAMMPS restart files are binary files and not available in text format.
They can be identified by the first few bytes that contain the (C-style)
string ``LammpS RestartT`` as `magic string
<https://en.wikipedia.org/wiki/Magic_string>`_. This string is followed
by a 16-bit integer of the number 1 used for detecting whether the
computer writing the restart has the same `endianness
<https://en.wikipedia.org/wiki/Endianness>`_ as the computer reading it.
If not, the file cannot be read correctly. This integer is followed by
a 32-bit integer indicating the file format revision (currently 3),
which can be used to implement backward compatibility for reading older
revisions.
This information has been added to the `Unix "file" command's
<https://www.darwinsys.com/file/>` "magic" file so that restart files
can be identified without opening them. If you have a fairly recent
version, it should already be included. If you have an older version,
the LAMMPS source package :ref:`contains a file with the necessary
additions <magic>`.
The rest of the file is organized in sections of a 32-bit signed integer
constant indicating the kind of content and the corresponding value (or
values). If those values are arrays (including C-style strings), then
the integer constant is followed by a 32-bit integer indicating the
length of the array. This mechanism will read the data regardless of
the ordering of the sections. Symbolic names of the section constants
are in the ``lmprestart.h`` header file.
LAMMPS restart files are not expected to be portable between platforms
or LAMMPS versions, but changes to the file format are rare.
.. Native Dump file
.. ^^^^^^^^^^^^^^^^
..
.. Potential files
.. ^^^^^^^^^^^^^^^

View File

@ -1,10 +1,11 @@
Run LAMMPS Run LAMMPS
********** **********
These pages explain how to run LAMMPS once you have :doc:`installed an executable <Install>` or :doc:`downloaded the source code <Install>` These pages explain how to run LAMMPS once you have :doc:`installed an
and :doc:`built an executable <Build>`. The :doc:`Commands <Commands>` executable <Install>` or :doc:`downloaded the source code <Install>` and
doc page describes how input scripts are structured and the commands :doc:`built an executable <Build>`. The :doc:`Commands <Commands>` doc
they can contain. page describes how input scripts are structured and the commands they
can contain.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
@ -12,4 +13,5 @@ they can contain.
Run_basics Run_basics
Run_options Run_options
Run_output Run_output
Run_formats
Run_windows Run_windows

View File

@ -117,14 +117,19 @@ number of histogram counts is equal to the number of processors.
---------- ----------
The last section gives aggregate statistics (across all processors) The last section gives aggregate statistics (across all processors) for
for pairwise neighbors and special neighbors that LAMMPS keeps track pairwise neighbors and special neighbors that LAMMPS keeps track of (see
of (see the :doc:`special_bonds <special_bonds>` command). The number the :doc:`special_bonds <special_bonds>` command). This section will
of times neighbor lists were rebuilt is tallied, as is the number of not always contain data, for example when there has not been a neighbor
potentially *dangerous* rebuilds. If atom movement triggered neighbor rebuild, or the neighbor list was constructed on the GPU or when a
list rebuilding (see the :doc:`neigh_modify <neigh_modify>` command), hybrid pair style was used and LAMMPS cannot determine a suitable (base)
then dangerous reneighborings are those that were triggered on the neighbor list to draw the statistics from.
first timestep atom movement was checked for. If this count is
The number of times neighbor lists were rebuilt is tallied, as is the
number of potentially *dangerous* rebuilds. If atom movement triggered
neighbor list rebuilding (see the :doc:`neigh_modify <neigh_modify>`
command), then dangerous reneighborings are those that were triggered on
the first timestep atom movement was checked for. If this count is
non-zero you may wish to reduce the delay factor to ensure no force non-zero you may wish to reduce the delay factor to ensure no force
interactions are missed by atoms moving beyond the neighbor skin interactions are missed by atoms moving beyond the neighbor skin
distance before a rebuild takes place. distance before a rebuild takes place.

View File

@ -44,11 +44,6 @@ section below for examples where this has been done.
system the crossover (in single precision) is often about 50K-100K system the crossover (in single precision) is often about 50K-100K
atoms per GPU. When performing double precision calculations the atoms per GPU. When performing double precision calculations the
crossover point can be significantly smaller. crossover point can be significantly smaller.
* Both KOKKOS and GPU package compute bonded interactions (bonds, angles,
etc) on the CPU. If the GPU package is running with several MPI processes
assigned to one GPU, the cost of computing the bonded interactions is
spread across more CPUs and hence the GPU package can run faster in these
cases.
* When using LAMMPS with multiple MPI ranks assigned to the same GPU, its * When using LAMMPS with multiple MPI ranks assigned to the same GPU, its
performance depends to some extent on the available bandwidth between performance depends to some extent on the available bandwidth between
the CPUs and the GPU. This can differ significantly based on the the CPUs and the GPU. This can differ significantly based on the
@ -85,10 +80,10 @@ section below for examples where this has been done.
code (with a performance penalty due to having data transfers between code (with a performance penalty due to having data transfers between
host and GPU). host and GPU).
* The GPU package requires neighbor lists to be built on the CPU when using * The GPU package requires neighbor lists to be built on the CPU when using
exclusion lists, or a triclinic simulation box. hybrid pair styles, exclusion lists, or a triclinic simulation box.
* The GPU package can be compiled for CUDA or OpenCL and thus supports * The GPU package can be compiled for CUDA, HIP, or OpenCL and thus supports
both, NVIDIA and AMD GPUs well. On NVIDIA hardware, using CUDA is typically NVIDIA, AMD, and Intel GPUs well. On NVIDIA hardware, using CUDA is
resulting in equal or better performance over OpenCL. typically resulting in equal or better performance over OpenCL.
* OpenCL in the GPU package does theoretically also support Intel CPUs or * OpenCL in the GPU package does theoretically also support Intel CPUs or
Intel Xeon Phi, but the native support for those in KOKKOS (or INTEL) Intel Xeon Phi, but the native support for those in KOKKOS (or INTEL)
is superior. is superior.

View File

@ -930,7 +930,7 @@ dependencies and redirects the download to the local cache.
mkdir build mkdir build
cd build cd build
cmake -D LAMMPS_DOWNLOADS_URL=${HTTP_CACHE_URL} -C "${LAMMPS_HTTP_CACHE_CONFIG}" -C ../cmake/presets/most.cmake ../cmake cmake -D LAMMPS_DOWNLOADS_URL=${HTTP_CACHE_URL} -C "${LAMMPS_HTTP_CACHE_CONFIG}" -C ../cmake/presets/most.cmake -D DOWNLOAD_POTENTIALS=off ../cmake
make -j 8 make -j 8
deactivate_caches deactivate_caches

View File

@ -21,7 +21,7 @@ Examples
Description Description
""""""""""" """""""""""
.. versionadded:: TBD .. versionadded:: 4Feb2025
The *mwlc* angle style models a meltable wormlike chain and can be used The *mwlc* angle style models a meltable wormlike chain and can be used
to model non-linear bending elasticity of polymers, e.g. DNA. *mwlc* to model non-linear bending elasticity of polymers, e.g. DNA. *mwlc*

View File

@ -10,7 +10,7 @@ Syntax
bond_style bpm/spring keyword value attribute1 attribute2 ... bond_style bpm/spring keyword value attribute1 attribute2 ...
* optional keyword = *overlay/pair* or *store/local* or *smooth* or *break* or *volume/factor* * optional keyword = *overlay/pair* or *store/local* or *smooth* or *normalize* or *break* or *volume/factor*
.. parsed-literal:: .. parsed-literal::
@ -123,7 +123,7 @@ heuristic maximum strain used by typical non-bpm bond styles. Similar behavior
to *break no* can also be attained by setting an arbitrarily high value of to *break no* can also be attained by setting an arbitrarily high value of
:math:`\epsilon_c`. One cannot use *break no* with *smooth yes*. :math:`\epsilon_c`. One cannot use *break no* with *smooth yes*.
.. versionadded:: TBD .. versionadded:: 4Feb2025
The *volume/factor* keyword toggles whether an additional multibody The *volume/factor* keyword toggles whether an additional multibody
contribution is added to he force using the formulation in contribution is added to he force using the formulation in
@ -141,7 +141,8 @@ calculated using bond lengths squared and the cube root in the above equation
is accordingly replaced with a square root. This approximation assumes bonds is accordingly replaced with a square root. This approximation assumes bonds
are evenly distributed on a spherical surface and neglects constant prefactors are evenly distributed on a spherical surface and neglects constant prefactors
which are irrelevant since only the ratio of volumes matters. This term may be which are irrelevant since only the ratio of volumes matters. This term may be
used to adjust the Poisson's ratio. used to adjust the Poisson's ratio. See the simulation in the
``examples/bpm/poissons_ratio`` directory for a demonstration of this effect.
If a bond is broken (or created), :math:`V_{0,i}` is updated by subtracting If a bond is broken (or created), :math:`V_{0,i}` is updated by subtracting
(or adding) that bond's contribution. (or adding) that bond's contribution.
@ -152,7 +153,7 @@ the data file or restart files read by the :doc:`read_data
<read_data>` or :doc:`read_restart <read_restart>` commands: <read_data>` or :doc:`read_restart <read_restart>` commands:
* :math:`k` (force/distance units) * :math:`k` (force/distance units)
* :math:`\epsilon_c` (unit less) * :math:`\epsilon_c` (unitless)
* :math:`\gamma` (force/velocity units) * :math:`\gamma` (force/velocity units)
Additionally, if *volume/factor* is set to *yes*, a fourth coefficient Additionally, if *volume/factor* is set to *yes*, a fourth coefficient
@ -214,11 +215,11 @@ for an overview of LAMMPS output options.
The vector or array will be floating point values that correspond to The vector or array will be floating point values that correspond to
the specified attribute. the specified attribute.
The single() function of this bond style returns 0.0 for the energy The potential energy and the single() function of this bond style return
of a bonded interaction, since energy is not conserved in these :math:`k (r - r_0)^2 / 2` as a proxy of the energy of a bonded interaction,
dissipative potentials. The single() function also calculates an ignoring any volumetric/smoothing factors or dissipative forces. The single()
extra bond quantity, the initial distance :math:`r_0`. This function also calculates an extra bond quantity, the initial distance
extra quantity can be accessed by the :math:`r_0`. This extra quantity can be accessed by the
:doc:`compute bond/local <compute_bond_local>` command as *b1*\ . :doc:`compute bond/local <compute_bond_local>` command as *b1*\ .
Restrictions Restrictions

View File

@ -0,0 +1,184 @@
.. index:: bond_style bpm/spring/plastic
bond_style bpm/spring/plastic command
=====================================
Syntax
""""""
.. code-block:: LAMMPS
bond_style bpm/spring/plastic keyword value attribute1 attribute2 ...
* optional keyword = *overlay/pair* or *store/local* or *smooth* or *normalize* or *break*
.. parsed-literal::
*store/local* values = fix_ID N attributes ...
* fix_ID = ID of associated internal fix to store data
* N = prepare data for output every this many timesteps
* attributes = zero or more of the below attributes may be appended
*id1, id2* = IDs of two atoms in the bond
*time* = the timestep the bond broke
*x, y, z* = the center of mass position of the two atoms when the bond broke (distance units)
*x/ref, y/ref, z/ref* = the initial center of mass position of the two atoms (distance units)
*overlay/pair* value = *yes* or *no*
bonded particles will still interact with pair forces
*smooth* value = *yes* or *no*
smooths bond forces near the breaking point
*normalize* value = *yes* or *no*
normalizes bond forces by the reference length
*break* value = *yes* or *no*
indicates whether bonds break during a run
Examples
""""""""
.. code-block:: LAMMPS
bond_style bpm/spring/plastic
bond_coeff 1 1.0 0.05 0.1 0.02
bond_style bpm/spring/plastic myfix 1000 time id1 id2
dump 1 all local 1000 dump.broken f_myfix[1] f_myfix[2] f_myfix[3]
dump_modify 1 write_header no
Description
"""""""""""
.. versionadded:: TBD
The *bpm/spring/plastic* bond style computes forces based on
deviations from the initial reference state of the two atoms and the
strain history. The reference length of the bond :math:`r_0` is stored
by each bond when it is first computed in the setup of a run. Initially,
the equilibrium length of each bond :math:`r_\mathrm{eq}` is set equal
to :math:`r_0` but can evolve. data is then preserved across run commands
and is written to :doc:`binary restart files <restart>` such that restarting
the system will not modify either of these quantities.
This bond style only applies central-body forces which conserve the
translational and rotational degrees of freedom of a bonded set of
particles. The force has a magnitude of
.. math::
F = -k (r_\mathrm{eq} - r) w
where :math:`k` is a stiffness, :math:`r` is the current distance between
the two particles, and :math:`w` is an optional smoothing factor discussed
below. If the bond stretches beyond a strain of :math:`\epsilon_p` in compression
or extension, it will plastically activate and :math:`r_\mathrm{eq}` will evolve
to ensure :math:`|(r-r_\mathrm{eq})/r_\mathrm{eq}|` never exceeds :math:`\epsilon_p`.
Therefore, if a bond is continually loaded in either tension or compression, the
force will initially grow elastically before plateauing. See
:ref:`(Clemmer) <plastic-Clemmer>` for more details on these mechanics.
Bonds will break at a strain of :math:`\epsilon_c`. This is done by setting
the bond type to 0 such that forces are no longer computed.
An additional damping force is applied to the bonded
particles. This forces is proportional to the difference in the
normal velocity of particles:
.. math::
F_D = - \gamma w (\hat{r} \bullet \vec{v})
where :math:`\gamma` is the damping strength, :math:`\hat{r}` is the
radial normal vector, and :math:`\vec{v}` is the velocity difference
between the two particles.
The smoothing factor :math:`w` is constructed such that forces smoothly
go to zero, avoiding discontinuities, as bonds approach the critical
breaking strain
.. math::
w = 1.0 - \left( \frac{r - r_0}{r_0 \epsilon_c} \right)^8 .
The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
the data file or restart files read by the :doc:`read_data
<read_data>` or :doc:`read_restart <read_restart>` commands:
* :math:`k` (force/distance units)
* :math:`\epsilon_c` (unitless)
* :math:`\gamma` (force/velocity units)
* :math:`\epsilon_p` (unitless)
See the :doc:`bpm/spring doc page <bond_bpm_spring>` for information on
the *smooth*, *normalize*, *break*, *overlay/pair*, and *store/local*
keywords.
Note that when unbroken bonds are dumped to a file via the
:doc:`dump local <dump>` command, bonds with type 0 (broken bonds)
are not included.
The :doc:`delete_bonds <delete_bonds>` command can also be used to
query the status of broken bonds or permanently delete them, e.g.:
.. code-block:: LAMMPS
delete_bonds all stats
delete_bonds all bond 0 remove
----------
Restart and other info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This bond style writes the reference state and plastic history of each
bond to :doc:`binary restart files <restart>`. Loading a restart file
will properly restore bonds. However, the reference state is NOT written
to data files. Therefore reading a data file will not restore bonds and
will cause their reference states to be redefined.
The potential energy and the single() function of this bond style
returns zero. The single() function also calculates two extra bond
quantities, the initial distance :math:`r_0` and the current equilibrium
length :math:`r_eq`. These extra quantities can be accessed by the
:doc:`compute bond/local <compute_bond_local>` command as *b1* and *b2*,
respectively.
Restrictions
""""""""""""
This bond style is part of the BPM package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
By default if pair interactions between bonded atoms are to be disabled,
this bond style requires setting
.. code-block:: LAMMPS
special_bonds lj 0 1 1 coul 1 1 1
and :doc:`newton <newton>` must be set to bond off. If the *overlay/pair*
keyword is set to *yes*, this bond style alternatively requires setting
.. code-block:: LAMMPS
special_bonds lj/coul 1 1 1
Related commands
""""""""""""""""
:doc:`bond_coeff <bond_coeff>`, :doc:`bond bpm/spring <bond_bpm_spring>`
Default
"""""""
The option defaults are *overlay/pair* = *no*, *smooth* = *yes*, *normalize* = *no*, and *break* = *yes*
----------
.. _plastic-Clemmer:
**(Clemmer)** Clemmer and Lechman, Powder Technology (2025).

View File

@ -60,6 +60,8 @@ Related commands
"""""""""""""""" """"""""""""""""
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>` :doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`
:doc:`bond style harmonic/shift <bond_harmonic_shift>`,
:doc:`bond style harmonic/shift/cut <bond_harmonic_shift_cut>`
Default Default
""""""" """""""

View File

@ -31,9 +31,15 @@ the potential
E = \frac{U_{\text{min}}}{(r_0-r_c)^2} \left[ (r-r_0)^2-(r_c-r_0)^2 \right] E = \frac{U_{\text{min}}}{(r_0-r_c)^2} \left[ (r-r_0)^2-(r_c-r_0)^2 \right]
where :math:`r_0` is the equilibrium bond distance, and :math:`r_c` the critical distance. where :math:`r_0` is the equilibrium bond distance, and :math:`r_c` the
The potential is :math:`-U_{\text{min}}` at :math:`r0` and zero at :math:`r_c`. The spring constant is critical distance. The potential energy has the value
:math:`k = U_{\text{min}} / [ 2 (r_0-r_c)^2]`. :math:`-U_{\text{min}}` at :math:`r_0` and zero at :math:`r_c`. This
bond style differs from :doc:`bond_style harmonic <bond_harmonic>`
by the value of the potential energy.
The equivalent spring constant value *K* for use with :doc:`bond_style
harmonic <bond_harmonic>` can be computed using :math:`K =
U_{\text{min}} / [(r_0-r_c)^2]`.
The following coefficients must be defined for each bond type via the The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in :doc:`bond_coeff <bond_coeff>` command as in the example above, or in
@ -41,9 +47,7 @@ the data file or restart files read by the :doc:`read_data <read_data>`
or :doc:`read_restart <read_restart>` commands: or :doc:`read_restart <read_restart>` commands:
* :math:`U_{\text{min}}` (energy) * :math:`U_{\text{min}}` (energy)
* :math:`r_0` (distance) * :math:`r_0` (distance)
* :math:`r_c` (distance) * :math:`r_c` (distance)
---------- ----------
@ -63,7 +67,8 @@ Related commands
"""""""""""""""" """"""""""""""""
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`, :doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`,
:doc:`bond_harmonic <bond_harmonic>` :doc:`bond style harmonic <bond_harmonic>`,
:doc:`bond style harmonic/shift/cut <bond_harmonic_shift_cut>`
Default Default
""""""" """""""

View File

@ -31,9 +31,14 @@ uses the potential
E = \frac{U_{\text{min}}}{(r_0-r_c)^2} \left[ (r-r_0)^2-(r_c-r_0)^2 \right] E = \frac{U_{\text{min}}}{(r_0-r_c)^2} \left[ (r-r_0)^2-(r_c-r_0)^2 \right]
where :math:`r_0` is the equilibrium bond distance, and rc the critical distance. where :math:`r_0` is the equilibrium bond distance, and :math:`r_c` the
The bond potential is zero for distances :math:`r > r_c`. The potential is :math:`-U_{\text{min}}` critical distance. The bond potential is zero and thus its force also
at :math:`r_0` and zero at :math:`r_c`. The spring constant is :math:`k = U_{\text{min}} / [ 2 (r_0-r_c)^2]`. zero for distances :math:`r > r_c`. The potential energy has the value
:math:`-U_{\text{min}}` at :math:`r_0` and zero at :math:`r_c`.
The equivalent spring constant value *K* for use with :doc:`bond_style
harmonic <bond_harmonic>` for :math:`r <= r_c`, can be computed using
:math:`K = U_{\text{min}} / [(r_0-r_c)^2]`
The following coefficients must be defined for each bond type via the The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in :doc:`bond_coeff <bond_coeff>` command as in the example above, or in

View File

@ -94,7 +94,7 @@ the data file or restart files read by the :doc:`read_data
<read_data>` or :doc:`read_restart <read_restart>` commands: <read_data>` or :doc:`read_restart <read_restart>` commands:
* :math:`k` (force/distance units) * :math:`k` (force/distance units)
* :math:`\epsilon_c` (unit less) * :math:`\epsilon_c` (unitless)
* :math:`\gamma` (force/velocity units) * :math:`\gamma` (force/velocity units)
Unlike other BPM-style bonds, this bond style does not update special Unlike other BPM-style bonds, this bond style does not update special

View File

@ -10,7 +10,7 @@ Syntax
bond_style style args bond_style style args
* style = *none* or *zero* or *hybrid* or *bpm/rotational* or *bpm/spring* or *class2* or *fene* or *fene/expand* or *fene/nm* or *gaussian* or *gromos* or *harmonic* or *harmonic/restrain* *harmonic/shift* or *harmonic/shift/cut* or *lepton* or *morse* or *nonlinear* or *oxdna/fene* or *oxdena2/fene* or *oxrna2/fene* or *quartic* or *special* or *table* * style = *none* or *zero* or *hybrid* or *bpm/rotational* or *bpm/spring* or *bpm/spring/plastic* or *class2* or *fene* or *fene/expand* or *fene/nm* or *gaussian* or *gromos* or *harmonic* or *harmonic/restrain* *harmonic/shift* or *harmonic/shift/cut* or *lepton* or *morse* or *nonlinear* or *oxdna/fene* or *oxdena2/fene* or *oxrna2/fene* or *quartic* or *special* or *table*
* args = none for any style except *hybrid* * args = none for any style except *hybrid*
@ -86,6 +86,7 @@ accelerated styles exist.
* :doc:`bpm/rotational <bond_bpm_rotational>` - breakable bond with forces and torques based on deviation from reference state * :doc:`bpm/rotational <bond_bpm_rotational>` - breakable bond with forces and torques based on deviation from reference state
* :doc:`bpm/spring <bond_bpm_spring>` - breakable bond with forces based on deviation from reference length * :doc:`bpm/spring <bond_bpm_spring>` - breakable bond with forces based on deviation from reference length
* :doc:`bpm/spring/plastic <bond_bpm_spring_plastic>` - a similar breakable bond with plastic yield
* :doc:`class2 <bond_class2>` - COMPASS (class 2) bond * :doc:`class2 <bond_class2>` - COMPASS (class 2) bond
* :doc:`fene <bond_fene>` - FENE (finite-extensible non-linear elastic) bond * :doc:`fene <bond_fene>` - FENE (finite-extensible non-linear elastic) bond
* :doc:`fene/expand <bond_fene_expand>` - FENE bonds with variable size particles * :doc:`fene/expand <bond_fene_expand>` - FENE bonds with variable size particles

View File

@ -15,15 +15,12 @@ Syntax
.. parsed-literal:: .. parsed-literal::
*mode* value = *single*, *multi*, or *multi/old* = communicate atoms within a single or multiple distances *mode* value = *single* or *multi* = communicate atoms within a single or multiple distances
*cutoff* value = Rcut (distance units) = communicate atoms from this far away *cutoff* value = Rcut (distance units) = communicate atoms from this far away
*cutoff/multi* collection value *cutoff/multi* collection value
collection = atom collection or collection range (supports asterisk notation) collection = atom collection or collection range (supports asterisk notation)
value = Rcut (distance units) = communicate atoms for selected types from this far away value = Rcut (distance units) = communicate atoms for selected types from this far away
*reduce/multi* arg = none = reduce number of communicated ghost atoms for multi style *reduce/multi* arg = none = reduce number of communicated ghost atoms for multi style
*cutoff/multi/old* type value
type = atom type or type range (supports asterisk notation)
value = Rcut (distance units) = communicate atoms for selected types from this far away
*group* value = group-ID = only communicate atoms in the group *group* value = group-ID = only communicate atoms in the group
*vel* value = *yes* or *no* = do or do not communicate velocity info with ghost atoms *vel* value = *yes* or *no* = do or do not communicate velocity info with ghost atoms
@ -66,19 +63,16 @@ subdomain. The distance is by default the maximum of the neighbor
cutoff across all atom type pairs. cutoff across all atom type pairs.
For many systems this is an efficient algorithm, but for systems with For many systems this is an efficient algorithm, but for systems with
widely varying cutoffs for different type pairs, the *multi* or *multi/old* mode can widely varying cutoffs for different type pairs, the *multi* mode can be
be faster. In *multi*, each atom is assigned to a collection which should faster. In *multi*, each atom is assigned to a collection which should
correspond to a set of atoms with similar interaction cutoffs. correspond to a set of atoms with similar interaction cutoffs. See the
See the :doc:`neighbor <neighbor>` command for a detailed description of collections. :doc:`neighbor <neighbor>` command for a detailed description of
In this case, each atom collection is assigned its own distance collections. In this case, each atom collection is assigned its own
cutoff for communication purposes, and fewer atoms will be distance cutoff for communication purposes, and fewer atoms will be
communicated. in *multi/old*, a similar technique is used but atoms communicated. See the :doc:`neighbor multi <neighbor>` command for
are grouped by atom type. See the :doc:`neighbor multi <neighbor>` and
:doc:`neighbor multi/old <neighbor>` commands for
neighbor list construction options that may also be beneficial for neighbor list construction options that may also be beneficial for
simulations of this kind. The *multi* communication mode is only compatible simulations of this kind. The *multi* communication mode is only
with the *multi* neighbor style. The *multi/old* communication mode is comparable compatible with the *multi* neighbor style.
with both the *multi* and *multi/old* neighbor styles.
The *cutoff* keyword allows you to extend the ghost cutoff distance The *cutoff* keyword allows you to extend the ghost cutoff distance
for communication mode *single*, which is the distance from the borders for communication mode *single*, which is the distance from the borders
@ -108,14 +102,12 @@ simulation to account for potential changes in the number of
collections. Custom cutoffs are preserved between runs but if collections. Custom cutoffs are preserved between runs but if
collections are redefined, one may want to re-specify the communication collections are redefined, one may want to re-specify the communication
cutoffs. For granular pair styles,the default cutoff is set to the sum cutoffs. For granular pair styles,the default cutoff is set to the sum
of the current maximum atomic radii for each collection. The of the current maximum atomic radii for each collection.
*cutoff/multi/old* option is similar to *cutoff/multi* except it
operates on atom types as opposed to collections.
The *reduce/multi* option applies to *multi* and sets the communication The *reduce/multi* option applies to *multi* and sets the communication
cutoff for a particle equal to the maximum interaction distance between particles cutoff for a particle equal to the maximum interaction distance between
in the same collection. This reduces the number of particles in the same collection. This reduces the number of ghost atoms
ghost atoms that need to be communicated. This method is only compatible with the that need to be communicated. This method is only compatible with the
*multi* neighbor style and requires a half neighbor list and Newton on. *multi* neighbor style and requires a half neighbor list and Newton on.
See the :doc:`neighbor multi <neighbor>` command for more information. See the :doc:`neighbor multi <neighbor>` command for more information.

View File

@ -82,6 +82,7 @@ Commands
read_dump read_dump
read_restart read_restart
region region
region2vmd
replicate replicate
rerun rerun
reset_atoms reset_atoms

View File

@ -356,6 +356,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`ti <compute_ti>` - thermodynamic integration free energy values * :doc:`ti <compute_ti>` - thermodynamic integration free energy values
* :doc:`torque/chunk <compute_torque_chunk>` - torque applied on each chunk * :doc:`torque/chunk <compute_torque_chunk>` - torque applied on each chunk
* :doc:`vacf <compute_vacf>` - velocity auto-correlation function of group of atoms * :doc:`vacf <compute_vacf>` - velocity auto-correlation function of group of atoms
* :doc:`vacf/chunk <compute_vacf_chunk>` - velocity auto-correlation for the center of mass velocities of chunks of atoms
* :doc:`vcm/chunk <compute_vcm_chunk>` - velocity of center-of-mass for each chunk * :doc:`vcm/chunk <compute_vcm_chunk>` - velocity of center-of-mass for each chunk
* :doc:`viscosity/cos <compute_viscosity_cos>` - velocity profile under cosine-shaped acceleration * :doc:`viscosity/cos <compute_viscosity_cos>` - velocity profile under cosine-shaped acceleration
* :doc:`voronoi/atom <compute_voronoi_atom>` - Voronoi volume and neighbors for each atom * :doc:`voronoi/atom <compute_voronoi_atom>` - Voronoi volume and neighbors for each atom

View File

@ -217,13 +217,16 @@ scaled differently in the two different dimensions to transform them
into ellipses). into ellipses).
The created bins (and hence the chunk IDs) are numbered consecutively The created bins (and hence the chunk IDs) are numbered consecutively
from 1 to the number of bins = *Nchunk*\ . For *bin2d* and *bin3d*, the from 1 to the number of bins = *Nchunk*\ . For *bin2d* and *bin3d*, the
numbering varies most rapidly in the first dimension (which could be numbering varies fastest in the last dimension (which could be
*x*, *y*, or *z*), next rapidly in the second dimension, and most slowly in the *x*, *y*, or *z*), slower in the second dimension, and slowest in the
third dimension. For *bin/sphere*, the bin with smallest radii is chunk first dimension. For *bin/sphere*, the bin with smallest radius is chunk
1 and the bin with largest radii is chunk Nchunk = *ncbin*\ . For 1 and the bin with largest radius is chunk Nchunk = *ncbin*\ . For
*bin/cylinder*, the numbering varies most rapidly in the dimension *bin/cylinder*, the numbering varies faster in the dimension
along the cylinder axis and most slowly in the radial direction. along the cylinder axis and slower in the radial direction.
In all cases, for a given dimension, the numbering increases
with increasing value of the coordinate (Cartesian coordinate,
sphere or cylinder radius, axial position).
Each time this compute is invoked, each atom is mapped to a bin based Each time this compute is invoked, each atom is mapped to a bin based
on its current position. Note that between reneighboring timesteps, on its current position. Note that between reneighboring timesteps,

View File

@ -67,7 +67,7 @@ following relation should also be satisfied:
.. math:: .. math::
r_c + r_s > 2*{\rm cutoff} r_c + r_s > 2*\mathrm{cutoff}
where :math:`r_c` is the cutoff distance of the potential, :math:`r_s` where :math:`r_c` is the cutoff distance of the potential, :math:`r_s`
is the skin is the skin

View File

@ -74,7 +74,7 @@ following relation should also be satisfied:
.. math:: .. math::
r_c + r_s > 2*{\rm cutoff} r_c + r_s > 2*\mathrm{cutoff}
where :math:`r_c` is the cutoff distance of the potential, :math:`r_s` is where :math:`r_c` is the cutoff distance of the potential, :math:`r_s` is
the skin the skin

View File

@ -50,9 +50,9 @@ the potential energy using the Wolf summation method, described in
.. math:: .. math::
E_i = \frac{1}{2} \sum_{j \neq i} E_i = \frac{1}{2} \sum_{j \neq i}
\frac{q_i q_j {\rm erfc}(\alpha r_{ij})}{r_{ij}} + \frac{q_i q_j \mathrm{erfc}(\alpha r_{ij})}{r_{ij}} +
\frac{1}{2} \sum_{j \neq i} \frac{1}{2} \sum_{j \neq i}
\frac{q_i q_j {\rm erf}(\alpha r_{ij})}{r_{ij}} \qquad r < r_c \frac{q_i q_j \mathrm{erf}(\alpha r_{ij})}{r_{ij}} \qquad r < r_c
where :math:`\alpha` is the damping parameter, and *erf()* and *erfc()* where :math:`\alpha` is the damping parameter, and *erf()* and *erfc()*
are error-function and complementary error-function terms. This are error-function and complementary error-function terms. This

View File

@ -30,7 +30,7 @@ Examples
Description Description
""""""""""" """""""""""
.. versionadded:: TBD .. versionadded:: 4Feb2025
Define a computation that calculates a Gaussian representation of the ionic Define a computation that calculates a Gaussian representation of the ionic
structure. This representation is used for the efficient evaluation structure. This representation is used for the efficient evaluation

View File

@ -40,7 +40,7 @@ is a complex number (stored as two real numbers) defined as follows:
.. math:: .. math::
q_n = \frac{1}{nnn}\sum_{j = 1}^{nnn} e^{n i \theta({\bf r}_{ij})} q_n = \frac{1}{nnn}\sum_{j = 1}^{nnn} e^{n i \theta({\textbf{r}}_{ij})}
where the sum is over the *nnn* nearest neighbors where the sum is over the *nnn* nearest neighbors
of the central atom. The angle :math:`\theta` of the central atom. The angle :math:`\theta`

View File

@ -116,7 +116,9 @@ Compute *msd* cannot be used with a dynamic group.
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute msd/nongauss <compute_msd_nongauss>`, :doc:`compute displace_atom <compute_displace_atom>`, :doc:`fix store/state <fix_store_state>`, :doc:`compute msd/chunk <compute_msd_chunk>` :doc:`compute msd/nongauss <compute_msd_nongauss>`,
:doc:`compute displace_atom <compute_displace_atom>`, :doc:`fix store/state <fix_store_state>`,
:doc:`compute msd/chunk <compute_msd_chunk>`
Default Default
""""""" """""""

View File

@ -131,7 +131,7 @@ Restrictions
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute msd <compute_msd>` :doc:`compute msd <compute_msd>`, :doc:`compute vacf/chunk <compute_vacf_chunk>`
Default Default
""""""" """""""

View File

@ -49,7 +49,7 @@ For each atom, :math:`Q_\ell` is a real number defined as follows:
.. math:: .. math::
\bar{Y}_{\ell m} = & \frac{1}{nnn}\sum_{j = 1}^{nnn} Y_{\ell m}\bigl( \theta( {\bf r}_{ij} ), \phi( {\bf r}_{ij} ) \bigr) \\ \bar{Y}_{\ell m} = & \frac{1}{nnn}\sum_{j = 1}^{nnn} Y_{\ell m}\bigl( \theta( \mathbf{r}_{ij} ), \phi( \mathbf{r}_{ij} ) \bigr) \\
Q_\ell = & \sqrt{\frac{4 \pi}{2 \ell + 1} \sum_{m = -\ell }^{m = \ell } \bar{Y}_{\ell m} \bar{Y}^*_{\ell m}} Q_\ell = & \sqrt{\frac{4 \pi}{2 \ell + 1} \sum_{m = -\ell }^{m = \ell } \bar{Y}_{\ell m} \bar{Y}^*_{\ell m}}
The first equation defines the local order parameters as averages The first equation defines the local order parameters as averages

View File

@ -87,7 +87,7 @@ values in the vector. The *sumsq* option sums the square of the
values in the vector into a global total. The *avesq* setting does values in the vector into a global total. The *avesq* setting does
the same as *sumsq*, then divides the sum of squares by the number of the same as *sumsq*, then divides the sum of squares by the number of
values. The last two options can be useful for calculating the values. The last two options can be useful for calculating the
variance of some quantity (e.g., variance = sumsq :math:`-` ave\ variance of some quantity (e.g., variance = *avesq* :math:`-` *ave*\
:math:`^2`). The *sumabs* option sums the absolute values in the :math:`^2`). The *sumabs* option sums the absolute values in the
vector into a global total. The *aveabs* setting does the same as vector into a global total. The *aveabs* setting does the same as
*sumabs*, then divides the sum of absolute values by the number of *sumabs*, then divides the sum of absolute values by the number of

View File

@ -139,11 +139,11 @@ mapped on to a third polar angle :math:`\theta_0` defined by,
.. math:: .. math::
\theta_0 = {\sf rfac0} \frac{r-r_{min0}}{R_{ii'}-r_{min0}} \pi \theta_0 = \mathsf{rfac0} \frac{r-r_{min0}}{R_{ii'}-r_{min0}} \pi
In this way, all possible neighbor positions are mapped on to a subset In this way, all possible neighbor positions are mapped on to a subset
of the 3-sphere. Points south of the latitude :math:`\theta_0` = of the 3-sphere. Points south of the latitude
*rfac0* :math:`\pi` are excluded. :math:`\theta_0 = \mathsf{rfac0} \pi` are excluded.
The natural basis for functions on the 3-sphere is formed by the The natural basis for functions on the 3-sphere is formed by the
representatives of *SU(2)*, the matrices :math:`U^j_{m,m'}(\theta, \phi, representatives of *SU(2)*, the matrices :math:`U^j_{m,m'}(\theta, \phi,
@ -204,7 +204,7 @@ components summed separately for each LAMMPS atom type:
.. math:: .. math::
-\sum_{i' \in I} \frac{\partial {B^{i'}_{j_1,j_2,j} }}{\partial {\bf r}_i} -\sum_{i' \in I} \frac{\partial {B^{i'}_{j_1,j_2,j} }}{\partial \mathbf{r}_i}
The sum is over all atoms *i'* of atom type *I*\ . For each atom *i*, The sum is over all atoms *i'* of atom type *I*\ . For each atom *i*,
this compute evaluates the above expression for each direction, each this compute evaluates the above expression for each direction, each
@ -216,7 +216,7 @@ derivatives:
.. math:: .. math::
-{\bf r}_i \otimes \sum_{i' \in I} \frac{\partial {B^{i'}_{j_1,j_2,j}}}{\partial {\bf r}_i} -\mathbf{r}_i \otimes \sum_{i' \in I} \frac{\partial {B^{i'}_{j_1,j_2,j}}}{\partial \mathbf{r}_i}
Again, the sum is over all atoms *i'* of atom type *I*\ . For each atom Again, the sum is over all atoms *i'* of atom type *I*\ . For each atom
*i*, this compute evaluates the above expression for each of the six *i*, this compute evaluates the above expression for each of the six

View File

@ -65,7 +65,7 @@ In case of compute *stress/atom*, the virial contribution is:
W_{ab} & = \frac{1}{2} \sum_{n = 1}^{N_p} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) + \frac{1}{2} \sum_{n = 1}^{N_b} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) \\ W_{ab} & = \frac{1}{2} \sum_{n = 1}^{N_p} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) + \frac{1}{2} \sum_{n = 1}^{N_b} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) \\
& + \frac{1}{3} \sum_{n = 1}^{N_a} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b}) + \frac{1}{4} \sum_{n = 1}^{N_d} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) \\ & + \frac{1}{3} \sum_{n = 1}^{N_a} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b}) + \frac{1}{4} \sum_{n = 1}^{N_d} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) \\
& + \frac{1}{4} \sum_{n = 1}^{N_i} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) + {\rm Kspace}(r_{i_a},F_{i_b}) + \sum_{n = 1}^{N_f} r_{i_a} F_{i_b} & + \frac{1}{4} \sum_{n = 1}^{N_i} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} + r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) + \mathrm{Kspace}(r_{i_a},F_{i_b}) + \sum_{n = 1}^{N_f} r_{i_a} F_{i_b}
The first term is a pairwise energy contribution where :math:`n` loops The first term is a pairwise energy contribution where :math:`n` loops
over the :math:`N_p` neighbors of atom :math:`I`, :math:`\mathbf{r}_1` over the :math:`N_p` neighbors of atom :math:`I`, :math:`\mathbf{r}_1`
@ -97,7 +97,7 @@ In case of compute *centroid/stress/atom*, the virial contribution is:
.. math:: .. math::
W_{ab} & = \sum_{n = 1}^{N_p} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_b} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_a} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_d} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_i} r_{I0_a} F_{I_b} \\ W_{ab} & = \sum_{n = 1}^{N_p} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_b} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_a} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_d} r_{I0_a} F_{I_b} + \sum_{n = 1}^{N_i} r_{I0_a} F_{I_b} \\
& + {\rm Kspace}(r_{i_a},F_{i_b}) + \sum_{n = 1}^{N_f} r_{i_a} F_{i_b} & + \mathrm{Kspace}(r_{i_a},F_{i_b}) + \sum_{n = 1}^{N_f} r_{i_a} F_{i_b}
As with compute *stress/atom*, the first, second, third, fourth and As with compute *stress/atom*, the first, second, third, fourth and
fifth terms are pairwise, bond, angle, dihedral and improper fifth terms are pairwise, bond, angle, dihedral and improper

View File

@ -76,7 +76,7 @@ Restrictions
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute msd <compute_msd>` :doc:`compute msd <compute_msd>`, :doc:`compute vacf/chunk <compute_vacf_chunk>`
Default Default
""""""" """""""

View File

@ -0,0 +1,124 @@
.. index:: compute vacf/chunk
compute vacf/chunk command
==========================
Syntax
""""""
.. code-block:: LAMMPS
compute ID group-ID vacf/chunk chunkID
* ID, group-ID are documented in :doc:`compute <compute>` command
* vacf/chunk = style name of this compute command
* chunkID = ID of :doc:`compute chunk/atom <compute_chunk_atom>` command
Examples
""""""""
.. code-block:: LAMMPS
compute 1 all vacf/chunk molchunk
Description
"""""""""""
.. versionadded:: TBD
Define a computation that calculates the velocity auto-correlation
function (VACF) for multiple chunks of atoms.
In LAMMPS, chunks are collections of atoms defined by a :doc:`compute
chunk/atom <compute_chunk_atom>` command, which assigns each atom to a
single chunk (or no chunk). The ID for this command is specified as
chunkID. For example, a single chunk could be the atoms in a molecule
or atoms in a spatial bin. See the :doc:`compute chunk/atom
<compute_chunk_atom>` and :doc:`Howto chunk <Howto_chunk>` doc pages for
details of how chunks can be defined and examples of how they can be
used to measure properties of a system.
Four quantities are calculated by this compute for each chunk. The
first 3 quantities are the product of the initial center of mass
velocity (VCM) for each chunk in *x*, *y*, and *z* direction with the
current center of mass velocity in the same direction. The fourth
component is the total VACF, i.e. the sum of the three components.
Note that only atoms in the specified group contribute to the
calculation. The :doc:`compute chunk/atom <compute_chunk_atom>` command
defines its own group; atoms will have a chunk ID = 0 if they are not in
that group, signifying they are not assigned to a chunk, and will thus
also not contribute to this calculation. You can specify the "all"
group for this command if you simply want to include atoms with non-zero
chunk IDs.
The integral of the VACF versus time is proportional to the diffusion
coefficient of the diffusing chunks.
.. note::
The number of chunks *Nchunk* calculated by the
:doc:`compute chunk/atom <compute_chunk_atom>` command must remain constant
each time this compute is invoked, so that the dot product for each chunk
from its original position can be computed consistently. If *Nchunk*
does not remain constant, an error will be generated. If needed, you
can enforce a constant *Nchunk* by using the *nchunk once* or *ids once*
options when specifying the :doc:`compute chunk/atom <compute_chunk_atom>`
command.
.. note::
This compute stores the original center-of-mass velocities of each
chunk. When a VACF is calculated on a later timestep, it is assumed
that the same atoms are assigned to the same chunk ID. However
LAMMPS has no simple way to ensure this is the case, though you can
use the *ids once* option when specifying the :doc:`compute
chunk/atom <compute_chunk_atom>` command. Note that if this is not
the case, the VACF calculation does not have a sensible meaning.
.. note::
If you want the quantities calculated by this compute to be
continuous when running from a :doc:`restart file <read_restart>`, then
you should use the same ID for this compute, as in the original run.
This is so that the fix this compute creates to store per-chunk
quantities will also have the same ID, and thus be initialized
correctly with chunk reference positions from the restart file.
The simplest way to output the results of the compute vacf/chunk
calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>`
command, for example:
.. code-block:: LAMMPS
compute cc1 all chunk/atom molecule
compute myChunk all vacf/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector
Output info
"""""""""""
This compute calculates a global array where the number of rows = the
number of chunks *Nchunk* as calculated by the specified :doc:`compute
chunk/atom <compute_chunk_atom>` command. The number of columns = 4 for
the *x*, *y*, *z*, component and the total VACF. These values can be
accessed by any command that uses global array values from a compute as
input. See the :doc:`Howto output <Howto_output>` page for an overview
of LAMMPS output options.
The array values are "intensive". The array values will be in
distance\ :math:`^2` divided by time\ :math:`^2` :doc:`units <units>`.
Restrictions
""""""""""""
none
Related commands
""""""""""""""""
:doc:`compute vacf <compute_vacf>`, :doc:`compute msd/chunk <compute_msd_chunk>`
Default
"""""""
none

View File

@ -263,10 +263,10 @@ then the globally defined weights from the ``fitting_weight_energy`` and
POD Potential POD Potential
""""""""""""" """""""""""""
We consider a multi-element system of *N* atoms with :math:`N_{\rm e}` We consider a multi-element system of *N* atoms with :math:`N_\mathrm{e}`
unique elements. We denote by :math:`\boldsymbol r_n` and :math:`Z_n` unique elements. We denote by :math:`\boldsymbol r_n` and :math:`Z_n`
position vector and type of an atom *n* in the system, position vector and type of an atom *n* in the system,
respectively. Note that we have :math:`Z_n \in \{1, \ldots, N_{\rm e} respectively. Note that we have :math:`Z_n \in \{1, \ldots, N_\mathrm{e}
\}`, :math:`\boldsymbol R = (\boldsymbol r_1, \boldsymbol r_2, \ldots, \}`, :math:`\boldsymbol R = (\boldsymbol r_1, \boldsymbol r_2, \ldots,
\boldsymbol r_N) \in \mathbb{R}^{3N}`, and :math:`\boldsymbol Z = (Z_1, \boldsymbol r_N) \in \mathbb{R}^{3N}`, and :math:`\boldsymbol Z = (Z_1,
Z_2, \ldots, Z_N) \in \mathbb{N}^{N}`. The total energy of the Z_2, \ldots, Z_N) \in \mathbb{N}^{N}`. The total energy of the

View File

@ -341,6 +341,8 @@ accelerated styles exist.
* :doc:`phonon <fix_phonon>` - calculate dynamical matrix from MD simulations * :doc:`phonon <fix_phonon>` - calculate dynamical matrix from MD simulations
* :doc:`pimd/langevin <fix_pimd>` - Feynman path-integral molecular dynamics with stochastic thermostat * :doc:`pimd/langevin <fix_pimd>` - Feynman path-integral molecular dynamics with stochastic thermostat
* :doc:`pimd/nvt <fix_pimd>` - Feynman path-integral molecular dynamics with Nose-Hoover thermostat * :doc:`pimd/nvt <fix_pimd>` - Feynman path-integral molecular dynamics with Nose-Hoover thermostat
* :doc:`pimd/langevin/bosonic <fix_pimd>` - Bosonic Feynman path-integral molecular dynamics for with stochastic thermostat
* :doc:`pimd/nvt/bosonic <fix_pimd>` - Bosonic Feynman path-integral molecular dynamics with Nose-Hoover thermostat
* :doc:`planeforce <fix_planeforce>` - constrain atoms to move in a plane * :doc:`planeforce <fix_planeforce>` - constrain atoms to move in a plane
* :doc:`plumed <fix_plumed>` - wrapper on PLUMED free energy library * :doc:`plumed <fix_plumed>` - wrapper on PLUMED free energy library
* :doc:`poems <fix_poems>` - constrain clusters of atoms to move as coupled rigid bodies * :doc:`poems <fix_poems>` - constrain clusters of atoms to move as coupled rigid bodies

View File

@ -236,6 +236,8 @@ formulas for the meaning of these parameters:
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+ +------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`wf/cut <pair_wf_cut>` | epsilon,sigma,nu,mu | type pairs | | :doc:`wf/cut <pair_wf_cut>` | epsilon,sigma,nu,mu | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+ +------------------------------------------------------------------------------+--------------------------------------------------+-------------+
| :doc:`yukawa <pair_yukawa>` | alpha | type pairs |
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
.. note:: .. note::

View File

@ -459,8 +459,8 @@ output. This option can only be used with the *ave running* setting.
The *format* keyword sets the numeric format of each value when it is The *format* keyword sets the numeric format of each value when it is
printed to a file via the *file* keyword. Note that all values are printed to a file via the *file* keyword. Note that all values are
floating point quantities. The default format is %g. You can specify floating point quantities. The default format is " %g". You can specify
a higher precision if desired (e.g., %20.16g). a higher precision if desired (e.g., " %20.16g").
The *title1* and *title2* and *title3* keywords allow specification of The *title1* and *title2* and *title3* keywords allow specification of
the strings that will be printed as the first three lines of the output the strings that will be printed as the first three lines of the output

View File

@ -32,13 +32,14 @@ Syntax
.. parsed-literal:: .. parsed-literal::
*type* arg = *auto* or *upper* or *lower* or *auto/upper* or *auto/lower* or *full* *type* arg = *auto* or *upper* or *lower* or *auto/upper* or *auto/lower* or *full* or *first*
auto = correlate each value with itself auto = correlate each value with itself
upper = correlate each value with each succeeding value upper = correlate each value with each succeeding value
lower = correlate each value with each preceding value lower = correlate each value with each preceding value
auto/upper = auto + upper auto/upper = auto + upper
auto/lower = auto + lower auto/lower = auto + lower
full = correlate each value with every other value, including itself = auto + upper + lower full = correlate each value with every other value, including itself = auto + upper + lower
first = correlate each value with the first value
*ave* args = *one* or *running* *ave* args = *one* or *running*
one = zero the correlation accumulation every Nfreq steps one = zero the correlation accumulation every Nfreq steps
running = accumulate correlations continuously running = accumulate correlations continuously
@ -257,6 +258,9 @@ time.
* If *type* is set to *full* then each input value is correlated with * If *type* is set to *full* then each input value is correlated with
itself and every other value (i.e., :math:`C_{ij} = V_i V_j` for itself and every other value (i.e., :math:`C_{ij} = V_i V_j` for
:math:`\{i,j\} = \{1,N\}`, so :math:`N_\text{pair} = N^2`). :math:`\{i,j\} = \{1,N\}`, so :math:`N_\text{pair} = N^2`).
* If *type* is set to *first* then each input value is correlated with
the first input value (i.e., :math:`C_{ij} = V_1 V_j` for
:math:`\{j\} = \{1,N\}`, so :math:`N_\text{pair} = N`).
The *ave* keyword determines what happens to the accumulation of correlation The *ave* keyword determines what happens to the accumulation of correlation
samples every :math:`N_\text{freq}` timesteps. If the *ave* setting is *one*, samples every :math:`N_\text{freq}` timesteps. If the *ave* setting is *one*,
@ -369,6 +373,8 @@ above.
* For *type* = *full*, the :math:`N_\text{pair} = N^2` columns are ordered: * For *type* = *full*, the :math:`N_\text{pair} = N^2` columns are ordered:
:math:`C_{11}, C_{12}, \dotsc, C_{1N}, C_{21}, C_{22}, \dotsc, C_{2N}, :math:`C_{11}, C_{12}, \dotsc, C_{1N}, C_{21}, C_{22}, \dotsc, C_{2N},
C_{31}, \dotsc, C_{3N}, \dotsc, C_{N1}, \dotsc, C_{N,N-1}, C_{NN}` C_{31}, \dotsc, C_{3N}, \dotsc, C_{N1}, \dotsc, C_{N,N-1}, C_{NN}`
* For *type* = *first*, the :math:`N_\text{pair} = N` columns are ordered:
:math:`C_{11}, C_{12}, \dotsc, C_{1N}`
The array values calculated by this fix are treated as extensive. If The array values calculated by this fix are treated as extensive. If
you need to divide them by the number of atoms, you must do this in a you need to divide them by the number of atoms, you must do this in a

View File

@ -31,13 +31,14 @@ Syntax
.. parsed-literal:: .. parsed-literal::
*type* arg = *auto* or *upper* or *lower* or *auto/upper* or *auto/lower* or *full* *type* arg = *auto* or *upper* or *lower* or *auto/upper* or *auto/lower* or *full* or *first*
auto = correlate each value with itself auto = correlate each value with itself
upper = correlate each value with each succeeding value upper = correlate each value with each succeeding value
lower = correlate each value with each preceding value lower = correlate each value with each preceding value
auto/upper = auto + upper auto/upper = auto + upper
auto/lower = auto + lower auto/lower = auto + lower
full = correlate each value with every other value, including itself = auto + upper + lower full = correlate each value with every other value, including itself = auto + upper + lower
first = correlate each value with the first value
*start* args = Nstart *start* args = Nstart
Nstart = start accumulating correlations on this time step Nstart = start accumulating correlations on this time step
*file* arg = filename *file* arg = filename

View File

@ -304,8 +304,8 @@ output. This option can only be used with the *ave running* setting.
The *format* keyword sets the numeric format of each value when it is The *format* keyword sets the numeric format of each value when it is
printed to a file via the *file* keyword. Note that all values are printed to a file via the *file* keyword. Note that all values are
floating point quantities. The default format is %g. You can specify floating point quantities. The default format is " %g". You can specify
a higher precision if desired (e.g., %20.16g). a higher precision if desired (e.g., " %20.16g").
The *title1* and *title2* and *title3* keywords allow specification of The *title1* and *title2* and *title3* keywords allow specification of
the strings that will be printed as the first 2 or 3 lines of the the strings that will be printed as the first 2 or 3 lines of the

View File

@ -40,7 +40,7 @@ Examples
Description Description
""""""""""" """""""""""
.. versionadded:: TBD .. versionadded:: 4Feb2025
Add an electric potential :math:`V` that applies to a group of charged atoms a force :math:`\vec{F} = q \vec{E}`, Add an electric potential :math:`V` that applies to a group of charged atoms a force :math:`\vec{F} = q \vec{E}`,
and to dipoles a force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}` and torque :math:`\vec{T} = \vec{p} \times \vec{E}`, and to dipoles a force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}` and torque :math:`\vec{T} = \vec{p} \times \vec{E}`,

View File

@ -49,7 +49,7 @@ computed according to the following relation:
where *m* is the number of species, :math:`c_{i,j}` is the where *m* is the number of species, :math:`c_{i,j}` is the
concentration of species *j* in particle *i*, :math:`u_j` is the concentration of species *j* in particle *i*, :math:`u_j` is the
internal energy of species j, :math:`\Delta H_{f,j} is the heat of internal energy of species j, :math:`\Delta H_{f,j}` is the heat of
formation of species *j*, N is the number of molecules represented formation of species *j*, N is the number of molecules represented
by the coarse-grained particle, :math:`k_B` is the Boltzmann constant, by the coarse-grained particle, :math:`k_B` is the Boltzmann constant,
and :math:`T` is the temperature of the system. Additionally, it is and :math:`T` is the temperature of the system. Additionally, it is

View File

@ -60,9 +60,9 @@ With this fix active, the force on the *j*\ th atom is given as
.. math:: .. math::
{\bf F}_{j}(t) = & {\bf F}^C_j(t)-\int \limits_{0}^{t} \Gamma_j(t-s) {\bf v}_j(s)~\text{d}s + {\bf F}^R_j(t) \\ \mathbf{F}_{j}(t) = & \mathbf{F}^C_j(t)-\int \limits_{0}^{t} \Gamma_j(t-s) \mathbf{v}_j(s)~\text{d}s + \mathbf{F}^R_j(t) \\
\Gamma_j(t-s) = & \sum \limits_{k=1}^{N_k} \frac{c_k}{\tau_k} e^{-(t-s)/\tau_k} \\ \Gamma_j(t-s) = & \sum \limits_{k=1}^{N_k} \frac{c_k}{\tau_k} e^{-(t-s)/\tau_k} \\
\langle{\bf F}^R_j(t),{\bf F}^R_j(s)\rangle = & \text{k$_\text{B}$T} ~\Gamma_j(t-s) \langle\mathbf{F}^R_j(t),\mathbf{F}^R_j(s)\rangle = & \text{k$_\text{B}$T} ~\Gamma_j(t-s)
Here, the first term is representative of all conservative (pairwise, Here, the first term is representative of all conservative (pairwise,
bonded, etc) forces external to this fix, the second is the temporally bonded, etc) forces external to this fix, the second is the temporally

View File

@ -25,13 +25,14 @@ Syntax
* operator = "<" or "<=" or ">" or ">=" or "==" or "!=" or "\|\^" * operator = "<" or "<=" or ">" or ">=" or "==" or "!=" or "\|\^"
* avalue = numeric value to compare attribute to * avalue = numeric value to compare attribute to
* zero or more keyword/value pairs may be appended * zero or more keyword/value pairs may be appended
* keyword = *error* or *message* or *path* * keyword = *error* or *message* or *path* or *universe*
.. parsed-literal:: .. parsed-literal::
*error* value = *hard* or *soft* or *continue* *error* value = *hard* or *soft* or *continue*
*message* value = *yes* or *no* *message* value = *yes* or *no*
*path* value = path to check for free space (may be in quotes) *path* value = path to check for free space (may be in quotes)
*universe* value = *yes* or *no*
Examples Examples
@ -40,8 +41,10 @@ Examples
.. code-block:: LAMMPS .. code-block:: LAMMPS
fix 10 all halt 1 bondmax > 1.5 fix 10 all halt 1 bondmax > 1.5
fix 10 all halt 10 v_myCheck != 0 error soft fix 10 all halt 10 v_myCheck != 0 error soft message no
fix 10 all halt 100 diskfree < 100000.0 path "dump storage/." fix 10 all halt 100 diskfree < 100000.0 path "dump storage/."
fix 2 all halt 100 v_curtime > ${maxtime} universe yes
Description Description
""""""""""" """""""""""
@ -141,33 +144,52 @@ The optional *error* keyword determines how the current run is halted.
If its value is *hard*, then LAMMPS will stop with an error message. If its value is *hard*, then LAMMPS will stop with an error message.
If its value is *soft*, LAMMPS will exit the current run, but continue If its value is *soft*, LAMMPS will exit the current run, but continue
to execute subsequent commands in the input script. However, to execute subsequent commands in the input script. However, additional
additional :doc:`run <run>` or :doc:`minimize <minimize>` commands will be :doc:`run <run>` or :doc:`minimize <minimize>` commands will be skipped.
skipped. For example, this allows a script to output the current For example, this allows a script to output the current state of the
state of the system, e.g. via a :doc:`write_dump <write_dump>` or system, e.g. via a :doc:`write_dump <write_dump>` or :doc:`write_restart
:doc:`write_restart <write_restart>` command. <write_restart>` command. To re-enable regular runs after *fix halt*
stopped a run, you need to issue a :doc:`timer timeout unlimited
<timer>` command.
If its value is *continue*, the behavior is the same as for *soft*, If its value is *continue*, the behavior is the same as for *soft*,
except subsequent :doc:`run <run>` or :doc:`minimize <minimize>` commands except subsequent :doc:`run <run>` or :doc:`minimize <minimize>` commands
are executed. This allows your script to remedy the condition that are executed. This allows your script to remedy the condition that
triggered the halt, if necessary. Note that you may wish use the triggered the halt, if necessary. This is the equivalent of stopping
:doc:`unfix <unfix>` command on the fix halt ID, so that the same with *error soft* and followed by :doc:`timer timeout unlimited
condition is not immediately triggered in a subsequent run. <timer>` command. This can have undesired consequences, when a
:doc:`run command <run>` uses the *every* keyword, so using *error soft*
and resetting the timer manually may be the preferred option.
You may wish use the :doc:`unfix <unfix>` command on the *fix halt* ID
before starting a subsequent run, so that the same condition is not
immediately triggered again.
The optional *message* keyword determines whether a message is printed The optional *message* keyword determines whether a message is printed
to the screen and logfile when the halt condition is triggered. If to the screen and logfile when the halt condition is triggered. If
*message* is set to yes, a one line message with the values that *message* is set to yes, a one line message with the values that
triggered the halt is printed. If *message* is set to no, no message triggered the halt is printed. If *message* is set to no, no message is
is printed; the run simply exits. The latter may be desirable for printed; the run simply exits. The latter may be desirable for
post-processing tools that extract thermodynamic information from log post-processing tools that extract thermodynamic information from log
files. files.
.. versionadded:: TBD
The optional *universe* keyword determines whether the halt request
should be synchronized across the partitions of a :doc:`multi-partition
run <Run_options>`. If *universe* is set to yes, fix halt will check if
there is a specific message received from any of the other partitions
requesting to stop the run on this partition as well. Consequently, if
fix halt determines to halt the simulation, the fix will send messages
to all other partitions so they stop their runs, too.
Restart, fix_modify, output, run start/stop, minimize info Restart, fix_modify, output, run start/stop, minimize info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options No information about this fix is written to :doc:`binary restart files
are relevant to this fix. No global or per-atom quantities are stored <restart>`. None of the :doc:`fix_modify <fix_modify>` options are
by this fix for access by various :doc:`output commands <Howto_output>`. relevant to this fix. No global 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 *start/stop* keywords of No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command. the :doc:`run <run>` command.
@ -183,4 +205,4 @@ Related commands
Default Default
""""""" """""""
The option defaults are error = soft, message = yes, and path = ".". The option defaults are error = soft, message = yes, path = ".", and universe = no.

View File

@ -131,14 +131,15 @@ timesteps is simply
t_{hyper} = \sum_{i=1,N} B-i \cdot dt t_{hyper} = \sum_{i=1,N} B-i \cdot dt
where *dt* is the timestep size defined by the :doc:`timestep <timestep>` where *dt* is the timestep size defined by the :doc:`timestep <timestep>`
command. The effective time acceleration due to GHD is thus t_hyper / command. The effective time acceleration due to GHD is thus
N\*dt, where N\*dt is elapsed time for a normal MD run of N timesteps. :math:`t_{hyper} / N * dt`, where N\*dt is elapsed time for a normal MD run
of N timesteps.
Note that in GHD, the boost factor varies from timestep to timestep. Note that in GHD, the boost factor varies from timestep to timestep. Likewise,
Likewise, which bond has :math:`E^{max}` strain and thus which pair of which bond has :math:`E^{max}` strain and thus which pair of atoms the bias
atoms the bias potential is added to, will also vary from timestep to timestep. potential is added to, will also vary from timestep to timestep. This is in
This is in contrast to local hyperdynamics (LHD) where the boost contrast to local hyperdynamics (LHD) where the boost factor is an input
factor is an input parameter; see the :doc:`fix hyper/local <fix_hyper_local>` page for details. parameter; see the :doc:`fix hyper/local <fix_hyper_local>` page for details.
---------- ----------
@ -178,7 +179,7 @@ time-accurate trajectory of the system.
Note that if *Vmax* is set too small, the GHD simulation will run Note that if *Vmax* is set too small, the GHD simulation will run
correctly. There will just be fewer events because the hyper time correctly. There will just be fewer events because the hyper time
(t_hyper equation above) will be shorter. (:math:`t_{hyper}` equation above) will be shorter.
.. note:: .. note::

View File

@ -111,7 +111,7 @@ requirement, and thus a bias potential :math:`V^{max}_{ij}` will be
applied to many bonds on the same timestep. applied to many bonds on the same timestep.
In LHD, all bonds store a :math:`C_{ij}` prefactor which appears in In LHD, all bonds store a :math:`C_{ij}` prefactor which appears in
the :math:`V^{max}_{ij}` and :math:`F^{max}_{ij}equations above. Note the :math:`V^{max}_{ij}` and :math:`F^{max}_{ij}` equations above. Note
that the :math:`C_{ij}` factor scales the strength of the bias energy that the :math:`C_{ij}` factor scales the strength of the bias energy
and forces whenever bond *ij* is the maximum strain bond in its neighborhood. and forces whenever bond *ij* is the maximum strain bond in its neighborhood.
@ -269,7 +269,7 @@ inverse of the alpha parameter discussed in
The *Btarget* argument is the desired time boost factor (a value > 1) The *Btarget* argument is the desired time boost factor (a value > 1)
that all the atoms in the system will experience. The elapsed time that all the atoms in the system will experience. The elapsed time
t_hyper for an LHD simulation running for *N* timesteps is simply :math:`t_{hyper}` for an LHD simulation running for *N* timesteps is simply
.. math:: .. math::
@ -294,7 +294,7 @@ is the specified temperature of the system
Note that if *Btarget* is set smaller than this, the LHD simulation Note that if *Btarget* is set smaller than this, the LHD simulation
will run correctly. There will just be fewer events because the hyper will run correctly. There will just be fewer events because the hyper
time (t_hyper equation above) will be shorter. time (:math:`t_{hyper}` equation above) will be shorter.
.. note:: .. note::

View File

@ -120,7 +120,7 @@ with different units or as a measure to tweak the forces generated by
the manipulation of the IMD client, this option allows to make the manipulation of the IMD client, this option allows to make
adjustments. adjustments.
.. versionadded:: TBD .. versionadded:: 4Feb2025
In `IMDv3 <IMDv3_>`_, the IMD protocol has been extended to allow for In `IMDv3 <IMDv3_>`_, the IMD protocol has been extended to allow for
the transmission of simulation time, box dimensions, atomic coordinates, the transmission of simulation time, box dimensions, atomic coordinates,

View File

@ -130,7 +130,7 @@ calculated as:
.. math:: .. math::
{\bf F}_{j \alpha} = \gamma \left({\bf v}_n - {\bf u}_f \right) \zeta_{j\alpha} \mathbf{F}_{j \alpha} = \gamma \left(\mathbf{v}_n - \mathbf{u}_f \right) \zeta_{j\alpha}
where :math:`\mathbf{v}_n` is the velocity of the MD particle, where :math:`\mathbf{v}_n` is the velocity of the MD particle,
:math:`\mathbf{u}_f` is the fluid velocity interpolated to the particle :math:`\mathbf{u}_f` is the fluid velocity interpolated to the particle

Some files were not shown because too many files have changed in this diff Show More