Merge branch 'master' into multi_epcc
This commit is contained in:
4
.github/workflows/unittest-macos.yml
vendored
4
.github/workflows/unittest-macos.yml
vendored
@ -24,7 +24,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
run: |
|
run: |
|
||||||
cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake \
|
cmake -C $GITHUB_WORKSPACE/cmake/presets/clang.cmake \
|
||||||
|
-C $GITHUB_WORKSPACE/cmake/presets/most.cmake \
|
||||||
|
$GITHUB_WORKSPACE/cmake \
|
||||||
-DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DLAMMPS_EXCEPTIONS=ON
|
-DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DLAMMPS_EXCEPTIONS=ON
|
||||||
cmake --build . --parallel 2
|
cmake --build . --parallel 2
|
||||||
|
|
||||||
|
|||||||
7
LICENSE
7
LICENSE
@ -1,6 +1,6 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
@ -301,9 +301,8 @@ one line to give the program's name and an idea of what it does.
|
|||||||
Copyright (C) yyyy name of author
|
Copyright (C) yyyy name of author
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License version 2 as
|
||||||
the Free Software Foundation; either version 2 of the License, or (at
|
published by the Free Software Foundation.
|
||||||
your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
This program is distributed in the hope that it will be useful, but
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@ -22,11 +22,23 @@ set(LAMMPS_TOOLS_DIR ${LAMMPS_DIR}/tools)
|
|||||||
set(LAMMPS_PYTHON_DIR ${LAMMPS_DIR}/python)
|
set(LAMMPS_PYTHON_DIR ${LAMMPS_DIR}/python)
|
||||||
set(LAMMPS_POTENTIALS_DIR ${LAMMPS_DIR}/potentials)
|
set(LAMMPS_POTENTIALS_DIR ${LAMMPS_DIR}/potentials)
|
||||||
|
|
||||||
|
set(LAMMPS_DOWNLOADS_URL "https://download.lammps.org" CACHE STRING "Base URL for LAMMPS downloads")
|
||||||
|
set(LAMMPS_POTENTIALS_URL "${LAMMPS_DOWNLOADS_URL}/potentials")
|
||||||
|
set(LAMMPS_THIRDPARTY_URL "${LAMMPS_DOWNLOADS_URL}/thirdparty")
|
||||||
|
mark_as_advanced(LAMMPS_DOWNLOADS_URL)
|
||||||
|
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
|
|
||||||
# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
|
# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
|
||||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE )
|
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# If enabled, no need to use LD_LIBRARY_PATH / DYLD_LIBRARY_PATH when installed
|
||||||
|
option(LAMMPS_INSTALL_RPATH "Set runtime path for shared libraries linked to LAMMPS binaries" OFF)
|
||||||
|
if(LAMMPS_INSTALL_RPATH)
|
||||||
|
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||||
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Cmake modules/macros are in a subdirectory to keep this file cleaner
|
# Cmake modules/macros are in a subdirectory to keep this file cleaner
|
||||||
@ -106,7 +118,7 @@ option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
|
|||||||
|
|
||||||
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE
|
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE
|
||||||
GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE PERI POEMS
|
GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE PERI POEMS
|
||||||
QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
PLUGIN QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK
|
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK
|
||||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
||||||
USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF
|
USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF
|
||||||
@ -156,8 +168,7 @@ if(BUILD_MPI)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
enable_language(C)
|
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
|
||||||
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c)
|
|
||||||
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
||||||
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
||||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||||
@ -527,6 +538,18 @@ foreach(PKG_WITH_INCL CORESHELL QEQ USER-OMP USER-SDPD KOKKOS OPT USER-INTEL GPU
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(PKG_PLUGIN)
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||||
|
else()
|
||||||
|
message(WARNING "Plugin loading will not work unless BUILD_SHARED_LIBS is enabled")
|
||||||
|
endif()
|
||||||
|
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||||
|
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||||
|
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# the windows version of LAMMPS requires a couple extra libraries
|
# the windows version of LAMMPS requires a couple extra libraries
|
||||||
# and the MPI library - if use - has to be linked right before those
|
# and the MPI library - if use - has to be linked right before those
|
||||||
@ -652,7 +675,7 @@ install(
|
|||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||||
set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5)
|
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5)
|
||||||
find_package(PythonInterp) # Deprecated since version 3.12
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
if(PYTHONINTERP_FOUND)
|
if(PYTHONINTERP_FOUND)
|
||||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
@ -662,10 +685,10 @@ if(BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
if (Python_EXECUTABLE)
|
if (Python_EXECUTABLE)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
install-python
|
install-python ${CMAKE_COMMAND} -E remove_directory build
|
||||||
${Python_EXECUTABLE} install.py -v ${LAMMPS_SOURCE_DIR}/version.h
|
COMMAND ${Python_EXECUTABLE} install.py -v ${LAMMPS_SOURCE_DIR}/version.h
|
||||||
-p ${LAMMPS_PYTHON_DIR}/lammps
|
-p ${LAMMPS_PYTHON_DIR}/lammps
|
||||||
-l ${CMAKE_BINARY_DIR}/liblammps${CMAKE_SHARED_LIBRARY_SUFFIX}
|
-l ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR}
|
WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR}
|
||||||
COMMENT "Installing LAMMPS Python module")
|
COMMENT "Installing LAMMPS Python module")
|
||||||
else()
|
else()
|
||||||
@ -778,9 +801,7 @@ if(PKG_GPU)
|
|||||||
message(STATUS "<<< GPU package settings >>>
|
message(STATUS "<<< GPU package settings >>>
|
||||||
-- GPU API: ${GPU_API}")
|
-- GPU API: ${GPU_API}")
|
||||||
if(GPU_API STREQUAL "CUDA")
|
if(GPU_API STREQUAL "CUDA")
|
||||||
message(STATUS "GPU architecture: ${GPU_ARCH}")
|
message(STATUS "GPU default architecture: ${GPU_ARCH}")
|
||||||
elseif(GPU_API STREQUAL "OPENCL")
|
|
||||||
message(STATUS "OpenCL tuning: ${OCL_TUNE}")
|
|
||||||
elseif(GPU_API STREQUAL "HIP")
|
elseif(GPU_API STREQUAL "HIP")
|
||||||
message(STATUS "HIP platform: ${HIP_PLATFORM}")
|
message(STATUS "HIP platform: ${HIP_PLATFORM}")
|
||||||
message(STATUS "HIP architecture: ${HIP_ARCH}")
|
message(STATUS "HIP architecture: ${HIP_ARCH}")
|
||||||
|
|||||||
@ -50,16 +50,20 @@ if(BUILD_DOC)
|
|||||||
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
||||||
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
||||||
COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade pip
|
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip
|
||||||
COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
||||||
COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.2.tar.gz" CACHE STRING "URL for MathJax tarball")
|
||||||
|
set(MATHJAX_MD5 "a4a6a093a89bc2ccab1452d766b98e53" CACHE STRING "MD5 checksum of MathJax tarball")
|
||||||
|
mark_as_advanced(MATHJAX_URL)
|
||||||
|
|
||||||
# download mathjax distribution and unpack to folder "mathjax"
|
# download mathjax distribution and unpack to folder "mathjax"
|
||||||
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
||||||
file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.1.2.tar.gz"
|
file(DOWNLOAD ${MATHJAX_URL}
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
||||||
EXPECTED_MD5 a4a6a093a89bc2ccab1452d766b98e53)
|
EXPECTED_MD5 ${MATHJAX_MD5})
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
||||||
|
|||||||
@ -8,10 +8,12 @@ endif()
|
|||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
|
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
|
||||||
|
set(GTEST_MD5 "ecd1fa65e7de707cd5c00bdac56022cd" CACHE STRING "MD5 checksum of GTest tarball")
|
||||||
mark_as_advanced(GTEST_URL)
|
mark_as_advanced(GTEST_URL)
|
||||||
|
mark_as_advanced(GTEST_MD5)
|
||||||
ExternalProject_Add(googletest
|
ExternalProject_Add(googletest
|
||||||
URL ${GTEST_URL}
|
URL ${GTEST_URL}
|
||||||
URL_MD5 ecd1fa65e7de707cd5c00bdac56022cd
|
URL_MD5 ${GTEST_MD5}
|
||||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
||||||
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
||||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
|
||||||
@ -20,10 +22,10 @@ ExternalProject_Add(googletest
|
|||||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||||
BUILD_BYPRODUCTS <BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a
|
BUILD_BYPRODUCTS <BINARY_DIR>/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a
|
<BINARY_DIR>/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a
|
<BINARY_DIR>/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a
|
<BINARY_DIR>/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
LOG_DOWNLOAD ON
|
LOG_DOWNLOAD ON
|
||||||
LOG_CONFIGURE ON
|
LOG_CONFIGURE ON
|
||||||
LOG_BUILD ON
|
LOG_BUILD ON
|
||||||
@ -39,10 +41,10 @@ file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
|
|||||||
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
|
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
|
||||||
|
|
||||||
ExternalProject_Get_Property(googletest BINARY_DIR)
|
ExternalProject_Get_Property(googletest BINARY_DIR)
|
||||||
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a)
|
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a)
|
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a)
|
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a)
|
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
# Prevent GoogleTest from overriding our compiler/linker options
|
# Prevent GoogleTest from overriding our compiler/linker options
|
||||||
# when building with Visual Studio
|
# when building with Visual Studio
|
||||||
|
|||||||
@ -86,7 +86,6 @@ endfunction(GenerateBinaryHeader)
|
|||||||
# fetch missing potential files
|
# fetch missing potential files
|
||||||
function(FetchPotentials pkgfolder potfolder)
|
function(FetchPotentials pkgfolder potfolder)
|
||||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||||
set(LAMMPS_POTENTIALS_URL "https://download.lammps.org/potentials")
|
|
||||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||||
foreach(line ${linelist})
|
foreach(line ${linelist})
|
||||||
string(FIND ${line} " " blank)
|
string(FIND ${line} " " blank)
|
||||||
|
|||||||
@ -1,16 +1,25 @@
|
|||||||
# Download and configure custom MPICH files for Windows
|
# Download and configure custom MPICH files for Windows
|
||||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
||||||
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
||||||
|
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
|
||||||
|
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
||||||
|
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
|
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
ExternalProject_Add(mpi4win_build
|
ExternalProject_Add(mpi4win_build
|
||||||
URL https://download.lammps.org/thirdparty/mpich2-win64-devel.tar.gz
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
URL_MD5 4939fdb59d13182fd5dd65211e469f14
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
else()
|
else()
|
||||||
ExternalProject_Add(mpi4win_build
|
ExternalProject_Add(mpi4win_build
|
||||||
URL https://download.lammps.org/thirdparty/mpich2-win32-devel.tar.gz
|
URL ${MPICH2_WIN32_DEVEL_URL}
|
||||||
URL_MD5 a61d153500dce44e21b755ee7257e031
|
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
50
cmake/Modules/OpenCLLoader.cmake
Normal file
50
cmake/Modules/OpenCLLoader.cmake
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
message(STATUS "Downloading and building OpenCL loader library")
|
||||||
|
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2020.12.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||||
|
set(OPENCL_LOADER_MD5 "011cdcbd41030be94f3fced6d763a52a" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||||
|
mark_as_advanced(OPENCL_LOADER_URL)
|
||||||
|
mark_as_advanced(OPENCL_LOADER_MD5)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(opencl_loader
|
||||||
|
URL ${OPENCL_LOADER_URL}
|
||||||
|
URL_MD5 ${OPENCL_LOADER_MD5}
|
||||||
|
SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src"
|
||||||
|
BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build"
|
||||||
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS}
|
||||||
|
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||||
|
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||||
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||||
|
BUILD_BYPRODUCTS <BINARY_DIR>/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
LOG_DOWNLOAD ON
|
||||||
|
LOG_CONFIGURE ON
|
||||||
|
LOG_BUILD ON
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
TEST_COMMAND "")
|
||||||
|
|
||||||
|
ExternalProject_Get_Property(opencl_loader SOURCE_DIR)
|
||||||
|
set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc)
|
||||||
|
|
||||||
|
# workaround for CMake 3.10 on ubuntu 18.04
|
||||||
|
file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR})
|
||||||
|
|
||||||
|
ExternalProject_Get_Property(opencl_loader BINARY_DIR)
|
||||||
|
set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
|
||||||
|
find_package(Threads QUIET)
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}")
|
||||||
|
else()
|
||||||
|
set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
|
||||||
|
add_dependencies(OpenCL::OpenCL opencl_loader)
|
||||||
|
|
||||||
|
set_target_properties(OpenCL::OpenCL PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR}
|
||||||
|
INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}")
|
||||||
|
|
||||||
|
|
||||||
@ -1,7 +1,9 @@
|
|||||||
set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
|
set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
|
||||||
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
||||||
${GPU_SOURCES_DIR}/fix_gpu.h
|
${GPU_SOURCES_DIR}/fix_gpu.h
|
||||||
${GPU_SOURCES_DIR}/fix_gpu.cpp)
|
${GPU_SOURCES_DIR}/fix_gpu.cpp
|
||||||
|
${GPU_SOURCES_DIR}/fix_nh_gpu.h
|
||||||
|
${GPU_SOURCES_DIR}/fix_nh_gpu.cpp)
|
||||||
target_compile_definitions(lammps PRIVATE -DLMP_GPU)
|
target_compile_definitions(lammps PRIVATE -DLMP_GPU)
|
||||||
|
|
||||||
set(GPU_API "opencl" CACHE STRING "API used by GPU package")
|
set(GPU_API "opencl" CACHE STRING "API used by GPU package")
|
||||||
@ -33,9 +35,12 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
if(NOT BIN2C)
|
if(NOT BIN2C)
|
||||||
message(FATAL_ERROR "Could not find bin2c, use -DBIN2C=/path/to/bin2c to help cmake finding it.")
|
message(FATAL_ERROR "Could not find bin2c, use -DBIN2C=/path/to/bin2c to help cmake finding it.")
|
||||||
endif()
|
endif()
|
||||||
option(CUDPP_OPT "Enable CUDPP_OPT" ON)
|
option(CUDPP_OPT "Enable GPU binning via CUDAPP (should be off for modern GPUs)" OFF)
|
||||||
option(CUDA_MPS_SUPPORT "Enable tweaks to support CUDA Multi-process service (MPS)" OFF)
|
option(CUDA_MPS_SUPPORT "Enable tweaks to support CUDA Multi-process service (MPS)" OFF)
|
||||||
if(CUDA_MPS_SUPPORT)
|
if(CUDA_MPS_SUPPORT)
|
||||||
|
if(CUDPP_OPT)
|
||||||
|
message(FATAL_ERROR "Must use -DCUDPP_OPT=OFF with -DGPU_CUDA_MPS_SUPPORT=ON")
|
||||||
|
endif()
|
||||||
set(GPU_CUDA_MPS_FLAGS "-DCUDA_PROXY")
|
set(GPU_CUDA_MPS_FLAGS "-DCUDA_PROXY")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -98,6 +103,10 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
||||||
endif()
|
endif()
|
||||||
|
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||||
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||||
|
endif()
|
||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
message(WARNING "Unsupported CUDA version. Use at your own risk.")
|
message(WARNING "Unsupported CUDA version. Use at your own risk.")
|
||||||
endif()
|
endif()
|
||||||
@ -122,7 +131,7 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
|
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
|
||||||
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
|
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
|
||||||
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT ${GPU_CUDA_MPS_FLAGS})
|
target_compile_definitions(gpu PRIVATE -DUSE_CUDA -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT ${GPU_CUDA_MPS_FLAGS})
|
||||||
if(CUDPP_OPT)
|
if(CUDPP_OPT)
|
||||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
|
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
|
||||||
@ -136,27 +145,13 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
|
target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
|
||||||
|
|
||||||
elseif(GPU_API STREQUAL "OPENCL")
|
elseif(GPU_API STREQUAL "OPENCL")
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
option(USE_STATIC_OPENCL_LOADER "Download and include a static OpenCL ICD loader" ON)
|
||||||
# download and unpack support binaries for compilation of windows binaries.
|
mark_as_advanced(USE_STATIC_OPENCL_LOADER)
|
||||||
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty")
|
if (USE_STATIC_OPENCL_LOADER)
|
||||||
file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz"
|
include(OpenCLLoader)
|
||||||
EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d)
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
|
|
||||||
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
|
|
||||||
set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win32/libOpenCL.dll")
|
|
||||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
|
||||||
set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win64/libOpenCL.dll")
|
|
||||||
endif()
|
|
||||||
set_target_properties(OpenCL::OpenCL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/include")
|
|
||||||
else()
|
else()
|
||||||
find_package(OpenCL REQUIRED)
|
find_package(OpenCL REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
set(OCL_TUNE "generic" CACHE STRING "OpenCL Device Tuning")
|
|
||||||
set(OCL_TUNE_VALUES intel fermi kepler cypress generic)
|
|
||||||
set_property(CACHE OCL_TUNE PROPERTY STRINGS ${OCL_TUNE_VALUES})
|
|
||||||
validate_option(OCL_TUNE OCL_TUNE_VALUES)
|
|
||||||
string(TOUPPER ${OCL_TUNE} OCL_TUNE)
|
|
||||||
|
|
||||||
include(OpenCLUtils)
|
include(OpenCLUtils)
|
||||||
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
||||||
@ -200,7 +195,7 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
||||||
target_link_libraries(gpu PRIVATE OpenCL::OpenCL)
|
target_link_libraries(gpu PRIVATE OpenCL::OpenCL)
|
||||||
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu)
|
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu)
|
||||||
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -D${OCL_TUNE}_OCL -DMPI_GERYON -DUCL_NO_EXIT)
|
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT)
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
|
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE gpu)
|
target_link_libraries(lammps PRIVATE gpu)
|
||||||
@ -208,6 +203,7 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||||
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
|
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
|
||||||
target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL)
|
target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL)
|
||||||
|
add_dependencies(ocl_get_devices OpenCL::OpenCL)
|
||||||
elseif(GPU_API STREQUAL "HIP")
|
elseif(GPU_API STREQUAL "HIP")
|
||||||
if(NOT DEFINED HIP_PATH)
|
if(NOT DEFINED HIP_PATH)
|
||||||
if(NOT DEFINED ENV{HIP_PATH})
|
if(NOT DEFINED ENV{HIP_PATH})
|
||||||
@ -222,7 +218,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(NOT DEFINED HIP_PLATFORM)
|
if(NOT DEFINED HIP_PLATFORM)
|
||||||
if(NOT DEFINED ENV{HIP_PLATFORM})
|
if(NOT DEFINED ENV{HIP_PLATFORM})
|
||||||
set(HIP_PLATFORM "hcc" CACHE PATH "HIP Platform to be used during compilation")
|
set(HIP_PLATFORM "amd" CACHE PATH "HIP Platform to be used during compilation")
|
||||||
else()
|
else()
|
||||||
set(HIP_PLATFORM $ENV{HIP_PLATFORM} CACHE PATH "HIP Platform used during compilation")
|
set(HIP_PLATFORM $ENV{HIP_PLATFORM} CACHE PATH "HIP Platform used during compilation")
|
||||||
endif()
|
endif()
|
||||||
@ -230,7 +226,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
set(ENV{HIP_PLATFORM} ${HIP_PLATFORM})
|
set(ENV{HIP_PLATFORM} ${HIP_PLATFORM})
|
||||||
|
|
||||||
if(HIP_PLATFORM STREQUAL "hcc")
|
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
||||||
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
||||||
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
||||||
find_package(CUDA REQUIRED)
|
find_package(CUDA REQUIRED)
|
||||||
@ -288,7 +284,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
set(CUBIN_FILE "${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}.cubin")
|
set(CUBIN_FILE "${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}.cubin")
|
||||||
set(CUBIN_H_FILE "${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}_cubin.h")
|
set(CUBIN_H_FILE "${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}_cubin.h")
|
||||||
|
|
||||||
if(HIP_PLATFORM STREQUAL "hcc")
|
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
||||||
configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY)
|
configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY)
|
||||||
|
|
||||||
if(HIP_COMPILER STREQUAL "clang")
|
if(HIP_COMPILER STREQUAL "clang")
|
||||||
@ -342,11 +338,16 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(DOWNLOAD_CUB)
|
if(DOWNLOAD_CUB)
|
||||||
message(STATUS "CUB download requested")
|
message(STATUS "CUB download requested")
|
||||||
|
set(CUB_URL "https://github.com/NVlabs/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
|
||||||
|
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
|
||||||
|
mark_as_advanced(CUB_URL)
|
||||||
|
mark_as_advanced(CUB_MD5)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
ExternalProject_Add(CUB
|
ExternalProject_Add(CUB
|
||||||
GIT_REPOSITORY https://github.com/NVlabs/cub
|
URL ${CUB_URL}
|
||||||
TIMEOUT 5
|
URL_MD5 ${CUB_MD5}
|
||||||
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
@ -358,7 +359,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
else()
|
else()
|
||||||
find_package(CUB)
|
find_package(CUB)
|
||||||
if(NOT CUB_FOUND)
|
if(NOT CUB_FOUND)
|
||||||
message(FATAL_ERROR "CUB library not found. Help CMake to find it by setting CUB_INCLUDE_DIR, or set DOWNLOAD_VORO=ON to download it")
|
message(FATAL_ERROR "CUB library not found. Help CMake to find it by setting CUB_INCLUDE_DIR, or set DOWNLOAD_CUB=ON to download it")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -385,18 +386,21 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_HCC__)
|
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_HCC__)
|
||||||
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||||
|
elseif(HIP_PLATFORM STREQUAL "amd")
|
||||||
|
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_AMD__)
|
||||||
|
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||||
|
|
||||||
|
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_AMD__)
|
||||||
|
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE gpu)
|
target_link_libraries(lammps PRIVATE gpu)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# GPU package
|
|
||||||
FindStyleHeaders(${GPU_SOURCES_DIR} FIX_CLASS fix_ FIX)
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
|
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
|
||||||
|
# detect styles which have a GPU version
|
||||||
# detects styles which have GPU version
|
|
||||||
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
||||||
|
RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h)
|
||||||
|
|
||||||
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
||||||
|
|
||||||
|
|||||||
@ -35,9 +35,13 @@ if(DOWNLOAD_KIM)
|
|||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
|
set(KIM_URL "https://s3.openkim.org/kim-api/kim-api-2.2.1.txz" CACHE STRING "URL for KIM tarball")
|
||||||
|
set(KIM_MD5 "ae1ddda2ef7017ea07934e519d023dca" CACHE STRING "MD5 checksum of KIM tarball")
|
||||||
|
mark_as_advanced(KIM_URL)
|
||||||
|
mark_as_advanced(KIM_MD5)
|
||||||
ExternalProject_Add(kim_build
|
ExternalProject_Add(kim_build
|
||||||
URL https://s3.openkim.org/kim-api/kim-api-2.2.1.txz
|
URL ${KIM_URL}
|
||||||
URL_MD5 ae1ddda2ef7017ea07934e519d023dca
|
URL_MD5 ${KIM_MD5}
|
||||||
BINARY_DIR build
|
BINARY_DIR build
|
||||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
||||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||||
@ -69,14 +73,14 @@ if(DOWNLOAD_KIM)
|
|||||||
BUILD_RPATH "${_rpath_prefix}/kim_build-prefix/lib"
|
BUILD_RPATH "${_rpath_prefix}/kim_build-prefix/lib"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
if(KIM-API_FOUND AND KIM_API_VERSION VERSION_GREATER_EQUAL 2.2.0)
|
if(KIM-API_FOUND AND KIM-API_VERSION VERSION_GREATER_EQUAL 2.2.0)
|
||||||
# For kim-api >= 2.2.0
|
# For kim-api >= 2.2.0
|
||||||
find_package(KIM-API ${KIM-API_MIN_VERSION} CONFIG REQUIRED)
|
find_package(KIM-API 2.2.0 CONFIG REQUIRED)
|
||||||
target_link_libraries(lammps PRIVATE KIM-API::kim-api)
|
target_link_libraries(lammps PRIVATE KIM-API::kim-api)
|
||||||
else()
|
else()
|
||||||
# For kim-api 2.1.3 (consistent with previous version of this file)
|
# For kim-api 2.1.3 (consistent with previous version of this file)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=KIM-API_MIN_VERSION)
|
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION})
|
||||||
target_link_libraries(lammps PRIVATE PkgConfig::KIM-API)
|
target_link_libraries(lammps PRIVATE PkgConfig::KIM-API)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -37,9 +37,13 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.3.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||||
|
set(KOKKOS_MD5 "08201d1c7cf5bc458ce0f5b44a629d5a" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||||
|
mark_as_advanced(KOKKOS_URL)
|
||||||
|
mark_as_advanced(KOKKOS_MD5)
|
||||||
ExternalProject_Add(kokkos_build
|
ExternalProject_Add(kokkos_build
|
||||||
URL https://github.com/kokkos/kokkos/archive/3.3.01.tar.gz
|
URL ${KOKKOS_URL}
|
||||||
URL_MD5 08201d1c7cf5bc458ce0f5b44a629d5a
|
URL_MD5 ${KOKKOS_MD5}
|
||||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
|
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
|
||||||
)
|
)
|
||||||
@ -51,10 +55,12 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
|
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
|
||||||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||||
|
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOS)
|
||||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||||
elseif(EXTERNAL_KOKKOS)
|
elseif(EXTERNAL_KOKKOS)
|
||||||
find_package(Kokkos 3.3.01 REQUIRED CONFIG)
|
find_package(Kokkos 3.3.01 REQUIRED CONFIG)
|
||||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||||
|
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||||
else()
|
else()
|
||||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||||
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
|
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
|
||||||
@ -66,6 +72,7 @@ else()
|
|||||||
${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
||||||
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
|
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
|
||||||
target_link_libraries(lammps PRIVATE kokkos)
|
target_link_libraries(lammps PRIVATE kokkos)
|
||||||
|
target_link_libraries(lmp PRIVATE kokkos)
|
||||||
endif()
|
endif()
|
||||||
target_compile_definitions(lammps PRIVATE -DLMP_KOKKOS)
|
target_compile_definitions(lammps PRIVATE -DLMP_KOKKOS)
|
||||||
|
|
||||||
|
|||||||
@ -15,10 +15,14 @@ endif()
|
|||||||
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
|
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
|
||||||
if(DOWNLOAD_LATTE)
|
if(DOWNLOAD_LATTE)
|
||||||
message(STATUS "LATTE download requested - we will build our own")
|
message(STATUS "LATTE download requested - we will build our own")
|
||||||
|
set(LATTE_URL "https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz" CACHE STRING "URL for LATTE tarball")
|
||||||
|
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
||||||
|
mark_as_advanced(LATTE_URL)
|
||||||
|
mark_as_advanced(LATTE_MD5)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(latte_build
|
ExternalProject_Add(latte_build
|
||||||
URL https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz
|
URL ${LATTE_URL}
|
||||||
URL_MD5 820e73a457ced178c08c71389a385de7
|
URL_MD5 ${LATTE_MD5}
|
||||||
SOURCE_SUBDIR cmake
|
SOURCE_SUBDIR cmake
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
||||||
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
||||||
|
|||||||
@ -2,9 +2,8 @@ if(LAMMPS_SIZES STREQUAL BIGBIG)
|
|||||||
message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG")
|
message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG")
|
||||||
endif()
|
endif()
|
||||||
option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
|
option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
|
||||||
file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F
|
file(GLOB_RECURSE cslib_SOURCES
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c
|
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
|
|
||||||
|
|
||||||
add_library(cslib STATIC ${cslib_SOURCES})
|
add_library(cslib STATIC ${cslib_SOURCES})
|
||||||
target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# if PYTHON package is included we may also include Python support in MLIAP
|
# if PYTHON package is included we may also include Python support in MLIAP
|
||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
||||||
if(PKG_PYTHON)
|
if(PKG_PYTHON)
|
||||||
find_package(Cythonize)
|
find_package(Cythonize QUIET)
|
||||||
if(Cythonize_FOUND)
|
if(Cythonize_FOUND)
|
||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
@ -14,6 +14,15 @@ if(MLIAP_ENABLE_PYTHON)
|
|||||||
if(NOT PKG_PYTHON)
|
if(NOT PKG_PYTHON)
|
||||||
message(FATAL_ERROR "Must enable PYTHON package for including Python support in MLIAP")
|
message(FATAL_ERROR "Must enable PYTHON package for including Python support in MLIAP")
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3.6)
|
||||||
|
message(FATAL_ERROR "Python support in MLIAP requires Python 3.6 or later")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(Python_VERSION VERSION_LESS 3.6)
|
||||||
|
message(FATAL_ERROR "Python support in MLIAP requires Python 3.6 or later")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython)
|
set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython)
|
||||||
set(MLIAP_CYTHON_SRC ${LAMMPS_SOURCE_DIR}/MLIAP/mliap_model_python_couple.pyx)
|
set(MLIAP_CYTHON_SRC ${LAMMPS_SOURCE_DIR}/MLIAP/mliap_model_python_couple.pyx)
|
||||||
|
|||||||
@ -7,10 +7,15 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
||||||
if(DOWNLOAD_MSCG)
|
if(DOWNLOAD_MSCG)
|
||||||
|
set(MSCG_URL "https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz" CACHE STRING "URL for MSCG tarball")
|
||||||
|
set(MSCG_MD5 "8c45e269ee13f60b303edd7823866a91" CACHE STRING "MD5 checksum of MSCG tarball")
|
||||||
|
mark_as_advanced(MSCG_URL)
|
||||||
|
mark_as_advanced(MSCG_MD5)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(mscg_build
|
ExternalProject_Add(mscg_build
|
||||||
URL https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz
|
URL ${MSCG_URL}
|
||||||
URL_MD5 8c45e269ee13f60b303edd7823866a91
|
URL_MD5 ${MSCG_MD5}
|
||||||
SOURCE_SUBDIR src/CMake
|
SOURCE_SUBDIR src/CMake
|
||||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
||||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||||
|
|||||||
@ -30,7 +30,12 @@ if(INTEL_LRT_MODE STREQUAL "THREADS")
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(INTEL_LRT_MODE STREQUAL "C++11")
|
if(INTEL_LRT_MODE STREQUAL "C++11")
|
||||||
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT11)
|
if(Threads_FOUND)
|
||||||
|
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT11)
|
||||||
|
target_link_libraries(lammps PRIVATE Threads::Threads)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Must have working threads library for Long-range thread support")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
|
|||||||
@ -2,8 +2,4 @@ set(MOLFILE_INCLUDE_DIR "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to
|
|||||||
set(MOLFILE_INCLUDE_DIRS "${MOLFILE_INCLUDE_DIR}")
|
set(MOLFILE_INCLUDE_DIRS "${MOLFILE_INCLUDE_DIR}")
|
||||||
add_library(molfile INTERFACE)
|
add_library(molfile INTERFACE)
|
||||||
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
||||||
# no need to link with -ldl on windows
|
|
||||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
||||||
target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS})
|
|
||||||
endif()
|
|
||||||
target_link_libraries(lammps PRIVATE molfile)
|
target_link_libraries(lammps PRIVATE molfile)
|
||||||
|
|||||||
@ -53,10 +53,16 @@ if(DOWNLOAD_PLUMED)
|
|||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.0/plumed-src-2.7.0.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||||
|
set(PLUMED_MD5 "95f29dd0c067577f11972ff90dfc7d12" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||||
|
mark_as_advanced(PLUMED_URL)
|
||||||
|
mark_as_advanced(PLUMED_MD5)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(plumed_build
|
ExternalProject_Add(plumed_build
|
||||||
URL https://github.com/plumed/plumed2/releases/download/v2.7.0/plumed-src-2.7.0.tgz
|
URL ${PLUMED_URL}
|
||||||
URL_MD5 95f29dd0c067577f11972ff90dfc7d12
|
URL_MD5 ${PLUMED_MD5}
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||||
${CONFIGURE_REQUEST_PIC}
|
${CONFIGURE_REQUEST_PIC}
|
||||||
|
|||||||
@ -14,15 +14,19 @@ endif()
|
|||||||
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
|
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
|
||||||
if(DOWNLOAD_SCAFACOS)
|
if(DOWNLOAD_SCAFACOS)
|
||||||
message(STATUS "ScaFaCoS download requested - we will build our own")
|
message(STATUS "ScaFaCoS download requested - we will build our own")
|
||||||
|
set(SCAFACOS_URL "https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz" CACHE STRING "URL for SCAFACOS tarball")
|
||||||
|
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
||||||
|
mark_as_advanced(SCAFACOS_URL)
|
||||||
|
mark_as_advanced(SCAFACOS_MD5)
|
||||||
|
|
||||||
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
||||||
file(DOWNLOAD https://download.lammps.org/thirdparty/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
|
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(scafacos_build
|
ExternalProject_Add(scafacos_build
|
||||||
URL https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz
|
URL ${SCAFACOS_URL}
|
||||||
URL_MD5 bd46d74e3296bd8a444d731bb10c1738
|
URL_MD5 ${SCAFACOS_MD5}
|
||||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
||||||
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
|
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
|
||||||
|
|||||||
@ -7,10 +7,14 @@ endif()
|
|||||||
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
|
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
|
||||||
if(DOWNLOAD_EIGEN3)
|
if(DOWNLOAD_EIGEN3)
|
||||||
message(STATUS "Eigen3 download requested - we will build our own")
|
message(STATUS "Eigen3 download requested - we will build our own")
|
||||||
|
set(EIGEN3_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||||
|
set(EIGEN3_MD5 "9e30f67e8531477de4117506fe44669b" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||||
|
mark_as_advanced(EIGEN3_URL)
|
||||||
|
mark_as_advanced(EIGEN3_MD5)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(Eigen3_build
|
ExternalProject_Add(Eigen3_build
|
||||||
URL https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
|
URL ${EIGEN3_URL}
|
||||||
URL_MD5 9e30f67e8531477de4117506fe44669b
|
URL_MD5 ${EIGEN3_MD5}
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
ExternalProject_get_property(Eigen3_build SOURCE_DIR)
|
ExternalProject_get_property(Eigen3_build SOURCE_DIR)
|
||||||
|
|||||||
@ -7,6 +7,11 @@ endif()
|
|||||||
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
|
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
|
||||||
if(DOWNLOAD_VORO)
|
if(DOWNLOAD_VORO)
|
||||||
message(STATUS "Voro++ download requested - we will build our own")
|
message(STATUS "Voro++ download requested - we will build our own")
|
||||||
|
set(VORO_URL "${LAMMPS_THIRDPARTY_URL}/voro++-0.4.6.tar.gz" CACHE STRING "URL for Voro++ tarball")
|
||||||
|
set(VORO_MD5 "2338b824c3b7b25590e18e8df5d68af9" CACHE STRING "MD5 checksum for Voro++ tarball")
|
||||||
|
mark_as_advanced(VORO_URL)
|
||||||
|
mark_as_advanced(VORO_MD5)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
@ -22,8 +27,8 @@ if(DOWNLOAD_VORO)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(voro_build
|
ExternalProject_Add(voro_build
|
||||||
URL https://download.lammps.org/thirdparty/voro++-0.4.6.tar.gz
|
URL ${VORO_URL}
|
||||||
URL_MD5 2338b824c3b7b25590e18e8df5d68af9
|
URL_MD5 ${VORO_MD5}
|
||||||
PATCH_COMMAND patch -b -p0 < ${LAMMPS_LIB_SOURCE_DIR}/voronoi/voro-make.patch
|
PATCH_COMMAND patch -b -p0 < ${LAMMPS_LIB_SOURCE_DIR}/voronoi/voro-make.patch
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND make ${VORO_BUILD_OPTIONS}
|
BUILD_COMMAND make ${VORO_BUILD_OPTIONS}
|
||||||
|
|||||||
@ -2,17 +2,20 @@ message(STATUS "Downloading and building YAML library")
|
|||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(YAML_URL "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz" CACHE STRING "URL for libyaml tarball")
|
set(YAML_URL "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz" CACHE STRING "URL for libyaml tarball")
|
||||||
|
set(YAML_MD5 "bb15429d8fb787e7d3f1c83ae129a999" CACHE STRING "MD5 checksum of libyaml tarball")
|
||||||
mark_as_advanced(YAML_URL)
|
mark_as_advanced(YAML_URL)
|
||||||
|
mark_as_advanced(YAML_MD5)
|
||||||
|
|
||||||
ExternalProject_Add(libyaml
|
ExternalProject_Add(libyaml
|
||||||
URL ${YAML_URL}
|
URL ${YAML_URL}
|
||||||
URL_MD5 bb15429d8fb787e7d3f1c83ae129a999
|
URL_MD5 ${YAML_MD5}
|
||||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src"
|
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src"
|
||||||
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build"
|
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build"
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${CONFIGURE_REQUEST_PIC}
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${CONFIGURE_REQUEST_PIC}
|
||||||
CXX=${CMAKE_CXX_COMPILER}
|
CXX=${CMAKE_CXX_COMPILER}
|
||||||
CC=${CMAKE_C_COMPILER}
|
CC=${CMAKE_C_COMPILER}
|
||||||
--prefix=<INSTALL_DIR> --disable-shared
|
--prefix=<INSTALL_DIR> --disable-shared
|
||||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a
|
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
TEST_COMMAND "")
|
TEST_COMMAND "")
|
||||||
|
|
||||||
ExternalProject_Get_Property(libyaml INSTALL_DIR)
|
ExternalProject_Get_Property(libyaml INSTALL_DIR)
|
||||||
@ -23,7 +26,7 @@ set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib)
|
|||||||
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
|
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
|
||||||
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
|
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
|
||||||
|
|
||||||
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a)
|
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
add_library(Yaml::Yaml UNKNOWN IMPORTED)
|
add_library(Yaml::Yaml UNKNOWN IMPORTED)
|
||||||
set_target_properties(Yaml::Yaml PROPERTIES
|
set_target_properties(Yaml::Yaml PROPERTIES
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE
|
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE
|
||||||
GRANULAR KSPACE MANYBODY MC MISC MLIAP MOLECULE OPT PERI
|
GRANULAR KSPACE MANYBODY MC MISC MLIAP MOLECULE OPT PERI
|
||||||
POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||||
USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
||||||
USER-DPD USER-DRUDE USER-EFF USER-FEP USER-MEAMC USER-MESODPD
|
USER-DPD USER-DRUDE USER-EFF USER-FEP USER-MEAMC USER-MESODPD
|
||||||
USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION
|
USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION
|
||||||
|
|||||||
18
cmake/presets/oneapi.cmake
Normal file
18
cmake/presets/oneapi.cmake
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# preset that will enable the LLVM based Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "icpx" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_C_COMPILER "icx" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_Fortran_COMPILER "ifx" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX "icpx" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
|
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
||||||
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
@ -47,6 +47,8 @@ HAS_PDFLATEX = YES
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# override settings for PIP commands
|
||||||
|
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
||||||
|
|
||||||
#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E")
|
#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E")
|
||||||
|
|
||||||
@ -228,13 +230,13 @@ $(VENV):
|
|||||||
@( \
|
@( \
|
||||||
$(VIRTUALENV) -p $(PYTHON) $(VENV); \
|
$(VIRTUALENV) -p $(PYTHON) $(VENV); \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
pip install --upgrade pip; \
|
pip $(PIP_OPTIONS) install --upgrade pip; \
|
||||||
pip install -r $(BUILDDIR)/utils/requirements.txt; \
|
pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \
|
||||||
deactivate;\
|
deactivate;\
|
||||||
)
|
)
|
||||||
|
|
||||||
$(MATHJAX):
|
$(MATHJAX):
|
||||||
@git clone --depth 1 https://github.com/mathjax/MathJax.git $@
|
@git clone --depth 1 git://github.com/mathjax/MathJax.git $@
|
||||||
|
|
||||||
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
||||||
@( \
|
@( \
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.TH LAMMPS "24 December 2020" "2020-12-24"
|
.TH LAMMPS "10 March 2021" "2021-03-10"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B LAMMPS
|
.B LAMMPS
|
||||||
\- Molecular Dynamics Simulator.
|
\- Molecular Dynamics Simulator.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Basic build options
|
Basic build options
|
||||||
===================
|
===================
|
||||||
|
|
||||||
The following topics are covered on this page, for building both with
|
The following topics are covered on this page, for building with both
|
||||||
CMake and make:
|
CMake and make:
|
||||||
|
|
||||||
* :ref:`Serial vs parallel build <serial>`
|
* :ref:`Serial vs parallel build <serial>`
|
||||||
@ -95,7 +95,7 @@ standard. A more detailed discussion of that is below.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
The file ``src/STUBS/mpi.c`` provides a CPU timer function
|
The file ``src/STUBS/mpi.cpp`` provides a CPU timer function
|
||||||
called ``MPI_Wtime()`` that calls ``gettimeofday()``. If your
|
called ``MPI_Wtime()`` that calls ``gettimeofday()``. If your
|
||||||
operating system does not support ``gettimeofday()``, you will
|
operating system does not support ``gettimeofday()``, you will
|
||||||
need to insert code to call another timer. Note that the
|
need to insert code to call another timer. Note that the
|
||||||
@ -234,6 +234,8 @@ LAMMPS.
|
|||||||
cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
|
cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
|
||||||
# Building with Intel Compilers:
|
# Building with Intel Compilers:
|
||||||
cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort
|
cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort
|
||||||
|
# Building with Intel oneAPI Compilers:
|
||||||
|
cmake ../cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_Fortran_COMPILER=ifx
|
||||||
# Building with LLVM/Clang Compilers:
|
# Building with LLVM/Clang Compilers:
|
||||||
cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
|
cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
|
||||||
# Building with PGI/Nvidia Compilers:
|
# Building with PGI/Nvidia Compilers:
|
||||||
@ -243,8 +245,10 @@ LAMMPS.
|
|||||||
provided that can be loaded with
|
provided that can be loaded with
|
||||||
`-C ../cmake/presets/clang.cmake`. Similarly,
|
`-C ../cmake/presets/clang.cmake`. Similarly,
|
||||||
`-C ../cmake/presets/intel.cmake` should switch the compiler
|
`-C ../cmake/presets/intel.cmake` should switch the compiler
|
||||||
toolchain to the Intel compilers and `-C ../cmake/presets/pgi.cmake`
|
toolchain to the legacy Intel compilers, `-C ../cmake/presets/oneapi.cmake`
|
||||||
should switch the compiler to the PGI compilers.
|
will switch to the LLVM based oneAPI Intel compilers,
|
||||||
|
and `-C ../cmake/presets/pgi.cmake`
|
||||||
|
will switch the compiler to the PGI compilers.
|
||||||
|
|
||||||
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add
|
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add
|
||||||
compiler flags to tune for optimal performance on given hosts. By
|
compiler flags to tune for optimal performance on given hosts. By
|
||||||
@ -526,6 +530,20 @@ you want to copy files to is protected.
|
|||||||
make # perform make after CMake command
|
make # perform make after CMake command
|
||||||
make install # perform the installation into prefix
|
make install # perform the installation into prefix
|
||||||
|
|
||||||
|
During the installation process CMake will by default remove any runtime
|
||||||
|
path settings for loading shared libraries. Because of this you may
|
||||||
|
have to set or modify the ``LD_LIBRARY_PATH`` (or ``DYLD_LIBRARY_PATH``)
|
||||||
|
environment variable, if you are installing LAMMPS into a non-system
|
||||||
|
location and/or are linking to libraries in a non-system location that
|
||||||
|
depend on such runtime path settings.
|
||||||
|
As an alternative you may set the CMake variable ``LAMMPS_INSTALL_RPATH``
|
||||||
|
to ``on`` and then the runtime paths for any linked shared libraries
|
||||||
|
and the library installation folder for the LAMMPS library will be
|
||||||
|
embedded and thus the requirement to set environment variables is avoided.
|
||||||
|
The ``off`` setting is usually preferred for packaged binaries or when
|
||||||
|
setting up environment modules, the ``on`` setting is more convenient
|
||||||
|
for installing software into a non-system or personal folder.
|
||||||
|
|
||||||
.. tab:: Traditional make
|
.. tab:: Traditional make
|
||||||
|
|
||||||
There is no "install" option in the ``src/Makefile`` for LAMMPS.
|
There is no "install" option in the ``src/Makefile`` for LAMMPS.
|
||||||
|
|||||||
@ -120,21 +120,21 @@ CMake build
|
|||||||
-D GPU_API=value # value = opencl (default) or cuda or hip
|
-D GPU_API=value # value = opencl (default) or cuda or hip
|
||||||
-D GPU_PREC=value # precision setting
|
-D GPU_PREC=value # precision setting
|
||||||
# value = double or mixed (default) or single
|
# value = double or mixed (default) or single
|
||||||
-D OCL_TUNE=value # hardware choice for GPU_API=opencl
|
|
||||||
# generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
|
|
||||||
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
||||||
# value = sm_XX, see below
|
# value = sm_XX, see below
|
||||||
# default is sm_50
|
# default is sm_50
|
||||||
-D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip
|
-D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip
|
||||||
# value depends on selected HIP_PLATFORM
|
# value depends on selected HIP_PLATFORM
|
||||||
# default is 'gfx906' for HIP_PLATFORM=hcc and 'sm_50' for HIP_PLATFORM=nvcc
|
# default is 'gfx906' for HIP_PLATFORM=amd and 'sm_50' for HIP_PLATFORM=nvcc
|
||||||
-D HIP_USE_DEVICE_SORT=value # enables GPU sorting
|
-D HIP_USE_DEVICE_SORT=value # enables GPU sorting
|
||||||
# value = yes (default) or no
|
# value = yes (default) or no
|
||||||
-D CUDPP_OPT=value # optimization setting for GPU_API=cuda
|
-D CUDPP_OPT=value # use GPU binning on with CUDA (should be off for modern GPUs)
|
||||||
# enables CUDA Performance Primitives Optimizations
|
# enables CUDA Performance Primitives, must be "no" for CUDA_MPS_SUPPORT=yes
|
||||||
# value = yes (default) or no
|
# value = yes or no (default)
|
||||||
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon
|
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon
|
||||||
# value = yes or no (default)
|
# value = yes or no (default)
|
||||||
|
-D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed
|
||||||
|
# value = yes (default) or no
|
||||||
|
|
||||||
:code:`GPU_ARCH` settings for different GPU hardware is as follows:
|
:code:`GPU_ARCH` settings for different GPU hardware is as follows:
|
||||||
|
|
||||||
@ -161,19 +161,32 @@ When building with CMake, you **must NOT** build the GPU library in ``lib/gpu``
|
|||||||
using the traditional build procedure. CMake will detect files generated by that
|
using the traditional build procedure. CMake will detect files generated by that
|
||||||
process and will terminate with an error and a suggestion for how to remove them.
|
process and will terminate with an error and a suggestion for how to remove them.
|
||||||
|
|
||||||
|
If you are compiling for OpenCL, the default setting is to download, build, and
|
||||||
|
link with a static OpenCL ICD loader library and standard OpenCL headers. This
|
||||||
|
way no local OpenCL development headers or library needs to be present and only
|
||||||
|
OpenCL compatible drivers need to be installed to use OpenCL. If this is not
|
||||||
|
desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`.
|
||||||
|
|
||||||
If you are compiling with HIP, note that before running CMake you will have to
|
If you are compiling with HIP, note that before running CMake you will have to
|
||||||
set appropriate environment variables. Some variables such as
|
set appropriate environment variables. Some variables such as
|
||||||
:code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc`
|
:code:`HCC_AMDGPU_TARGET` (for ROCm <= 4.0) or :code:`CUDA_PATH` are necessary for :code:`hipcc`
|
||||||
and the linker to work correctly.
|
and the linker to work correctly.
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
# AMDGPU target
|
# AMDGPU target (ROCm <= 4.0)
|
||||||
export HIP_PLATFORM=hcc
|
export HIP_PLATFORM=hcc
|
||||||
export HCC_AMDGPU_TARGET=gfx906
|
export HCC_AMDGPU_TARGET=gfx906
|
||||||
cmake -D PKG_GPU=on -D GPU_API=HIP -D HIP_ARCH=gfx906 -D CMAKE_CXX_COMPILER=hipcc ..
|
cmake -D PKG_GPU=on -D GPU_API=HIP -D HIP_ARCH=gfx906 -D CMAKE_CXX_COMPILER=hipcc ..
|
||||||
make -j 4
|
make -j 4
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
# AMDGPU target (ROCm >= 4.1)
|
||||||
|
export HIP_PLATFORM=amd
|
||||||
|
cmake -D PKG_GPU=on -D GPU_API=HIP -D HIP_ARCH=gfx906 -D CMAKE_CXX_COMPILER=hipcc ..
|
||||||
|
make -j 4
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
# CUDA target (not recommended, use GPU_ARCH=cuda)
|
# CUDA target (not recommended, use GPU_ARCH=cuda)
|
||||||
@ -219,11 +232,20 @@ Makefile if desired:
|
|||||||
* ``CUDA_PRECISION`` = precision (double, mixed, single)
|
* ``CUDA_PRECISION`` = precision (double, mixed, single)
|
||||||
* ``EXTRAMAKE`` = which Makefile.lammps.\* file to copy to Makefile.lammps
|
* ``EXTRAMAKE`` = which Makefile.lammps.\* file to copy to Makefile.lammps
|
||||||
|
|
||||||
The file Makefile.linux_multi is set up to include support for multiple
|
The file Makefile.cuda is set up to include support for multiple
|
||||||
GPU architectures as supported by the CUDA toolkit in use. This is done
|
GPU architectures as supported by the CUDA toolkit in use. This is done
|
||||||
through using the "--gencode " flag, which can be used multiple times and
|
through using the "--gencode " flag, which can be used multiple times and
|
||||||
thus support all GPU architectures supported by your CUDA compiler.
|
thus support all GPU architectures supported by your CUDA compiler.
|
||||||
|
|
||||||
|
To enable GPU binning via CUDA performance primitives set the Makefile variable
|
||||||
|
``CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini``. This should **not** be used with
|
||||||
|
most modern GPUs.
|
||||||
|
|
||||||
|
To support the CUDA multiprocessor server you can set the define
|
||||||
|
``-DCUDA_PROXY``. Please note that in this case you must **not** use
|
||||||
|
the CUDA performance primitives and thus set the variable ``CUDPP_OPT``
|
||||||
|
to empty.
|
||||||
|
|
||||||
If the library build is successful, 3 files should be created:
|
If the library build is successful, 3 files should be created:
|
||||||
``lib/gpu/libgpu.a``\ , ``lib/gpu/nvc_get_devices``\ , and
|
``lib/gpu/libgpu.a``\ , ``lib/gpu/nvc_get_devices``\ , and
|
||||||
``lib/gpu/Makefile.lammps``\ . The latter has settings that enable LAMMPS
|
``lib/gpu/Makefile.lammps``\ . The latter has settings that enable LAMMPS
|
||||||
@ -250,18 +272,18 @@ To build with this package, the KIM library with API v2 must be downloaded
|
|||||||
and built on your system. It must include the KIM models that you want to
|
and built on your system. It must include the KIM models that you want to
|
||||||
use with LAMMPS.
|
use with LAMMPS.
|
||||||
|
|
||||||
If you would like to use the :doc:`kim_query <kim_commands>`
|
If you would like to use the :doc:`kim query <kim_commands>`
|
||||||
command, you also need to have libcurl installed with the matching
|
command, you also need to have libcurl installed with the matching
|
||||||
development headers and the curl-config tool.
|
development headers and the curl-config tool.
|
||||||
|
|
||||||
If you would like to use the :doc:`kim_property <kim_commands>`
|
If you would like to use the :doc:`kim property <kim_commands>`
|
||||||
command, you need to build LAMMPS with the PYTHON package installed
|
command, you need to build LAMMPS with the PYTHON package installed
|
||||||
and linked to Python 3.6 or later. See the :ref:`PYTHON package build info <python>`
|
and linked to Python 3.6 or later. See the :ref:`PYTHON package build info <python>`
|
||||||
for more details on this. After successfully building LAMMPS with Python, you
|
for more details on this. After successfully building LAMMPS with Python, you
|
||||||
also need to install the kim-property Python package, which can be easily done using
|
also need to install the ``kim-property`` Python package, which can be easily
|
||||||
*pip* as ``pip install kim-property``, or from the *conda-forge* channel as
|
done using *pip* as ``pip install kim-property``, or from the *conda-forge*
|
||||||
``conda install kim-property`` if LAMMPS is built in Conda. More detailed
|
channel as ``conda install kim-property`` if LAMMPS is built in Conda. More
|
||||||
information is available at:
|
detailed information is available at:
|
||||||
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
||||||
|
|
||||||
In addition to installing the KIM API, it is also necessary to install the
|
In addition to installing the KIM API, it is also necessary to install the
|
||||||
@ -301,7 +323,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
|
|
||||||
You can download and build the KIM library manually if you prefer;
|
You can download and build the KIM library manually if you prefer;
|
||||||
follow the instructions in ``lib/kim/README``. You can also do
|
follow the instructions in ``lib/kim/README``. You can also do
|
||||||
this in one step from the lammps/src dir, using a command like
|
this in one step from the lammps/src directory, using a command like
|
||||||
these, which simply invoke the ``lib/kim/Install.py`` script with
|
these, which simply invoke the ``lib/kim/Install.py`` script with
|
||||||
the specified args.
|
the specified args.
|
||||||
|
|
||||||
@ -321,7 +343,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
|
|
||||||
.. code-block:: make
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLMP_NO_SSL_CHECK
|
LMP_INC = -DLMP_NO_SSL_CHECK
|
||||||
|
|
||||||
Debugging OpenKIM web queries in LAMMPS
|
Debugging OpenKIM web queries in LAMMPS
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -369,10 +391,11 @@ Enabling the extra unit tests have some requirements,
|
|||||||
Conda. More detailed information is available at:
|
Conda. More detailed information is available at:
|
||||||
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
|
||||||
* It is also necessary to install
|
* It is also necessary to install
|
||||||
``EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000``, and
|
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
||||||
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`` KIM models.
|
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
||||||
|
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
||||||
to learn how to install a pre-build binary of the OpenKIM Repository of
|
to learn how to install a pre-built binary of the OpenKIM Repository of
|
||||||
Models or see
|
Models or see
|
||||||
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
||||||
to learn how to install the specific KIM models.
|
to learn how to install the specific KIM models.
|
||||||
|
|||||||
@ -20,16 +20,8 @@ the suffix ``.so.0`` (or some other number).
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Care should be taken to use the same MPI library for the calling code
|
Care should be taken to use the same MPI library for the calling code
|
||||||
and the LAMMPS library. The ``library.h`` file includes ``mpi.h``
|
and the LAMMPS library unless LAMMPS is to be compiled without (real)
|
||||||
and uses definitions from it so those need to be available and
|
MPI support using the include STUBS MPI library.
|
||||||
consistent. When LAMMPS is compiled with the included STUBS MPI
|
|
||||||
library, then its ``mpi.h`` file needs to be included. While it is
|
|
||||||
technically possible to use a full MPI library in the calling code
|
|
||||||
and link to a serial LAMMPS library compiled with MPI STUBS, it is
|
|
||||||
recommended to use the *same* MPI library for both, and then use
|
|
||||||
``MPI_Comm_split()`` in the calling code to pass a suitable
|
|
||||||
communicator with a subset of MPI ranks to the function creating the
|
|
||||||
LAMMPS instance.
|
|
||||||
|
|
||||||
Link with LAMMPS as a static library
|
Link with LAMMPS as a static library
|
||||||
------------------------------------
|
------------------------------------
|
||||||
@ -110,7 +102,7 @@ executable, that are also required to link the LAMMPS executable.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
gcc -c -O -I${HOME}/lammps/src -caller.c
|
||||||
g++ -o caller caller.o -L${HOME}/lammps/lib/poems \
|
g++ -o caller caller.o -L${HOME}/lammps/lib/poems \
|
||||||
-L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src \
|
-L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src \
|
||||||
-llammps_serial -lpoems -lmpi_stubs
|
-llammps_serial -lpoems -lmpi_stubs
|
||||||
@ -174,7 +166,7 @@ the POEMS package installed becomes:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
gcc -c -O -I${HOME}/lammps/src -caller.c
|
||||||
g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial
|
g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial
|
||||||
|
|
||||||
Locating liblammps.so at runtime
|
Locating liblammps.so at runtime
|
||||||
|
|||||||
@ -74,7 +74,11 @@ For the documentation build a python virtual environment is set up in
|
|||||||
the folder ``doc/docenv`` and various python packages are installed into
|
the folder ``doc/docenv`` and various python packages are installed into
|
||||||
that virtual environment via the ``pip`` tool. For rendering embedded
|
that virtual environment via the ``pip`` tool. For rendering embedded
|
||||||
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ JavaScript
|
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ JavaScript
|
||||||
engine needs to be downloaded.
|
engine needs to be downloaded. If you need to pass additional options
|
||||||
|
to the pip commands to work (e.g. to use a web proxy or to point to
|
||||||
|
additional SSL certificates) you can set them via the ``PIP_OPTIONS``
|
||||||
|
environment variable or uncomment and edit the ``PIP_OPTIONS`` setting
|
||||||
|
at beginning of the makefile.
|
||||||
|
|
||||||
The actual translation is then done via ``make`` commands in the doc
|
The actual translation is then done via ``make`` commands in the doc
|
||||||
folder. The following ``make`` commands are available:
|
folder. The following ``make`` commands are available:
|
||||||
@ -108,7 +112,10 @@ installation of the HTML manual pages into the "install" step when
|
|||||||
installing LAMMPS after the CMake build via ``cmake --build . --target
|
installing LAMMPS after the CMake build via ``cmake --build . --target
|
||||||
install``. The documentation build is included in the default build
|
install``. The documentation build is included in the default build
|
||||||
target, but can also be requested independently with
|
target, but can also be requested independently with
|
||||||
``cmake --build . --target doc``.
|
``cmake --build . --target doc``. If you need to pass additional options
|
||||||
|
to the pip commands to work (e.g. to use a web proxy or to point to
|
||||||
|
additional SSL certificates) you can set them via the ``PIP_OPTIONS``
|
||||||
|
environment variable.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|||||||
@ -60,11 +60,7 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`include <include>`
|
* :doc:`include <include>`
|
||||||
* :doc:`info <info>`
|
* :doc:`info <info>`
|
||||||
* :doc:`jump <jump>`
|
* :doc:`jump <jump>`
|
||||||
* :doc:`kim_init <kim_commands>`
|
* :doc:`kim <kim_commands>`
|
||||||
* :doc:`kim_interactions <kim_commands>`
|
|
||||||
* :doc:`kim_param <kim_commands>`
|
|
||||||
* :doc:`kim_property <kim_commands>`
|
|
||||||
* :doc:`kim_query <kim_commands>`
|
|
||||||
* :doc:`kspace_modify <kspace_modify>`
|
* :doc:`kspace_modify <kspace_modify>`
|
||||||
* :doc:`kspace_style <kspace_style>`
|
* :doc:`kspace_style <kspace_style>`
|
||||||
* :doc:`label <label>`
|
* :doc:`label <label>`
|
||||||
@ -90,6 +86,7 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`pair_style <pair_style>`
|
* :doc:`pair_style <pair_style>`
|
||||||
* :doc:`pair_write <pair_write>`
|
* :doc:`pair_write <pair_write>`
|
||||||
* :doc:`partition <partition>`
|
* :doc:`partition <partition>`
|
||||||
|
* :doc:`plugin <plugin>`
|
||||||
* :doc:`prd <prd>`
|
* :doc:`prd <prd>`
|
||||||
* :doc:`print <print>`
|
* :doc:`print <print>`
|
||||||
* :doc:`processors <processors>`
|
* :doc:`processors <processors>`
|
||||||
|
|||||||
@ -126,7 +126,7 @@ OPT.
|
|||||||
* :doc:`quadratic (o) <dihedral_quadratic>`
|
* :doc:`quadratic (o) <dihedral_quadratic>`
|
||||||
* :doc:`spherical <dihedral_spherical>`
|
* :doc:`spherical <dihedral_spherical>`
|
||||||
* :doc:`table (o) <dihedral_table>`
|
* :doc:`table (o) <dihedral_table>`
|
||||||
* :doc:`table/cut <dihedral_table_cut>`
|
* :doc:`table/cut <dihedral_table>`
|
||||||
|
|
||||||
.. _improper:
|
.. _improper:
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ OPT.
|
|||||||
* :doc:`nph/eff <fix_nh_eff>`
|
* :doc:`nph/eff <fix_nh_eff>`
|
||||||
* :doc:`nph/sphere (o) <fix_nph_sphere>`
|
* :doc:`nph/sphere (o) <fix_nph_sphere>`
|
||||||
* :doc:`nphug <fix_nphug>`
|
* :doc:`nphug <fix_nphug>`
|
||||||
* :doc:`npt (iko) <fix_nh>`
|
* :doc:`npt (giko) <fix_nh>`
|
||||||
* :doc:`npt/asphere (o) <fix_npt_asphere>`
|
* :doc:`npt/asphere (o) <fix_npt_asphere>`
|
||||||
* :doc:`npt/body <fix_npt_body>`
|
* :doc:`npt/body <fix_npt_body>`
|
||||||
* :doc:`npt/cauchy <fix_npt_cauchy>`
|
* :doc:`npt/cauchy <fix_npt_cauchy>`
|
||||||
@ -122,8 +122,8 @@ OPT.
|
|||||||
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
||||||
* :doc:`npt/uef <fix_nh_uef>`
|
* :doc:`npt/uef <fix_nh_uef>`
|
||||||
* :doc:`numdiff <fix_numdiff>`
|
* :doc:`numdiff <fix_numdiff>`
|
||||||
* :doc:`nve (iko) <fix_nve>`
|
* :doc:`nve (giko) <fix_nve>`
|
||||||
* :doc:`nve/asphere (i) <fix_nve_asphere>`
|
* :doc:`nve/asphere (gi) <fix_nve_asphere>`
|
||||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
||||||
* :doc:`nve/awpmd <fix_nve_awpmd>`
|
* :doc:`nve/awpmd <fix_nve_awpmd>`
|
||||||
* :doc:`nve/body <fix_nve_body>`
|
* :doc:`nve/body <fix_nve_body>`
|
||||||
@ -138,7 +138,7 @@ OPT.
|
|||||||
* :doc:`nve/spin <fix_nve_spin>`
|
* :doc:`nve/spin <fix_nve_spin>`
|
||||||
* :doc:`nve/tri <fix_nve_tri>`
|
* :doc:`nve/tri <fix_nve_tri>`
|
||||||
* :doc:`nvk <fix_nvk>`
|
* :doc:`nvk <fix_nvk>`
|
||||||
* :doc:`nvt (iko) <fix_nh>`
|
* :doc:`nvt (giko) <fix_nh>`
|
||||||
* :doc:`nvt/asphere (o) <fix_nvt_asphere>`
|
* :doc:`nvt/asphere (o) <fix_nvt_asphere>`
|
||||||
* :doc:`nvt/body <fix_nvt_body>`
|
* :doc:`nvt/body <fix_nvt_body>`
|
||||||
* :doc:`nvt/eff <fix_nh_eff>`
|
* :doc:`nvt/eff <fix_nh_eff>`
|
||||||
|
|||||||
@ -122,7 +122,7 @@ OPT.
|
|||||||
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
||||||
* :doc:`lennard/mdf <pair_mdf>`
|
* :doc:`lennard/mdf <pair_mdf>`
|
||||||
* :doc:`line/lj <pair_line_lj>`
|
* :doc:`line/lj <pair_line_lj>`
|
||||||
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
|
* :doc:`lj/charmm/coul/charmm (giko) <pair_charmm>`
|
||||||
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
||||||
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
||||||
* :doc:`lj/charmm/coul/long/soft (o) <pair_fep_soft>`
|
* :doc:`lj/charmm/coul/long/soft (o) <pair_fep_soft>`
|
||||||
@ -163,6 +163,7 @@ OPT.
|
|||||||
* :doc:`lj/long/dipole/long <pair_dipole>`
|
* :doc:`lj/long/dipole/long <pair_dipole>`
|
||||||
* :doc:`lj/long/tip4p/long (o) <pair_lj_long>`
|
* :doc:`lj/long/tip4p/long (o) <pair_lj_long>`
|
||||||
* :doc:`lj/mdf <pair_mdf>`
|
* :doc:`lj/mdf <pair_mdf>`
|
||||||
|
* :doc:`lj/relres (o) <pair_lj_relres>`
|
||||||
* :doc:`lj/sdk (gko) <pair_sdk>`
|
* :doc:`lj/sdk (gko) <pair_sdk>`
|
||||||
* :doc:`lj/sdk/coul/long (go) <pair_sdk>`
|
* :doc:`lj/sdk/coul/long (go) <pair_sdk>`
|
||||||
* :doc:`lj/sdk/coul/msm (o) <pair_sdk>`
|
* :doc:`lj/sdk/coul/msm (o) <pair_sdk>`
|
||||||
@ -186,7 +187,7 @@ OPT.
|
|||||||
* :doc:`mgpt <pair_mgpt>`
|
* :doc:`mgpt <pair_mgpt>`
|
||||||
* :doc:`mie/cut (g) <pair_mie>`
|
* :doc:`mie/cut (g) <pair_mie>`
|
||||||
* :doc:`mliap <pair_mliap>`
|
* :doc:`mliap <pair_mliap>`
|
||||||
* :doc:`mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>`
|
* :doc:`mm3/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||||
* :doc:`momb <pair_momb>`
|
* :doc:`momb <pair_momb>`
|
||||||
* :doc:`morse (gkot) <pair_morse>`
|
* :doc:`morse (gkot) <pair_morse>`
|
||||||
* :doc:`morse/smooth/linear (o) <pair_morse>`
|
* :doc:`morse/smooth/linear (o) <pair_morse>`
|
||||||
|
|||||||
@ -14,6 +14,7 @@ of time and requests from the LAMMPS user community.
|
|||||||
Developer_flow
|
Developer_flow
|
||||||
Developer_write
|
Developer_write
|
||||||
Developer_notes
|
Developer_notes
|
||||||
|
Developer_plugins
|
||||||
Developer_unittest
|
Developer_unittest
|
||||||
Classes
|
Classes
|
||||||
Developer_utils
|
Developer_utils
|
||||||
|
|||||||
@ -1,11 +1,133 @@
|
|||||||
Notes for Developers and Code Maintainers
|
Notes for developers and code maintainers
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
This section documents how a few large sections of code with LAMMPS
|
This section documents how some of the code functionality within
|
||||||
work at a conceptual level. Comments on code in source files
|
LAMMPS works at a conceptual level. Comments on code in source files
|
||||||
typically document what a variable stores, what a small section of
|
typically document what a variable stores, what a small section of
|
||||||
code does, or what a function does or its input/outputs. The topics
|
code does, or what a function does and its input/outputs. The topics
|
||||||
on this page are intended to document code at a higher level.
|
on this page are intended to document code functionality at a higher level.
|
||||||
|
|
||||||
|
Fix contributions to instantaneous energy, virial, and cumulative energy
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Fixes can calculate contributions to the instantaneous energy and/or
|
||||||
|
virial of the system, both in a global and peratom sense. Fixes that
|
||||||
|
perform thermostatting or barostatting can calculate the cumulative
|
||||||
|
energy they add to or subtract from the system, which is accessed by
|
||||||
|
the *ecouple* and *econserve* thermodynamic keywords. This subsection
|
||||||
|
explains how both work and what flags to set in a new fix to enable
|
||||||
|
this functionality.
|
||||||
|
|
||||||
|
Let's start with thermostatting and barostatting fixes. Examples are
|
||||||
|
the :doc:`fix langevin <fix_langevin>` and :doc:`fix npt <fix_nh>`
|
||||||
|
commands. Here is what the fix needs to do:
|
||||||
|
|
||||||
|
* Set the variable *ecouple_flag* = 1 in the constructor. Also set
|
||||||
|
*scalar_flag* = 1, *extscalar* = 1, and *global_freq* to a timestep
|
||||||
|
increment which matches how often the fix is invoked.
|
||||||
|
* Implement a compute_scalar() method that returns the cumulative
|
||||||
|
energy added or subtracted by the fix, e.g. by rescaling the
|
||||||
|
velocity of atoms. The sign convention is that subtracted energy is
|
||||||
|
positive, added energy is negative. This must be the total energy
|
||||||
|
added to the entire system, i.e. an "extensive" quantity, not a
|
||||||
|
per-atom energy. Cumulative means the summed energy since the fix
|
||||||
|
was instantiated, even across multiple runs. This is because the
|
||||||
|
energy is used by the *econserve* thermodynamic keyword to check
|
||||||
|
that the fix is conserving the total energy of the system,
|
||||||
|
i.e. potential energy + kinetic energy + coupling energy = a
|
||||||
|
constant.
|
||||||
|
|
||||||
|
And here is how the code operates:
|
||||||
|
|
||||||
|
* The Modify class makes a list of all fixes that set *ecouple_flag* = 1.
|
||||||
|
* The :doc:`thermo_style custom <thermo_style>` command defines
|
||||||
|
*ecouple* and *econserve* keywords.
|
||||||
|
* These keywords sum the energy contributions from all the
|
||||||
|
*ecouple_flag* = 1 fixes by invoking the energy_couple() method in
|
||||||
|
the Modify class, which calls the compute_scalar() method of each
|
||||||
|
fix in the list.
|
||||||
|
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Next, here is how a fix contributes to the instantaneous energy and
|
||||||
|
virial of the system. First, it sets any or all of these flags to a
|
||||||
|
value of 1 in their constructor:
|
||||||
|
|
||||||
|
* *energy_global_flag* to contribute to global energy, example: :doc:`fix indent <fix_indent>`
|
||||||
|
* *energy_peratom_flag* to contribute to peratom energy, :doc:`fix cmap <fix_cmap>`
|
||||||
|
* *virial_global_flag* to contribute to global virial, example: :doc:`fix wall <fix_wall>`
|
||||||
|
* *virial_peratom_flag* to contribute to peratom virial, example: :doc:`fix wall <fix_wall>`
|
||||||
|
|
||||||
|
The fix must also do the following:
|
||||||
|
|
||||||
|
* For global energy, implement a compute_scalar() method that returns
|
||||||
|
the energy added or subtracted on this timestep. Here the sign
|
||||||
|
convention is that added energy is positive, subtracted energy is
|
||||||
|
negative.
|
||||||
|
* For peratom energy, invoke the ev_init(eflag,vflag) function each
|
||||||
|
time the fix is invoked, which initializes per-atom energy storage.
|
||||||
|
The value of eflag may need to be stored from an earlier call to the
|
||||||
|
fix during the same timestep. See how the :doc:`fix cmap
|
||||||
|
<fix_cmap>` command does this in src/MOLECULE/fix_cmap.cpp. When an
|
||||||
|
energy for one or more atoms is calculated, invoke the ev_tally()
|
||||||
|
function to tally the contribution to each atom. Both the ev_init()
|
||||||
|
and ev_tally() methods are in the parent Fix class.
|
||||||
|
* For global and/or peratom virial, invoke the v_init(vflag) function
|
||||||
|
each time the fix is invoked, which initializes virial storage.
|
||||||
|
When forces on one or more atoms are calculated, invoke the
|
||||||
|
v_tally() function to tally the contribution. Both the v_init() and
|
||||||
|
v_tally() methods are in the parent Fix class. Note that there are
|
||||||
|
several variants of v_tally(); choose the one appropriate to your
|
||||||
|
fix.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The ev_init() and ev_tally() methods also account for global and
|
||||||
|
peratom virial contributions. Thus you do not need to invoke the
|
||||||
|
v_init() and v_tally() methods, if the fix also calculates peratom
|
||||||
|
energies.
|
||||||
|
|
||||||
|
The fix must also specify whether (by default) to include or exclude
|
||||||
|
these contributions to the global/peratom energy/virial of the system.
|
||||||
|
For the fix to include the contributions, set either of both of these
|
||||||
|
variables in the constructor:
|
||||||
|
|
||||||
|
* *thermo_energy* = 1, for global and peratom energy
|
||||||
|
* *thermo_virial* = 1, for global and peratom virial
|
||||||
|
|
||||||
|
Note that these variables are zeroed in fix.cpp. Thus if you don't
|
||||||
|
set the variables, the contributions will be excluded (by default)
|
||||||
|
|
||||||
|
However, the user has ultimate control over whether to include or
|
||||||
|
exclude the contributions of the fix via the :doc:`fix modify
|
||||||
|
<fix_modify>` command:
|
||||||
|
|
||||||
|
* fix modify *energy yes* to include global and peratom energy contributions
|
||||||
|
* fix modify *virial yes* to include global and peratom virial contributions
|
||||||
|
|
||||||
|
If the fix contributes to any of the global/peratom energy/virial
|
||||||
|
values for the system, it should be explained on the fix doc page,
|
||||||
|
along with the default values for the *energy yes/no* and *virial
|
||||||
|
yes/no* settings of the :doc:`fix modify <fix_modify>` command.
|
||||||
|
|
||||||
|
Finally, these 4 contributions are included in the output of 4
|
||||||
|
computes:
|
||||||
|
|
||||||
|
* global energy in :doc:`compute pe <compute_pe>`
|
||||||
|
* peratom energy in :doc:`compute pe/atom <compute_pe_atom>`
|
||||||
|
* global virial in :doc:`compute pressure <compute_pressure>`
|
||||||
|
* peratom virial in :doc:`compute stress/atom <compute_stress_atom>`
|
||||||
|
|
||||||
|
These computes invoke a method of the Modify class to include
|
||||||
|
contributions from fixes that have the corresponding flags set,
|
||||||
|
e.g. *energy_peratom_flag* and *thermo_energy* for :doc:`compute
|
||||||
|
pe/atom <compute_pe_atom>`.
|
||||||
|
|
||||||
|
Note that each compute has an optional keyword to either include or
|
||||||
|
exclude all contributions from fixes. Also note that :doc:`compute pe
|
||||||
|
<compute_pe>` and :doc:`compute pressure <compute_pressure>` are what
|
||||||
|
is used (by default) by :doc:`thermodynamic output <thermo_style>` to
|
||||||
|
calculate values for its *pe* and *press* keywords.
|
||||||
|
|
||||||
KSpace PPPM FFT grids
|
KSpace PPPM FFT grids
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|||||||
258
doc/src/Developer_plugins.rst
Normal file
258
doc/src/Developer_plugins.rst
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
Writing plugins
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Plugins provide a mechanism to add functionality to a LAMMPS executable
|
||||||
|
without recompiling LAMMPS. The functionality for this and the
|
||||||
|
:doc:`plugin command <plugin>` are implemented in the
|
||||||
|
:ref:`PLUGIN package <PKG-PLUGIN>` which must be installed to use plugins.
|
||||||
|
|
||||||
|
Plugins use the operating system's capability to load dynamic shared
|
||||||
|
object (DSO) files in a way similar shared libraries and then reference
|
||||||
|
specific functions in those DSOs. Any DSO file with plugins has to include
|
||||||
|
an initialization function with a specific name, "lammpsplugin_init", that
|
||||||
|
has to follow specific rules described below. When loading the DSO with
|
||||||
|
the "plugin" command, this function is looked up and called and will then
|
||||||
|
register the contained plugin(s) with LAMMPS.
|
||||||
|
|
||||||
|
From the programmer perspective this can work because of the object
|
||||||
|
oriented design of LAMMPS where all pair style commands are derived from
|
||||||
|
the class Pair, all fix style commands from the class Fix and so on and
|
||||||
|
usually only functions present in those base classes are called
|
||||||
|
directly. When a :doc:`pair_style` command or :doc:`fix` command is
|
||||||
|
issued a new instance of such a derived class is created. This is done
|
||||||
|
by a so-called factory function which is mapped to the style name. Thus
|
||||||
|
when, for example, the LAMMPS processes the command ``pair_style lj/cut
|
||||||
|
2.5``, LAMMPS will look up the factory function for creating the
|
||||||
|
``PairLJCut`` class and then execute it. The return value of that
|
||||||
|
function is a ``Pair *`` pointer and the pointer will be assigned to the
|
||||||
|
location for the currently active pair style.
|
||||||
|
|
||||||
|
A DSO file with a plugin thus has to implement such a factory function
|
||||||
|
and register it with LAMMPS so that it gets added to the map of available
|
||||||
|
styles of the given category. To register a plugin with LAMMPS an
|
||||||
|
initialization function has to be present in the DSO file called
|
||||||
|
``lammpsplugin_init`` which is called with three ``void *`` arguments:
|
||||||
|
a pointer to the current LAMMPS instance, a pointer to the opened DSO
|
||||||
|
handle, and a pointer to the registration function. The registration
|
||||||
|
function takes two arguments: a pointer to a ``lammpsplugin_t`` struct
|
||||||
|
with information about the plugin and a pointer to the current LAMMPS
|
||||||
|
instance. Please see below for an example of how the registration is
|
||||||
|
done.
|
||||||
|
|
||||||
|
Members of ``lammpsplugin_t``
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: auto
|
||||||
|
|
||||||
|
* - Member
|
||||||
|
- Description
|
||||||
|
* - version
|
||||||
|
- LAMMPS Version string the plugin was compiled for
|
||||||
|
* - style
|
||||||
|
- Style of the plugin (pair, bond, fix, command, etc.)
|
||||||
|
* - name
|
||||||
|
- Name of the plugin style
|
||||||
|
* - info
|
||||||
|
- String with information about the plugin
|
||||||
|
* - author
|
||||||
|
- String with the name and email of the author
|
||||||
|
* - creator.v1
|
||||||
|
- Pointer to factory function for pair, bond, angle, dihedral, or improper styles
|
||||||
|
* - creator.v2
|
||||||
|
- Pointer to factory function for compute, fix, or region styles
|
||||||
|
* - creator.v3
|
||||||
|
- Pointer to factory function for command styles
|
||||||
|
* - handle
|
||||||
|
- Pointer to the open DSO file handle
|
||||||
|
|
||||||
|
Only one of the three alternate creator entries can be used at a time
|
||||||
|
and which of those is determined by the style of plugin. The "creator.v1"
|
||||||
|
element is for factory functions of supported styles computing forces (i.e.
|
||||||
|
pair, bond, angle, dihedral, or improper styles) and the function takes
|
||||||
|
as single argument the pointer to the LAMMPS instance. The factory function
|
||||||
|
is cast to the ``lammpsplugin_factory1`` type before assignment. The
|
||||||
|
"creator.v2" element is for factory functions creating an instance of
|
||||||
|
a fix, compute, or region style and takes three arguments: a pointer to
|
||||||
|
the LAMMPS instance, an integer with the length of the argument list and
|
||||||
|
a ``char **`` pointer to the list of arguments. The factory function pointer
|
||||||
|
needs to be cast to the ``lammpsplugin_factory2`` type before assignment.
|
||||||
|
The "creator.v3" element takes the same arguments as "creator.v3" but is
|
||||||
|
specific to creating command styles: the factory function has to instantiate
|
||||||
|
the command style locally passing the LAMMPS pointer as argument and then
|
||||||
|
call its "command" member function with the number and list of arguments.
|
||||||
|
The factory function pointer needs to be cast to the
|
||||||
|
``lammpsplugin_factory3`` type before assignment.
|
||||||
|
|
||||||
|
Pair style example
|
||||||
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
As an example, a hypothetical pair style plugin "morse2" implemented in
|
||||||
|
a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
||||||
|
``pair_morse2.cpp`` with the factory function and initialization
|
||||||
|
function would look like this:
|
||||||
|
|
||||||
|
.. code-block:: C++
|
||||||
|
|
||||||
|
#include "lammpsplugin.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "pair_morse2.h"
|
||||||
|
|
||||||
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
static Pair *morse2creator(LAMMPS *lmp)
|
||||||
|
{
|
||||||
|
return new PairMorse2(lmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
|
{
|
||||||
|
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||||
|
lammpsplugin_t plugin;
|
||||||
|
|
||||||
|
plugin.version = LAMMPS_VERSION;
|
||||||
|
plugin.style = "pair";
|
||||||
|
plugin.name = "morse2";
|
||||||
|
plugin.info = "Morse2 variant pair style v1.0";
|
||||||
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
|
plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2creator;
|
||||||
|
plugin.handle = handle;
|
||||||
|
(*register_plugin)(&plugin,lmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
The factory function in this example is called ``morse2creator()``. It
|
||||||
|
receives a pointer to the LAMMPS class as only argument and thus has to
|
||||||
|
be assigned to the *creator.v1* member of the plugin struct and cast to the
|
||||||
|
``lammpsplugin_factory1`` pointer type. It returns a
|
||||||
|
pointer to the allocated class instance derived from the ``Pair`` class.
|
||||||
|
This function may be declared static to avoid clashes with other plugins.
|
||||||
|
The name of the derived class, ``PairMorse2``, must be unique inside
|
||||||
|
the entire LAMMPS executable.
|
||||||
|
|
||||||
|
Fix style example
|
||||||
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
If the factory function would be for a fix or compute, which take three
|
||||||
|
arguments (a pointer to the LAMMPS class, the number of arguments and the
|
||||||
|
list of argument strings), then the pointer type is ``lammpsplugin_factory2``
|
||||||
|
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||||
|
Below is an example for that:
|
||||||
|
|
||||||
|
.. code-block:: C++
|
||||||
|
|
||||||
|
#include "lammpsplugin.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "fix_nve2.h"
|
||||||
|
|
||||||
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
static Fix *nve2creator(LAMMPS *lmp, int argc, char **argv)
|
||||||
|
{
|
||||||
|
return new FixNVE2(lmp,argc,argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
|
{
|
||||||
|
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||||
|
lammpsplugin_t plugin;
|
||||||
|
|
||||||
|
plugin.version = LAMMPS_VERSION;
|
||||||
|
plugin.style = "fix";
|
||||||
|
plugin.name = "nve2";
|
||||||
|
plugin.info = "NVE2 variant fix style v1.0";
|
||||||
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
|
plugin.creator.v2 = (lammpsplugin_factory2 *) &nve2creator;
|
||||||
|
plugin.handle = handle;
|
||||||
|
(*register_plugin)(&plugin,lmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
Command style example
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
For command styles there is a third variant of factory function as
|
||||||
|
demonstrated in the following example, which also shows that the
|
||||||
|
implementation of the plugin class may also be within the same
|
||||||
|
file as the plugin interface code:
|
||||||
|
|
||||||
|
.. code-block:: C++
|
||||||
|
|
||||||
|
#include "lammpsplugin.h"
|
||||||
|
|
||||||
|
#include "comm.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "pointers.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
|
class Hello : protected Pointers {
|
||||||
|
public:
|
||||||
|
Hello(class LAMMPS *lmp) : Pointers(lmp) {};
|
||||||
|
void command(int, char **);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
void Hello::command(int argc, char **argv)
|
||||||
|
{
|
||||||
|
if (argc != 1) error->all(FLERR,"Illegal hello command");
|
||||||
|
if (comm->me == 0)
|
||||||
|
utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hellocreator(LAMMPS *lmp, int argc, char **argv)
|
||||||
|
{
|
||||||
|
Hello hello(lmp);
|
||||||
|
hello.command(argc,argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
|
{
|
||||||
|
lammpsplugin_t plugin;
|
||||||
|
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||||
|
|
||||||
|
plugin.version = LAMMPS_VERSION;
|
||||||
|
plugin.style = "command";
|
||||||
|
plugin.name = "hello";
|
||||||
|
plugin.info = "Hello world command v1.0";
|
||||||
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
|
plugin.creator.v3 = (lammpsplugin_factory3 *) &hellocreator;
|
||||||
|
plugin.handle = handle;
|
||||||
|
(*register_plugin)(&plugin,lmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
Additional Details
|
||||||
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The initialization function **must** be called ``lammpsplugin_init``, it
|
||||||
|
**must** have C bindings and it takes three void pointers as arguments.
|
||||||
|
The first is a pointer to the LAMMPS class that calls it and it needs to
|
||||||
|
be passed to the registration function. The second argument is a
|
||||||
|
pointer to the internal handle of the DSO file, this needs to be added
|
||||||
|
to the plugin info struct, so that the DSO can be closed and unloaded
|
||||||
|
when all its contained plugins are unloaded. The third argument is a
|
||||||
|
function pointer to the registration function and needs to be stored
|
||||||
|
in a variable of ``lammpsplugin_regfunc`` type and then called with a
|
||||||
|
pointer to the ``lammpsplugin_t`` struct and the pointer to the LAMMPS
|
||||||
|
instance as arguments to register a single plugin. There may be multiple
|
||||||
|
calls to multiple plugins in the same initialization function.
|
||||||
|
|
||||||
|
To register a plugin a struct of the ``lammpsplugin_t`` needs to be filled
|
||||||
|
with relevant info: current LAMMPS version string, kind of style, name of
|
||||||
|
style, info string, author string, pointer to factory function, and the
|
||||||
|
DSO handle. The registration function is called with a pointer to the address
|
||||||
|
of this struct and the pointer of the LAMMPS class. The registration function
|
||||||
|
will then add the factory function of the plugin style to the respective
|
||||||
|
style map under the provided name. It will also make a copy of the struct
|
||||||
|
in a list of all loaded plugins and update the reference counter for loaded
|
||||||
|
plugins from this specific DSO file.
|
||||||
|
|
||||||
|
The pair style itself (i.e. the PairMorse2 class in this example) can be
|
||||||
|
written just like any other pair style that is included in LAMMPS. For
|
||||||
|
a plugin, the use of the ``PairStyle`` macro in the section encapsulated
|
||||||
|
by ``#ifdef PAIR_CLASS`` is not needed, since the mapping of the class
|
||||||
|
name to the style name is done by the plugin registration function with
|
||||||
|
the information from the ``lammpsplugin_t`` struct. It may be included
|
||||||
|
in case the new code is intended to be later included in LAMMPS directly.
|
||||||
@ -4,10 +4,10 @@ Adding tests for unit testing
|
|||||||
This section discusses adding or expanding tests for the unit test
|
This section discusses adding or expanding tests for the unit test
|
||||||
infrastructure included into the LAMMPS source code distribution.
|
infrastructure included into the LAMMPS source code distribution.
|
||||||
Unlike example inputs, unit tests focus on testing the "local" behavior
|
Unlike example inputs, unit tests focus on testing the "local" behavior
|
||||||
of individual features, tend to run very fast, and should be set up to
|
of individual features, tend to run fast, and should be set up to cover
|
||||||
cover as much of the added code as possible. When contributing code to
|
as much of the added code as possible. When contributing code to the
|
||||||
the distribution, the LAMMPS developers will appreciate if additions
|
distribution, the LAMMPS developers will appreciate if additions to the
|
||||||
to the integrated unit test facility are included.
|
integrated unit test facility are included.
|
||||||
|
|
||||||
Given the complex nature of MD simulations where many operations can
|
Given the complex nature of MD simulations where many operations can
|
||||||
only be performed when suitable "real" simulation environment has been
|
only be performed when suitable "real" simulation environment has been
|
||||||
@ -50,6 +50,9 @@ available:
|
|||||||
* - File name:
|
* - File name:
|
||||||
- Test name:
|
- Test name:
|
||||||
- Description:
|
- Description:
|
||||||
|
* - ``test_argutils.cpp``
|
||||||
|
- ArgInfo
|
||||||
|
- Tests for ``ArgInfo`` class used by LAMMPS
|
||||||
* - ``test_fmtlib.cpp``
|
* - ``test_fmtlib.cpp``
|
||||||
- FmtLib
|
- FmtLib
|
||||||
- Tests for ``fmtlib::`` functions used by LAMMPS
|
- Tests for ``fmtlib::`` functions used by LAMMPS
|
||||||
@ -155,23 +158,27 @@ have the desired effect:
|
|||||||
{
|
{
|
||||||
ASSERT_EQ(lmp->update->ntimestep, 0);
|
ASSERT_EQ(lmp->update->ntimestep, 0);
|
||||||
|
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
BEGIN_HIDE_OUTPUT();
|
||||||
lmp->input->one("reset_timestep 10");
|
command("reset_timestep 10");
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
END_HIDE_OUTPUT();
|
||||||
ASSERT_EQ(lmp->update->ntimestep, 10);
|
ASSERT_EQ(lmp->update->ntimestep, 10);
|
||||||
|
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
BEGIN_HIDE_OUTPUT();
|
||||||
lmp->input->one("reset_timestep 0");
|
command("reset_timestep 0");
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
END_HIDE_OUTPUT();
|
||||||
ASSERT_EQ(lmp->update->ntimestep, 0);
|
ASSERT_EQ(lmp->update->ntimestep, 0);
|
||||||
|
|
||||||
|
TEST_FAILURE(".*ERROR: Timestep must be >= 0.*", command("reset_timestep -10"););
|
||||||
|
TEST_FAILURE(".*ERROR: Illegal reset_timestep .*", command("reset_timestep"););
|
||||||
|
TEST_FAILURE(".*ERROR: Illegal reset_timestep .*", command("reset_timestep 10 10"););
|
||||||
|
TEST_FAILURE(".*ERROR: Expected integer .*", command("reset_timestep xxx"););
|
||||||
}
|
}
|
||||||
|
|
||||||
Please note the use of the (global) verbose variable to control whether
|
Please note the use of the ``BEGIN_HIDE_OUTPUT`` and ``END_HIDE_OUTPUT``
|
||||||
the LAMMPS command will be silent by capturing the output or not. In
|
functions that will capture output from running LAMMPS. This is normally
|
||||||
the default case, verbose == false, the test output will be compact and
|
discarded but by setting the verbose flag (via setting the ``TEST_ARGS``
|
||||||
not mixed with LAMMPS output. However setting the verbose flag (via
|
environment variable, ``TEST_ARGS=-v``) it can be printed and used to
|
||||||
setting the ``TEST_ARGS`` environment variable, ``TEST_ARGS=-v``) can be
|
understand why tests fail unexpectedly.
|
||||||
helpful to understand why tests fail unexpectedly.
|
|
||||||
|
|
||||||
Another complexity of these tests stems from the need to capture
|
Another complexity of these tests stems from the need to capture
|
||||||
situations where LAMMPS will stop with an error, i.e. handle so-called
|
situations where LAMMPS will stop with an error, i.e. handle so-called
|
||||||
@ -210,6 +217,12 @@ The following test programs are currently available:
|
|||||||
* - ``test_lattice_region.cpp``
|
* - ``test_lattice_region.cpp``
|
||||||
- LatticeRegion
|
- LatticeRegion
|
||||||
- Tests to validate the :doc:`lattice <lattice>` and :doc:`region <region>` commands
|
- Tests to validate the :doc:`lattice <lattice>` and :doc:`region <region>` commands
|
||||||
|
* - ``test_groups.cpp``
|
||||||
|
- GroupTest
|
||||||
|
- Tests to validate the :doc:`group <group>` command
|
||||||
|
* - ``test_variables.cpp``
|
||||||
|
- VariableTest
|
||||||
|
- Tests to validate the :doc:`variable <variable>` command
|
||||||
* - ``test_kim_commands.cpp``
|
* - ``test_kim_commands.cpp``
|
||||||
- KimCommands
|
- KimCommands
|
||||||
- Tests for several commands from the :ref:`KIM package <PKG-KIM>`
|
- Tests for several commands from the :ref:`KIM package <PKG-KIM>`
|
||||||
|
|||||||
@ -101,9 +101,15 @@ and parsing files or arguments.
|
|||||||
.. doxygenfunction:: split_words
|
.. doxygenfunction:: split_words
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
|
.. doxygenfunction:: split_lines
|
||||||
|
:project: progguide
|
||||||
|
|
||||||
.. doxygenfunction:: strmatch
|
.. doxygenfunction:: strmatch
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
|
.. doxygenfunction:: strfind
|
||||||
|
:project: progguide
|
||||||
|
|
||||||
.. doxygenfunction:: is_integer
|
.. doxygenfunction:: is_integer
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,7 @@ documentation for the formula it computes.
|
|||||||
* :doc:`bond_style <bond_harmonic>` harmonic
|
* :doc:`bond_style <bond_harmonic>` harmonic
|
||||||
* :doc:`bond_style <bond_morse>` morse
|
* :doc:`bond_style <bond_morse>` morse
|
||||||
|
|
||||||
|
* :doc:`angle_style <angle_cosine_squared>` cosine/squared
|
||||||
* :doc:`angle_style <angle_harmonic>` harmonic
|
* :doc:`angle_style <angle_harmonic>` harmonic
|
||||||
* :doc:`angle_style <angle_cosine>` cosine
|
* :doc:`angle_style <angle_cosine>` cosine
|
||||||
* :doc:`angle_style <angle_cosine_periodic>` cosine/periodic
|
* :doc:`angle_style <angle_cosine_periodic>` cosine/periodic
|
||||||
|
|||||||
@ -296,6 +296,8 @@ Some common CMake variables
|
|||||||
- Description
|
- Description
|
||||||
* - ``CMAKE_INSTALL_PREFIX``
|
* - ``CMAKE_INSTALL_PREFIX``
|
||||||
- root directory of install location for ``make install`` (default: ``$HOME/.local``)
|
- root directory of install location for ``make install`` (default: ``$HOME/.local``)
|
||||||
|
* - ``LAMMPS_INSTALL_RPATH``
|
||||||
|
- set or remove runtime path setting from binaries for ``make install`` (default: ``off``)
|
||||||
* - ``CMAKE_BUILD_TYPE``
|
* - ``CMAKE_BUILD_TYPE``
|
||||||
- controls compilation options:
|
- controls compilation options:
|
||||||
one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel``
|
one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel``
|
||||||
@ -409,10 +411,10 @@ interface (``ccmake`` or ``cmake-gui``).
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Using a preset to select a compiler package (``clang.cmake``,
|
Using a preset to select a compiler package (``clang.cmake``,
|
||||||
``gcc.cmake``, or ``intel.cmake``) are an exception to the option
|
``gcc.cmake``, ``intel.cmake``, ``oneapi.cmake``, or ``pgi.cmake``)
|
||||||
of updating the configuration incrementally, as they will trigger
|
are an exception to the mechanism of updating the configuration incrementally,
|
||||||
a reset of cached internal CMake settings and thus reset them to
|
as they will trigger a reset of cached internal CMake settings and thus
|
||||||
their default values.
|
reset settings to their default values.
|
||||||
|
|
||||||
Compilation and build targets
|
Compilation and build targets
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|||||||
@ -18,12 +18,13 @@ This compute
|
|||||||
|
|
||||||
calculates rotational kinetic energy which can be :doc:`output with thermodynamic info <Howto_output>`.
|
calculates rotational kinetic energy which can be :doc:`output with thermodynamic info <Howto_output>`.
|
||||||
|
|
||||||
Use one of these 3 pair potentials, which compute forces and torques
|
Use one of these 4 pair potentials, which compute forces and torques
|
||||||
between interacting pairs of particles:
|
between interacting pairs of particles:
|
||||||
|
|
||||||
* :doc:`pair_style <pair_style>` gran/history
|
* :doc:`pair_style gran/history <pair_gran>`
|
||||||
* :doc:`pair_style <pair_style>` gran/no_history
|
* :doc:`pair_style gran/no_history <pair_gran>`
|
||||||
* :doc:`pair_style <pair_style>` gran/hertzian
|
* :doc:`pair_style gran/hertzian <pair_gran>`
|
||||||
|
* :doc:`pair_style granular <pair_granular>`
|
||||||
|
|
||||||
These commands implement fix options specific to granular systems:
|
These commands implement fix options specific to granular systems:
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ These commands implement fix options specific to granular systems:
|
|||||||
* :doc:`fix pour <fix_pour>`
|
* :doc:`fix pour <fix_pour>`
|
||||||
* :doc:`fix viscous <fix_viscous>`
|
* :doc:`fix viscous <fix_viscous>`
|
||||||
* :doc:`fix wall/gran <fix_wall_gran>`
|
* :doc:`fix wall/gran <fix_wall_gran>`
|
||||||
|
* :doc:`fix wall/gran/region <fix_wall_gran_region>`
|
||||||
|
|
||||||
The fix style *freeze* zeroes both the force and torque of frozen
|
The fix style *freeze* zeroes both the force and torque of frozen
|
||||||
atoms, and should be used for granular system instead of the fix style
|
atoms, and should be used for granular system instead of the fix style
|
||||||
|
|||||||
@ -86,33 +86,59 @@ check out any other desired branch) first.
|
|||||||
|
|
||||||
Once you have updated your local files with a ``git pull`` (or ``git
|
Once you have updated your local files with a ``git pull`` (or ``git
|
||||||
checkout``), you still need to re-build LAMMPS if any source files have
|
checkout``), you still need to re-build LAMMPS if any source files have
|
||||||
changed. To do this, you should cd to the src directory and type:
|
changed. How to do this depends on the build system you are using.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. tabs::
|
||||||
|
|
||||||
$ make purge # remove any deprecated src files
|
.. tab:: CMake build
|
||||||
$ make package-update # sync package files with src files
|
|
||||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
|
||||||
|
|
||||||
just as described on the :doc:`Apply patch <Install_patch>` page,
|
Change to your build folder and type:
|
||||||
after a patch has been installed.
|
|
||||||
|
|
||||||
.. warning::
|
.. code-block:: bash
|
||||||
|
|
||||||
If you wish to edit/change a src file that is from a
|
cmake . --build
|
||||||
package, you should edit the version of the file inside the package
|
|
||||||
sub-directory with src, then re-install the package. The version in
|
|
||||||
the source directory is merely a copy and will be wiped out if you type "make
|
|
||||||
package-update".
|
|
||||||
|
|
||||||
.. warning::
|
CMake should auto-detect whether it needs to re-run the CMake
|
||||||
|
configuration step and otherwise redo the build for all files
|
||||||
|
that have been changed or files that depend on changed files.
|
||||||
|
In case some build options have been changed or renamed, you
|
||||||
|
may have to update those by running:
|
||||||
|
|
||||||
The GitHub servers support both the "git://" and
|
.. code-block:: bash
|
||||||
"https://" access protocols for anonymous read-only access. If you
|
|
||||||
have a correspondingly configured GitHub account, you may also use
|
|
||||||
SSH access with the URL "git@github.com:lammps/lammps.git".
|
|
||||||
|
|
||||||
The LAMMPS GitHub project is managed by Christoph Junghans (LANL,
|
cmake .
|
||||||
junghans at lanl.gov), Axel Kohlmeyer (Temple U, akohlmey at
|
|
||||||
gmail.com) and Richard Berger (Temple U, richard.berger at
|
and then rebuild.
|
||||||
temple.edu).
|
|
||||||
|
.. tab:: Traditional make
|
||||||
|
|
||||||
|
Switch to the src directory and type:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make purge # remove any deprecated src files
|
||||||
|
$ make package-update # sync package files with src files
|
||||||
|
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||||
|
|
||||||
|
Just as described on the :doc:`Apply patch <Install_patch>` page,
|
||||||
|
after a patch has been installed.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
If you wish to edit/change a src file that is from a package,
|
||||||
|
you should edit the version of the file inside the package
|
||||||
|
sub-directory with src, then re-install the package. The
|
||||||
|
version in the source directory is merely a copy and will be
|
||||||
|
wiped out if you type "make package-update".
|
||||||
|
|
||||||
|
.. admonition:: Git protocols
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
The servers at github.com support the "git://" and "https://" access
|
||||||
|
protocols for anonymous, read-only access. If you have a suitably
|
||||||
|
configured GitHub account, you may also use SSH protocol with the
|
||||||
|
URL "git@github.com:lammps/lammps.git".
|
||||||
|
|
||||||
|
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
||||||
|
(Temple U, akohlmey at gmail.com) and Richard Berger (Temple U,
|
||||||
|
richard.berger at temple.edu).
|
||||||
|
|||||||
@ -43,24 +43,54 @@ up to date.
|
|||||||
* A list of updated files print out to the screen. The -b switch
|
* A list of updated files print out to the screen. The -b switch
|
||||||
creates backup files of your originals (e.g. src/force.cpp.orig), so
|
creates backup files of your originals (e.g. src/force.cpp.orig), so
|
||||||
you can manually undo the patch if something goes wrong.
|
you can manually undo the patch if something goes wrong.
|
||||||
* Type the following from the src directory, to enforce consistency
|
|
||||||
between the src and package directories. This is OK to do even if you
|
|
||||||
don't use one or more packages. If you are applying several patches
|
|
||||||
successively, you only need to type this once at the end. The purge
|
|
||||||
command removes deprecated src files if any were removed by the patch
|
|
||||||
from package sub-directories.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
* Once you have updated your local files you need to re-build LAMMPS.
|
||||||
|
If you are applying several patches successively, you only need to
|
||||||
|
do the rebuild once at the end. How to do it depends on the build
|
||||||
|
system you are using.
|
||||||
|
|
||||||
$ make purge
|
.. tabs::
|
||||||
$ make package-update
|
|
||||||
|
|
||||||
* Re-build LAMMPS via the "make" command.
|
.. tab:: CMake build
|
||||||
|
|
||||||
.. warning::
|
Change to your build folder and type:
|
||||||
|
|
||||||
If you wish to edit/change a source file that is part of a package,
|
.. code-block:: bash
|
||||||
you should edit the version of the file inside the package folder in
|
|
||||||
src, and then re-install or update the package. The version in the
|
cmake . --build
|
||||||
src directory is merely a copy and will be wiped out when you type
|
|
||||||
"make package-update".
|
CMake should auto-detect whether it needs to re-run the CMake
|
||||||
|
configuration step and otherwise redo the build for all files
|
||||||
|
that have been changed or files that depend on changed files.
|
||||||
|
In case some build options have been changed or renamed, you
|
||||||
|
may have to update those by running:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cmake .
|
||||||
|
|
||||||
|
and then rebuild.
|
||||||
|
|
||||||
|
.. tab:: Traditional make
|
||||||
|
|
||||||
|
Switch to the src directory and type:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make purge # remove any deprecated src files
|
||||||
|
$ make package-update # sync package files with src files
|
||||||
|
$ make foo # re-build for your machine (mpi, serial, etc)
|
||||||
|
|
||||||
|
to enforce consistency of the source between the src folder
|
||||||
|
and package directories. This is OK to do even if you don't
|
||||||
|
use any packages. The "make purge" command removes any deprecated
|
||||||
|
src files if they were removed by the patch from a package
|
||||||
|
sub-directory.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
If you wish to edit/change a src file that is from a package,
|
||||||
|
you should edit the version of the file inside the package
|
||||||
|
sub-directory with src, then re-install the package. The
|
||||||
|
version in the source directory is merely a copy and will be
|
||||||
|
wiped out if you type "make package-update".
|
||||||
|
|||||||
@ -33,22 +33,19 @@ in its name, e.g. lammps-23Jun18.
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
You can also download a zip file via the "Clone or download" button on
|
You can also download a compressed tar or zip archives from the
|
||||||
the `LAMMPS GitHub site <git_>`_. The file name will be lammps-master.zip
|
"Assets" sections of the `LAMMPS GitHub releases site <git_>`_.
|
||||||
which can be unzipped with the following command, to create
|
The file name will be lammps-<version>.zip which can be unzipped
|
||||||
a lammps-master dir:
|
with the following command, to create a lammps-<version> dir:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ unzip lammps*.zip
|
$ unzip lammps*.zip
|
||||||
|
|
||||||
This version is the most up-to-date LAMMPS development version. It
|
This version corresponds to the selected LAMMPS patch or stable
|
||||||
will have the date of the most recent patch release (see the file
|
release.
|
||||||
src/version.h). But it will also include any new bug-fixes or
|
|
||||||
features added since the last patch release. They will be included in
|
|
||||||
the next patch release tarball.
|
|
||||||
|
|
||||||
.. _git: https://github.com/lammps/lammps
|
.. _git: https://github.com/lammps/lammps/releases
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -38,17 +38,18 @@ In addition there are DOIs for individual stable releases. Currently there are:
|
|||||||
Home page
|
Home page
|
||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
|
|
||||||
The LAMMPS website at `https://lammps.sandia.gov/ <https://lammps.sandia.gov>`_ is the canonical
|
The LAMMPS website at `https://lammps.sandia.gov/
|
||||||
location for information about LAMMPS and more detailed lists of publications
|
<https://lammps.sandia.gov>`_ is the canonical location for information
|
||||||
using LAMMPS and contributing features.
|
about LAMMPS and its features.
|
||||||
|
|
||||||
Citing contributions
|
Citing contributions
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
LAMMPS has many features and uses previously published methods and
|
LAMMPS has many features and that use either previously published
|
||||||
algorithms or novel features. It also includes potential parameter
|
methods and algorithms or novel features. It also includes potential
|
||||||
filed for specific models. You can look up relevant publications either
|
parameter filed for specific models. Where available, a reminder about
|
||||||
in the LAMMPS output to the screen, the ``log.cite`` file (which is
|
references for optional features used in a specific run is printed to
|
||||||
populated with references to relevant papers through embedding them into
|
the screen and log file. Style and output location can be selected with
|
||||||
the source code) and in the documentation of the :doc:`corresponding commands
|
the :ref:`-cite command-line switch <cite>`. Additional references are
|
||||||
|
given in the documentation of the :doc:`corresponding commands
|
||||||
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
|
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
|
||||||
|
|||||||
@ -85,7 +85,7 @@ commands)
|
|||||||
* water potentials: TIP3P, TIP4P, SPC
|
* water potentials: TIP3P, TIP4P, SPC
|
||||||
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
||||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim_init, kim_interactions, and kim_query <kim_commands>` commands
|
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
|
||||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||||
* overlaid potentials: superposition of multiple pair potentials
|
* overlaid potentials: superposition of multiple pair potentials
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ It documents the following functions:
|
|||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
.. doxygenfunction:: lammps_create_atoms(void *handle, int n, int *id, int *type, double *x, double *v, int *image, int bexpand)
|
.. doxygenfunction:: lammps_create_atoms(void *handle, int n, const int *id, const int *type, const double *x, const double *v, const int *image, int bexpand)
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -206,16 +206,22 @@ packages in the src directory for examples. If you are uncertain, please ask.
|
|||||||
algorithm/science behind the feature itself, or its initial usage, or
|
algorithm/science behind the feature itself, or its initial usage, or
|
||||||
its implementation in LAMMPS), you can add the citation to the \*.cpp
|
its implementation in LAMMPS), you can add the citation to the \*.cpp
|
||||||
source file. See src/USER-EFF/atom_vec_electron.cpp for an example.
|
source file. See src/USER-EFF/atom_vec_electron.cpp for an example.
|
||||||
A LaTeX citation is stored in a variable at the top of the file and a
|
A LaTeX citation is stored in a variable at the top of the file and
|
||||||
single line of code that references the variable is added to the
|
a single line of code registering this variable is added to the
|
||||||
constructor of the class. Whenever a user invokes your feature from
|
constructor of the class. If there is additional functionality (which
|
||||||
their input script, this will cause LAMMPS to output the citation to a
|
may have been added later) described in a different publication,
|
||||||
log.cite file and prompt the user to examine the file. Note that you
|
additional citation descriptions may be added for as long as they
|
||||||
should only use this for a paper you or your group authored.
|
are only registered when the corresponding keyword activating this
|
||||||
E.g. adding a cite in the code for a paper by Nose and Hoover if you
|
functionality is used. With these options it is possible to have
|
||||||
write a fix that implements their integrator is not the intended
|
LAMMPS output a specific citation reminder whenever a user invokes
|
||||||
usage. That kind of citation should just be in the doc page you
|
your feature from their input script. Note that you should only use
|
||||||
provide.
|
this for the most relevant paper for a feature and a publication that
|
||||||
|
you or your group authored. E.g. adding a citation in the code for
|
||||||
|
a paper by Nose and Hoover if you write a fix that implements their
|
||||||
|
integrator is not the intended usage. That kind of citation should
|
||||||
|
just be included in the documentation page you provide describing
|
||||||
|
your contribution. If you are not sure what the best option would
|
||||||
|
be, please contact the LAMMPS developers for advice.
|
||||||
|
|
||||||
Finally, as a general rule-of-thumb, the more clear and
|
Finally, as a general rule-of-thumb, the more clear and
|
||||||
self-explanatory you make your documentation and README files, and the
|
self-explanatory you make your documentation and README files, and the
|
||||||
|
|||||||
@ -50,6 +50,7 @@ page gives those details.
|
|||||||
* :ref:`MSCG <PKG-MSCG>`
|
* :ref:`MSCG <PKG-MSCG>`
|
||||||
* :ref:`OPT <PKG-OPT>`
|
* :ref:`OPT <PKG-OPT>`
|
||||||
* :ref:`PERI <PKG-PERI>`
|
* :ref:`PERI <PKG-PERI>`
|
||||||
|
* :ref:`PLUGIN <PKG-PLUGIN>`
|
||||||
* :ref:`POEMS <PKG-POEMS>`
|
* :ref:`POEMS <PKG-POEMS>`
|
||||||
* :ref:`PYTHON <PKG-PYTHON>`
|
* :ref:`PYTHON <PKG-PYTHON>`
|
||||||
* :ref:`QEQ <PKG-QEQ>`
|
* :ref:`QEQ <PKG-QEQ>`
|
||||||
@ -367,17 +368,19 @@ KIM package
|
|||||||
|
|
||||||
**Contents:**
|
**Contents:**
|
||||||
|
|
||||||
This package contains a set of commands that serve as a wrapper on the
|
This package contains a command with a set of sub-commands that serve as a
|
||||||
|
wrapper on the
|
||||||
`Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_
|
`Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_
|
||||||
repository of interatomic models (IMs) enabling compatible ones to be used in
|
repository of interatomic models (IMs) enabling compatible ones to be used in
|
||||||
LAMMPS simulations.
|
LAMMPS simulations.
|
||||||
|
|
||||||
This includes :doc:`kim_init <kim_commands>`, and
|
|
||||||
:doc:`kim_interactions <kim_commands>` commands to select, initialize and
|
This includes :doc:`kim init <kim_commands>`, and
|
||||||
instantiate the IM, a :doc:`kim_query <kim_commands>` command to perform web
|
:doc:`kim interactions <kim_commands>` commands to select, initialize and
|
||||||
|
instantiate the IM, a :doc:`kim query <kim_commands>` command to perform web
|
||||||
queries for material property predictions of OpenKIM IMs, a
|
queries for material property predictions of OpenKIM IMs, a
|
||||||
:doc:`kim_param <kim_commands>` command to access KIM Model Parameters from
|
:doc:`kim param <kim_commands>` command to access KIM Model Parameters from
|
||||||
LAMMPS, and a :doc:`kim_property <kim_commands>` command to write material
|
LAMMPS, and a :doc:`kim property <kim_commands>` command to write material
|
||||||
properties computed in LAMMPS to standard KIM property instance format.
|
properties computed in LAMMPS to standard KIM property instance format.
|
||||||
|
|
||||||
Support for KIM IMs that conform to the
|
Support for KIM IMs that conform to the
|
||||||
@ -386,8 +389,8 @@ is provided by the :doc:`pair_style kim <pair_kim>` command.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
The command *pair_style kim* is called by *kim_interactions* and
|
The command *pair_style kim* is called by *kim interactions* and is not
|
||||||
is not recommended to be directly used in input scripts.
|
recommended to be directly used in input scripts.
|
||||||
|
|
||||||
To use this package you must have the KIM API library available on your
|
To use this package you must have the KIM API library available on your
|
||||||
system. The KIM API is available for download on the
|
system. The KIM API is available for download on the
|
||||||
@ -404,7 +407,7 @@ and is funded by the `National Science Foundation <https://www.nsf.gov/>`_.
|
|||||||
API and the *pair_style kim* command. Yaser Afshar (U Minnesota),
|
API and the *pair_style kim* command. Yaser Afshar (U Minnesota),
|
||||||
Axel Kohlmeyer (Temple U), Ellad Tadmor (U Minnesota), and
|
Axel Kohlmeyer (Temple U), Ellad Tadmor (U Minnesota), and
|
||||||
Daniel Karls (U Minnesota) contributed to the
|
Daniel Karls (U Minnesota) contributed to the
|
||||||
:doc:`kim_commands <kim_commands>` interface in close collaboration with
|
:doc:`kim command <kim_commands>` interface in close collaboration with
|
||||||
Ryan Elliott.
|
Ryan Elliott.
|
||||||
|
|
||||||
**Install:**
|
**Install:**
|
||||||
@ -414,7 +417,7 @@ This package has :ref:`specific installation instructions <kim>` on the
|
|||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
* :doc:`kim_commands <kim_commands>`
|
* :doc:`kim command <kim_commands>`
|
||||||
* :doc:`pair_style kim <pair_kim>`
|
* :doc:`pair_style kim <pair_kim>`
|
||||||
* src/KIM: filenames -> commands
|
* src/KIM: filenames -> commands
|
||||||
* src/KIM/README
|
* src/KIM/README
|
||||||
@ -668,8 +671,8 @@ A general interface for machine-learning interatomic potentials, including PyTor
|
|||||||
|
|
||||||
To use this package, also the :ref:`SNAP package <PKG-SNAP>` package needs
|
To use this package, also the :ref:`SNAP package <PKG-SNAP>` package needs
|
||||||
to be installed. To make the *mliappy* model available, also the
|
to be installed. To make the *mliappy* model available, also the
|
||||||
:ref:`PYTHON package <PKG-PYTHON>` package needs to be installed, the version of
|
:ref:`PYTHON package <PKG-PYTHON>` package needs to be installed, the version
|
||||||
Python must be 3.6 or later, and the `cython <https://cython.org/>`_ software
|
of Python must be 3.6 or later, and the `cython <https://cython.org/>`_ software
|
||||||
must be installed.
|
must be installed.
|
||||||
|
|
||||||
**Author:** Aidan Thompson (Sandia), Nicholas Lubbers (LANL).
|
**Author:** Aidan Thompson (Sandia), Nicholas Lubbers (LANL).
|
||||||
@ -841,6 +844,28 @@ Foster (UTSA).
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _PKG-PLUGIN:
|
||||||
|
|
||||||
|
PLUGIN package
|
||||||
|
--------------
|
||||||
|
|
||||||
|
**Contents:**
|
||||||
|
|
||||||
|
A :doc:`plugin <plugin>` command that can load and unload several
|
||||||
|
kind of styles in LAMMPS from shared object files at runtime without
|
||||||
|
having to recompile and relink LAMMPS.
|
||||||
|
|
||||||
|
**Authors:** Axel Kohlmeyer (Temple U)
|
||||||
|
|
||||||
|
**Supporting info:**
|
||||||
|
|
||||||
|
* src/PLUGIN: filenames -> commands
|
||||||
|
* :doc:`plugin command <plugin>`
|
||||||
|
* :doc:`Information on writing plugins <Developer_plugins>`
|
||||||
|
* examples/plugin
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _PKG-POEMS:
|
.. _PKG-POEMS:
|
||||||
|
|
||||||
POEMS package
|
POEMS package
|
||||||
@ -1430,8 +1455,8 @@ oscillators as a model of polarization. See the :doc:`Howto drude <Howto_drude>
|
|||||||
for an overview of how to use the package. There are auxiliary tools
|
for an overview of how to use the package. There are auxiliary tools
|
||||||
for using this package in tools/drude.
|
for using this package in tools/drude.
|
||||||
|
|
||||||
**Authors:** Alain Dequidt (U Blaise Pascal Clermont-Ferrand), Julien
|
**Authors:** Alain Dequidt (U Clermont Auvergne), Julien
|
||||||
Devemy (CNRS), and Agilio Padua (U Blaise Pascal).
|
Devemy (CNRS), and Agilio Padua (ENS de Lyon).
|
||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
@ -1498,7 +1523,7 @@ methods for performing FEP simulations by using a :doc:`fix adapt/fep <fix_adapt
|
|||||||
which have a "soft" in their style name. There are auxiliary tools
|
which have a "soft" in their style name. There are auxiliary tools
|
||||||
for using this package in tools/fep; see its README file.
|
for using this package in tools/fep; see its README file.
|
||||||
|
|
||||||
**Author:** Agilio Padua (Universite Blaise Pascal Clermont-Ferrand)
|
**Author:** Agilio Padua (ENS de Lyon)
|
||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
@ -2454,6 +2479,6 @@ which discuss the `QuickFF <quickff_>`_ methodology.
|
|||||||
* :doc:`bond_style mm3 <bond_mm3>`
|
* :doc:`bond_style mm3 <bond_mm3>`
|
||||||
* :doc:`improper_style distharm <improper_distharm>`
|
* :doc:`improper_style distharm <improper_distharm>`
|
||||||
* :doc:`improper_style sqdistharm <improper_sqdistharm>`
|
* :doc:`improper_style sqdistharm <improper_sqdistharm>`
|
||||||
* :doc:`pair_style mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>`
|
* :doc:`pair_style mm3/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||||
* :doc:`pair_style lj/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
* :doc:`pair_style lj/switch3/coulgauss/long <pair_lj_switch3_coulgauss_long>`
|
||||||
* examples/USER/yaff
|
* examples/USER/yaff
|
||||||
|
|||||||
@ -71,6 +71,8 @@ package:
|
|||||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`PERI <PKG-PERI>` | Peridynamics models | :doc:`pair_style peri <pair_peri>` | peri | no |
|
| :ref:`PERI <PKG-PERI>` | Peridynamics models | :doc:`pair_style peri <pair_peri>` | peri | no |
|
||||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||||
|
| :ref:`PLUGIN <PKG-PLUGIN>` | Plugin loader command | :doc:`plugin <plugin>` | plugins | no |
|
||||||
|
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`POEMS <PKG-POEMS>` | coupled rigid body motion | :doc:`fix poems <fix_poems>` | rigid | int |
|
| :ref:`POEMS <PKG-POEMS>` | coupled rigid body motion | :doc:`fix poems <fix_poems>` | rigid | int |
|
||||||
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
+----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`PYTHON <PKG-PYTHON>` | embed Python code in an input script | :doc:`python <python>` | python | sys |
|
| :ref:`PYTHON <PKG-PYTHON>` | embed Python code in an input script | :doc:`python <python>` | python | sys |
|
||||||
|
|||||||
@ -50,7 +50,7 @@ against invalid accesses.
|
|||||||
|
|
||||||
**Numpy Methods**:
|
**Numpy Methods**:
|
||||||
|
|
||||||
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
* :py:meth:`numpy.extract_atom() <lammps.numpy_wrapper.numpy_wrapper.extract_atom()>`: extract a per-atom quantity as numpy array
|
||||||
|
|
||||||
.. tab:: PyLammps/IPyLammps API
|
.. tab:: PyLammps/IPyLammps API
|
||||||
|
|
||||||
|
|||||||
11
doc/src/Python_formats.rst
Normal file
11
doc/src/Python_formats.rst
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Output Readers
|
||||||
|
==============
|
||||||
|
|
||||||
|
.. py:module:: lammps.formats
|
||||||
|
|
||||||
|
The Python package contains the :py:mod:`lammps.formats` module, which
|
||||||
|
provides classes to post-process some of the output files generated by LAMMPS.
|
||||||
|
|
||||||
|
.. automodule:: lammps.formats
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
@ -13,6 +13,7 @@ together.
|
|||||||
Python_module
|
Python_module
|
||||||
Python_ext
|
Python_ext
|
||||||
Python_call
|
Python_call
|
||||||
|
Python_formats
|
||||||
Python_examples
|
Python_examples
|
||||||
Python_error
|
Python_error
|
||||||
Python_trouble
|
Python_trouble
|
||||||
|
|||||||
@ -26,6 +26,23 @@ There are multiple Python interface classes in the :py:mod:`lammps` module:
|
|||||||
|
|
||||||
.. _mpi4py_url: https://mpi4py.readthedocs.io
|
.. _mpi4py_url: https://mpi4py.readthedocs.io
|
||||||
|
|
||||||
|
.. admonition:: Version check
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
The :py:mod:`lammps` module stores the version number of the LAMMPS
|
||||||
|
version it is installed from. When initializing the
|
||||||
|
:py:class:`lammps <lammps.lammps>` class, this version is checked to
|
||||||
|
be the same as the result from :py:func:`lammps.version`, the version
|
||||||
|
of the LAMMPS shared library that the module interfaces to. If the
|
||||||
|
they are not the same an AttributeError exception is raised since a
|
||||||
|
mismatch of versions (e.g. due to incorrect use of the
|
||||||
|
``LD_LIBRARY_PATH`` or ``PYTHONPATH`` environment variables can lead
|
||||||
|
to crashes or data corruption and otherwise incorrect behavior.
|
||||||
|
|
||||||
|
.. automodule:: lammps
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The ``lammps`` class API
|
The ``lammps`` class API
|
||||||
@ -44,7 +61,7 @@ functions. Below is a detailed documentation of the API.
|
|||||||
.. autoclass:: lammps.lammps
|
.. autoclass:: lammps.lammps
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: lammps.numpy::numpy_wrapper
|
.. autoclass:: lammps.numpy_wrapper::numpy_wrapper
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -117,23 +134,23 @@ Style Constants
|
|||||||
to request from computes or fixes. See :cpp:enum:`_LMP_STYLE_CONST`
|
to request from computes or fixes. See :cpp:enum:`_LMP_STYLE_CONST`
|
||||||
for the equivalent constants in the C library interface. Used in
|
for the equivalent constants in the C library interface. Used in
|
||||||
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
||||||
:py:func:`lammps.numpy.extract_compute() <lammps.numpy.numpy_wrapper.extract_compute>` and
|
:py:func:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute>` and
|
||||||
:py:func:`lammps.numpy.extract_fix() <lammps.numpy.numpy_wrapper.extract_fix>`.
|
:py:func:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix>`.
|
||||||
|
|
||||||
.. _py_type_constants:
|
.. _py_type_constants:
|
||||||
|
|
||||||
Type Constants
|
Type Constants
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
.. py:data:: LMP_TYPE_SCALAR, LMP_TYLE_VECTOR, LMP_TYPE_ARRAY, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS
|
.. py:data:: LMP_TYPE_SCALAR, LMP_TYPE_VECTOR, LMP_TYPE_ARRAY, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS
|
||||||
:type: int
|
:type: int
|
||||||
|
|
||||||
Constants in the :py:mod:`lammps` module to select what type of data
|
Constants in the :py:mod:`lammps` module to select what type of data
|
||||||
to request from computes or fixes. See :cpp:enum:`_LMP_TYPE_CONST`
|
to request from computes or fixes. See :cpp:enum:`_LMP_TYPE_CONST`
|
||||||
for the equivalent constants in the C library interface. Used in
|
for the equivalent constants in the C library interface. Used in
|
||||||
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
:py:func:`lammps.extract_compute`, :py:func:`lammps.extract_fix`, and their NumPy variants
|
||||||
:py:func:`lammps.numpy.extract_compute() <lammps.numpy.numpy_wrapper.extract_compute>` and
|
:py:func:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute>` and
|
||||||
:py:func:`lammps.numpy.extract_fix() <lammps.numpy.numpy_wrapper.extract_fix>`.
|
:py:func:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix>`.
|
||||||
|
|
||||||
.. _py_vartype_constants:
|
.. _py_vartype_constants:
|
||||||
|
|
||||||
@ -153,6 +170,6 @@ Classes representing internal objects
|
|||||||
:members:
|
:members:
|
||||||
:no-undoc-members:
|
:no-undoc-members:
|
||||||
|
|
||||||
.. autoclass:: lammps.numpy::NumPyNeighList
|
.. autoclass:: lammps.numpy_wrapper::NumPyNeighList
|
||||||
:members:
|
:members:
|
||||||
:no-undoc-members:
|
:no-undoc-members:
|
||||||
|
|||||||
@ -1,6 +1,43 @@
|
|||||||
Neighbor list access
|
Neighbor list access
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
Access to neighbor lists is handled through a couple of wrapper classes
|
||||||
|
that allows to treat it like either a python list or a NumPy array. The
|
||||||
|
access procedure is similar to that of the C-library interface: use one
|
||||||
|
of the "find" functions to look up the index of the neighbor list in the
|
||||||
|
global table of neighbor lists and then get access to the neighbor list
|
||||||
|
data. The code sample below demonstrates reading the neighbor list data
|
||||||
|
using the NumPy access method.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from lammps import lammps
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
lmp = lammps()
|
||||||
|
lmp.commands_string("""
|
||||||
|
region box block -2 2 -2 2 -2 2
|
||||||
|
lattice fcc 1.0
|
||||||
|
create_box 1 box
|
||||||
|
create_atoms 1 box
|
||||||
|
mass 1 1.0
|
||||||
|
pair_style lj/cut 2.5
|
||||||
|
pair_coeff 1 1 1.0 1.0
|
||||||
|
run 0 post no""")
|
||||||
|
|
||||||
|
# look up the neighbor list
|
||||||
|
nlidx = lmp.find_pair_neighlist('lj/cut')
|
||||||
|
nl = lmp.numpy.get_neighlist(nlidx)
|
||||||
|
tags = lmp.extract_atom('id')
|
||||||
|
print("half neighbor list with {} entries".format(nl.size))
|
||||||
|
# print neighbor list contents
|
||||||
|
for i in range(0,nl.size):
|
||||||
|
idx, nlist = nl.get(i)
|
||||||
|
print("\natom {} with ID {} has {} neighbors:".format(idx,tags[idx],nlist.size))
|
||||||
|
if nlist.size > 0:
|
||||||
|
for n in np.nditer(nlist):
|
||||||
|
print(" atom {} with ID {}".format(n,tags[n]))
|
||||||
|
|
||||||
**Methods:**
|
**Methods:**
|
||||||
|
|
||||||
* :py:meth:`lammps.get_neighlist() <lammps.lammps.get_neighlist()>`: Get neighbor list for given index
|
* :py:meth:`lammps.get_neighlist() <lammps.lammps.get_neighlist()>`: Get neighbor list for given index
|
||||||
@ -14,5 +51,5 @@ Neighbor list access
|
|||||||
|
|
||||||
**NumPy Methods:**
|
**NumPy Methods:**
|
||||||
|
|
||||||
* :py:meth:`lammps.numpy.get_neighlist() <lammps.numpy_wrapper.get_neighlist()>`: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays
|
* :py:meth:`lammps.numpy.get_neighlist() <lammps.numpy_wrapper.numpy_wrapper.get_neighlist()>`: Get neighbor list for given index, which uses NumPy arrays for its element neighbor arrays
|
||||||
* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() <lammps.numpy_wrapper.get_neighlist_element_neighbors()>`: Get element in neighbor list and its neighbors (as numpy array)
|
* :py:meth:`lammps.numpy.get_neighlist_element_neighbors() <lammps.numpy_wrapper.numpy_wrapper.get_neighlist_element_neighbors()>`: Get element in neighbor list and its neighbors (as numpy array)
|
||||||
|
|||||||
@ -36,9 +36,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
|||||||
Python subscripting. The values will be zero for atoms not in the
|
Python subscripting. The values will be zero for atoms not in the
|
||||||
specified group.
|
specified group.
|
||||||
|
|
||||||
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.extract_compute()>`,
|
:py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`,
|
||||||
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.extract_fix()>`, and
|
:py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`, and
|
||||||
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.extract_variable()>` are
|
:py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>` are
|
||||||
equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers.
|
equivalent NumPy implementations that return NumPy arrays instead of ``ctypes`` pointers.
|
||||||
|
|
||||||
The :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>` method sets an
|
The :py:meth:`lammps.set_variable() <lammps.lammps.set_variable()>` method sets an
|
||||||
@ -54,9 +54,9 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
|||||||
|
|
||||||
**NumPy Methods**:
|
**NumPy Methods**:
|
||||||
|
|
||||||
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
* :py:meth:`lammps.numpy.extract_compute() <lammps.numpy_wrapper.numpy_wrapper.extract_compute()>`: extract value(s) from a compute, return arrays as numpy arrays
|
||||||
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
* :py:meth:`lammps.numpy.extract_fix() <lammps.numpy_wrapper.numpy_wrapper.extract_fix()>`: extract value(s) from a fix, return arrays as numpy arrays
|
||||||
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
* :py:meth:`lammps.numpy.extract_variable() <lammps.numpy_wrapper.numpy_wrapper.extract_variable()>`: extract value(s) from a variable, return arrays as numpy arrays
|
||||||
|
|
||||||
|
|
||||||
.. tab:: PyLammps/IPyLammps API
|
.. tab:: PyLammps/IPyLammps API
|
||||||
|
|||||||
@ -11,6 +11,7 @@ letter abbreviation can be used:
|
|||||||
* :ref:`-k or -kokkos <run-kokkos>`
|
* :ref:`-k or -kokkos <run-kokkos>`
|
||||||
* :ref:`-l or -log <log>`
|
* :ref:`-l or -log <log>`
|
||||||
* :ref:`-m or -mpicolor <mpicolor>`
|
* :ref:`-m or -mpicolor <mpicolor>`
|
||||||
|
* :ref:`-c or -cite <cite>`
|
||||||
* :ref:`-nc or -nocite <nocite>`
|
* :ref:`-nc or -nocite <nocite>`
|
||||||
* :ref:`-pk or -package <package>`
|
* :ref:`-pk or -package <package>`
|
||||||
* :ref:`-p or -partition <partition>`
|
* :ref:`-p or -partition <partition>`
|
||||||
@ -220,14 +221,31 @@ links with from the lib/message directory. See the
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _cite:
|
||||||
|
|
||||||
|
**-cite style or file name**
|
||||||
|
|
||||||
|
Select how and where to output a reminder about citing contributions
|
||||||
|
to the LAMMPS code that were used during the run. Available styles are
|
||||||
|
"both", "none", "screen", or "log". Any flag will be considered a file
|
||||||
|
name to write the detailed citation info to. Default is the "log" style
|
||||||
|
where there is a short summary in the screen output and detailed citations
|
||||||
|
in BibTeX format in the logfile. The option "both" selects the detailed
|
||||||
|
output for both, "none", the short output for both, and "screen" will
|
||||||
|
write the detailed info to the screen and the short version to the log
|
||||||
|
file. If a dedicated citation info file is requested, the screen and
|
||||||
|
log file output will be in the short format (same as with "none").
|
||||||
|
|
||||||
|
See the :doc:`citation page <Intro_citing>` for more details on
|
||||||
|
how to correctly reference and cite LAMMPS.
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _nocite:
|
.. _nocite:
|
||||||
|
|
||||||
**-nocite**
|
**-nocite**
|
||||||
|
|
||||||
Disable writing the log.cite file which is normally written to list
|
Disable generating a citation reminder (see above) at all.
|
||||||
references for specific cite-able features used during a LAMMPS run.
|
|
||||||
See the `citation page <https://lammps.sandia.gov/cite.html>`_ for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
GPU package
|
GPU package
|
||||||
===========
|
===========
|
||||||
|
|
||||||
The GPU package was developed by Mike Brown while at SNL and ORNL
|
The GPU package was developed by Mike Brown while at SNL and ORNL (now
|
||||||
and his collaborators, particularly Trung Nguyen (now at Northwestern).
|
at Intel Corp.) and his collaborators, particularly Trung Nguyen (now at
|
||||||
It provides GPU versions of many pair styles and for parts of the
|
Northwestern). Support for AMD GPUs via HIP was added by Vsevolod Nikolskiy
|
||||||
:doc:`kspace_style pppm <kspace_style>` for long-range Coulombics.
|
and coworkers at HSE University.
|
||||||
It has the following general features:
|
|
||||||
|
The GPU package provides GPU versions of many pair styles and for
|
||||||
|
parts of the :doc:`kspace_style pppm <kspace_style>` for long-range
|
||||||
|
Coulombics. It has the following general features:
|
||||||
|
|
||||||
* It is designed to exploit common GPU hardware configurations where one
|
* It is designed to exploit common GPU hardware configurations where one
|
||||||
or more GPUs are coupled to many cores of one or more multi-core CPUs,
|
or more GPUs are coupled to many cores of one or more multi-core CPUs,
|
||||||
@ -24,8 +27,9 @@ It has the following general features:
|
|||||||
force vectors.
|
force vectors.
|
||||||
* LAMMPS-specific code is in the GPU package. It makes calls to a
|
* LAMMPS-specific code is in the GPU package. It makes calls to a
|
||||||
generic GPU library in the lib/gpu directory. This library provides
|
generic GPU library in the lib/gpu directory. This library provides
|
||||||
NVIDIA support as well as more general OpenCL support, so that the
|
either Nvidia support, AMD support, or more general OpenCL support
|
||||||
same functionality is supported on a variety of hardware.
|
(for Nvidia GPUs, AMD GPUs, Intel GPUs, and multi-core CPUs).
|
||||||
|
so that the same functionality is supported on a variety of hardware.
|
||||||
|
|
||||||
**Required hardware/software:**
|
**Required hardware/software:**
|
||||||
|
|
||||||
@ -45,12 +49,23 @@ to have the OpenCL headers and the (vendor neutral) OpenCL library installed.
|
|||||||
In OpenCL mode, the acceleration depends on having an `OpenCL Installable Client Driver (ICD) <https://www.khronos.org/news/permalink/opencl-installable-client-driver-icd-loader>`_
|
In OpenCL mode, the acceleration depends on having an `OpenCL Installable Client Driver (ICD) <https://www.khronos.org/news/permalink/opencl-installable-client-driver-icd-loader>`_
|
||||||
installed. There can be multiple of them for the same or different hardware
|
installed. There can be multiple of them for the same or different hardware
|
||||||
(GPUs, CPUs, Accelerators) installed at the same time. OpenCL refers to those
|
(GPUs, CPUs, Accelerators) installed at the same time. OpenCL refers to those
|
||||||
as 'platforms'. The GPU library will select the **first** suitable platform,
|
as 'platforms'. The GPU library will try to auto-select the best suitable platform,
|
||||||
but this can be overridden using the device option of the :doc:`package <package>`
|
but this can be overridden using the platform option of the :doc:`package <package>`
|
||||||
command. run lammps/lib/gpu/ocl_get_devices to get a list of available
|
command. run lammps/lib/gpu/ocl_get_devices to get a list of available
|
||||||
platforms and devices with a suitable ICD available.
|
platforms and devices with a suitable ICD available.
|
||||||
|
|
||||||
To compute and use this package in HIP mode, you have to have the AMD ROCm
|
To compile and use this package for Intel GPUs, OpenCL or the Intel oneAPI
|
||||||
|
HPC Toolkit can be installed using linux package managers. The latter also
|
||||||
|
provides optimized C++, MPI, and many other libraries and tools. See:
|
||||||
|
|
||||||
|
* https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit/download.html
|
||||||
|
|
||||||
|
If you do not have a discrete GPU card installed, this package can still provide
|
||||||
|
significant speedups on some CPUs that include integrated GPUs. Additionally, for
|
||||||
|
many macs, OpenCL is already included with the OS and Makefiles are available
|
||||||
|
in the lib/gpu directory.
|
||||||
|
|
||||||
|
To compile and use this package in HIP mode, you have to have the AMD ROCm
|
||||||
software installed. Versions of ROCm older than 3.5 are currently deprecated
|
software installed. Versions of ROCm older than 3.5 are currently deprecated
|
||||||
by AMD.
|
by AMD.
|
||||||
|
|
||||||
@ -75,10 +90,20 @@ automatically if you create more MPI tasks/node than there are
|
|||||||
GPUs/mode. E.g. with 8 MPI tasks/node and 2 GPUs, each GPU will be
|
GPUs/mode. E.g. with 8 MPI tasks/node and 2 GPUs, each GPU will be
|
||||||
shared by 4 MPI tasks.
|
shared by 4 MPI tasks.
|
||||||
|
|
||||||
|
The GPU package also has limited support for OpenMP for both
|
||||||
|
multi-threading and vectorization of routines that are run on the CPUs.
|
||||||
|
This requires that the GPU library and LAMMPS are built with flags to
|
||||||
|
enable OpenMP support (e.g. -fopenmp). Some styles for time integration
|
||||||
|
are also available in the GPU package. These run completely on the CPUs
|
||||||
|
in full double precision, but exploit multi-threading and vectorization
|
||||||
|
for faster performance.
|
||||||
|
|
||||||
Use the "-sf gpu" :doc:`command-line switch <Run_options>`, which will
|
Use the "-sf gpu" :doc:`command-line switch <Run_options>`, which will
|
||||||
automatically append "gpu" to styles that support it. Use the "-pk
|
automatically append "gpu" to styles that support it. Use the "-pk
|
||||||
gpu Ng" :doc:`command-line switch <Run_options>` to set Ng = # of
|
gpu Ng" :doc:`command-line switch <Run_options>` to set Ng = # of
|
||||||
GPUs/node to use.
|
GPUs/node to use. If Ng is 0, the number is selected automatically as
|
||||||
|
the number of matching GPUs that have the highest number of compute
|
||||||
|
cores.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
@ -87,8 +112,8 @@ GPUs/node to use.
|
|||||||
mpirun -np 48 -ppn 12 lmp_machine -sf gpu -pk gpu 2 -in in.script # ditto on 4 16-core nodes
|
mpirun -np 48 -ppn 12 lmp_machine -sf gpu -pk gpu 2 -in in.script # ditto on 4 16-core nodes
|
||||||
|
|
||||||
Note that if the "-sf gpu" switch is used, it also issues a default
|
Note that if the "-sf gpu" switch is used, it also issues a default
|
||||||
:doc:`package gpu 1 <package>` command, which sets the number of
|
:doc:`package gpu 0 <package>` command, which will result in
|
||||||
GPUs/node to 1.
|
automatic selection of the number of GPUs to use.
|
||||||
|
|
||||||
Using the "-pk" switch explicitly allows for setting of the number of
|
Using the "-pk" switch explicitly allows for setting of the number of
|
||||||
GPUs/node to use and additional options. Its syntax is the same as
|
GPUs/node to use and additional options. Its syntax is the same as
|
||||||
@ -138,6 +163,13 @@ Likewise, you should experiment with the precision setting for the GPU
|
|||||||
library to see if single or mixed precision will give accurate
|
library to see if single or mixed precision will give accurate
|
||||||
results, since they will typically be faster.
|
results, since they will typically be faster.
|
||||||
|
|
||||||
|
MPI parallelism typically outperforms OpenMP parallelism, but in some
|
||||||
|
cases using fewer MPI tasks and multiple OpenMP threads with the GPU
|
||||||
|
package can give better performance. 3-body potentials can often perform
|
||||||
|
better with multiple OMP threads because the inter-process communication
|
||||||
|
is higher for these styles with the GPU package in order to allow
|
||||||
|
deterministic results.
|
||||||
|
|
||||||
**Guidelines for best performance:**
|
**Guidelines for best performance:**
|
||||||
|
|
||||||
* Using multiple MPI tasks per GPU will often give the best performance,
|
* Using multiple MPI tasks per GPU will often give the best performance,
|
||||||
@ -161,6 +193,12 @@ results, since they will typically be faster.
|
|||||||
:doc:`angle <angle_style>`, :doc:`dihedral <dihedral_style>`,
|
:doc:`angle <angle_style>`, :doc:`dihedral <dihedral_style>`,
|
||||||
:doc:`improper <improper_style>`, and :doc:`long-range <kspace_style>`
|
:doc:`improper <improper_style>`, and :doc:`long-range <kspace_style>`
|
||||||
calculations will not be included in the "Pair" time.
|
calculations will not be included in the "Pair" time.
|
||||||
|
* Since only part of the pppm kspace style is GPU accelerated, it
|
||||||
|
may be faster to only use GPU acceleration for Pair styles with
|
||||||
|
long-range electrostatics. See the "pair/only" keyword of the
|
||||||
|
package command for a shortcut to do that. The work between kspace
|
||||||
|
on the CPU and non-bonded interactions on the GPU can be balanced
|
||||||
|
through adjusting the coulomb cutoff without loss of accuracy.
|
||||||
* When the *mode* setting for the package gpu command is force/neigh,
|
* When the *mode* setting for the package gpu command is force/neigh,
|
||||||
the time for neighbor list calculations on the GPU will be added into
|
the time for neighbor list calculations on the GPU will be added into
|
||||||
the "Pair" time, not the "Neigh" time. An additional breakdown of the
|
the "Pair" time, not the "Neigh" time. An additional breakdown of the
|
||||||
|
|||||||
@ -16,7 +16,7 @@ These are the accelerator packages currently in LAMMPS, either as
|
|||||||
standard or user packages:
|
standard or user packages:
|
||||||
|
|
||||||
+-----------------------------------------+-------------------------------------------------------+
|
+-----------------------------------------+-------------------------------------------------------+
|
||||||
| :doc:`GPU Package <Speed_gpu>` | for NVIDIA GPUs as well as OpenCL support |
|
| :doc:`GPU Package <Speed_gpu>` | for GPUs via CUDA, OpenCL, or ROCm HIP |
|
||||||
+-----------------------------------------+-------------------------------------------------------+
|
+-----------------------------------------+-------------------------------------------------------+
|
||||||
| :doc:`USER-INTEL Package <Speed_intel>` | for Intel CPUs and Intel Xeon Phi |
|
| :doc:`USER-INTEL Package <Speed_intel>` | for Intel CPUs and Intel Xeon Phi |
|
||||||
+-----------------------------------------+-------------------------------------------------------+
|
+-----------------------------------------+-------------------------------------------------------+
|
||||||
@ -43,7 +43,7 @@ three kinds of hardware, via the listed packages:
|
|||||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||||
| Many-core CPUs | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>`, :doc:`USER-OMP <Speed_omp>`, :doc:`OPT <Speed_opt>` packages |
|
| Many-core CPUs | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>`, :doc:`USER-OMP <Speed_omp>`, :doc:`OPT <Speed_opt>` packages |
|
||||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||||
| NVIDIA/AMD GPUs | :doc:`GPU <Speed_gpu>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
| GPUs | :doc:`GPU <Speed_gpu>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
||||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||||
| Intel Phi/AVX | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
| Intel Phi/AVX | :doc:`USER-INTEL <Speed_intel>`, :doc:`KOKKOS <Speed_kokkos>` packages |
|
||||||
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
+-----------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||||
@ -154,8 +154,8 @@ Here is a brief summary of what the various packages provide. Details
|
|||||||
are in the individual accelerator sections.
|
are in the individual accelerator sections.
|
||||||
|
|
||||||
* Styles with a "gpu" suffix are part of the GPU package and can be run
|
* Styles with a "gpu" suffix are part of the GPU package and can be run
|
||||||
on NVIDIA or AMD GPUs. The speed-up on a GPU depends on a variety of
|
on Intel, NVIDIA, or AMD GPUs. The speed-up on a GPU depends on a
|
||||||
factors, discussed in the accelerator sections.
|
variety of factors, discussed in the accelerator sections.
|
||||||
* Styles with an "intel" suffix are part of the USER-INTEL
|
* Styles with an "intel" suffix are part of the USER-INTEL
|
||||||
package. These styles support vectorized single and mixed precision
|
package. These styles support vectorized single and mixed precision
|
||||||
calculations, in addition to full double precision. In extreme cases,
|
calculations, in addition to full double precision. In extreme cases,
|
||||||
|
|||||||
@ -93,6 +93,7 @@ Miscellaneous tools
|
|||||||
* :ref:`i-pi <ipi>`
|
* :ref:`i-pi <ipi>`
|
||||||
* :ref:`kate <kate>`
|
* :ref:`kate <kate>`
|
||||||
* :ref:`LAMMPS shell <lammps_shell>`
|
* :ref:`LAMMPS shell <lammps_shell>`
|
||||||
|
* :ref:`LAMMPS magic patterns for file(1) <magic>`
|
||||||
* :ref:`singularity <singularity_tool>`
|
* :ref:`singularity <singularity_tool>`
|
||||||
* :ref:`SWIG interface <swig>`
|
* :ref:`SWIG interface <swig>`
|
||||||
* :ref:`vim <vim>`
|
* :ref:`vim <vim>`
|
||||||
@ -267,7 +268,7 @@ data file in the required format.
|
|||||||
See the header of the polarizer.py file for details.
|
See the header of the polarizer.py file for details.
|
||||||
|
|
||||||
The tool is authored by Agilio Padua and Alain Dequidt: agilio.padua
|
The tool is authored by Agilio Padua and Alain Dequidt: agilio.padua
|
||||||
at univ-bpclermont.fr, alain.dequidt at univ-bpclermont.fr
|
at ens-lyon.fr, alain.dequidt at uca.fr
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -341,8 +342,7 @@ The tools/fep directory contains Python scripts useful for
|
|||||||
post-processing results from performing free-energy perturbation
|
post-processing results from performing free-energy perturbation
|
||||||
simulations using the USER-FEP package.
|
simulations using the USER-FEP package.
|
||||||
|
|
||||||
The scripts were contributed by Agilio Padua (Universite Blaise
|
The scripts were contributed by Agilio Padua (ENS de Lyon), agilio.padua at ens-lyon.fr.
|
||||||
Pascal Clermont-Ferrand), agilio.padua at univ-bpclermont.fr.
|
|
||||||
|
|
||||||
See README file in the tools/fep directory.
|
See README file in the tools/fep directory.
|
||||||
|
|
||||||
@ -642,6 +642,39 @@ This tool was written by Ara Kooser at Sandia (askoose at sandia.gov).
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _magic:
|
||||||
|
|
||||||
|
Magic patterns for the "file" command
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
.. versionadded:: 10Mar2021
|
||||||
|
|
||||||
|
The file ``magic`` contains patterns that are used by the
|
||||||
|
`file program <https://en.wikipedia.org/wiki/File_(command)>`_
|
||||||
|
available on most Unix-like operating systems which enables it
|
||||||
|
to detect various LAMMPS files and print some useful information
|
||||||
|
about them. To enable these patterns, append or copy the contents
|
||||||
|
of the file to either the file ``.magic`` in your home directory
|
||||||
|
or (as administrator) to ``/etc/magic`` (for a system-wide
|
||||||
|
installation). Afterwards the ``file`` command should be able to
|
||||||
|
detect most LAMMPS restarts, dump, data and log files. Examples:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ file *.*
|
||||||
|
dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian
|
||||||
|
mol-pair-wf_cut.restart: LAMMPS binary restart file (rev 2), Version 24 Dec 2020, Little Endian
|
||||||
|
atom.bin: LAMMPS atom style binary dump (rev 2), Little Endian, First time step: 445570
|
||||||
|
custom.bin: LAMMPS custom style binary dump (rev 2), Little Endian, First time step: 100
|
||||||
|
bn1.lammpstrj: LAMMPS text mode dump, First time step: 5000
|
||||||
|
data.fourmol: LAMMPS data file written by LAMMPS
|
||||||
|
pnc.data: LAMMPS data file written by msi2lmp
|
||||||
|
data.spce: LAMMPS data file written by TopoTools
|
||||||
|
B.data: LAMMPS data file written by OVITO
|
||||||
|
log.lammps: LAMMPS log file written by version 10 Feb 2021
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _matlab:
|
.. _matlab:
|
||||||
|
|
||||||
matlab tool
|
matlab tool
|
||||||
|
|||||||
@ -24,20 +24,17 @@ Examples
|
|||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
The *cosine/periodic* angle style uses the following potential, which
|
The *cosine/periodic* angle style uses the following potential, which may be
|
||||||
is commonly used in the :doc:`DREIDING <Howto_bioFF>` force field,
|
particularly used for organometallic systems where :math:`n` = 4 might be used
|
||||||
particularly for organometallic systems where :math:`n` = 4 might be used
|
|
||||||
for an octahedral complex and :math:`n` = 3 might be used for a trigonal
|
for an octahedral complex and :math:`n` = 3 might be used for a trigonal
|
||||||
center:
|
center:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
E = C \left[ 1 - B(-1)^n\cos\left( n\theta\right) \right]
|
E = \frac{2.0}{n^2} * C \left[ 1 - B(-1)^n\cos\left( n\theta\right) \right]
|
||||||
|
|
||||||
where :math:`C`, :math:`B` and :math:`n` are coefficients defined for each angle type.
|
where :math:`C`, :math:`B` and :math:`n` are coefficients defined for each angle type.
|
||||||
|
|
||||||
See :ref:`(Mayo) <cosine-Mayo>` for a description of the DREIDING force field
|
|
||||||
|
|
||||||
The following coefficients must be defined for each angle type via the
|
The following coefficients must be defined for each angle type via the
|
||||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||||
@ -47,10 +44,9 @@ or :doc:`read_restart <read_restart>` commands:
|
|||||||
* :math:`B` = 1 or -1
|
* :math:`B` = 1 or -1
|
||||||
* :math:`n` = 1, 2, 3, 4, 5 or 6 for periodicity
|
* :math:`n` = 1, 2, 3, 4, 5 or 6 for periodicity
|
||||||
|
|
||||||
Note that the prefactor :math:`C` is specified and not the overall force
|
Note that the prefactor :math:`C` is specified as coefficient and not the overall force
|
||||||
constant :math:`K = \frac{C}{n^2}`. When :math:`B = 1`, it leads to a minimum for the
|
constant :math:`K = \frac{2 C}{n^2}`. When :math:`B = 1`, it leads to a minimum for the
|
||||||
linear geometry. When :math:`B = -1`, it leads to a maximum for the linear
|
linear geometry. When :math:`B = -1`, it leads to a maximum for the linear geometry.
|
||||||
geometry.
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -75,9 +71,3 @@ Default
|
|||||||
|
|
||||||
none
|
none
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. _cosine-Mayo:
|
|
||||||
|
|
||||||
**(Mayo)** Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
|
|
||||||
(1990).
|
|
||||||
|
|||||||
@ -30,8 +30,11 @@ The *cosine/squared* angle style uses the potential
|
|||||||
|
|
||||||
E = K [\cos(\theta) - \cos(\theta_0)]^2
|
E = K [\cos(\theta) - \cos(\theta_0)]^2
|
||||||
|
|
||||||
where :math:`\theta_0` is the equilibrium value of the angle, and :math:`K` is a
|
, which is commonly used in the :doc:`DREIDING <Howto_bioFF>` force field,
|
||||||
prefactor. Note that the usual 1/2 factor is included in :math:`K`.
|
where :math:`\theta_0` is the equilibrium value of the angle, and :math:`K`
|
||||||
|
is a prefactor. Note that the usual 1/2 factor is included in :math:`K`.
|
||||||
|
|
||||||
|
See :ref:`(Mayo) <cosine-Mayo>` for a description of the DREIDING force field.
|
||||||
|
|
||||||
The following coefficients must be defined for each angle type via the
|
The following coefficients must be defined for each angle type via the
|
||||||
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
:doc:`angle_coeff <angle_coeff>` command as in the example above, or in
|
||||||
@ -66,3 +69,10 @@ Default
|
|||||||
"""""""
|
"""""""
|
||||||
|
|
||||||
none
|
none
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. _cosine-Mayo:
|
||||||
|
|
||||||
|
**(Mayo)** Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
|
||||||
|
(1990).
|
||||||
|
|||||||
@ -77,6 +77,7 @@ Commands
|
|||||||
pair_style
|
pair_style
|
||||||
pair_write
|
pair_write
|
||||||
partition
|
partition
|
||||||
|
plugin
|
||||||
prd
|
prd
|
||||||
print
|
print
|
||||||
processors
|
processors
|
||||||
|
|||||||
@ -46,11 +46,12 @@ the compute command was issued. The value of the displacement will be
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Initial coordinates are stored in "unwrapped" form, by using the
|
Initial coordinates are stored in "unwrapped" form, by using the
|
||||||
image flags associated with each atom. See the :doc:`dump custom <dump>` command for a discussion of "unwrapped" coordinates.
|
image flags associated with each atom. See the :doc:`dump custom
|
||||||
See the Atoms section of the :doc:`read_data <read_data>` command for a
|
<dump>` command for a discussion of "unwrapped" coordinates. See
|
||||||
discussion of image flags and how they are set for each atom. You can
|
the Atoms section of the :doc:`read_data <read_data>` command for a
|
||||||
reset the image flags (e.g. to 0) before invoking this compute by
|
discussion of image flags and how they are set for each atom. You
|
||||||
using the :doc:`set image <set>` command.
|
can reset the image flags (e.g. to 0) before invoking this compute
|
||||||
|
by using the :doc:`set image <set>` command.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|||||||
@ -163,7 +163,7 @@ the meaning of these parameters:
|
|||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
|
|||||||
@ -122,8 +122,11 @@ Output info
|
|||||||
This compute calculates a global scalar (the pressure) and a global
|
This compute calculates a global scalar (the pressure) and a global
|
||||||
vector of length 6 (pressure tensor), which can be accessed by indices
|
vector of length 6 (pressure tensor), which can be accessed by indices
|
||||||
1-6. These values can be used by any command that uses global scalar
|
1-6. These values can be used by any command that uses global scalar
|
||||||
or vector values from a compute as input. See the :doc:`Howto output <Howto_output>` doc page for an overview of LAMMPS output
|
or vector values from a compute as input. See the :doc:`Howto output
|
||||||
options.
|
<Howto_output>` doc page for an overview of LAMMPS output options.
|
||||||
|
|
||||||
|
The ordering of values in the symmetric pressure tensor is as follows:
|
||||||
|
pxx, pyy, pzz, pxy, pxz, pyz.
|
||||||
|
|
||||||
The scalar and vector values calculated by this compute are
|
The scalar and vector values calculated by this compute are
|
||||||
"intensive". The scalar and vector values will be in pressure
|
"intensive". The scalar and vector values will be in pressure
|
||||||
|
|||||||
@ -30,7 +30,7 @@ Examples
|
|||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
compute 1 all reduce/chunk/atom mychunk min c_cluster
|
compute 1 all reduce/chunk mychunk min c_cluster
|
||||||
|
|
||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|||||||
@ -216,6 +216,11 @@ an identical manner to compute *stress/atom*. See the :doc:`Howto
|
|||||||
output <Howto_output>` doc page for an overview of LAMMPS output
|
output <Howto_output>` doc page for an overview of LAMMPS output
|
||||||
options.
|
options.
|
||||||
|
|
||||||
|
The ordering of the 6 columns for *stress/atom* is as follows: xx, yy,
|
||||||
|
zz, xy, xz, yz. The ordering of the 9 columns for
|
||||||
|
*centroid/stress/atom* is as follows: xx, yy, zz, xy, xz, yz, yx, zx,
|
||||||
|
zy.
|
||||||
|
|
||||||
The per-atom array values will be in pressure\*volume :doc:`units
|
The per-atom array values will be in pressure\*volume :doc:`units
|
||||||
<units>` as discussed above.
|
<units>` as discussed above.
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ temp/chunk calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>
|
|||||||
|
|
||||||
compute cc1 all chunk/atom molecule
|
compute cc1 all chunk/atom molecule
|
||||||
compute myChunk all temp/chunk cc1 temp
|
compute myChunk all temp/chunk cc1 temp
|
||||||
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector
|
fix 1 all ave/time 100 1 100 c_myChunk[1] file tmp.out mode vector
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -125,6 +125,16 @@ cannot appear in the neighbor list, to avoid creation of duplicate
|
|||||||
bonds. The neighbor list for all atom type pairs must also extend to
|
bonds. The neighbor list for all atom type pairs must also extend to
|
||||||
a distance that encompasses the *rmax* for new bonds to create.
|
a distance that encompasses the *rmax* for new bonds to create.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If you want to create bonds between pairs of 1-3 or 1-4 atoms in
|
||||||
|
the current bond topology, then you need to use :doc:`special_bonds
|
||||||
|
lj 0 1 1 <special_bonds>` to insure those pairs appear in the
|
||||||
|
neighbor list. They will not appear with the default special_bonds
|
||||||
|
settings which are zero for 1-2, 1-3, and 1-4 atoms. 1-3 or 1-4
|
||||||
|
atoms are those which are 2 hops or 3 hops apart in the bond
|
||||||
|
topology.
|
||||||
|
|
||||||
An additional requirement for this style is that your system must be
|
An additional requirement for this style is that your system must be
|
||||||
ready to perform a simulation. This means, for example, that all
|
ready to perform a simulation. This means, for example, that all
|
||||||
:doc:`pair_style <pair_style>` coefficients be set via the
|
:doc:`pair_style <pair_style>` coefficients be set via the
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Syntax
|
|||||||
* N = # of atom types to use in this simulation
|
* N = # of atom types to use in this simulation
|
||||||
* region-ID = ID of region to use as simulation domain
|
* region-ID = ID of region to use as simulation domain
|
||||||
* zero or more keyword/value pairs may be appended
|
* zero or more keyword/value pairs may be appended
|
||||||
* keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom*
|
* keyword = *bond/types* or *angle/types* or *dihedral/types* or *improper/types* or *extra/bond/per/atom* or *extra/angle/per/atom* or *extra/dihedral/per/atom* or *extra/improper/per/atom* or *extra/special/per/atom*
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
|
|||||||
@ -113,7 +113,7 @@ more of (g,i,k,o,t) to indicate which accelerated styles exist.
|
|||||||
* :doc:`quadratic <dihedral_quadratic>` - dihedral with quadratic term in angle
|
* :doc:`quadratic <dihedral_quadratic>` - dihedral with quadratic term in angle
|
||||||
* :doc:`spherical <dihedral_spherical>` - dihedral which includes angle terms to avoid singularities
|
* :doc:`spherical <dihedral_spherical>` - dihedral which includes angle terms to avoid singularities
|
||||||
* :doc:`table <dihedral_table>` - tabulated dihedral
|
* :doc:`table <dihedral_table>` - tabulated dihedral
|
||||||
* :doc:`table/cut <dihedral_table_cut>` - tabulated dihedral with analytic cutoff
|
* :doc:`table/cut <dihedral_table>` - tabulated dihedral with analytic cutoff
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,24 @@
|
|||||||
.. index:: dihedral_style table
|
.. index:: dihedral_style table
|
||||||
.. index:: dihedral_style table/omp
|
.. index:: dihedral_style table/omp
|
||||||
|
.. index:: dihedral_style table/cut
|
||||||
|
|
||||||
dihedral_style table command
|
dihedral_style table command
|
||||||
============================
|
============================
|
||||||
|
|
||||||
Accelerator Variants: *table/omp*
|
Accelerator Variants: *table/omp*
|
||||||
|
|
||||||
|
dihedral_style table/cut command
|
||||||
|
================================
|
||||||
|
|
||||||
Syntax
|
Syntax
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
dihedral_style table style Ntable
|
dihedral_style style interpolation Ntable
|
||||||
|
|
||||||
* style = *linear* or *spline* = method of interpolation
|
* style = *table* or *table/cut*
|
||||||
|
* interpolation = *linear* or *spline* = method of interpolation
|
||||||
* Ntable = size of the internal lookup table
|
* Ntable = size of the internal lookup table
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
@ -26,13 +31,21 @@ Examples
|
|||||||
dihedral_coeff 1 file.table DIH_TABLE1
|
dihedral_coeff 1 file.table DIH_TABLE1
|
||||||
dihedral_coeff 2 file.table DIH_TABLE2
|
dihedral_coeff 2 file.table DIH_TABLE2
|
||||||
|
|
||||||
|
dihedral_style table/cut spline 400
|
||||||
|
dihedral_style table/cut linear 1000
|
||||||
|
dihedral_coeff 1 aat 1.0 177 180 file.table DIH_TABLE1
|
||||||
|
dihedral_coeff 2 aat 0.5 170 180 file.table DIH_TABLE2
|
||||||
|
|
||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
The *table* dihedral style creates interpolation tables of length
|
The *table* and *table/cut* dihedral styles create interpolation tables
|
||||||
*Ntable* from dihedral potential and derivative values listed in a
|
of length *Ntable* from dihedral potential and derivative values listed
|
||||||
file(s) as a function of the dihedral angle "phi". The files are read
|
in a file(s) as a function of the dihedral angle "phi". The files are
|
||||||
by the :doc:`dihedral_coeff <dihedral_coeff>` command.
|
read by the :doc:`dihedral_coeff <dihedral_coeff>` command. For
|
||||||
|
dihedral style *table/cut* additionally an analytic cutoff that is
|
||||||
|
quadratic in the bond-angle (theta) is applied in order to regularize
|
||||||
|
the dihedral interaction.
|
||||||
|
|
||||||
The interpolation tables are created by fitting cubic splines to the
|
The interpolation tables are created by fitting cubic splines to the
|
||||||
file values and interpolating energy and derivative values at each of
|
file values and interpolating energy and derivative values at each of
|
||||||
@ -51,16 +64,53 @@ interpolated table. For a given dihedral angle (phi), the appropriate
|
|||||||
coefficients are chosen from this list, and a cubic polynomial is used
|
coefficients are chosen from this list, and a cubic polynomial is used
|
||||||
to compute the energy and the derivative at this angle.
|
to compute the energy and the derivative at this angle.
|
||||||
|
|
||||||
The following coefficients must be defined for each dihedral type via
|
For dihedral style *table* the following coefficients must be defined
|
||||||
the :doc:`dihedral_coeff <dihedral_coeff>` command as in the example
|
for each dihedral type via the :doc:`dihedral_coeff <dihedral_coeff>`
|
||||||
above.
|
command as in the example above.
|
||||||
|
|
||||||
* filename
|
* filename
|
||||||
* keyword
|
* keyword
|
||||||
|
|
||||||
The filename specifies a file containing tabulated energy and
|
The filename specifies a file containing tabulated energy and derivative
|
||||||
derivative values. The keyword specifies a section of the file. The
|
values. The keyword specifies which section of the file to read. The
|
||||||
format of this file is described below.
|
format of this file is the same for both dihedral styles and described
|
||||||
|
below.
|
||||||
|
|
||||||
|
For dihedral style *table/cut* the following coefficients must be
|
||||||
|
defined for each dihedral type via the :doc:`dihedral_coeff
|
||||||
|
<dihedral_coeff>` command as in the example above.
|
||||||
|
|
||||||
|
* style (aat)
|
||||||
|
* cutoff prefactor
|
||||||
|
* cutoff angle1
|
||||||
|
* cutoff angle2
|
||||||
|
* filename
|
||||||
|
* keyword
|
||||||
|
|
||||||
|
The cutoff dihedral style uses a tabulated dihedral interaction with a
|
||||||
|
cutoff function:
|
||||||
|
|
||||||
|
.. math::
|
||||||
|
|
||||||
|
f(\theta) & = K \qquad\qquad\qquad\qquad\qquad\qquad \theta < \theta_1 \\
|
||||||
|
f(\theta) & = K \left(1-\frac{(\theta - \theta_1)^2}{(\theta_2 - \theta_1)^2}\right) \qquad \theta_1 < \theta < \theta_2
|
||||||
|
|
||||||
|
The cutoff specifies an prefactor to the cutoff function. While this
|
||||||
|
value would ordinarily equal 1 there may be situations where the value
|
||||||
|
should change.
|
||||||
|
|
||||||
|
The cutoff :math:`\theta_1` specifies the angle (in degrees) below which
|
||||||
|
the dihedral interaction is unmodified, i.e. the cutoff function is 1.
|
||||||
|
|
||||||
|
The cutoff function is applied between :math:`\theta_1` and
|
||||||
|
:math:`\theta_2`, which is the angle at which the cutoff function drops
|
||||||
|
to zero. The value of zero effectively "turns off" the dihedral
|
||||||
|
interaction.
|
||||||
|
|
||||||
|
The filename specifies a file containing tabulated energy and derivative
|
||||||
|
values. The keyword specifies which section of the file to read. The
|
||||||
|
format of this file is the same for both dihedral styles and described
|
||||||
|
below.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -182,18 +232,19 @@ that matches the specified keyword.
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
This dihedral style writes the settings for the "dihedral_style table"
|
These dihedral styles write the settings for the "dihedral_style table"
|
||||||
command to :doc:`binary restart files <restart>`, so a dihedral_style
|
or "dihedral_style table/cut" command to :doc:`binary restart files
|
||||||
command does not need to specified in an input script that reads a
|
<restart>`, so a dihedral_style command does not need to specified in an
|
||||||
restart file. However, the coefficient information is not stored in
|
input script that reads a restart file. However, the coefficient
|
||||||
the restart file, since it is tabulated in the potential files. Thus,
|
information loaded from the table file(s) is not stored in the restart
|
||||||
|
file, since it is tabulated in the potential files. Thus, suitable
|
||||||
dihedral_coeff commands do need to be specified in the restart input
|
dihedral_coeff commands do need to be specified in the restart input
|
||||||
script.
|
script after reading the restart file.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This dihedral style can only be used if LAMMPS was built with the
|
These dihedral styles can only be used if LAMMPS was built with the
|
||||||
USER-MISC package. See the :doc:`Build package <Build_package>` doc
|
USER-MISC package. See the :doc:`Build package <Build_package>` doc
|
||||||
page for more info.
|
page for more info.
|
||||||
|
|
||||||
|
|||||||
@ -1,229 +0,0 @@
|
|||||||
.. index:: dihedral_style table/cut
|
|
||||||
|
|
||||||
dihedral_style table/cut command
|
|
||||||
================================
|
|
||||||
|
|
||||||
Syntax
|
|
||||||
""""""
|
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
dihedral_style table/cut style Ntable
|
|
||||||
|
|
||||||
* style = *linear* or *spline* = method of interpolation
|
|
||||||
* Ntable = size of the internal lookup table
|
|
||||||
|
|
||||||
Examples
|
|
||||||
""""""""
|
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
dihedral_style table/cut spline 400
|
|
||||||
dihedral_style table/cut linear 1000
|
|
||||||
dihedral_coeff 1 aat 1.0 177 180 file.table DIH_TABLE1
|
|
||||||
dihedral_coeff 2 aat 0.5 170 180 file.table DIH_TABLE2
|
|
||||||
|
|
||||||
Description
|
|
||||||
"""""""""""
|
|
||||||
|
|
||||||
The *table/cut* dihedral style creates interpolation tables of length
|
|
||||||
*Ntable* from dihedral potential and derivative values listed in a
|
|
||||||
file(s) as a function of the dihedral angle "phi". In addition, an
|
|
||||||
analytic cutoff that is quadratic in the bond-angle (theta) is applied
|
|
||||||
in order to regularize the dihedral interaction. The dihedral table
|
|
||||||
files are read by the :doc:`dihedral_coeff <dihedral_coeff>` command.
|
|
||||||
|
|
||||||
The interpolation tables are created by fitting cubic splines to the
|
|
||||||
file values and interpolating energy and derivative values at each of
|
|
||||||
*Ntable* dihedral angles. During a simulation, these tables are used
|
|
||||||
to interpolate energy and force values on individual atoms as
|
|
||||||
needed. The interpolation is done in one of 2 styles: *linear* or
|
|
||||||
*spline*\ .
|
|
||||||
|
|
||||||
For the *linear* style, the dihedral angle (phi) is used to find 2
|
|
||||||
surrounding table values from which an energy or its derivative is
|
|
||||||
computed by linear interpolation.
|
|
||||||
|
|
||||||
For the *spline* style, cubic spline coefficients are computed and
|
|
||||||
stored at each of the *Ntable* evenly-spaced values in the
|
|
||||||
interpolated table. For a given dihedral angle (phi), the appropriate
|
|
||||||
coefficients are chosen from this list, and a cubic polynomial is used
|
|
||||||
to compute the energy and the derivative at this angle.
|
|
||||||
|
|
||||||
The following coefficients must be defined for each dihedral type via
|
|
||||||
the :doc:`dihedral_coeff <dihedral_coeff>` command as in the example
|
|
||||||
above.
|
|
||||||
|
|
||||||
* style (aat)
|
|
||||||
* cutoff prefactor
|
|
||||||
* cutoff angle1
|
|
||||||
* cutoff angle2
|
|
||||||
* filename
|
|
||||||
* keyword
|
|
||||||
|
|
||||||
The cutoff dihedral style uses a tabulated dihedral interaction with a
|
|
||||||
cutoff function:
|
|
||||||
|
|
||||||
.. math::
|
|
||||||
|
|
||||||
f(\theta) & = K \qquad\qquad\qquad\qquad\qquad\qquad \theta < \theta_1 \\
|
|
||||||
f(\theta) & = K \left(1-\frac{(\theta - \theta_1)^2}{(\theta_2 - \theta_1)^2}\right) \qquad \theta_1 < \theta < \theta_2
|
|
||||||
|
|
||||||
The cutoff specifies an prefactor to the cutoff function. While this value
|
|
||||||
would ordinarily equal 1 there may be situations where the value should change.
|
|
||||||
|
|
||||||
The cutoff :math:`\theta_1` specifies the angle (in degrees) below which the dihedral
|
|
||||||
interaction is unmodified, i.e. the cutoff function is 1.
|
|
||||||
|
|
||||||
The cutoff function is applied between :math:`\theta_1` and :math:`\theta_2`, which is
|
|
||||||
the angle at which the cutoff function drops to zero. The value of zero effectively
|
|
||||||
"turns off" the dihedral interaction.
|
|
||||||
|
|
||||||
The filename specifies a file containing tabulated energy and
|
|
||||||
derivative values. The keyword specifies a section of the file. The
|
|
||||||
format of this file is described below.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
The format of a tabulated file is as follows (without the
|
|
||||||
parenthesized comments). It can begin with one or more comment
|
|
||||||
or blank lines.
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
# Table of the potential and its negative derivative
|
|
||||||
|
|
||||||
DIH_TABLE1 (keyword is the first text on line)
|
|
||||||
N 30 DEGREES (N, NOF, DEGREES, RADIANS, CHECKU/F)
|
|
||||||
(blank line)
|
|
||||||
1 -168.0 -1.40351172223 0.0423346818422
|
|
||||||
2 -156.0 -1.70447981034 0.00811786522531
|
|
||||||
3 -144.0 -1.62956100432 -0.0184129719987
|
|
||||||
...
|
|
||||||
30 180.0 -0.707106781187 0.0719306095245
|
|
||||||
|
|
||||||
# Example 2: table of the potential. Forces omitted
|
|
||||||
|
|
||||||
DIH_TABLE2
|
|
||||||
N 30 NOF CHECKU testU.dat CHECKF testF.dat
|
|
||||||
|
|
||||||
1 -168.0 -1.40351172223
|
|
||||||
2 -156.0 -1.70447981034
|
|
||||||
3 -144.0 -1.62956100432
|
|
||||||
...
|
|
||||||
30 180.0 -0.707106781187
|
|
||||||
|
|
||||||
A section begins with a non-blank line whose first character is not a
|
|
||||||
"#"; blank lines or lines starting with "#" can be used as comments
|
|
||||||
between sections. The first line begins with a keyword which
|
|
||||||
identifies the section. The line can contain additional text, but the
|
|
||||||
initial text must match the argument specified in the
|
|
||||||
:doc:`dihedral_coeff <dihedral_coeff>` command. The next line lists (in
|
|
||||||
any order) one or more parameters for the table. Each parameter is a
|
|
||||||
keyword followed by one or more numeric values.
|
|
||||||
|
|
||||||
Following a blank line, the next N lines list the tabulated values. On
|
|
||||||
each line, the first value is the index from 1 to N, the second value is
|
|
||||||
the angle value, the third value is the energy (in energy units), and
|
|
||||||
the fourth is -dE/d(phi) also in energy units). The third term is the
|
|
||||||
energy of the 4-atom configuration for the specified angle. The fourth
|
|
||||||
term (when present) is the negative derivative of the energy with
|
|
||||||
respect to the angle (in degrees, or radians depending on whether the
|
|
||||||
user selected DEGREES or RADIANS). Thus the units of the last term
|
|
||||||
are still energy, not force. The dihedral angle values must increase
|
|
||||||
from one line to the next.
|
|
||||||
|
|
||||||
Dihedral table splines are cyclic. There is no discontinuity at 180
|
|
||||||
degrees (or at any other angle). Although in the examples above, the
|
|
||||||
angles range from -180 to 180 degrees, in general, the first angle in
|
|
||||||
the list can have any value (positive, zero, or negative). However
|
|
||||||
the *range* of angles represented in the table must be *strictly* less
|
|
||||||
than 360 degrees (2pi radians) to avoid angle overlap. (You may not
|
|
||||||
supply entries in the table for both 180 and -180, for example.) If
|
|
||||||
the user's table covers only a narrow range of dihedral angles,
|
|
||||||
strange numerical behavior can occur in the large remaining gap.
|
|
||||||
|
|
||||||
**Parameters:**
|
|
||||||
|
|
||||||
The parameter "N" is required and its value is the number of table
|
|
||||||
entries that follow. Note that this may be different than the N
|
|
||||||
specified in the :doc:`dihedral_style table <dihedral_style>` command.
|
|
||||||
Let *Ntable* is the number of table entries requested dihedral_style
|
|
||||||
command, and let *Nfile* be the parameter following "N" in the
|
|
||||||
tabulated file ("30" in the sparse example above). What LAMMPS does
|
|
||||||
is a preliminary interpolation by creating splines using the *Nfile*
|
|
||||||
tabulated values as nodal points. It uses these to interpolate as
|
|
||||||
needed to generate energy and derivative values at *Ntable* different
|
|
||||||
points (which are evenly spaced over a 360 degree range, even if the
|
|
||||||
angles in the file are not). The resulting tables of length *Ntable*
|
|
||||||
are then used as described above, when computing energy and force for
|
|
||||||
individual dihedral angles and their atoms. This means that if you
|
|
||||||
want the interpolation tables of length *Ntable* to match exactly what
|
|
||||||
is in the tabulated file (with effectively nopreliminary
|
|
||||||
interpolation), you should set *Ntable* = *Nfile*\ . To insure the
|
|
||||||
nodal points in the user's file are aligned with the interpolated
|
|
||||||
table entries, the angles in the table should be integer multiples of
|
|
||||||
360/\ *Ntable* degrees, or 2\*PI/\ *Ntable* radians (depending on your
|
|
||||||
choice of angle units).
|
|
||||||
|
|
||||||
The optional "NOF" keyword allows the user to omit the forces
|
|
||||||
(negative energy derivatives) from the table file (normally located in
|
|
||||||
the fourth column). In their place, forces will be calculated
|
|
||||||
automatically by differentiating the potential energy function
|
|
||||||
indicated by the third column of the table (using either linear or
|
|
||||||
spline interpolation).
|
|
||||||
|
|
||||||
The optional "DEGREES" keyword allows the user to specify angles in
|
|
||||||
degrees instead of radians (default).
|
|
||||||
|
|
||||||
The optional "RADIANS" keyword allows the user to specify angles in
|
|
||||||
radians instead of degrees. (Note: This changes the way the forces
|
|
||||||
are scaled in the fourth column of the data file.)
|
|
||||||
|
|
||||||
The optional "CHECKU" keyword is followed by a filename. This allows
|
|
||||||
the user to save all of the *Ntable* different entries in the
|
|
||||||
interpolated energy table to a file to make sure that the interpolated
|
|
||||||
function agrees with the user's expectations. (Note: You can
|
|
||||||
temporarily increase the *Ntable* parameter to a high value for this
|
|
||||||
purpose. "\ *Ntable*\ " is explained above.)
|
|
||||||
|
|
||||||
The optional "CHECKF" keyword is analogous to the "CHECKU" keyword.
|
|
||||||
It is followed by a filename, and it allows the user to check the
|
|
||||||
interpolated force table. This option is available even if the user
|
|
||||||
selected the "NOF" option.
|
|
||||||
|
|
||||||
Note that one file can contain many sections, each with a tabulated
|
|
||||||
potential. LAMMPS reads the file section by section until it finds one
|
|
||||||
that matches the specified keyword.
|
|
||||||
|
|
||||||
Restart, fix_modify, output, run start/stop, minimize info
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
This dihedral style writes the settings for the "dihedral_style table/cut"
|
|
||||||
command to :doc:`binary restart files <restart>`, so a dihedral_style
|
|
||||||
command does not need to specified in an input script that reads a
|
|
||||||
restart file. However, the coefficient information is not stored in
|
|
||||||
the restart file, since it is tabulated in the potential files. Thus,
|
|
||||||
dihedral_coeff commands do need to be specified in the restart input
|
|
||||||
script.
|
|
||||||
|
|
||||||
Restrictions
|
|
||||||
""""""""""""
|
|
||||||
|
|
||||||
This dihedral style can only be used if LAMMPS was built with the
|
|
||||||
USER-MISC package. See the :doc:`Build package <Build_package>` doc
|
|
||||||
page for more info.
|
|
||||||
|
|
||||||
Related commands
|
|
||||||
""""""""""""""""
|
|
||||||
|
|
||||||
:doc:`dihedral_coeff <dihedral_coeff>`, :doc:`dihedral_style table <dihedral_table>`
|
|
||||||
|
|
||||||
Default
|
|
||||||
"""""""
|
|
||||||
|
|
||||||
none
|
|
||||||
|
|
||||||
.. _dihedralcut-Salerno:
|
|
||||||
|
|
||||||
**(Salerno)** Salerno, Bernstein, J Chem Theory Comput, --, ---- (2018).
|
|
||||||
@ -349,7 +349,7 @@ the box size stored with the snapshot.
|
|||||||
|
|
||||||
The *xtc* style writes XTC files, a compressed trajectory format used
|
The *xtc* style writes XTC files, a compressed trajectory format used
|
||||||
by the GROMACS molecular dynamics package, and described
|
by the GROMACS molecular dynamics package, and described
|
||||||
`here <http://manual.gromacs.org/current/online/xtc.html>`_.
|
`here <https://manual.gromacs.org/current/reference-manual/file-formats.html#xtc>`_.
|
||||||
The precision used in XTC files can be adjusted via the
|
The precision used in XTC files can be adjusted via the
|
||||||
:doc:`dump_modify <dump_modify>` command. The default value of 1000
|
:doc:`dump_modify <dump_modify>` command. The default value of 1000
|
||||||
means that coordinates are stored to 1/1000 nanometer accuracy. XTC
|
means that coordinates are stored to 1/1000 nanometer accuracy. XTC
|
||||||
|
|||||||
@ -128,9 +128,9 @@ formulas for the meaning of these parameters:
|
|||||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||||
| :doc:`born/coul/long, born/coul/msm <pair_born>` | coulombic_cutoff | type global |
|
| :doc:`born/coul/long, born/coul/msm <pair_born>` | coulombic_cutoff | type global |
|
||||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
| :doc:`buck, buck/coul/cut <pair_buck>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||||
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | coulombic_cutoff | type global |
|
| :doc:`buck/coul/long, buck/coul/msm <pair_buck>` | a,c,coulombic_cutoff | type pairs |
|
||||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
+------------------------------------------------------------------------------+--------------------------------------------------+-------------+
|
||||||
|
|||||||
@ -120,7 +120,7 @@ styles and their energy formulas for the meaning of these parameters:
|
|||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
| :doc:`born <pair_born>` | a,b,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`buck <pair_buck>` | a,c | type pairs |
|
| :doc:`buck, buck/coul/cut, buck/coul/long, buck/coul/msm <pair_buck>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
| :doc:`buck/mdf <pair_mdf>` | a,c | type pairs |
|
||||||
+------------------------------------------------------------------------------+-------------------------+------------+
|
+------------------------------------------------------------------------------+-------------------------+------------+
|
||||||
|
|||||||
@ -118,32 +118,38 @@ converge properly.
|
|||||||
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>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential "energy" inferred by the added force to the
|
this fix to add the potential energy inferred by the added force to
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
the global potential energy of the system as part of
|
||||||
needed so that the :doc:`minimize <minimize>` command can include the
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
forces added by this fix in a consistent manner. I.e. there is a
|
this fix is :doc:`fix_modify energy no <fix_modify>`. Note that this
|
||||||
decrease in potential energy when atoms move in the direction of the
|
energy is a fictitious quantity but is needed so that the
|
||||||
added force.
|
:doc:`minimize <minimize>` command can include the forces added by
|
||||||
|
this fix in a consistent manner. I.e. there is a decrease in
|
||||||
|
potential energy when atoms move in the direction of the added force.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||||
fix to add the contribution due to the added forces on atoms to the
|
this fix to add the contribution due to the added forces on atoms to
|
||||||
system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
both the global pressure and per-atom stress of the system via the
|
||||||
The default is *virial no*
|
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||||
|
stress/atom <compute_stress_atom>` commands. The former can be
|
||||||
|
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||||
|
setting for this fix is :doc:`fix_modify virial no <fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
integrator the fix is adding its forces. Default is the outermost
|
<run_style>` integrator the fix is adding its forces. Default is the
|
||||||
level.
|
outermost level.
|
||||||
|
|
||||||
This fix computes a global scalar and a global 3-vector of forces,
|
This fix computes a global scalar and a global 3-vector of forces,
|
||||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
which can be accessed by various :doc:`output commands
|
||||||
The scalar is the potential energy discussed above. The vector is the
|
<Howto_output>`. The scalar is the potential energy discussed above.
|
||||||
total force on the group of atoms before the forces on individual
|
The vector is the total force on the group of atoms before the forces
|
||||||
atoms are changed by the fix. The scalar and vector values calculated
|
on individual atoms are changed by the fix. The scalar and vector
|
||||||
by this fix are "extensive".
|
values calculated by this fix are "extensive".
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
@ -55,13 +55,15 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential "energy" inferred by the added forces to the
|
this fix to add the potential "energy" inferred by the added torques
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
to the global potential energy of the system as part of
|
||||||
needed so that the :doc:`minimize <minimize>` command can include the
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
forces added by this fix in a consistent manner. I.e. there is a
|
this fix is :doc:`fix_modify energy no <fix_modify>`. Note that this
|
||||||
decrease in potential energy when atoms move in the direction of the
|
is a fictitious quantity but is needed so that the :doc:`minimize
|
||||||
added forces.
|
<minimize>` command can include the forces added by this fix in a
|
||||||
|
consistent manner. I.e. there is a decrease in potential energy when
|
||||||
|
atoms move in the direction of the added forces.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by
|
||||||
this fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
this fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
||||||
@ -78,16 +80,28 @@ No parameter of this fix can be used with the *start/stop* keywords of
|
|||||||
the :doc:`run <run>` command.
|
the :doc:`run <run>` command.
|
||||||
|
|
||||||
The forces due to this fix are imposed during an energy minimization,
|
The forces due to this fix are imposed during an energy minimization,
|
||||||
invoked by the :doc:`minimize <minimize>` command. You should not
|
invoked by the :doc:`minimize <minimize>` command.
|
||||||
specify force components with a variable that has time-dependence for
|
|
||||||
use with a minimizer, since the minimizer increments the timestep as
|
.. note::
|
||||||
the iteration count during the minimization.
|
|
||||||
|
If you want the fictitious potential energy associated with the
|
||||||
|
added forces to be included in the total potential energy of the
|
||||||
|
system (the quantity being minimized), you MUST enable the
|
||||||
|
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
You should not specify force components with a variable that has
|
||||||
|
time-dependence for use with a minimizer, since the minimizer
|
||||||
|
increments the timestep as the iteration count during the
|
||||||
|
minimization.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This fix is part of the USER-MISC package. It is only enabled if
|
This fix is part of the USER-MISC package. It is only enabled if
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
|
<Build_package>` doc page for more info.
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -122,10 +122,22 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files
|
No information about this fix is written to :doc:`binary restart files
|
||||||
<restart>`. The :doc:`fix_modify <fix_modify>` options relevant to this
|
<restart>`.
|
||||||
fix are listed below. No global scalar or vector or per-atom quantities
|
|
||||||
are stored by this fix for access by various :doc:`output commands
|
The :doc:`fix_modify <fix_modify>` *energy* option is not supported by
|
||||||
<Howto_output>`. No parameter of this fix can be used with the
|
this fix, but this fix does add the kinetic energy imparted to atoms
|
||||||
|
by the momentum coupling mode of the AtC package to the global
|
||||||
|
potential energy of the system as part of :doc:`thermodynamic output
|
||||||
|
<thermo_style>`.
|
||||||
|
|
||||||
|
Additional :doc:`fix_modify <fix_modify>` options relevant to this
|
||||||
|
fix are listed below.
|
||||||
|
|
||||||
|
This fix computes a global scalar which can be accessed by various
|
||||||
|
:doc:`output commands <Howto_output>`. The scalar is the energy
|
||||||
|
discussed in the previous paragraph. The scalar value is "extensive".
|
||||||
|
|
||||||
|
No parameter of this fix can be used with the
|
||||||
*start/stop* keywords of the :doc:`run <run>` command. This fix is not
|
*start/stop* keywords of the :doc:`run <run>` command. This fix is not
|
||||||
invoked during :doc:`energy minimization <minimize>`.
|
invoked during :doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
@ -145,10 +157,10 @@ one, e.g. nve, nvt, etc. In addition, currently:
|
|||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|
||||||
After specifying this fix in your input script, several other
|
After specifying this fix in your input script, several
|
||||||
:doc:`fix_modify <fix_modify>` commands are used to setup the problem,
|
:doc:`fix_modify AtC <fix_modify>` commands are used to setup the
|
||||||
e.g. define the finite element mesh and prescribe initial and boundary
|
problem, e.g. define the finite element mesh and prescribe initial and
|
||||||
conditions.
|
boundary conditions. Each of these options has its own doc page.
|
||||||
|
|
||||||
*fix_modify* commands for setup:
|
*fix_modify* commands for setup:
|
||||||
|
|
||||||
@ -240,7 +252,8 @@ miscellaneous *fix_modify* commands:
|
|||||||
* :doc:`fix_modify AtC remove_species <atc_remove_species>`
|
* :doc:`fix_modify AtC remove_species <atc_remove_species>`
|
||||||
* :doc:`fix_modify AtC remove_molecule <atc_remove_molecule>`
|
* :doc:`fix_modify AtC remove_molecule <atc_remove_molecule>`
|
||||||
|
|
||||||
Note: a set of example input files with the attendant material files are included in the ``examples/USER/atc`` folders.
|
Note: a set of example input files with the attendant material files
|
||||||
|
are included in the ``examples/USER/atc`` folders.
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
@ -252,30 +265,52 @@ For detailed exposition of the theory and algorithms please see:
|
|||||||
|
|
||||||
.. _Wagner:
|
.. _Wagner:
|
||||||
|
|
||||||
**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An atomistic-to-continuum coupling method for heat transfer in solids." Special Issue of Computer Methods and Applied Mechanics (2008) 197:3351.
|
**(Wagner)** Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An
|
||||||
|
atomistic-to-continuum coupling method for heat transfer in solids."
|
||||||
|
Special Issue of Computer Methods and Applied Mechanics (2008)
|
||||||
|
197:3351.
|
||||||
|
|
||||||
.. _Zimmeman2004:
|
.. _Zimmeman2004:
|
||||||
|
|
||||||
**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004), 12:S319.
|
**(Zimmerman2004)** Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE;
|
||||||
|
Klein, PA; Bammann, DJ, "Calculation of stress in atomistic
|
||||||
|
simulation." Special Issue of Modelling and Simulation in Materials
|
||||||
|
Science and Engineering (2004), 12:S319.
|
||||||
|
|
||||||
.. _Zimmerman2010:
|
.. _Zimmerman2010:
|
||||||
|
|
||||||
**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A material frame approach for evaluating continuum variables in atomistic simulations." Journal of Computational Physics (2010), 229:2364.
|
**(Zimmerman2010)** Zimmerman, JA; Jones, RE; Templeton, JA, "A
|
||||||
|
material frame approach for evaluating continuum variables in
|
||||||
|
atomistic simulations." Journal of Computational Physics (2010),
|
||||||
|
229:2364.
|
||||||
|
|
||||||
.. _Templeton2010:
|
.. _Templeton2010:
|
||||||
|
|
||||||
**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application of a field-based method to spatially varying thermal transport problems in molecular dynamics." Modelling and Simulation in Materials Science and Engineering (2010), 18:085007.
|
**(Templeton2010)** Templeton, JA; Jones, RE; Wagner, GJ, "Application
|
||||||
|
of a field-based method to spatially varying thermal transport
|
||||||
|
problems in molecular dynamics." Modelling and Simulation in
|
||||||
|
Materials Science and Engineering (2010), 18:085007.
|
||||||
|
|
||||||
.. _Jones:
|
.. _Jones:
|
||||||
|
|
||||||
**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine, JA, "Electron transport enhanced molecular dynamics for metals and semi-metals." International Journal for Numerical Methods in Engineering (2010), 83:940.
|
**(Jones)** Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine,
|
||||||
|
JA, "Electron transport enhanced molecular dynamics for metals and
|
||||||
|
semi-metals." International Journal for Numerical Methods in
|
||||||
|
Engineering (2010), 83:940.
|
||||||
|
|
||||||
.. _Templeton2011:
|
.. _Templeton2011:
|
||||||
|
|
||||||
**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA; Wong, BM, "A long-range electric field solver for molecular dynamics based on atomistic-to-continuum modeling." Journal of Chemical Theory and Computation (2011), 7:1736.
|
**(Templeton2011)** Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA;
|
||||||
|
Wong, BM, "A long-range electric field solver for molecular dynamics
|
||||||
|
based on atomistic-to-continuum modeling." Journal of Chemical Theory
|
||||||
|
and Computation (2011), 7:1736.
|
||||||
|
|
||||||
.. _Mandadapu:
|
.. _Mandadapu:
|
||||||
|
|
||||||
**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization as a field variable from molecular dynamics simulations." Journal of Chemical Physics (2013), 139:054115.
|
**(Mandadapu)** Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization
|
||||||
|
as a field variable from molecular dynamics simulations." Journal of
|
||||||
|
Chemical Physics (2013), 139:054115.
|
||||||
|
|
||||||
Please refer to the standard finite element (FE) texts, e.g. T.J.R Hughes " The finite element method ", Dover 2003, for the basics of FE simulation.
|
Please refer to the standard finite element (FE) texts, e.g. T.J.R
|
||||||
|
Hughes " The finite element method ", Dover 2003, for the basics of FE
|
||||||
|
simulation.
|
||||||
|
|||||||
@ -307,7 +307,9 @@ atoms in the chunk. The averaged output value for the chunk on the
|
|||||||
average over atoms across the entire *Nfreq* timescale. For the
|
average over atoms across the entire *Nfreq* timescale. For the
|
||||||
*density/number* and *density/mass* values, the volume (bin volume or
|
*density/number* and *density/mass* values, the volume (bin volume or
|
||||||
system volume) used in the final normalization will be the volume at
|
system volume) used in the final normalization will be the volume at
|
||||||
the final *Nfreq* timestep.
|
the final *Nfreq* timestep. For the *temp* values, degrees of freedom and
|
||||||
|
kinetic energy are summed separately across the entire *Nfreq* timescale, and
|
||||||
|
the output value is calculated by dividing those two sums.
|
||||||
|
|
||||||
If the *norm* setting is *sample*\ , the chunk value is summed over
|
If the *norm* setting is *sample*\ , the chunk value is summed over
|
||||||
atoms for each sample, as is the count, and an "average sample value"
|
atoms for each sample, as is the count, and an "average sample value"
|
||||||
|
|||||||
@ -138,8 +138,8 @@ vector or columns of the array had been listed one by one. E.g. these
|
|||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
compute myCOM all com/chunk
|
compute myCOM all com/chunk
|
||||||
fix 1 all ave/histo 100 1 100 c_myCOM[*] file tmp1.com mode vector
|
fix 1 all ave/histo 100 1 100 -10.0 10.0 100 c_myCOM[*] file tmp1.com mode vector
|
||||||
fix 2 all ave/histo 100 1 100 c_myCOM[1] c_myCOM[2] c_myCOM[3] file tmp2.com mode vector
|
fix 2 all ave/histo 100 1 100 -10.0 10.0 100 c_myCOM[1] c_myCOM[2] c_myCOM[3] file tmp2.com mode vector
|
||||||
|
|
||||||
If the fix ave/histo/weight command is used, exactly two values must
|
If the fix ave/histo/weight command is used, exactly two values must
|
||||||
be specified. If the values are vectors, they must be the same
|
be specified. If the values are vectors, they must be the same
|
||||||
|
|||||||
@ -75,6 +75,39 @@ Note that *V_avg* and *Coeff_i* should all be in the proper units, e.g. if you
|
|||||||
are using *units real*\ , *V_avg* should be in cubic angstroms, and the
|
are using *units real*\ , *V_avg* should be in cubic angstroms, and the
|
||||||
coefficients should all be in atmospheres \* cubic angstroms.
|
coefficients should all be in atmospheres \* cubic angstroms.
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
This fix writes the cumulative global energy change to :doc:`binary
|
||||||
|
restart files <restart>`. See the :doc:`read_restart <read_restart>`
|
||||||
|
command for info on how to re-specify a fix in an input script that
|
||||||
|
reads a restart file, so that the fix continues in an uninterrupted
|
||||||
|
fashion.
|
||||||
|
|
||||||
|
The :doc:`fix_modify <fix_modify>` *temp* option is supported by this
|
||||||
|
fix. You can use it to assign a temperature :doc:`compute <compute>`
|
||||||
|
you have defined to this fix which will be used in its thermostatting
|
||||||
|
procedure, as described above. For consistency, the group used by
|
||||||
|
this fix and by the compute should be the same.
|
||||||
|
|
||||||
|
The cumulative energy change in the system imposed by this fix is
|
||||||
|
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||||
|
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||||
|
doc page for details.
|
||||||
|
|
||||||
|
This fix computes a global scalar which can be accessed by various
|
||||||
|
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||||
|
cumulative energy change due to this fix described in the previous
|
||||||
|
paragraph. The scalar value calculated by this fix is "extensive".
|
||||||
|
|
||||||
|
This fix can ramp its target temperature over multiple runs, using the
|
||||||
|
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||||
|
:doc:`run <run>` command for details of how to do this.
|
||||||
|
|
||||||
|
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Syntax
|
|||||||
* template-ID(post-reacted) = ID of a molecule template containing post-reaction topology
|
* template-ID(post-reacted) = ID of a molecule template containing post-reaction topology
|
||||||
* map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates
|
* map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates
|
||||||
* zero or more individual keyword/value pairs may be appended to each react argument
|
* zero or more individual keyword/value pairs may be appended to each react argument
|
||||||
* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges*
|
* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* or *molecule* or *modify_create*
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
@ -59,6 +59,12 @@ Syntax
|
|||||||
off = allow both inter- and intramolecular reactions (default)
|
off = allow both inter- and intramolecular reactions (default)
|
||||||
inter = search for reactions between molecules with different IDs
|
inter = search for reactions between molecules with different IDs
|
||||||
intra = search for reactions within the same molecule
|
intra = search for reactions within the same molecule
|
||||||
|
*modify_create* keyword values
|
||||||
|
*fit* value = *all* or *fragmentID*
|
||||||
|
all = use all eligible atoms for create-atoms fit (default)
|
||||||
|
fragmentID = ID of molecule fragment used for create-atoms fit
|
||||||
|
*overlap* value = R
|
||||||
|
R = only insert atom/molecule if further than R from existing particles (distance units)
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
""""""""
|
""""""""
|
||||||
@ -89,7 +95,9 @@ documentation. Topology changes are defined in pre- and post-reaction
|
|||||||
molecule templates and can include creation and deletion of bonds,
|
molecule templates and can include creation and deletion of bonds,
|
||||||
angles, dihedrals, impropers, bond types, angle types, dihedral types,
|
angles, dihedrals, impropers, bond types, angle types, dihedral types,
|
||||||
atom types, or atomic charges. In addition, reaction by-products or
|
atom types, or atomic charges. In addition, reaction by-products or
|
||||||
other molecules can be identified and deleted.
|
other molecules can be identified and deleted. Finally, atoms can be
|
||||||
|
created and inserted at specific positions relative to the reaction
|
||||||
|
site.
|
||||||
|
|
||||||
Fix bond/react does not use quantum mechanical (eg. fix qmmm) or
|
Fix bond/react does not use quantum mechanical (eg. fix qmmm) or
|
||||||
pairwise bond-order potential (eg. Tersoff or AIREBO) methods to
|
pairwise bond-order potential (eg. Tersoff or AIREBO) methods to
|
||||||
@ -262,14 +270,14 @@ command page.
|
|||||||
|
|
||||||
The post-reacted molecule template contains a sample of the reaction
|
The post-reacted molecule template contains a sample of the reaction
|
||||||
site and its surrounding topology after the reaction has occurred. It
|
site and its surrounding topology after the reaction has occurred. It
|
||||||
must contain the same number of atoms as the pre-reacted template. A
|
must contain the same number of atoms as the pre-reacted template
|
||||||
one-to-one correspondence between the atom IDs in the pre- and
|
(unless there are created atoms). A one-to-one correspondence between
|
||||||
post-reacted templates is specified in the map file as described
|
the atom IDs in the pre- and post-reacted templates is specified in
|
||||||
below. Note that during a reaction, an atom, bond, etc. type may
|
the map file as described below. Note that during a reaction, an atom,
|
||||||
change to one that was previously not present in the simulation. These
|
bond, etc. type may change to one that was previously not present in
|
||||||
new types must also be defined during the setup of a given simulation.
|
the simulation. These new types must also be defined during the setup
|
||||||
A discussion of correctly handling this is also provided on the
|
of a given simulation. A discussion of correctly handling this is also
|
||||||
:doc:`molecule <molecule>` command page.
|
provided on the :doc:`molecule <molecule>` command page.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@ -283,7 +291,7 @@ A discussion of correctly handling this is also provided on the
|
|||||||
The map file is a text document with the following format:
|
The map file is a text document with the following format:
|
||||||
|
|
||||||
A map file has a header and a body. The header of map file the
|
A map file has a header and a body. The header of map file the
|
||||||
contains one mandatory keyword and four optional keywords. The
|
contains one mandatory keyword and five optional keywords. The
|
||||||
mandatory keyword is 'equivalences':
|
mandatory keyword is 'equivalences':
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
@ -296,11 +304,12 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and
|
|||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
N *edgeIDs* = # of edge atoms N in the pre-reacted molecule template
|
N *edgeIDs* = # of edge atoms N in the pre-reacted molecule template
|
||||||
N *deleteIDs* = # of atoms N that are specified for deletion
|
N *deleteIDs* = # of atoms N that are deleted
|
||||||
N *chiralIDs* = # of specified chiral centers N
|
N *createIDs* = # of atoms N that are created
|
||||||
N *constraints* = # of specified reaction constraints N
|
N *chiralIDs* = # of chiral centers N
|
||||||
|
N *constraints* = # of reaction constraints N
|
||||||
|
|
||||||
The body of the map file contains two mandatory sections and four
|
The body of the map file contains two mandatory sections and five
|
||||||
optional sections. The first mandatory section begins with the keyword
|
optional sections. The first mandatory section begins with the keyword
|
||||||
'InitiatorIDs' and lists the two atom IDs of the initiator atom pair
|
'InitiatorIDs' and lists the two atom IDs of the initiator atom pair
|
||||||
in the pre-reacted molecule template. The second mandatory section
|
in the pre-reacted molecule template. The second mandatory section
|
||||||
@ -313,8 +322,10 @@ the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the
|
|||||||
pre-reacted molecule template. The second optional section begins with
|
pre-reacted molecule template. The second optional section begins with
|
||||||
the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction
|
the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction
|
||||||
template atoms to delete. The third optional section begins with the
|
template atoms to delete. The third optional section begins with the
|
||||||
|
keyword 'CreateIDs' and lists the atom IDs of the post-reaction
|
||||||
|
template atoms to create. The fourth optional section begins with the
|
||||||
keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose
|
keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose
|
||||||
handedness should be enforced. The fourth optional section begins with
|
handedness should be enforced. The fifth optional section begins with
|
||||||
the keyword 'Constraints' and lists additional criteria that must be
|
the keyword 'Constraints' and lists additional criteria that must be
|
||||||
satisfied in order for the reaction to occur. Currently, there are
|
satisfied in order for the reaction to occur. Currently, there are
|
||||||
five types of constraints available, as discussed below: 'distance',
|
five types of constraints available, as discussed below: 'distance',
|
||||||
@ -353,6 +364,38 @@ A sample map file is given below:
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
A user-specified set of atoms can be deleted by listing their
|
||||||
|
pre-reaction template IDs in the DeleteIDs section. A deleted atom
|
||||||
|
must still be included in the post-reaction molecule template, in
|
||||||
|
which it cannot be bonded to an atom that is not deleted. In addition
|
||||||
|
to deleting unwanted reaction by-products, this feature can be used to
|
||||||
|
remove specific topologies, such as small rings, that may be otherwise
|
||||||
|
indistinguishable.
|
||||||
|
|
||||||
|
Atoms can be created by listing their post-reaction template IDs in
|
||||||
|
the CreateIDs section. A created atom should not be included in the
|
||||||
|
pre-reaction template. The inserted positions of created atoms are
|
||||||
|
determined by the coordinates of the post-reaction template, after
|
||||||
|
optimal translation and rotation of the post-reaction template to the
|
||||||
|
reaction site (using a fit with atoms that are neither created nor
|
||||||
|
deleted). The *modify_create* keyword can be used to modify the
|
||||||
|
default behavior when creating atoms. The *modify_create* keyword has
|
||||||
|
two sub-keywords, *fit* and *overlap*. One or more of the sub-keywords
|
||||||
|
may be used after the *modify_create* keyword. The *fit* sub-keyword
|
||||||
|
can be used to specify which post-reaction atoms are used for the
|
||||||
|
optimal translation and rotation of the post-reaction template. The
|
||||||
|
*fragmentID* value of the *fit* sub-keyword must be the name of a
|
||||||
|
molecule fragment defined in the post-reaction :doc:`molecule
|
||||||
|
<molecule>` template, and only atoms in this fragment are used for the
|
||||||
|
fit. Atoms are created only if no current atom in the simulation is
|
||||||
|
within a distance R of any created atom, including the effect of
|
||||||
|
periodic boundary conditions if applicable. R is defined by the
|
||||||
|
*overlap* sub-keyword. Note that the default value for R is 0.0, which
|
||||||
|
will allow atoms to strongly overlap if you are inserting where other
|
||||||
|
atoms are present. The velocity of each created atom is initialized in
|
||||||
|
a random direction with a magnitude calculated from the instantaneous
|
||||||
|
temperature of the reaction site.
|
||||||
|
|
||||||
The handedness of atoms that are chiral centers can be enforced by
|
The handedness of atoms that are chiral centers can be enforced by
|
||||||
listing their IDs in the ChiralIDs section. A chiral atom must be
|
listing their IDs in the ChiralIDs section. A chiral atom must be
|
||||||
bonded to four atoms with mutually different atom types. This feature
|
bonded to four atoms with mutually different atom types. This feature
|
||||||
@ -528,15 +571,6 @@ the same molecule ID are considered for the reaction.
|
|||||||
|
|
||||||
A few other considerations:
|
A few other considerations:
|
||||||
|
|
||||||
Many reactions result in one or more atoms that are considered
|
|
||||||
unwanted by-products. Therefore, bond/react provides the option to
|
|
||||||
delete a user-specified set of atoms. These pre-reaction atoms are
|
|
||||||
identified in the map file. A deleted atom must still be included in
|
|
||||||
the post-reaction molecule template, in which it cannot be bonded to
|
|
||||||
an atom that is not deleted. In addition to deleting unwanted reaction
|
|
||||||
by-products, this feature can be used to remove specific topologies,
|
|
||||||
such as small rings, that may be otherwise indistinguishable.
|
|
||||||
|
|
||||||
Optionally, you can enforce additional behaviors on reacting atoms.
|
Optionally, you can enforce additional behaviors on reacting atoms.
|
||||||
For example, it may be beneficial to force reacting atoms to remain at
|
For example, it may be beneficial to force reacting atoms to remain at
|
||||||
a certain temperature. For this, you can use the internally-created
|
a certain temperature. For this, you can use the internally-created
|
||||||
@ -610,14 +644,14 @@ Default
|
|||||||
"""""""
|
"""""""
|
||||||
|
|
||||||
The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60,
|
The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60,
|
||||||
reset_mol_ids = yes, custom_charges = no, molecule = off
|
reset_mol_ids = yes, custom_charges = no, molecule = off, modify_create = no
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _Gissinger:
|
.. _Gissinger:
|
||||||
|
|
||||||
**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017).
|
**(Gissinger2017)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017).
|
||||||
|
|
||||||
.. _Gissinger2020:
|
.. _Gissinger2020:
|
||||||
|
|
||||||
**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020).
|
**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020).
|
||||||
|
|||||||
@ -47,14 +47,15 @@ for running *ab initio* MD with quantum forces.
|
|||||||
The group associated with this fix is ignored.
|
The group associated with this fix is ignored.
|
||||||
|
|
||||||
The protocol and :doc:`units <units>` for message format and content
|
The protocol and :doc:`units <units>` for message format and content
|
||||||
that LAMMPS exchanges with the server code is defined on the :doc:`server md <server_md>` doc page.
|
that LAMMPS exchanges with the server code is defined on the
|
||||||
|
:doc:`server md <server_md>` doc page.
|
||||||
|
|
||||||
Note that when using LAMMPS as an MD client, your LAMMPS input script
|
Note that when using LAMMPS as an MD client, your LAMMPS input script
|
||||||
should not normally contain force field commands, like a
|
should not normally contain force field commands, like a
|
||||||
:doc:`pair_style <pair_style>`, :doc:`bond_style <bond_style>`, or
|
:doc:`pair_style <pair_style>`, :doc:`bond_style <bond_style>`, or
|
||||||
:doc:`kspace_style <kspace_style>` command. However it is possible for
|
:doc:`kspace_style <kspace_style>` command. However it is possible
|
||||||
a server code to only compute a portion of the full force-field, while
|
for a server code to only compute a portion of the full force-field,
|
||||||
LAMMPS computes the remaining part. Your LAMMPS script can also
|
while LAMMPS computes the remaining part. Your LAMMPS script can also
|
||||||
specify boundary conditions or force constraints in the usual way,
|
specify boundary conditions or force constraints in the usual way,
|
||||||
which will be added to the per-atom forces returned by the server
|
which will be added to the per-atom forces returned by the server
|
||||||
code.
|
code.
|
||||||
@ -69,16 +70,21 @@ LAMMPS and another code in tandem to perform a coupled simulation.
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential energy computed by the server application to
|
this fix to add the potential energy set by the server application to
|
||||||
the system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
the global potential energy of the system as part of
|
||||||
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
|
this fix is :doc:`fix_modify energy yes <fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||||
fix to add the server application's contribution to the system's
|
this fix to add the contribution computed by the server application to
|
||||||
virial as part of :doc:`thermodynamic output <thermo_style>`. The
|
the global pressure of the system via the :doc:`compute pressure
|
||||||
default is *virial yes*
|
<compute_pressure>` command. This can be accessed by
|
||||||
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
|
this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||||
@ -86,13 +92,16 @@ energy discussed above. The scalar value calculated by this fix is
|
|||||||
"extensive".
|
"extensive".
|
||||||
|
|
||||||
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. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
the :doc:`run <run>` command.
|
||||||
|
|
||||||
|
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This fix is part of the MESSAGE package. It is only enabled if LAMMPS
|
This fix is part of the MESSAGE package. It is only enabled if LAMMPS
|
||||||
was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
was built with that package. See the :doc:`Build package
|
||||||
|
<Build_package>` doc page for more info.
|
||||||
|
|
||||||
A script that uses this command must also use the
|
A script that uses this command must also use the
|
||||||
:doc:`message <message>` command to setup and shut down the messaging
|
:doc:`message <message>` command to setup and shut down the messaging
|
||||||
|
|||||||
@ -29,11 +29,12 @@ Description
|
|||||||
This command enables CMAP cross-terms to be added to simulations which
|
This command enables CMAP cross-terms to be added to simulations which
|
||||||
use the CHARMM force field. These are relevant for any CHARMM model
|
use the CHARMM force field. These are relevant for any CHARMM model
|
||||||
of a peptide or protein sequences that is 3 or more amino-acid
|
of a peptide or protein sequences that is 3 or more amino-acid
|
||||||
residues long; see :ref:`(Buck) <Buck>` and :ref:`(Brooks) <Brooks2>` for details,
|
residues long; see :ref:`(Buck) <Buck>` and :ref:`(Brooks) <Brooks2>`
|
||||||
including the analytic energy expressions for CMAP interactions. The
|
for details, including the analytic energy expressions for CMAP
|
||||||
CMAP cross-terms add additional potential energy contributions to pairs
|
interactions. The CMAP cross-terms add additional potential energy
|
||||||
of overlapping phi-psi dihedrals of amino-acids, which are important
|
contributions to pairs of overlapping phi-psi dihedrals of
|
||||||
to properly represent their conformational behavior.
|
amino-acids, which are important to properly represent their
|
||||||
|
conformational behavior.
|
||||||
|
|
||||||
The examples/cmap directory has a sample input script and data file
|
The examples/cmap directory has a sample input script and data file
|
||||||
for a small peptide, that illustrates use of the fix cmap command.
|
for a small peptide, that illustrates use of the fix cmap command.
|
||||||
@ -93,19 +94,27 @@ the note below about how to include the CMAP energy when performing an
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
This fix writes the list of CMAP cross-terms to :doc:`binary restart files <restart>`. See the :doc:`read_restart <read_restart>` command
|
This fix writes the list of CMAP cross-terms to :doc:`binary restart
|
||||||
|
files <restart>`. See the :doc:`read_restart <read_restart>` command
|
||||||
for info on how to re-specify a fix in an input script that reads a
|
for info on how to re-specify a fix in an input script that reads a
|
||||||
restart file, so that the operation of the fix continues in an
|
restart file, so that the operation of the fix continues in an
|
||||||
uninterrupted fashion.
|
uninterrupted fashion.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential "energy" of the CMAP interactions system's
|
this fix to add the potential energy of the CMAP interactions to both
|
||||||
potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
the global potential energy and peratom potential energies of the
|
||||||
|
system as part of :doc:`thermodynamic output <thermo_style>` or
|
||||||
|
output by the :doc:`compute pe/atom <compute_pe_atom>` command. The
|
||||||
|
default setting for this fix is :doc:`fix_modify energy yes
|
||||||
|
<fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||||
fix to add the contribution due to the interaction between atoms to
|
this fix to add the contribution due to the CMAP interactions to both
|
||||||
the system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
the global pressure and per-atom stress of the system via the
|
||||||
The default is *virial yes*
|
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||||
|
stress/atom <compute_stress_atom>` commands. The former can be
|
||||||
|
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||||
|
setting for this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||||
@ -118,11 +127,16 @@ the :doc:`run <run>` command.
|
|||||||
The forces due to this fix are imposed during an energy minimization,
|
The forces due to this fix are imposed during an energy minimization,
|
||||||
invoked by the :doc:`minimize <minimize>` command.
|
invoked by the :doc:`minimize <minimize>` command.
|
||||||
|
|
||||||
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
|
<run_style>` integrator the fix is adding its forces. Default is the
|
||||||
|
outermost level.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you want the potential energy associated with the CMAP terms
|
If you want the potential energy associated with the CMAP terms
|
||||||
forces to be included in the total potential energy of the system (the
|
forces to be included in the total potential energy of the system
|
||||||
quantity being minimized), you MUST enable the
|
(the quantity being minimized), you MUST not disable the
|
||||||
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
|
|||||||
@ -35,12 +35,12 @@ Examples
|
|||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This fix interfaces LAMMPS to the collective variables "Colvars"
|
This fix interfaces LAMMPS to the collective variables (Colvars)
|
||||||
library, which allows to calculate potentials of mean force
|
library, which allows to calculate potentials of mean force (PMFs) for
|
||||||
(PMFs) for any set of colvars, using different sampling methods:
|
any set of colvars, using different sampling methods: currently
|
||||||
currently implemented are the Adaptive Biasing Force (ABF) method,
|
implemented are the Adaptive Biasing Force (ABF) method, metadynamics,
|
||||||
metadynamics, Steered Molecular Dynamics (SMD) and Umbrella Sampling
|
Steered Molecular Dynamics (SMD) and Umbrella Sampling (US) via a
|
||||||
(US) via a flexible harmonic restraint bias.
|
flexible harmonic restraint bias.
|
||||||
|
|
||||||
This documentation describes only the fix colvars command itself and
|
This documentation describes only the fix colvars command itself and
|
||||||
LAMMPS specific parts of the code. The full documentation of the
|
LAMMPS specific parts of the code. The full documentation of the
|
||||||
@ -98,9 +98,11 @@ This fix writes the current status of the colvars module into
|
|||||||
mode status file that is written by the colvars module itself and the
|
mode status file that is written by the colvars module itself and the
|
||||||
kind of information in both files is identical.
|
kind of information in both files is identical.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the energy change from the biasing force added by the fix
|
this fix to add the energy change from the biasing force added by
|
||||||
to the system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
Colvars to the global potential energy of the system as part of
|
||||||
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
|
this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||||
|
|
||||||
The *fix_modify configfile <config file>* option allows to add settings
|
The *fix_modify configfile <config file>* option allows to add settings
|
||||||
from an additional config file to the colvars module. This option can
|
from an additional config file to the colvars module. This option can
|
||||||
@ -113,15 +115,16 @@ in a pair of double quotes ("), or can span multiple lines when bracketed
|
|||||||
by a pair of triple double quotes (""", like python embedded documentation).
|
by a pair of triple double quotes (""", like python embedded documentation).
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
:doc:`output commands <Howto_output>`. The scalar is the Colvars
|
||||||
energy change due to this fix. The scalar value calculated by this
|
energy mentioned above. The scalar value calculated by this fix is
|
||||||
fix is "extensive".
|
"extensive".
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This fix is part of the USER-COLVARS package. It is only enabled if
|
This fix is part of the USER-COLVARS package. It is only enabled if
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
|
<Build_package>` doc page for more info.
|
||||||
|
|
||||||
There can only be one colvars fix active at a time. Since the interface
|
There can only be one colvars fix active at a time. Since the interface
|
||||||
communicates only the minimum amount of information and colvars module
|
communicates only the minimum amount of information and colvars module
|
||||||
|
|||||||
@ -100,9 +100,9 @@ minimize the orientation of dipoles in an applied electric field.
|
|||||||
|
|
||||||
The *energy* keyword specifies the name of an atom-style
|
The *energy* keyword specifies the name of an atom-style
|
||||||
:doc:`variable <variable>` which is used to compute the energy of each
|
:doc:`variable <variable>` which is used to compute the energy of each
|
||||||
atom as function of its position. Like variables used for *ex*\ , *ey*\ ,
|
atom as function of its position. Like variables used for *ex*\ ,
|
||||||
*ez*\ , the energy variable is specified as v_name, where name is the
|
*ey*\ , *ez*\ , the energy variable is specified as v_name, where name
|
||||||
variable name.
|
is the variable name.
|
||||||
|
|
||||||
Note that when the *energy* keyword is used during an energy
|
Note that when the *energy* keyword is used during an energy
|
||||||
minimization, you must insure that the formula defined for the
|
minimization, you must insure that the formula defined for the
|
||||||
@ -117,31 +117,38 @@ minimization will not converge properly.
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential "energy" inferred by the added force due to
|
this fix to add the potential energy inferred by the added force due
|
||||||
the electric field to the system's potential energy as part of
|
to the electric field to the global potential energy of the system as
|
||||||
:doc:`thermodynamic output <thermo_style>`. This is a fictitious
|
part of :doc:`thermodynamic output <thermo_style>`. The default
|
||||||
quantity but is needed so that the :doc:`minimize <minimize>` command
|
setting for this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||||
can include the forces added by this fix in a consistent manner.
|
Note that this energy is a fictitious quantity but is needed so that
|
||||||
I.e. there is a decrease in potential energy when atoms move in the
|
the :doc:`minimize <minimize>` command can include the forces added by
|
||||||
direction of the added force due to the electric field.
|
this fix in a consistent manner. I.e. there is a decrease in
|
||||||
|
potential energy when atoms move in the direction of the added force
|
||||||
|
due to the electric field.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||||
fix to add the contribution due to the added forces on atoms to the
|
this fix to add the contribution due to the added forces on atoms to
|
||||||
system's virial as part of :doc:`thermodynamic output <thermo_style>`.
|
both the global pressure and per-atom stress of the system via the
|
||||||
The default is *virial no*
|
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||||
|
stress/atom <compute_stress_atom>` commands. The former can be
|
||||||
|
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||||
|
setting for this fix is :doc:`fix_modify virial no <fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
integrator the fix adding its forces. Default is the outermost level.
|
<run_style>` integrator the fix adding its forces. Default is the
|
||||||
|
outermost level.
|
||||||
|
|
||||||
This fix computes a global scalar and a global 3-vector of forces,
|
This fix computes a global scalar and a global 3-vector of forces,
|
||||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
which can be accessed by various :doc:`output commands
|
||||||
The scalar is the potential energy discussed above. The vector is the
|
<Howto_output>`. The scalar is the potential energy discussed above.
|
||||||
total force added to the group of atoms. The scalar and vector values
|
The vector is the total force added to the group of atoms. The scalar
|
||||||
calculated by this fix are "extensive".
|
and vector values calculated by this fix are "extensive".
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
@ -84,7 +84,8 @@ code `Quest <quest_>`_.
|
|||||||
|
|
||||||
If mode is *pf/array* then the fix simply stores force values in an
|
If mode is *pf/array* then the fix simply stores force values in an
|
||||||
array. The fix adds these forces to each atom in the group, once
|
array. The fix adds these forces to each atom in the group, once
|
||||||
every *Napply* steps, similar to the way the :doc:`fix addforce <fix_addforce>` command works.
|
every *Napply* steps, similar to the way the :doc:`fix addforce
|
||||||
|
<fix_addforce>` command works.
|
||||||
|
|
||||||
The name of the public force array provided by the FixExternal
|
The name of the public force array provided by the FixExternal
|
||||||
class is
|
class is
|
||||||
@ -150,19 +151,27 @@ of properties that the caller code may want to communicate to LAMMPS
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the potential "energy" set by the external driver to the
|
this fix to add the potential energy set by the external driver to
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. This is a fictitious quantity but is
|
both the global potential energy and peratom potential energies of the
|
||||||
needed so that the :doc:`minimize <minimize>` command can include the
|
system as part of :doc:`thermodynamic output <thermo_style>` or output
|
||||||
forces added by this fix in a consistent manner. I.e. there is a
|
by the :doc:`compute pe/atom <compute_pe_atom>` command. The default
|
||||||
decrease in potential energy when atoms move in the direction of the
|
setting for this fix is :doc:`fix_modify energy yes <fix_modify>`.
|
||||||
added force.
|
Note that this energy may be a fictitious quantity but it is needed so
|
||||||
|
that the :doc:`minimize <minimize>` command can include the forces
|
||||||
|
added by this fix in a consistent manner. I.e. there is a decrease in
|
||||||
|
potential energy when atoms move in the direction of the added force.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *virial* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *virial* option is supported by
|
||||||
fix to add the contribution due to the interactions computed by the
|
this fix to add the contribution computed by the external program to
|
||||||
external program to the system's virial as part of :doc:`thermodynamic output <thermo_style>`. The default is *virial yes*
|
both the global pressure and per-atom stress of the system via the
|
||||||
|
:doc:`compute pressure <compute_pressure>` and :doc:`compute
|
||||||
|
stress/atom <compute_stress_atom>` commands. The former can be
|
||||||
|
accessed by :doc:`thermodynamic output <thermo_style>`. The default
|
||||||
|
setting for this fix is :doc:`fix_modify virial yes <fix_modify>`.
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the potential
|
:doc:`output commands <Howto_output>`. The scalar is the potential
|
||||||
@ -178,7 +187,7 @@ invoked by the :doc:`minimize <minimize>` command.
|
|||||||
|
|
||||||
If you want the fictitious potential energy associated with the
|
If you want the fictitious potential energy associated with the
|
||||||
added forces to be included in the total potential energy of the
|
added forces to be included in the total potential energy of the
|
||||||
system (the quantity being minimized), you MUST enable the
|
system (the quantity being minimized), you MUST not disable the
|
||||||
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
:doc:`fix_modify <fix_modify>` *energy* option for this fix.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
|
|||||||
@ -76,28 +76,31 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The instantaneous values of the extended variables are written to
|
The instantaneous values of the extended variables are written to
|
||||||
:doc:`binary restart files <restart>`. Because the state of the random
|
:doc:`binary restart files <restart>`. Because the state of the
|
||||||
number generator is not saved in restart files, this means you cannot
|
random number generator is not saved in restart files, this means you
|
||||||
do "exact" restarts with this fix, where the simulation continues on
|
cannot do "exact" restarts with this fix, where the simulation
|
||||||
the same as if no restart had taken place. However, in a statistical
|
continues on the same as if no restart had taken place. However, in a
|
||||||
sense, a restarted simulation should produce the same behavior.
|
statistical sense, a restarted simulation should produce the same
|
||||||
Note however that you should use a different seed each time you
|
behavior. Note however that you should use a different seed each time
|
||||||
restart, otherwise the same sequence of random numbers will be used
|
you restart, otherwise the same sequence of random numbers will be
|
||||||
each time, which might lead to stochastic synchronization and
|
used each time, which might lead to stochastic synchronization and
|
||||||
subtle artifacts in the sampling.
|
subtle artifacts in the sampling.
|
||||||
|
|
||||||
|
The cumulative energy change in the system imposed by this fix is
|
||||||
|
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||||
|
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||||
|
doc page for details.
|
||||||
|
|
||||||
|
This fix computes a global scalar which can be accessed by various
|
||||||
|
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||||
|
cumulative energy change due to this fix described in the previous
|
||||||
|
paragraph. The scalar value calculated by this fix is "extensive".
|
||||||
|
|
||||||
This fix can ramp its target temperature over multiple runs, using the
|
This fix can ramp its target temperature over multiple runs, using the
|
||||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||||
:doc:`run <run>` command for details of how to do this.
|
:doc:`run <run>` command for details of how to do this.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
fix to add the energy change induced by Langevin thermostatting to the
|
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
|
||||||
energy change due to this fix. The scalar value calculated by this
|
|
||||||
fix is "extensive".
|
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -55,17 +55,22 @@ momentum.
|
|||||||
GD applies an external fluctuating gravitational field that acts as a
|
GD applies an external fluctuating gravitational field that acts as a
|
||||||
driving force to keep the system away from equilibrium. To maintain
|
driving force to keep the system away from equilibrium. To maintain
|
||||||
steady state, a profile-unbiased thermostat must be implemented to
|
steady state, a profile-unbiased thermostat must be implemented to
|
||||||
dissipate the heat that is added by the driving force. :doc:`Compute temp/profile <compute_temp_profile>` can be used to implement a
|
dissipate the heat that is added by the driving force. :doc:`Compute
|
||||||
|
temp/profile <compute_temp_profile>` can be used to implement a
|
||||||
profile-unbiased thermostat.
|
profile-unbiased thermostat.
|
||||||
|
|
||||||
A common use of this fix is to compute a pressure drop across a pipe,
|
A common use of this fix is to compute a pressure drop across a pipe,
|
||||||
pore, or membrane. The pressure profile can be computed in LAMMPS with
|
pore, or membrane. The pressure profile can be computed in LAMMPS with
|
||||||
:doc:`compute stress/atom <compute_stress_atom>` and :doc:`fix ave/chunk <fix_ave_chunk>`, or with the hardy method in :doc:`fix atc <fix_atc>`. Note that the simple :doc:`compute stress/atom <compute_stress_atom>` method is only accurate away
|
:doc:`compute stress/atom <compute_stress_atom>` and :doc:`fix
|
||||||
from inhomogeneities in the fluid, such as fixed wall atoms. Further,
|
ave/chunk <fix_ave_chunk>`, or with the hardy method in :doc:`fix atc
|
||||||
the computed pressure profile must be corrected for the acceleration
|
<fix_atc>`. Note that the simple :doc:`compute stress/atom
|
||||||
|
<compute_stress_atom>` method is only accurate away from
|
||||||
|
inhomogeneities in the fluid, such as fixed wall atoms. Further, the
|
||||||
|
computed pressure profile must be corrected for the acceleration
|
||||||
applied by GD before computing a pressure drop or comparing it to
|
applied by GD before computing a pressure drop or comparing it to
|
||||||
other methods, such as the pump method :ref:`(Zhu) <Zhu>`. The pressure
|
other methods, such as the pump method :ref:`(Zhu) <Zhu>`. The
|
||||||
correction is discussed and described in :ref:`(Strong) <Strong>`.
|
pressure correction is discussed and described in :ref:`(Strong)
|
||||||
|
<Strong>`.
|
||||||
|
|
||||||
For a complete example including the considerations discussed
|
For a complete example including the considerations discussed
|
||||||
above, see the examples/USER/flow_gauss directory.
|
above, see the examples/USER/flow_gauss directory.
|
||||||
@ -102,14 +107,15 @@ computed by the fix will return zero.
|
|||||||
of wall atoms fixed, such as :doc:`fix spring/self <fix_spring_self>`.
|
of wall atoms fixed, such as :doc:`fix spring/self <fix_spring_self>`.
|
||||||
|
|
||||||
If this fix is used in a simulation with the :doc:`rRESPA <run_style>`
|
If this fix is used in a simulation with the :doc:`rRESPA <run_style>`
|
||||||
integrator, the applied acceleration must be computed and applied at the same
|
integrator, the applied acceleration must be computed and applied at
|
||||||
rRESPA level as the interactions between the flowing fluid and the obstacle.
|
the same rRESPA level as the interactions between the flowing fluid
|
||||||
The rRESPA level at which the acceleration is applied can be changed using
|
and the obstacle. The rRESPA level at which the acceleration is
|
||||||
the :doc:`fix_modify <fix_modify>` *respa* option discussed below. If the
|
applied can be changed using the :doc:`fix_modify <fix_modify>`
|
||||||
flowing fluid and the obstacle interact through multiple interactions that are
|
*respa* option discussed below. If the flowing fluid and the obstacle
|
||||||
computed at different rRESPA levels, then there must be a separate flow/gauss
|
interact through multiple interactions that are computed at different
|
||||||
fix for each level. For example, if the flowing fluid and obstacle interact
|
rRESPA levels, then there must be a separate flow/gauss fix for each
|
||||||
through pairwise and long-range Coulomb interactions, which are computed at
|
level. For example, if the flowing fluid and obstacle interact through
|
||||||
|
pairwise and long-range Coulomb interactions, which are computed at
|
||||||
rRESPA levels 3 and 4, respectively, then there must be two separate
|
rRESPA levels 3 and 4, respectively, then there must be two separate
|
||||||
flow/gauss fixes, one that specifies *fix_modify respa 3* and one with
|
flow/gauss fixes, one that specifies *fix_modify respa 3* and one with
|
||||||
*fix_modify respa 4*.
|
*fix_modify respa 4*.
|
||||||
@ -119,38 +125,49 @@ flow/gauss fixes, one that specifies *fix_modify respa 3* and one with
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
This fix is part of the USER-MISC package. It is only enabled if
|
No information about this fix is written to :doc:`binary restart files
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
|
<restart>`.
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
|
this fix to add the potential energy added by the fix to the global
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
potential energy of the system as part of :doc:`thermodynamic output
|
||||||
fix to subtract the work done from the
|
<thermo_style>`. The default setting for this fix is :doc:`fix_modify
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
energy no <fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
fix. This allows the user to set at which level of the :doc:`rRESPA <run_style>`
|
fix. This allows the user to set at which level of the :doc:`rRESPA
|
||||||
integrator the fix computes and adds the external acceleration. Default is the
|
<run_style>` integrator the fix computes and adds the external
|
||||||
outermost level.
|
acceleration. Default is the outermost level.
|
||||||
|
|
||||||
This fix computes a global scalar and a global 3-vector of forces,
|
This fix computes a global scalar and a global 3-vector of forces,
|
||||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
which can be accessed by various :doc:`output commands
|
||||||
The scalar is the negative of the work done on the system, see above
|
<Howto_output>`. The scalar is the negative of the work done on the
|
||||||
discussion. The vector is the total force that this fix applied to
|
system, see the discussion above. It is only calculated if the
|
||||||
the group of atoms on the current timestep. The scalar and vector
|
*energy* keyword is enabled or :doc:`fix_modify energy yes
|
||||||
values calculated by this fix are "extensive".
|
<fix_modify>` is set.
|
||||||
|
|
||||||
|
The vector is the total force that this fix applied to the group of
|
||||||
|
atoms on the current timestep. The scalar and vector values
|
||||||
|
calculated by this fix are "extensive".
|
||||||
|
|
||||||
No parameter of this fix can be used with the *start/stop* keywords of
|
No parameter of this fix can be used with the *start/stop* keywords of
|
||||||
the :doc:`run <run>` command.
|
the :doc:`run <run>` command.
|
||||||
|
|
||||||
|
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
none
|
|
||||||
|
This fix is part of the USER-MISC package. It is only enabled if
|
||||||
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
|
<Build_package>` doc page for more info.
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|
||||||
:doc:`fix addforce <fix_addforce>`, :doc:`compute temp/profile <compute_temp_profile>`, :doc:`velocity <velocity>`
|
:doc:`fix addforce <fix_addforce>`,
|
||||||
|
:doc:`compute temp/profile <compute_temp_profile>`,
|
||||||
|
:doc:`velocity <velocity>`
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
|
|||||||
@ -398,12 +398,13 @@ adds all inserted atoms of the specified type to the
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
|
This fix writes the state of the fix to :doc:`binary restart files
|
||||||
number generator seed, the next timestep for MC exchanges, the number
|
<restart>`. This includes information about the random number
|
||||||
of MC step attempts and successes etc. See
|
generator seed, the next timestep for MC exchanges, the number of MC
|
||||||
the :doc:`read_restart <read_restart>` command for info on how to
|
step attempts and successes etc. See the :doc:`read_restart
|
||||||
re-specify a fix in an input script that reads a restart file, so that
|
<read_restart>` command for info on how to re-specify a fix in an
|
||||||
the operation of the fix continues in an uninterrupted fashion.
|
input script that reads a restart file, so that the operation of the
|
||||||
|
fix continues in an uninterrupted fashion.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@ -411,8 +412,8 @@ the operation of the fix continues in an uninterrupted fashion.
|
|||||||
after reading the restart with :doc:`reset_timestep <reset_timestep>`.
|
after reading the restart with :doc:`reset_timestep <reset_timestep>`.
|
||||||
The fix will try to detect it and stop with an error.
|
The fix will try to detect it and stop with an error.
|
||||||
|
|
||||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to this
|
None of the :doc:`fix_modify <fix_modify>` options are relevant to
|
||||||
fix.
|
this fix.
|
||||||
|
|
||||||
This fix computes a global vector of length 8, which can be accessed
|
This fix computes a global vector of length 8, which can be accessed
|
||||||
by various :doc:`output commands <Howto_output>`. The vector values are
|
by various :doc:`output commands <Howto_output>`. The vector values are
|
||||||
@ -430,7 +431,8 @@ the following global cumulative quantities:
|
|||||||
The vector values calculated by this fix are "extensive".
|
The vector values calculated by this fix are "extensive".
|
||||||
|
|
||||||
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. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
the :doc:`run <run>` command. This fix is not invoked during
|
||||||
|
:doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -103,28 +103,31 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The instantaneous values of the extended variables are written to
|
The instantaneous values of the extended variables are written to
|
||||||
:doc:`binary restart files <restart>`. Because the state of the random
|
:doc:`binary restart files <restart>`. Because the state of the
|
||||||
number generator is not saved in restart files, this means you cannot
|
random number generator is not saved in restart files, this means you
|
||||||
do "exact" restarts with this fix, where the simulation continues on
|
cannot do "exact" restarts with this fix, where the simulation
|
||||||
the same as if no restart had taken place. However, in a statistical
|
continues on the same as if no restart had taken place. However, in a
|
||||||
sense, a restarted simulation should produce the same behavior.
|
statistical sense, a restarted simulation should produce the same
|
||||||
Note however that you should use a different seed each time you
|
behavior. Note however that you should use a different seed each time
|
||||||
restart, otherwise the same sequence of random numbers will be used
|
you restart, otherwise the same sequence of random numbers will be
|
||||||
each time, which might lead to stochastic synchronization and
|
used each time, which might lead to stochastic synchronization and
|
||||||
subtle artifacts in the sampling.
|
subtle artifacts in the sampling.
|
||||||
|
|
||||||
|
The cumulative energy change in the system imposed by this fix is
|
||||||
|
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||||
|
*ecouple* and *econserve*. See the :doc:`thermo_style <thermo_style>`
|
||||||
|
doc page for details.
|
||||||
|
|
||||||
|
This fix computes a global scalar which can be accessed by various
|
||||||
|
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||||
|
cumulative energy change due to this fix described in the previous
|
||||||
|
paragraph. The scalar value calculated by this fix is "extensive".
|
||||||
|
|
||||||
This fix can ramp its target temperature over multiple runs, using the
|
This fix can ramp its target temperature over multiple runs, using the
|
||||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||||
:doc:`run <run>` command for details of how to do this.
|
:doc:`run <run>` command for details of how to do this.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
fix to add the energy change induced by Langevin thermostatting to the
|
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
|
||||||
energy change due to this fix. The scalar value calculated by this
|
|
||||||
fix is "extensive".
|
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -103,23 +103,27 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the gravitational potential energy of the system to the
|
this fix to add the gravitational potential energy of the system to
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
the global potential energy of the system as part of
|
||||||
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
|
this fix is :doc:`fix_modify energy no <fix_modify>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
integrator the fix is adding its forces. Default is the outermost level.
|
<run_style>` integrator the fix is adding its forces. Default is the
|
||||||
|
outermost level.
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. This scalar is the gravitational
|
:doc:`output commands <Howto_output>`. This scalar is the
|
||||||
potential energy of the particles in the defined field, namely mass \*
|
gravitational potential energy of the particles in the defined field,
|
||||||
(g dot x) for each particles, where x and mass are the particles
|
namely mass \* (g dot x) for each particles, where x and mass are the
|
||||||
position and mass, and g is the gravitational field. The scalar value
|
particles position and mass, and g is the gravitational field. The
|
||||||
calculated by this fix is "extensive".
|
scalar value calculated by this fix is "extensive".
|
||||||
|
|
||||||
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. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
the :doc:`run <run>` command. This fix is not invoked during
|
||||||
|
:doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -115,6 +115,18 @@ The version with "bondmax" will just run somewhat faster, due to less
|
|||||||
overhead in computing bond lengths and not storing them in a separate
|
overhead in computing bond lengths and not storing them in a separate
|
||||||
compute.
|
compute.
|
||||||
|
|
||||||
|
A variable can be used to implement a large variety of conditions,
|
||||||
|
including to stop when a specific file exists. Example:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
variable exit equal is_file(EXIT)
|
||||||
|
fix 10 all halt 100 v_exit != 0 error soft
|
||||||
|
|
||||||
|
Will stop the current run command when a file ``EXIT`` is created
|
||||||
|
in the current working directory. The condition can be cleared
|
||||||
|
by removing the file through the :doc:`shell <shell>` command.
|
||||||
|
|
||||||
The choice of operators listed above are the usual comparison
|
The choice of operators listed above are the usual comparison
|
||||||
operators. The XOR operation (exclusive or) is also included as "\|\^".
|
operators. The XOR operation (exclusive or) is also included as "\|\^".
|
||||||
In this context, XOR means that if either the attribute or avalue is
|
In this context, XOR means that if either the attribute or avalue is
|
||||||
|
|||||||
@ -200,16 +200,20 @@ algorithm.
|
|||||||
Restart, fix_modify, output, run start/stop, minimize info
|
Restart, fix_modify, output, run start/stop, minimize info
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the energy of the bias potential to the system's
|
this fix to add the energy of the bias potential to the global
|
||||||
potential energy as part of :doc:`thermodynamic output <thermo_style>`.
|
potential energy of the system as part of :doc:`thermodynamic output
|
||||||
|
<thermo_style>`. The default setting for this fix is :doc:`fix_modify
|
||||||
|
energy no <fix_modify>`.
|
||||||
|
|
||||||
This fix computes a global scalar and global vector of length 12, which
|
This fix computes a global scalar and global vector of length 12,
|
||||||
can be accessed by various :doc:`output commands <Howto_output>`. The
|
which can be accessed by various :doc:`output commands
|
||||||
scalar is the magnitude of the bias potential (energy units) applied on
|
<Howto_output>`. The scalar is the magnitude of the bias potential
|
||||||
the current timestep. The vector stores the following quantities:
|
(energy units) applied on the current timestep. The vector stores the
|
||||||
|
following quantities:
|
||||||
|
|
||||||
* 1 = boost factor on this step (unitless)
|
* 1 = boost factor on this step (unitless)
|
||||||
* 2 = max strain :math:`E_{ij}` of any bond on this step (absolute value, unitless)
|
* 2 = max strain :math:`E_{ij}` of any bond on this step (absolute value, unitless)
|
||||||
@ -253,7 +257,8 @@ The scalar and vector values calculated by this fix are all
|
|||||||
"intensive".
|
"intensive".
|
||||||
|
|
||||||
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. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
the :doc:`run <run>` command. This fix is not invoked during
|
||||||
|
:doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -370,15 +370,17 @@ Restart, fix_modify, output, run start/stop, minimize info
|
|||||||
|
|
||||||
No information about this fix is written to :doc:`binary restart files <restart>`.
|
No information about this fix is written to :doc:`binary restart files <restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the energy of the bias potential to the system's potential
|
this fix to add the energy of the bias potential to the global
|
||||||
energy as part of :doc:`thermodynamic output <thermo_style>`.
|
potential energy of the system as part of :doc:`thermodynamic output
|
||||||
|
<thermo_style>`. The default setting for this fix is :doc:`fix_modify
|
||||||
|
energy no <fix_modify>`.
|
||||||
|
|
||||||
This fix computes a global scalar and global vector of length 28,
|
This fix computes a global scalar and global vector of length 28,
|
||||||
which can be accessed by various :doc:`output commands <Howto_output>`.
|
which can be accessed by various :doc:`output commands
|
||||||
The scalar is the magnitude of the bias potential (energy units)
|
<Howto_output>`. The scalar is the magnitude of the bias potential
|
||||||
applied on the current timestep, summed over all biased bonds. The
|
(energy units) applied on the current timestep, summed over all biased
|
||||||
vector stores the following quantities:
|
bonds. The vector stores the following quantities:
|
||||||
|
|
||||||
* 1 = average boost for all bonds on this step (unitless)
|
* 1 = average boost for all bonds on this step (unitless)
|
||||||
* 2 = # of biased bonds on this step
|
* 2 = # of biased bonds on this step
|
||||||
@ -510,8 +512,8 @@ Value 27 computes the average boost for biased bonds only on this step.
|
|||||||
Value 28 is the count of bonds with an absolute value of strain >= q
|
Value 28 is the count of bonds with an absolute value of strain >= q
|
||||||
on this step.
|
on this step.
|
||||||
|
|
||||||
The scalar and vector values calculated by this fix are all
|
The scalar value is an "extensive" quantity since it grows with the
|
||||||
"intensive".
|
system size; the vector values are all "intensive".
|
||||||
|
|
||||||
This fix also computes a local vector of length the number of bonds
|
This fix also computes a local vector of length the number of bonds
|
||||||
currently in the system. The value for each bond is its :math:`C_{ij}`
|
currently in the system. The value for each bond is its :math:`C_{ij}`
|
||||||
@ -524,7 +526,8 @@ close to 1.0, which indicates a good choice of :math:`V^{max}`.
|
|||||||
The local values calculated by this fix are unitless.
|
The local values calculated by this fix are unitless.
|
||||||
|
|
||||||
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. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
the :doc:`run <run>` command. This fix is not invoked during
|
||||||
|
:doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -179,20 +179,25 @@ contains *xlat*\ , *ylat*\ , *zlat* keywords of the
|
|||||||
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>`.
|
No information about this fix is written to :doc:`binary restart files
|
||||||
|
<restart>`.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *energy* option is supported by
|
||||||
fix to add the energy of interaction between atoms and the indenter to
|
this fix to add the energy of interaction between atoms and the
|
||||||
the system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. The energy of each particle interacting
|
indenter to the global potential energy of the system as part of
|
||||||
with the indenter is K/3 (r - R)\^3.
|
:doc:`thermodynamic output <thermo_style>`. The default setting for
|
||||||
|
this fix is :doc:`fix_modify energy no <fix_modify>`. The energy of
|
||||||
|
each particle interacting with the indenter is K/3 (r - R)\^3.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
fix. This allows to set at which level of the :doc:`r-RESPA <run_style>`
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
integrator the fix is adding its forces. Default is the outermost level.
|
<run_style>` integrator the fix is adding its forces. Default is the
|
||||||
|
outermost level.
|
||||||
|
|
||||||
This fix computes a global scalar energy and a global 3-vector of
|
This fix computes a global scalar energy and a global 3-vector of
|
||||||
forces (on the indenter), which can be accessed by various :doc:`output commands <Howto_output>`. The scalar and vector values calculated
|
forces (on the indenter), which can be accessed by various
|
||||||
by this fix are "extensive".
|
:doc:`output commands <Howto_output>`. The scalar and vector values
|
||||||
|
calculated by this fix are "extensive".
|
||||||
|
|
||||||
The forces due to this fix are imposed during an energy minimization,
|
The forces due to this fix are imposed during an energy minimization,
|
||||||
invoked by the :doc:`minimize <minimize>` command. Note that if you
|
invoked by the :doc:`minimize <minimize>` command. Note that if you
|
||||||
@ -204,10 +209,10 @@ check if you have done this.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you want the atom/indenter interaction energy to be included
|
If you want the atom/indenter interaction energy to be included in
|
||||||
in the total potential energy of the system (the quantity being
|
the total potential energy of the system (the quantity being
|
||||||
minimized), you must enable the :doc:`fix_modify <fix_modify>` *energy*
|
minimized), you must enable the :doc:`fix_modify <fix_modify>`
|
||||||
option for this fix.
|
*energy* option for this fix.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -230,7 +230,7 @@ conservation.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
this accumulated energy does NOT include kinetic energy removed
|
This accumulated energy does NOT include kinetic energy removed
|
||||||
by the *zero* flag. LAMMPS will print a warning when both options are
|
by the *zero* flag. LAMMPS will print a warning when both options are
|
||||||
active.
|
active.
|
||||||
|
|
||||||
@ -244,7 +244,8 @@ to zero by subtracting off an equal part of it from each atom in the
|
|||||||
group. As a result, the center-of-mass of a system with zero initial
|
group. As a result, the center-of-mass of a system with zero initial
|
||||||
momentum will not drift over time.
|
momentum will not drift over time.
|
||||||
|
|
||||||
The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago <Gronbech-Jensen>` time-discretization of the Langevin model. As
|
The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago
|
||||||
|
<Gronbech-Jensen>` time-discretization of the Langevin model. As
|
||||||
described in the papers cited below, the purpose of this method is to
|
described in the papers cited below, the purpose of this method is to
|
||||||
enable longer timesteps to be used (up to the numerical stability
|
enable longer timesteps to be used (up to the numerical stability
|
||||||
limit of the integrator), while still producing the correct Boltzmann
|
limit of the integrator), while still producing the correct Boltzmann
|
||||||
@ -252,19 +253,20 @@ distribution of atom positions.
|
|||||||
|
|
||||||
The current implementation provides the user with the option to output
|
The current implementation provides the user with the option to output
|
||||||
the velocity in one of two forms: *vfull* or *vhalf*\ , which replaces
|
the velocity in one of two forms: *vfull* or *vhalf*\ , which replaces
|
||||||
the outdated option *yes*\ . The *gjf* option *vfull* outputs the on-site
|
the outdated option *yes*\ . The *gjf* option *vfull* outputs the
|
||||||
velocity given in :ref:`Gronbech-Jensen/Farago <Gronbech-Jensen>`; this velocity
|
on-site velocity given in :ref:`Gronbech-Jensen/Farago
|
||||||
is shown to be systematically lower than the target temperature by a small
|
<Gronbech-Jensen>`; this velocity is shown to be systematically lower
|
||||||
amount, which grows quadratically with the timestep.
|
than the target temperature by a small amount, which grows
|
||||||
The *gjf* option *vhalf* outputs the 2GJ half-step velocity given in
|
quadratically with the timestep. The *gjf* option *vhalf* outputs the
|
||||||
:ref:`Gronbech Jensen/Gronbech-Jensen <2Gronbech-Jensen>`; for linear systems,
|
2GJ half-step velocity given in :ref:`Gronbech Jensen/Gronbech-Jensen
|
||||||
this velocity is shown to not have any statistical errors for any stable time step.
|
<2Gronbech-Jensen>`; for linear systems, this velocity is shown to not
|
||||||
An overview of statistically correct Boltzmann and Maxwell-Boltzmann
|
have any statistical errors for any stable time step. An overview of
|
||||||
sampling of true on-site and true half-step velocities is given in
|
statistically correct Boltzmann and Maxwell-Boltzmann sampling of true
|
||||||
:ref:`Gronbech-Jensen <1Gronbech-Jensen>`.
|
on-site and true half-step velocities is given in
|
||||||
Regardless of the choice of output velocity, the sampling of the configurational
|
:ref:`Gronbech-Jensen <1Gronbech-Jensen>`. Regardless of the choice
|
||||||
distribution of atom positions is the same, and linearly consistent with the
|
of output velocity, the sampling of the configurational distribution
|
||||||
target temperature.
|
of atom positions is the same, and linearly consistent with the target
|
||||||
|
temperature.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -287,16 +289,18 @@ you have defined to this fix which will be used in its thermostatting
|
|||||||
procedure, as described above. For consistency, the group used by
|
procedure, as described above. For consistency, the group used by
|
||||||
this fix and by the compute should be the same.
|
this fix and by the compute should be the same.
|
||||||
|
|
||||||
The :doc:`fix_modify <fix_modify>` *energy* option is supported by this
|
The cumulative energy change in the system imposed by this fix is
|
||||||
fix to add the energy change induced by Langevin thermostatting to the
|
included in the :doc:`thermodynamic output <thermo_style>` keywords
|
||||||
system's potential energy as part of :doc:`thermodynamic output <thermo_style>`. Note that use of this option requires
|
*ecouple* and *econserve*\ , but only if the *tally* keyword to set to
|
||||||
setting the *tally* keyword to *yes*\ .
|
*yes*\ . See the :doc:`thermo_style <thermo_style>` doc page for
|
||||||
|
details.
|
||||||
|
|
||||||
This fix computes a global scalar which can be accessed by various
|
This fix computes a global scalar which can be accessed by various
|
||||||
:doc:`output commands <Howto_output>`. The scalar is the cumulative
|
:doc:`output commands <Howto_output>`. The scalar is the same
|
||||||
energy change due to this fix. The scalar value calculated by this
|
cumulative energy change due to this fix described in the previous
|
||||||
fix is "extensive". Note that calculation of this quantity requires
|
paragraph. The scalar value calculated by this fix is "extensive".
|
||||||
setting the *tally* keyword to *yes*\ .
|
Note that calculation of this quantity also requires setting the
|
||||||
|
*tally* keyword to *yes*\ .
|
||||||
|
|
||||||
This fix can ramp its target temperature over multiple runs, using the
|
This fix can ramp its target temperature over multiple runs, using the
|
||||||
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
*start* and *stop* keywords of the :doc:`run <run>` command. See the
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user