Merge branch 'develop' into amoeba-gpu
This commit is contained in:
61
.github/CODEOWNERS
vendored
61
.github/CODEOWNERS
vendored
@ -13,40 +13,45 @@ lib/kim/* @ellio167
|
|||||||
lib/mesont/* @iafoss
|
lib/mesont/* @iafoss
|
||||||
|
|
||||||
# whole packages
|
# whole packages
|
||||||
|
src/ADIOS/* @pnorbert
|
||||||
src/AMOEBA/* @sjplimp
|
src/AMOEBA/* @sjplimp
|
||||||
src/COMPRESS/* @rbberger
|
src/BPM/* @jtclemm
|
||||||
src/GPU/* @ndtrung81
|
|
||||||
src/KOKKOS/* @stanmoore1
|
|
||||||
src/KIM/* @ellio167
|
|
||||||
src/LATTE/* @cnegre
|
|
||||||
src/MLIAP/* @athomps
|
|
||||||
src/SNAP/* @athomps
|
|
||||||
src/SPIN/* @julient31
|
|
||||||
src/BROWNIAN/* @samueljmcameron
|
src/BROWNIAN/* @samueljmcameron
|
||||||
src/CG-DNA/* @ohenrich
|
src/CG-DNA/* @ohenrich
|
||||||
src/CG-SPICA/* @yskmiyazaki
|
src/CG-SPICA/* @yskmiyazaki
|
||||||
src/COLVARS/* @giacomofiorin
|
src/COLVARS/* @giacomofiorin
|
||||||
|
src/COMPRESS/* @rbberger
|
||||||
src/DIELECTRIC/* @ndtrung81
|
src/DIELECTRIC/* @ndtrung81
|
||||||
src/ELECTRODE/* @ludwig-ahrens
|
src/ELECTRODE/* @ludwig-ahrens
|
||||||
src/FEP/* @agiliopadua
|
src/FEP/* @agiliopadua
|
||||||
src/ML-HDNNP/* @singraber
|
src/GPU/* @ndtrung81
|
||||||
|
src/GRANULAR/* @jtclemm @dsbolin
|
||||||
src/INTEL/* @wmbrownintel
|
src/INTEL/* @wmbrownintel
|
||||||
|
src/KIM/* @ellio167
|
||||||
|
src/KOKKOS/* @stanmoore1
|
||||||
|
src/LATTE/* @cnegre
|
||||||
src/MANIFOLD/* @Pakketeretet2
|
src/MANIFOLD/* @Pakketeretet2
|
||||||
src/MDI/* @taylor-a-barnes
|
src/MDI/* @taylor-a-barnes @sjplimp
|
||||||
src/MEAM/* @martok
|
src/MEAM/* @martok
|
||||||
src/MESONT/* @iafoss
|
src/MESONT/* @iafoss
|
||||||
|
src/ML-HDNNP/* @singraber
|
||||||
|
src/ML-IAP/* @athomps
|
||||||
|
src/ML-PACE/* @yury-lysogorskiy
|
||||||
|
src/ML-POD/* @exapde @rohskopf
|
||||||
src/MOFFF/* @hheenen
|
src/MOFFF/* @hheenen
|
||||||
src/MOLFILE/* @akohlmey
|
src/MOLFILE/* @akohlmey
|
||||||
src/NETCDF/* @pastewka
|
src/NETCDF/* @pastewka
|
||||||
src/ML-PACE/* @yury-lysogorskiy
|
|
||||||
src/PLUMED/* @gtribello
|
|
||||||
src/PHONON/* @lingtikong
|
|
||||||
src/PTM/* @pmla
|
|
||||||
src/OPENMP/* @akohlmey
|
src/OPENMP/* @akohlmey
|
||||||
|
src/PHONON/* @lingtikong
|
||||||
|
src/PLUGIN/* @akohlmey
|
||||||
|
src/PLUMED/* @gtribello
|
||||||
|
src/PTM/* @pmla
|
||||||
src/QMMM/* @akohlmey
|
src/QMMM/* @akohlmey
|
||||||
src/REAXFF/* @hasanmetin @stanmoore1
|
|
||||||
src/REACTION/* @jrgissing
|
src/REACTION/* @jrgissing
|
||||||
|
src/REAXFF/* @hasanmetin @stanmoore1
|
||||||
src/SCAFACOS/* @rhalver
|
src/SCAFACOS/* @rhalver
|
||||||
|
src/SNAP/* @athomps
|
||||||
|
src/SPIN/* @julient31
|
||||||
src/TALLY/* @akohlmey
|
src/TALLY/* @akohlmey
|
||||||
src/UEF/* @danicholson
|
src/UEF/* @danicholson
|
||||||
src/VTK/* @rbberger
|
src/VTK/* @rbberger
|
||||||
@ -120,27 +125,32 @@ src/dump_movie.* @akohlmey
|
|||||||
src/exceptions.h @rbberger
|
src/exceptions.h @rbberger
|
||||||
src/fix_nh.* @athomps
|
src/fix_nh.* @athomps
|
||||||
src/info.* @akohlmey @rbberger
|
src/info.* @akohlmey @rbberger
|
||||||
src/timer.* @akohlmey
|
|
||||||
src/min* @sjplimp @stanmoore1
|
src/min* @sjplimp @stanmoore1
|
||||||
|
src/platform.* @akohlmey
|
||||||
|
src/timer.* @akohlmey
|
||||||
src/utils.* @akohlmey @rbberger
|
src/utils.* @akohlmey @rbberger
|
||||||
src/verlet.* @sjplimp @stanmoore1
|
src/verlet.* @sjplimp @stanmoore1
|
||||||
src/math_eigen_impl.h @jewettaij
|
src/math_eigen_impl.h @jewettaij
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
tools/msi2lmp/* @akohlmey
|
tools/coding_standard/* @akohlmey @rbberger
|
||||||
tools/emacs/* @HaoZeke
|
tools/emacs/* @HaoZeke
|
||||||
tools/singularity/* @akohlmey @rbberger
|
tools/lammps-shell/* @akohlmey
|
||||||
tools/coding_standard/* @rbberger
|
tools/msi2lmp/* @akohlmey
|
||||||
tools/valgrind/* @akohlmey
|
|
||||||
tools/swig/* @akohlmey
|
|
||||||
tools/offline/* @rbberger
|
tools/offline/* @rbberger
|
||||||
|
tools/singularity/* @akohlmey @rbberger
|
||||||
|
tools/swig/* @akohlmey
|
||||||
|
tools/valgrind/* @akohlmey
|
||||||
tools/vim/* @hammondkd
|
tools/vim/* @hammondkd
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
unittest/* @akohlmey @rbberger
|
unittest/* @akohlmey
|
||||||
|
|
||||||
# cmake
|
# cmake
|
||||||
cmake/* @junghans @rbberger
|
cmake/* @junghans @rbberger
|
||||||
|
cmake/Modules/LAMMPSInterfacePlugin.cmake @akohlmey
|
||||||
|
cmake/Modules/MPI4WIN.cmake @akohlmey
|
||||||
|
cmake/Modules/OpenCLLoader.cmake @akohlmey
|
||||||
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
||||||
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
||||||
cmake/presets/*.cmake @akohlmey
|
cmake/presets/*.cmake @akohlmey
|
||||||
@ -149,13 +159,12 @@ cmake/presets/*.cmake @akohlmey
|
|||||||
python/* @rbberger
|
python/* @rbberger
|
||||||
|
|
||||||
# fortran
|
# fortran
|
||||||
fortran/* @akohlmey
|
fortran/* @akohlmey @hammondkd
|
||||||
|
|
||||||
# docs
|
# docs
|
||||||
doc/utils/*/* @rbberger
|
doc/* @akohlmey
|
||||||
doc/Makefile @rbberger
|
|
||||||
doc/README @rbberger
|
|
||||||
examples/plugin/* @akohlmey
|
examples/plugin/* @akohlmey
|
||||||
|
examples/PACKAGES/pace/plugin/* @akohlmey
|
||||||
|
|
||||||
# for releases
|
# for releases
|
||||||
src/version.h @sjplimp
|
src/version.h @sjplimp
|
||||||
|
|||||||
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Request for Help
|
name: Request for Help
|
||||||
about: "Don't post help requests here, email the lammps-users mailing list"
|
about: "Don't post help requests here, post in the LAMMPS forum"
|
||||||
title: ""
|
title: ""
|
||||||
labels: invalid
|
labels: invalid
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@ -8,8 +8,9 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
||||||
Instead send an e-mail to the lammps-users mailing list.
|
Instead, you can post to the LAMMPS category in the Materials Science Community
|
||||||
|
Discourse forum at: https://matsci.org/lammps/
|
||||||
|
|
||||||
This issue tracker is for tracking LAMMPS development related issues only.
|
This issue tracker is for tracking LAMMPS development related issues only.
|
||||||
|
|
||||||
Thanks for your cooperation.
|
Thank you in advance for your cooperation.
|
||||||
|
|||||||
6
.github/workflows/compile-msvc.yml
vendored
6
.github/workflows/compile-msvc.yml
vendored
@ -26,15 +26,19 @@ jobs:
|
|||||||
- name: Select Python version
|
- name: Select Python version
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Building LAMMPS via CMake
|
- name: Building LAMMPS via CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install numpy
|
python3 -m pip install numpy
|
||||||
python3 -m pip install pyyaml
|
python3 -m pip install pyyaml
|
||||||
|
nuget install MSMPIsdk
|
||||||
|
nuget install MSMPIDIST
|
||||||
cmake -C cmake/presets/windows.cmake \
|
cmake -C cmake/presets/windows.cmake \
|
||||||
-D PKG_PYTHON=on \
|
-D PKG_PYTHON=on \
|
||||||
|
-D WITH_PNG=off \
|
||||||
|
-D WITH_JPEG=off \
|
||||||
-S cmake -B build \
|
-S cmake -B build \
|
||||||
-D BUILD_SHARED_LIBS=on \
|
-D BUILD_SHARED_LIBS=on \
|
||||||
-D LAMMPS_EXCEPTIONS=on \
|
-D LAMMPS_EXCEPTIONS=on \
|
||||||
|
|||||||
4
README
4
README
@ -16,8 +16,8 @@ National Laboratories, a US Department of Energy facility, with
|
|||||||
funding from the DOE. It is an open-source code, distributed freely
|
funding from the DOE. It is an open-source code, distributed freely
|
||||||
under the terms of the GNU Public License (GPL) version 2.
|
under the terms of the GNU Public License (GPL) version 2.
|
||||||
|
|
||||||
The primary author of the code is Steve Plimpton, who can be emailed
|
The code is maintained by the LAMMPS development team who can be emailed
|
||||||
at sjplimp@sandia.gov. The LAMMPS WWW Site at www.lammps.org has
|
at developers@lammps.org. The LAMMPS WWW Site at www.lammps.org has
|
||||||
more information about the code and its uses.
|
more information about the code and its uses.
|
||||||
|
|
||||||
The LAMMPS distribution includes the following files and directories:
|
The LAMMPS distribution includes the following files and directories:
|
||||||
|
|||||||
@ -7,11 +7,20 @@ cmake_minimum_required(VERSION 3.10)
|
|||||||
if(POLICY CMP0074)
|
if(POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about ignoring ${CMAKE_REQUIRED_LIBRARIES} but use it
|
||||||
|
if(POLICY CMP0075)
|
||||||
|
cmake_policy(SET CMP0075 NEW)
|
||||||
|
endif()
|
||||||
# set policy to silence warnings about missing executable permissions in
|
# set policy to silence warnings about missing executable permissions in
|
||||||
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
||||||
if(POLICY CMP0109)
|
if(POLICY CMP0109)
|
||||||
cmake_policy(SET CMP0109 OLD)
|
cmake_policy(SET CMP0109 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
|
if(POLICY CMP0135)
|
||||||
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
project(lammps CXX)
|
project(lammps CXX)
|
||||||
@ -100,7 +109,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
|||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
set(CMAKE_TUNE_DEFAULT "-xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=2196")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -257,6 +266,7 @@ set(STANDARD_PACKAGES
|
|||||||
ML-QUIP
|
ML-QUIP
|
||||||
ML-RANN
|
ML-RANN
|
||||||
ML-SNAP
|
ML-SNAP
|
||||||
|
ML-POD
|
||||||
MOFFF
|
MOFFF
|
||||||
MOLECULE
|
MOLECULE
|
||||||
MOLFILE
|
MOLFILE
|
||||||
@ -307,6 +317,15 @@ if(PKG_ADIOS)
|
|||||||
# script that defines the MPI::MPI_C target
|
# script that defines the MPI::MPI_C target
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
find_package(ADIOS2 REQUIRED)
|
find_package(ADIOS2 REQUIRED)
|
||||||
|
if(BUILD_MPI)
|
||||||
|
if(NOT ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built with MPI support when LAMMPS has MPI enabled")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built without MPI support when LAMMPS has MPI disabled")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
target_link_libraries(lammps PRIVATE adios2::adios2)
|
target_link_libraries(lammps PRIVATE adios2::adios2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -381,9 +400,9 @@ pkg_depends(EXTRA-MOLECULE MOLECULE)
|
|||||||
|
|
||||||
# detect if we may enable OpenMP support by default
|
# detect if we may enable OpenMP support by default
|
||||||
set(BUILD_OMP_DEFAULT OFF)
|
set(BUILD_OMP_DEFAULT OFF)
|
||||||
find_package(OpenMP QUIET)
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
if(OpenMP_FOUND)
|
if(OpenMP_CXX_FOUND)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(HAVE_OMP_H_INCLUDE)
|
if(HAVE_OMP_H_INCLUDE)
|
||||||
set(BUILD_OMP_DEFAULT ON)
|
set(BUILD_OMP_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
@ -392,8 +411,8 @@ endif()
|
|||||||
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
||||||
|
|
||||||
if(BUILD_OMP)
|
if(BUILD_OMP)
|
||||||
find_package(OpenMP REQUIRED)
|
find_package(OpenMP COMPONENTS CXX REQUIRED)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(NOT HAVE_OMP_H_INCLUDE)
|
if(NOT HAVE_OMP_H_INCLUDE)
|
||||||
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
||||||
endif()
|
endif()
|
||||||
@ -415,7 +434,7 @@ if(BUILD_OMP)
|
|||||||
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE OR PKG_ELECTRODE)
|
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_LATTE OR PKG_ELECTRODE)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
if (NOT USE_INTERNAL_LINALG)
|
if (NOT USE_INTERNAL_LINALG)
|
||||||
find_package(LAPACK)
|
find_package(LAPACK)
|
||||||
@ -621,7 +640,7 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(PKG_ELECTRODE)
|
if(PKG_ELECTRODE OR PKG_ML-POD)
|
||||||
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -723,18 +742,17 @@ list(FIND LANGUAGES "Fortran" _index)
|
|||||||
if(_index GREATER -1)
|
if(_index GREATER -1)
|
||||||
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h compute.h dihedral.h domain.h error.h fix.h force.h group.h improper.h
|
set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h command.h compute.h dihedral.h domain.h
|
||||||
input.h info.h kspace.h lammps.h lattice.h library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h
|
error.h exceptions.h fix.h force.h group.h improper.h input.h info.h kspace.h lammps.h lattice.h
|
||||||
pair.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h pair.h
|
||||||
if(LAMMPS_EXCEPTIONS)
|
platform.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
||||||
list(APPEND LAMMPS_CXX_HEADERS exceptions.h)
|
set(LAMMPS_FMT_HEADERS core.h format.h)
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||||
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
||||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt)
|
||||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
||||||
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
||||||
@ -743,6 +761,14 @@ foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
|||||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
foreach(_HEADER ${LAMMPS_FMT_HEADERS})
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER})
|
||||||
|
add_custom_target(fmt_${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER})
|
||||||
|
add_dependencies(lammps fmt_${_HEADER})
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
install(FILES ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/fmt)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
||||||
add_library(LAMMPS::lammps ALIAS lammps)
|
add_library(LAMMPS::lammps ALIAS lammps)
|
||||||
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
||||||
@ -850,8 +876,11 @@ if(BUILD_SHARED_LIBS OR PKG_PYTHON)
|
|||||||
find_package(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
endif()
|
endif()
|
||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
install(CODE "execute_process(COMMAND ${Python_EXECUTABLE} setup.py build -b ${CMAKE_BINARY_DIR}/python install --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR}/ WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR})")
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_SOURCE_DIR}/version.h DESTINATION ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_PYTHON_DIR}/README ${LAMMPS_PYTHON_DIR}/pyproject.toml ${LAMMPS_PYTHON_DIR}/setup.py ${LAMMPS_PYTHON_DIR}/lammps DESTINATION ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
|
install(CODE "if(\"\$ENV{DESTDIR}\" STREQUAL \"\")\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX})\n else()\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR})\n endif()")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -962,9 +991,6 @@ if(PKG_GPU)
|
|||||||
endif()
|
endif()
|
||||||
message(STATUS "GPU precision: ${GPU_PREC}")
|
message(STATUS "GPU precision: ${GPU_PREC}")
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KOKKOS)
|
|
||||||
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
|
||||||
endif()
|
|
||||||
if(PKG_KSPACE)
|
if(PKG_KSPACE)
|
||||||
message(STATUS "<<< FFT settings >>>
|
message(STATUS "<<< FFT settings >>>
|
||||||
-- Primary FFT lib: ${FFT}")
|
-- Primary FFT lib: ${FFT}")
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
# Find clang-format
|
# Find clang-format
|
||||||
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
||||||
|
clang-format-15.0
|
||||||
|
clang-format-14.0
|
||||||
|
clang-format-13.0
|
||||||
|
clang-format-12.0
|
||||||
|
clang-format-11.0
|
||||||
clang-format-10.0
|
clang-format-10.0
|
||||||
clang-format-9.0
|
clang-format-9.0
|
||||||
clang-format-8.0
|
clang-format-8.0
|
||||||
@ -14,19 +19,27 @@ if(ClangFormat_EXECUTABLE)
|
|||||||
OUTPUT_VARIABLE clang_format_version
|
OUTPUT_VARIABLE clang_format_version
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
if(clang_format_version MATCHES "^(Ubuntu |)clang-format version .*")
|
||||||
if(clang_format_version MATCHES "^clang-format version .*")
|
# Arch Linux output:
|
||||||
# Arch Linux
|
|
||||||
# clang-format version 10.0.0
|
# clang-format version 10.0.0
|
||||||
|
#
|
||||||
# Ubuntu 18.04 LTS Output
|
# Ubuntu 18.04 LTS output:
|
||||||
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||||
string(REGEX REPLACE "clang-format version ([0-9.]+).*"
|
#
|
||||||
"\\1"
|
# Ubuntu 20.04 LTS output:
|
||||||
|
# clang-format version 10.0.0-4ubuntu1
|
||||||
|
#
|
||||||
|
# Ubuntu 22.04 LTS output:
|
||||||
|
# Ubuntu clang-format version 14.0.0-1ubuntu1
|
||||||
|
#
|
||||||
|
# Fedora 36 output:
|
||||||
|
# clang-format version 14.0.5 (Fedora 14.0.5-1.fc36)
|
||||||
|
string(REGEX REPLACE "^(Ubuntu |)clang-format version ([0-9.]+).*"
|
||||||
|
"\\2"
|
||||||
ClangFormat_VERSION
|
ClangFormat_VERSION
|
||||||
"${clang_format_version}")
|
"${clang_format_version}")
|
||||||
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
||||||
# CentOS 7 Output
|
# CentOS 7 output:
|
||||||
# LLVM (http://llvm.org/):
|
# LLVM (http://llvm.org/):
|
||||||
# LLVM version 3.4.2
|
# LLVM version 3.4.2
|
||||||
# Optimized build.
|
# Optimized build.
|
||||||
|
|||||||
@ -22,7 +22,7 @@ endif()
|
|||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
||||||
find_program(Cythonize_EXECUTABLE
|
find_program(Cythonize_EXECUTABLE
|
||||||
NAMES cythonize3 cythonize cythonize.bat
|
NAMES cythonize-${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} cythonize3 cythonize cythonize.bat
|
||||||
HINTS ${_python_path})
|
HINTS ${_python_path})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
find_path(ZMQ_INCLUDE_DIR zmq.h)
|
|
||||||
find_library(ZMQ_LIBRARY NAMES zmq)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# Copy the results to the output variables and target.
|
|
||||||
if(ZMQ_FOUND)
|
|
||||||
set(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
|
|
||||||
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if(NOT TARGET ZMQ::ZMQ)
|
|
||||||
add_library(ZMQ::ZMQ UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(ZMQ::ZMQ PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
|
||||||
IMPORTED_LOCATION "${ZMQ_LIBRARY}"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
@ -112,16 +112,46 @@ if(BUILD_MPI)
|
|||||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||||
|
# Download and configure MinGW compatible MPICH development files for Windows
|
||||||
|
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||||
|
if(USE_MSMPI)
|
||||||
|
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||||
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
|
||||||
|
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||||
|
else()
|
||||||
# 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_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_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_WIN64_DEVEL_URL)
|
||||||
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
|
|
||||||
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
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")
|
||||||
@ -151,6 +181,7 @@ if(BUILD_MPI)
|
|||||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(MPI REQUIRED)
|
find_package(MPI REQUIRED)
|
||||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||||
|
|||||||
@ -24,6 +24,21 @@ function(validate_option name values)
|
|||||||
endif()
|
endif()
|
||||||
endfunction(validate_option)
|
endfunction(validate_option)
|
||||||
|
|
||||||
|
# helper function to check for usable omp.h header
|
||||||
|
function(check_omp_h_include)
|
||||||
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
|
if(OpenMP_CXX_FOUND)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${OpenMP_CXX_INCLUDE_DIRS})
|
||||||
|
set(CMAKE_REQUIRED_LINK_OPTIONS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${OpenMP_CXX_LIBRARIES})
|
||||||
|
check_include_file_cxx(omp.h _have_omp_h)
|
||||||
|
else()
|
||||||
|
set(_have_omp_h FALSE)
|
||||||
|
endif()
|
||||||
|
set(HAVE_OMP_H_INCLUDE ${_have_omp_h} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# helper function for getting the most recently modified file or folder from a glob pattern
|
# helper function for getting the most recently modified file or folder from a glob pattern
|
||||||
function(get_newest_file path variable)
|
function(get_newest_file path variable)
|
||||||
file(GLOB _dirs ${path})
|
file(GLOB _dirs ${path})
|
||||||
|
|||||||
@ -1,39 +1,74 @@
|
|||||||
# Download and configure custom MPICH files for Windows
|
# Download and configure MinGW compatible MPICH development files for Windows
|
||||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||||
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)
|
if(USE_MSMPI)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||||
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
|
||||||
|
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||||
|
else()
|
||||||
|
message(STATUS "Downloading and configuring MPICH2-1.4.1 for Windows cross-compilation")
|
||||||
|
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)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
ExternalProject_Add(mpi4win_build
|
ExternalProject_Add(mpi4win_build
|
||||||
URL ${MPICH2_WIN64_DEVEL_URL}
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
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 ${MPICH2_WIN32_DEVEL_URL}
|
URL ${MPICH2_WIN32_DEVEL_URL}
|
||||||
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
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()
|
||||||
|
|
||||||
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
set_target_properties(MPI::MPI_CXX PROPERTIES
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
# set variables for status reporting at the end of CMake run
|
# set variables for status reporting at the end of CMake run
|
||||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||||
|
endif()
|
||||||
|
|||||||
@ -15,8 +15,9 @@ if(Kokkos_ENABLE_OPENMP)
|
|||||||
if(NOT BUILD_OMP)
|
if(NOT BUILD_OMP)
|
||||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||||
else()
|
else()
|
||||||
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
|
# NVHPC does not seem to provide a detectable OpenMP version, but is far beyond version 3.1
|
||||||
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
|
if((OpenMP_CXX_VERSION VERSION_LESS 3.1) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
|
message(FATAL_ERROR "Compiler must support OpenMP 3.1 or later with Kokkos_ENABLE_OPENMP")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -47,8 +48,8 @@ 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.6.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.7.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||||
set(KOKKOS_MD5 "0ec97fc0c356dd65bd2487defe81a7bf" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
set(KOKKOS_MD5 "84991eca9f066383abe119a5bc7a11c4" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||||
mark_as_advanced(KOKKOS_URL)
|
mark_as_advanced(KOKKOS_URL)
|
||||||
mark_as_advanced(KOKKOS_MD5)
|
mark_as_advanced(KOKKOS_MD5)
|
||||||
ExternalProject_Add(kokkos_build
|
ExternalProject_Add(kokkos_build
|
||||||
@ -72,7 +73,7 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||||
elseif(EXTERNAL_KOKKOS)
|
elseif(EXTERNAL_KOKKOS)
|
||||||
find_package(Kokkos 3.6.01 REQUIRED CONFIG)
|
find_package(Kokkos 3.7.00 REQUIRED CONFIG)
|
||||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||||
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||||
else()
|
else()
|
||||||
@ -138,6 +139,12 @@ if(PKG_KSPACE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PKG_ML-IAP)
|
||||||
|
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/mliap_data_kokkos.cpp
|
||||||
|
${KOKKOS_PKG_SOURCES_DIR}/mliap_descriptor_so3_kokkos.cpp
|
||||||
|
${KOKKOS_PKG_SOURCES_DIR}/mliap_model_linear_kokkos.cpp
|
||||||
|
${KOKKOS_PKG_SOURCES_DIR}/mliap_so3_kokkos.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PKG_PHONON)
|
if(PKG_PHONON)
|
||||||
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp)
|
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp)
|
||||||
|
|||||||
@ -49,6 +49,14 @@ if(DOWNLOAD_MDI)
|
|||||||
set(MDI_USE_PYTHON_PLUGINS ON)
|
set(MDI_USE_PYTHON_PLUGINS ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
# python plugins are not supported and thus must be always off on Windows
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
unset(Python_Development_FOUND)
|
||||||
|
set(MDI_USE_PYTHON_PLUGINS OFF)
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
set(CMAKE_INSTALL_LIBDIR lib)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# download/ build MDI library
|
# download/ build MDI library
|
||||||
# always build static library with -fpic
|
# always build static library with -fpic
|
||||||
@ -57,8 +65,9 @@ if(DOWNLOAD_MDI)
|
|||||||
ExternalProject_Add(mdi_build
|
ExternalProject_Add(mdi_build
|
||||||
URL ${MDI_URL}
|
URL ${MDI_URL}
|
||||||
URL_MD5 ${MDI_MD5}
|
URL_MD5 ${MDI_MD5}
|
||||||
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/mdi_build_ext
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/mdi_build_ext
|
||||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||||
@ -70,22 +79,22 @@ if(DOWNLOAD_MDI)
|
|||||||
-Dplugins=ON
|
-Dplugins=ON
|
||||||
-Dpython_plugins=${MDI_USE_PYTHON_PLUGINS}
|
-Dpython_plugins=${MDI_USE_PYTHON_PLUGINS}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/mdi_build_ext/src/mdi_build-build --target install
|
||||||
BUILD_BYPRODUCTS "<BINARY_DIR>/MDI_Library/libmdi.a"
|
BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/mdi_build_ext/${CMAKE_INSTALL_LIBDIR}/mdi/${CMAKE_STATIC_LIBRARY_PREFIX}mdi${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# where is the compiled library?
|
# where is the compiled library?
|
||||||
ExternalProject_get_property(mdi_build BINARY_DIR)
|
ExternalProject_get_property(mdi_build PREFIX)
|
||||||
set(MDI_BINARY_DIR "${BINARY_DIR}/MDI_Library")
|
|
||||||
# workaround for older CMake versions
|
# workaround for older CMake versions
|
||||||
file(MAKE_DIRECTORY ${MDI_BINARY_DIR})
|
file(MAKE_DIRECTORY ${PREFIX}/${CMAKE_INSTALL_LIBDIR}/mdi)
|
||||||
|
file(MAKE_DIRECTORY ${PREFIX}/include/mdi)
|
||||||
|
|
||||||
# create imported target for the MDI library
|
# create imported target for the MDI library
|
||||||
add_library(LAMMPS::MDI UNKNOWN IMPORTED)
|
add_library(LAMMPS::MDI UNKNOWN IMPORTED)
|
||||||
add_dependencies(LAMMPS::MDI mdi_build)
|
add_dependencies(LAMMPS::MDI mdi_build)
|
||||||
set_target_properties(LAMMPS::MDI PROPERTIES
|
set_target_properties(LAMMPS::MDI PROPERTIES
|
||||||
IMPORTED_LOCATION "${MDI_BINARY_DIR}/libmdi.a"
|
IMPORTED_LOCATION "${PREFIX}/${CMAKE_INSTALL_LIBDIR}/mdi/${CMAKE_STATIC_LIBRARY_PREFIX}mdi${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${MDI_BINARY_DIR}
|
INTERFACE_INCLUDE_DIRECTORIES ${PREFIX}/include/mdi
|
||||||
)
|
)
|
||||||
|
|
||||||
set(MDI_DEP_LIBS "")
|
set(MDI_DEP_LIBS "")
|
||||||
|
|||||||
@ -2,7 +2,13 @@
|
|||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
||||||
if(PKG_PYTHON)
|
if(PKG_PYTHON)
|
||||||
find_package(Cythonize QUIET)
|
find_package(Cythonize QUIET)
|
||||||
if(Cythonize_FOUND)
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy QUIET)
|
||||||
|
else()
|
||||||
|
# assume we have NumPy
|
||||||
|
set(Python_NumPy_FOUND ON)
|
||||||
|
endif()
|
||||||
|
if(Cythonize_FOUND AND Python_NumPy_FOUND)
|
||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -11,6 +17,9 @@ option(MLIAP_ENABLE_PYTHON "Build ML-IAP package with Python support" ${MLIAP_EN
|
|||||||
|
|
||||||
if(MLIAP_ENABLE_PYTHON)
|
if(MLIAP_ENABLE_PYTHON)
|
||||||
find_package(Cythonize REQUIRED)
|
find_package(Cythonize REQUIRED)
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy REQUIRED)
|
||||||
|
endif()
|
||||||
if(NOT PKG_PYTHON)
|
if(NOT PKG_PYTHON)
|
||||||
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.fix2.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2022.10.15.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||||
|
|
||||||
set(PACELIB_MD5 "32394d799bc282bb57696c78c456e64f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
set(PACELIB_MD5 "848ad6a6cc79fa82745927001fb1c9b5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||||
mark_as_advanced(PACELIB_URL)
|
mark_as_advanced(PACELIB_URL)
|
||||||
mark_as_advanced(PACELIB_MD5)
|
mark_as_advanced(PACELIB_MD5)
|
||||||
|
|
||||||
@ -15,23 +15,9 @@ execute_process(
|
|||||||
)
|
)
|
||||||
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||||
|
|
||||||
# enforce building libyaml-cpp as static library and turn off optional features
|
add_subdirectory(${lib-pace} build-pace)
|
||||||
set(YAML_BUILD_SHARED_LIBS OFF)
|
|
||||||
set(YAML_CPP_BUILD_CONTRIB OFF)
|
|
||||||
set(YAML_CPP_BUILD_TOOLS OFF)
|
|
||||||
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
|
||||||
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
|
||||||
|
|
||||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
|
|
||||||
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
|
|
||||||
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
|
||||||
|
|
||||||
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
|
||||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR})
|
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
|
||||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||||
target_link_libraries(lammps PRIVATE pace)
|
target_link_libraries(lammps PRIVATE pace)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -58,12 +58,12 @@ if(DOWNLOAD_QUIP)
|
|||||||
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
BUILD_IN_SOURCE YES
|
BUILD_IN_SOURCE YES
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/libquip.a
|
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
)
|
)
|
||||||
ExternalProject_get_property(quip_build SOURCE_DIR)
|
ExternalProject_get_property(quip_build SOURCE_DIR)
|
||||||
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
||||||
set_target_properties(LAMMPS::QUIP PROPERTIES
|
set_target_properties(LAMMPS::QUIP PROPERTIES
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/libquip.a"
|
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
||||||
add_dependencies(LAMMPS::QUIP quip_build)
|
add_dependencies(LAMMPS::QUIP quip_build)
|
||||||
|
|||||||
@ -47,15 +47,15 @@ if(DOWNLOAD_PLUMED)
|
|||||||
endif()
|
endif()
|
||||||
message(STATUS "PLUMED download requested - we will build our own")
|
message(STATUS "PLUMED download requested - we will build our own")
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
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/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.4/plumed-src-2.7.4.tgz" CACHE STRING "URL for PLUMED tarball")
|
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.1/plumed-src-2.8.1.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||||
set(PLUMED_MD5 "858e0b6aed173748fc85b6bc8a9dcb3e" CACHE STRING "MD5 checksum of PLUMED tarball")
|
set(PLUMED_MD5 "6bfe72ebdae63dc38a9ca27d9b0e08f8" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||||
|
|
||||||
mark_as_advanced(PLUMED_URL)
|
mark_as_advanced(PLUMED_URL)
|
||||||
mark_as_advanced(PLUMED_MD5)
|
mark_as_advanced(PLUMED_MD5)
|
||||||
@ -78,12 +78,12 @@ if(DOWNLOAD_PLUMED)
|
|||||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumedWrapper.a INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||||
@ -96,7 +96,7 @@ else()
|
|||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
find_package(VTK REQUIRED NO_MODULE)
|
find_package(VTK REQUIRED NO_MODULE)
|
||||||
include(${VTK_USE_FILE})
|
|
||||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
||||||
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
if (VTK_MAJOR_VERSION VERSION_LESS 9.0)
|
||||||
|
include(${VTK_USE_FILE})
|
||||||
|
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
||||||
|
else()
|
||||||
|
target_link_libraries(lammps PRIVATE VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
vtk_module_autoinit(TARGETS lammps MODULES VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -56,6 +56,7 @@ set(ALL_PACKAGES
|
|||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
ML-IAP
|
ML-IAP
|
||||||
ML-PACE
|
ML-PACE
|
||||||
|
ML-POD
|
||||||
ML-QUIP
|
ML-QUIP
|
||||||
ML-RANN
|
ML-RANN
|
||||||
ML-SNAP
|
ML-SNAP
|
||||||
|
|||||||
@ -58,6 +58,7 @@ set(ALL_PACKAGES
|
|||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
ML-IAP
|
ML-IAP
|
||||||
ML-PACE
|
ML-PACE
|
||||||
|
ML-POD
|
||||||
ML-QUIP
|
ML-QUIP
|
||||||
ML-RANN
|
ML-RANN
|
||||||
ML-SNAP
|
ML-SNAP
|
||||||
|
|||||||
@ -28,10 +28,3 @@ set(MPI_CXX "clang++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "clang" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -19,11 +19,3 @@ set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
|
|||||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
# preset that will enable the classic Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ set(WIN_PACKAGES
|
|||||||
MISC
|
MISC
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
ML-IAP
|
ML-IAP
|
||||||
|
ML-POD
|
||||||
ML-RANN
|
ML-RANN
|
||||||
ML-SNAP
|
ML-SNAP
|
||||||
MOFFF
|
MOFFF
|
||||||
|
|||||||
@ -41,6 +41,7 @@ set(ALL_PACKAGES
|
|||||||
MEAM
|
MEAM
|
||||||
MISC
|
MISC
|
||||||
ML-IAP
|
ML-IAP
|
||||||
|
ML-POD
|
||||||
ML-SNAP
|
ML-SNAP
|
||||||
MOFFF
|
MOFFF
|
||||||
MOLECULE
|
MOLECULE
|
||||||
|
|||||||
9
cmake/presets/nvhpc.cmake
Normal file
9
cmake/presets/nvhpc.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# preset that will enable Nvidia HPC SDK compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_C_COMPILER "nvc" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_Fortran_COMPILER "nvfortran" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will restore gcc/g++ with support for MPI and OpenMP (on Linux boxes)
|
# preset that will set gcc/g++ with extra warnings enabled and support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||||
@ -17,10 +17,3 @@ set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
|||||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -7,10 +7,3 @@ set(MPI_CXX "pgc++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "pgcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "pgc++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
16
doc/Makefile
16
doc/Makefile
@ -38,16 +38,14 @@ endif
|
|||||||
# override settings for PIP commands
|
# override settings for PIP commands
|
||||||
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
||||||
|
|
||||||
#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E")
|
|
||||||
|
|
||||||
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
||||||
SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
||||||
|
|
||||||
# grab list of sources from doxygen config file.
|
# grab list of sources from doxygen config file.
|
||||||
# we only want to use explicitly listed files.
|
# we only want to use explicitly listed files.
|
||||||
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
||||||
|
|
||||||
.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check char_check xmlgen fasthtml
|
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check xmlgen fasthtml
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
@ -89,6 +87,8 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
ln -sf Manual.html html/index.html;\
|
ln -sf Manual.html html/index.html;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
@ -114,7 +114,9 @@ fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@mkdir -p fasthtml
|
@mkdir -p fasthtml
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
sphinx-build -j 4 -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
)
|
)
|
||||||
@rm -rf fasthtml/_sources
|
@rm -rf fasthtml/_sources
|
||||||
@ -144,6 +146,8 @@ epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@cp src/JPG/*.* epub/JPG
|
@cp src/JPG/*.* epub/JPG
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -163,6 +167,8 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.TH LAMMPS "1" "15 September 2022" "2022-9-15"
|
.TH LAMMPS "1" "3 November 2022" "2022-11-3"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B LAMMPS
|
.B LAMMPS
|
||||||
\- Molecular Dynamics Simulator. Version 15 September 2022
|
\- Molecular Dynamics Simulator. Version 3 November 2022
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B lmp
|
.B lmp
|
||||||
|
|||||||
@ -147,6 +147,16 @@ compile and will download and compile a specific recent version of the
|
|||||||
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
||||||
for implementing the tests.
|
for implementing the tests.
|
||||||
|
|
||||||
|
.. admonition:: Software version requirements for testing
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
The compiler and library version requirements for the testing
|
||||||
|
framework are more strict than for the main part of LAMMPS. For
|
||||||
|
example the default GNU C++ and Fortran compilers of RHEL/CentOS 7.x
|
||||||
|
(version 4.8.x) are not sufficient. The CMake configuration will try
|
||||||
|
to detect compatible versions and either skip incompatible tests or
|
||||||
|
stop with an error.
|
||||||
|
|
||||||
After compilation is complete, the unit testing is started in the build
|
After compilation is complete, the unit testing is started in the build
|
||||||
folder using the ``ctest`` command, which is part of the CMake software.
|
folder using the ``ctest`` command, which is part of the CMake software.
|
||||||
The output of this command will be looking something like this::
|
The output of this command will be looking something like this::
|
||||||
|
|||||||
@ -36,6 +36,7 @@ This is the list of packages that may require additional steps.
|
|||||||
* :ref:`AWPMD <awpmd>`
|
* :ref:`AWPMD <awpmd>`
|
||||||
* :ref:`COLVARS <colvars>`
|
* :ref:`COLVARS <colvars>`
|
||||||
* :ref:`COMPRESS <compress>`
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`ELECTRODE <electrode>`
|
||||||
* :ref:`GPU <gpu>`
|
* :ref:`GPU <gpu>`
|
||||||
* :ref:`H5MD <h5md>`
|
* :ref:`H5MD <h5md>`
|
||||||
* :ref:`INTEL <intel>`
|
* :ref:`INTEL <intel>`
|
||||||
@ -48,6 +49,7 @@ This is the list of packages that may require additional steps.
|
|||||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||||
* :ref:`ML-IAP <mliap>`
|
* :ref:`ML-IAP <mliap>`
|
||||||
* :ref:`ML-PACE <ml-pace>`
|
* :ref:`ML-PACE <ml-pace>`
|
||||||
|
* :ref:`ML-POD <ml-pod>`
|
||||||
* :ref:`ML-QUIP <ml-quip>`
|
* :ref:`ML-QUIP <ml-quip>`
|
||||||
* :ref:`MOLFILE <molfile>`
|
* :ref:`MOLFILE <molfile>`
|
||||||
* :ref:`MSCG <mscg>`
|
* :ref:`MSCG <mscg>`
|
||||||
@ -234,7 +236,7 @@ LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ ,
|
|||||||
Makefile you use.
|
Makefile you use.
|
||||||
|
|
||||||
You can also build the library in one step from the ``lammps/src`` dir,
|
You can also build the library in one step from the ``lammps/src`` dir,
|
||||||
using a command like these, which simply invoke the ``lib/gpu/Install.py``
|
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
||||||
script with the specified args:
|
script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -350,7 +352,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 directory, 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 invokes the ``lib/kim/Install.py`` script with
|
||||||
the specified args.
|
the specified args.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -483,6 +485,9 @@ They must be specified in uppercase.
|
|||||||
* - **Arch-ID**
|
* - **Arch-ID**
|
||||||
- **HOST or GPU**
|
- **HOST or GPU**
|
||||||
- **Description**
|
- **Description**
|
||||||
|
* - NATIVE
|
||||||
|
- HOST
|
||||||
|
- Local machine
|
||||||
* - AMDAVX
|
* - AMDAVX
|
||||||
- HOST
|
- HOST
|
||||||
- AMD 64-bit x86 CPU (AVX 1)
|
- AMD 64-bit x86 CPU (AVX 1)
|
||||||
@ -522,9 +527,21 @@ They must be specified in uppercase.
|
|||||||
* - BDW
|
* - BDW
|
||||||
- HOST
|
- HOST
|
||||||
- Intel Broadwell Xeon E-class CPU (AVX 2 + transactional mem)
|
- Intel Broadwell Xeon E-class CPU (AVX 2 + transactional mem)
|
||||||
|
* - SKL
|
||||||
|
- HOST
|
||||||
|
- Intel Skylake Client CPU
|
||||||
* - SKX
|
* - SKX
|
||||||
- HOST
|
- HOST
|
||||||
- Intel Sky Lake Xeon E-class HPC CPU (AVX512 + transactional mem)
|
- Intel Skylake Xeon Server CPU (AVX512)
|
||||||
|
* - ICL
|
||||||
|
- HOST
|
||||||
|
- Intel Ice Lake Client CPU (AVX512)
|
||||||
|
* - ICX
|
||||||
|
- HOST
|
||||||
|
- Intel Ice Lake Xeon Server CPU (AVX512)
|
||||||
|
* - SPR
|
||||||
|
- HOST
|
||||||
|
- Intel Sapphire Rapids Xeon Server CPU (AVX512)
|
||||||
* - KNC
|
* - KNC
|
||||||
- HOST
|
- HOST
|
||||||
- Intel Knights Corner Xeon Phi
|
- Intel Knights Corner Xeon Phi
|
||||||
@ -596,7 +613,10 @@ They must be specified in uppercase.
|
|||||||
- AMD GPU MI100 GFX908
|
- AMD GPU MI100 GFX908
|
||||||
* - VEGA90A
|
* - VEGA90A
|
||||||
- GPU
|
- GPU
|
||||||
- AMD GPU
|
- AMD GPU MI200 GFX90A
|
||||||
|
* - INTEL_GEN
|
||||||
|
- GPU
|
||||||
|
- SPIR64-based devices, e.g. Intel GPUs, using JIT
|
||||||
* - INTEL_DG1
|
* - INTEL_DG1
|
||||||
- GPU
|
- GPU
|
||||||
- Intel Iris XeMAX GPU
|
- Intel Iris XeMAX GPU
|
||||||
@ -611,9 +631,12 @@ They must be specified in uppercase.
|
|||||||
- Intel GPU Gen12LP
|
- Intel GPU Gen12LP
|
||||||
* - INTEL_XEHP
|
* - INTEL_XEHP
|
||||||
- GPU
|
- GPU
|
||||||
- Intel GPUs Xe-HP
|
- Intel GPU Xe-HP
|
||||||
|
* - INTEL_PVC
|
||||||
|
- GPU
|
||||||
|
- Intel GPU Ponte Vecchio
|
||||||
|
|
||||||
This list was last updated for version 3.5.0 of the Kokkos library.
|
This list was last updated for version 3.7.0 of the Kokkos library.
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
@ -933,7 +956,7 @@ more details.
|
|||||||
You can download and build the MS-CG library manually if you
|
You can download and build the MS-CG library manually if you
|
||||||
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
||||||
also do it in one step from the ``lammps/src`` dir, using a
|
also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/mscg/Install.py`` script with the specified args:
|
``lib/mscg/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -990,7 +1013,7 @@ POEMS package
|
|||||||
``lib/poems``\ . You can do this manually if you prefer; follow
|
``lib/poems``\ . You can do this manually if you prefer; follow
|
||||||
the instructions in ``lib/poems/README``\ . You can also do it in
|
the instructions in ``lib/poems/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these,
|
one step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/poems/Install.py`` script with the
|
which simply invokes the ``lib/poems/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1079,7 +1102,7 @@ binary package provided by your operating system.
|
|||||||
You can download and build the Voro++ library manually if you
|
You can download and build the Voro++ library manually if you
|
||||||
prefer; follow the instructions in ``lib/voronoi/README``. You
|
prefer; follow the instructions in ``lib/voronoi/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/voronoi/Install.py`` script with the specified args:
|
``lib/voronoi/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1158,7 +1181,7 @@ The ATC package requires the MANYBODY package also be installed.
|
|||||||
``lib/atc``. You can do this manually if you prefer; follow the
|
``lib/atc``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/atc/README``. You can also do it in one
|
instructions in ``lib/atc/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/atc/Install.py`` script with the
|
which simply invokes the ``lib/atc/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1209,7 +1232,7 @@ AWPMD package
|
|||||||
``lib/awpmd``. You can do this manually if you prefer; follow the
|
``lib/awpmd``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/awpmd/README``. You can also do it in one
|
instructions in ``lib/awpmd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/awpmd/Install.py`` script with the
|
which simply invokes the ``lib/awpmd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1272,7 +1295,7 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
In general, it is safer to use build setting consistent with the
|
In general, it is safer to use build setting consistent with the
|
||||||
rest of LAMMPS. This is best carried out from the LAMMPS src
|
rest of LAMMPS. This is best carried out from the LAMMPS src
|
||||||
directory using a command like these, which simply invoke the
|
directory using a command like these, which simply invokes the
|
||||||
``lib/colvars/Install.py`` script with the specified args:
|
``lib/colvars/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1313,20 +1336,30 @@ This package depends on the KSPACE package.
|
|||||||
|
|
||||||
.. tab:: CMake build
|
.. tab:: CMake build
|
||||||
|
|
||||||
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and ``-D
|
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and
|
||||||
PKG_ELECTRODE=yes``.
|
``-D PKG_ELECTRODE=yes``.
|
||||||
|
|
||||||
.. tab:: Traditional make
|
.. tab:: Traditional make
|
||||||
|
|
||||||
The package is activated with ``make yes-KSPACE`` and ``make
|
Before building LAMMPS, you must configure the ELECTRODE support
|
||||||
yes-ELECTRODE``
|
libraries and settings in ``lib/electrode``. You can do this
|
||||||
|
manually, if you prefer, or do it in one step from the
|
||||||
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
|
invokes the ``lib/electrode/Install.py`` script with the specified
|
||||||
|
args:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make lib-electrode # print help message
|
||||||
|
$ make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
|
$ make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
|
|
||||||
|
|
||||||
Note that the ``Makefile.lammps`` file has settings for the BLAS and
|
Note that the ``Makefile.lammps`` file has settings for the BLAS
|
||||||
LAPACK linear algebra libraries. As explained in ``lib/awpmd/README``
|
and LAPACK linear algebra libraries. These can either exist on
|
||||||
these can either exist on your system, or you can use the files provided
|
your system, or you can use the files provided in ``lib/linalg``.
|
||||||
in ``lib/linalg``. In the latter case you also need to build the library
|
In the latter case you also need to build the library in
|
||||||
in ``lib/linalg`` with a command like these:
|
``lib/linalg`` with a command like these:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
@ -1335,6 +1368,9 @@ This package depends on the KSPACE package.
|
|||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
The package itself is activated with ``make yes-KSPACE`` and
|
||||||
|
``make yes-ELECTRODE``
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _ml-pace:
|
.. _ml-pace:
|
||||||
@ -1377,6 +1413,49 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _ml-pod:
|
||||||
|
|
||||||
|
ML-POD package
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
.. tabs::
|
||||||
|
|
||||||
|
.. tab:: CMake build
|
||||||
|
|
||||||
|
No additional settings are needed besides ``-D PKG_ML-POD=yes``.
|
||||||
|
|
||||||
|
.. tab:: Traditional make
|
||||||
|
|
||||||
|
Before building LAMMPS, you must configure the ML-POD support
|
||||||
|
settings in ``lib/mlpod``. You can do this manually, if you
|
||||||
|
prefer, or do it in one step from the ``lammps/src`` dir, using a
|
||||||
|
command like the following, which simply invoke the
|
||||||
|
``lib/mlpod/Install.py`` script with the specified args:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make lib-mlpod # print help message
|
||||||
|
$ make lib-mlpod args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
|
$ make lib-mlpod args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
|
$ make lib-mlpod args="-m mpi -e linalg" # same as above but use the bundled linalg lib
|
||||||
|
|
||||||
|
Note that the ``Makefile.lammps`` file has settings to use the BLAS
|
||||||
|
and LAPACK linear algebra libraries. These can either exist on
|
||||||
|
your system, or you can use the files provided in ``lib/linalg``.
|
||||||
|
In the latter case you also need to build the library in
|
||||||
|
``lib/linalg`` with a command like these:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make lib-linalg # print help message
|
||||||
|
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||||
|
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
|
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
The package itself is activated with ``make yes-ML-POD``.
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _plumed:
|
.. _plumed:
|
||||||
|
|
||||||
PLUMED package
|
PLUMED package
|
||||||
@ -1534,7 +1613,7 @@ the HDF5 library.
|
|||||||
``lib/h5md``. You can do this manually if you prefer; follow the
|
``lib/h5md``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/h5md/README``. You can also do it in one
|
instructions in ``lib/h5md/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/h5md/Install.py`` script with the
|
which simply invokes the ``lib/h5md/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1590,7 +1669,7 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
|
|||||||
You can download and build the *n2p2* library manually if you prefer;
|
You can download and build the *n2p2* library manually if you prefer;
|
||||||
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these, which
|
one step from the ``lammps/src`` dir, using a command like these, which
|
||||||
simply invoke the ``lib/hdnnp/Install.py`` script with the specified args:
|
simply invokes the ``lib/hdnnp/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
@ -1727,7 +1806,7 @@ they will be downloaded the first time this package is installed.
|
|||||||
Before building LAMMPS, you must build the *mesont* library in
|
Before building LAMMPS, you must build the *mesont* library in
|
||||||
``lib/mesont``\ . You can also do it in one step from the
|
``lib/mesont``\ . You can also do it in one step from the
|
||||||
``lammps/src`` dir, using a command like these, which simply
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
invoke the ``lib/mesont/Install.py`` script with the specified
|
invokes the ``lib/mesont/Install.py`` script with the specified
|
||||||
args:
|
args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1896,7 +1975,7 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
|||||||
``lib/qmmm``. You can do this manually if you prefer; follow the
|
``lib/qmmm``. You can do this manually if you prefer; follow the
|
||||||
first two steps explained in ``lib/qmmm/README``. You can also do
|
first two steps explained in ``lib/qmmm/README``. You can also do
|
||||||
it in one step from the ``lammps/src`` dir, using a command like
|
it in one step from the ``lammps/src`` dir, using a command like
|
||||||
these, which simply invoke the ``lib/qmmm/Install.py`` script with
|
these, which simply invokes the ``lib/qmmm/Install.py`` script with
|
||||||
the specified args:
|
the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -2004,7 +2083,7 @@ To build with this package, you must download and build the
|
|||||||
You can download and build the ScaFaCoS library manually if you
|
You can download and build the ScaFaCoS library manually if you
|
||||||
prefer; follow the instructions in ``lib/scafacos/README``. You
|
prefer; follow the instructions in ``lib/scafacos/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/scafacos/Install.py`` script with the specified args:
|
``lib/scafacos/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -2048,7 +2127,7 @@ Eigen3 is a template library, so you do not need to build it.
|
|||||||
You can download the Eigen3 library manually if you prefer; follow
|
You can download the Eigen3 library manually if you prefer; follow
|
||||||
the instructions in ``lib/smd/README``. You can also do it in one
|
the instructions in ``lib/smd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/smd/Install.py`` script with the
|
which simply invokes the ``lib/smd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|||||||
@ -216,9 +216,20 @@ be multiple tests run automatically:
|
|||||||
- A test that only standard, printable ASCII text characters are used.
|
- A test that only standard, printable ASCII text characters are used.
|
||||||
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
||||||
thus prints all offending lines with filename and line number
|
thus prints all offending lines with filename and line number
|
||||||
prepended to the screen. Special characters like the Angstrom
|
prepended to the screen. Special characters like Greek letters
|
||||||
:math:`\mathrm{\mathring{A}}` should be typeset with embedded math
|
(:math:`\alpha~~\sigma~~\epsilon`), super- or subscripts
|
||||||
(like this ``:math:`\mathrm{\mathring{A}}```\ ).
|
(:math:`x^2~~\mathrm{U}_{LJ}`), mathematical expressions
|
||||||
|
(:math:`\frac{1}{2}\mathrm{N}~~x\to\infty`), or the Angstrom symbol
|
||||||
|
(:math:`\AA`) should be typeset with embedded LaTeX (like this
|
||||||
|
``:math:`\alpha \sigma \epsilon```, ``:math:`x^2 \mathrm{E}_{LJ}```,
|
||||||
|
``:math:`\frac{1}{2}\mathrm{N} x\to\infty```, or ``:math:`\AA```\ ).
|
||||||
|
|
||||||
|
- Embedded LaTeX is rendered in HTML output with `MathJax
|
||||||
|
<https://www.mathjax.org/>`_ and in PDF output by passing the embedded
|
||||||
|
text to LaTeX. Some care has to be taken, though, since there are
|
||||||
|
limitations which macros and features can be used in either mode, so
|
||||||
|
it is recommended to always check whether any new or changed
|
||||||
|
documentation does translate and render correctly with either output.
|
||||||
|
|
||||||
- A test whether all styles are documented and listed in their
|
- A test whether all styles are documented and listed in their
|
||||||
respective overview pages. A typical output with warnings looks like this:
|
respective overview pages. A typical output with warnings looks like this:
|
||||||
|
|||||||
@ -31,7 +31,6 @@ table above.
|
|||||||
* :doc:`bond_style <bond_style>`
|
* :doc:`bond_style <bond_style>`
|
||||||
* :doc:`bond_write <bond_write>`
|
* :doc:`bond_write <bond_write>`
|
||||||
* :doc:`boundary <boundary>`
|
* :doc:`boundary <boundary>`
|
||||||
* :doc:`box <box>`
|
|
||||||
* :doc:`change_box <change_box>`
|
* :doc:`change_box <change_box>`
|
||||||
* :doc:`clear <clear>`
|
* :doc:`clear <clear>`
|
||||||
* :doc:`comm_modify <comm_modify>`
|
* :doc:`comm_modify <comm_modify>`
|
||||||
@ -90,8 +89,7 @@ table above.
|
|||||||
* :doc:`region <region>`
|
* :doc:`region <region>`
|
||||||
* :doc:`replicate <replicate>`
|
* :doc:`replicate <replicate>`
|
||||||
* :doc:`rerun <rerun>`
|
* :doc:`rerun <rerun>`
|
||||||
* :doc:`reset_atom_ids <reset_atom_ids>`
|
* :doc:`reset_atoms <reset_atoms>`
|
||||||
* :doc:`reset_mol_ids <reset_mol_ids>`
|
|
||||||
* :doc:`reset_timestep <reset_timestep>`
|
* :doc:`reset_timestep <reset_timestep>`
|
||||||
* :doc:`restart <restart>`
|
* :doc:`restart <restart>`
|
||||||
* :doc:`run <run>`
|
* :doc:`run <run>`
|
||||||
@ -127,6 +125,7 @@ additional letter in parenthesis: k = KOKKOS.
|
|||||||
* :doc:`group2ndx <group2ndx>`
|
* :doc:`group2ndx <group2ndx>`
|
||||||
* :doc:`hyper <hyper>`
|
* :doc:`hyper <hyper>`
|
||||||
* :doc:`kim <kim_commands>`
|
* :doc:`kim <kim_commands>`
|
||||||
|
* :doc:`fitpod <fitpod_command>`
|
||||||
* :doc:`mdi <mdi>`
|
* :doc:`mdi <mdi>`
|
||||||
* :doc:`ndx2group <group2ndx>`
|
* :doc:`ndx2group <group2ndx>`
|
||||||
* :doc:`neb <neb>`
|
* :doc:`neb <neb>`
|
||||||
|
|||||||
@ -25,7 +25,6 @@ Setup simulation box:
|
|||||||
:columns: 4
|
:columns: 4
|
||||||
|
|
||||||
* :doc:`boundary <boundary>`
|
* :doc:`boundary <boundary>`
|
||||||
* :doc:`box <box>`
|
|
||||||
* :doc:`change_box <change_box>`
|
* :doc:`change_box <change_box>`
|
||||||
* :doc:`create_box <create_box>`
|
* :doc:`create_box <create_box>`
|
||||||
* :doc:`dimension <dimension>`
|
* :doc:`dimension <dimension>`
|
||||||
|
|||||||
@ -69,9 +69,9 @@ OPT.
|
|||||||
* :doc:`edpd/source <fix_dpd_source>`
|
* :doc:`edpd/source <fix_dpd_source>`
|
||||||
* :doc:`efield <fix_efield>`
|
* :doc:`efield <fix_efield>`
|
||||||
* :doc:`ehex <fix_ehex>`
|
* :doc:`ehex <fix_ehex>`
|
||||||
* :doc:`electrode/conp (i) <fix_electrode_conp>`
|
* :doc:`electrode/conp (i) <fix_electrode>`
|
||||||
* :doc:`electrode/conq (i) <fix_electrode_conp>`
|
* :doc:`electrode/conq (i) <fix_electrode>`
|
||||||
* :doc:`electrode/thermo (i) <fix_electrode_conp>`
|
* :doc:`electrode/thermo (i) <fix_electrode>`
|
||||||
* :doc:`electron/stopping <fix_electron_stopping>`
|
* :doc:`electron/stopping <fix_electron_stopping>`
|
||||||
* :doc:`electron/stopping/fit <fix_electron_stopping>`
|
* :doc:`electron/stopping/fit <fix_electron_stopping>`
|
||||||
* :doc:`enforce2d (k) <fix_enforce2d>`
|
* :doc:`enforce2d (k) <fix_enforce2d>`
|
||||||
|
|||||||
@ -205,7 +205,7 @@ OPT.
|
|||||||
* :doc:`mesont/tpm <pair_mesont_tpm>`
|
* :doc:`mesont/tpm <pair_mesont_tpm>`
|
||||||
* :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 (k) <pair_mliap>`
|
||||||
* :doc:`mm3/switch3/coulgauss/long <pair_lj_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>`
|
||||||
@ -236,6 +236,8 @@ OPT.
|
|||||||
* :doc:`oxrna2/xstk <pair_oxrna2>`
|
* :doc:`oxrna2/xstk <pair_oxrna2>`
|
||||||
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
||||||
* :doc:`pace (k) <pair_pace>`
|
* :doc:`pace (k) <pair_pace>`
|
||||||
|
* :doc:`pace/extrapolation <pair_pace>`
|
||||||
|
* :doc:`pod <pair_pod>`
|
||||||
* :doc:`peri/eps <pair_peri>`
|
* :doc:`peri/eps <pair_peri>`
|
||||||
* :doc:`peri/lps (o) <pair_peri>`
|
* :doc:`peri/lps (o) <pair_peri>`
|
||||||
* :doc:`peri/pmb (o) <pair_peri>`
|
* :doc:`peri/pmb (o) <pair_peri>`
|
||||||
@ -294,6 +296,7 @@ OPT.
|
|||||||
* :doc:`vashishta (gko) <pair_vashishta>`
|
* :doc:`vashishta (gko) <pair_vashishta>`
|
||||||
* :doc:`vashishta/table (o) <pair_vashishta>`
|
* :doc:`vashishta/table (o) <pair_vashishta>`
|
||||||
* :doc:`wf/cut <pair_wf_cut>`
|
* :doc:`wf/cut <pair_wf_cut>`
|
||||||
|
* :doc:`ylz <pair_ylz>`
|
||||||
* :doc:`yukawa (gko) <pair_yukawa>`
|
* :doc:`yukawa (gko) <pair_yukawa>`
|
||||||
* :doc:`yukawa/colloid (go) <pair_yukawa_colloid>`
|
* :doc:`yukawa/colloid (go) <pair_yukawa_colloid>`
|
||||||
* :doc:`zbl (gko) <pair_zbl>`
|
* :doc:`zbl (gko) <pair_zbl>`
|
||||||
|
|||||||
@ -2,14 +2,17 @@ Removed commands and packages
|
|||||||
=============================
|
=============================
|
||||||
|
|
||||||
This page lists LAMMPS commands and packages that have been removed from
|
This page lists LAMMPS commands and packages that have been removed from
|
||||||
the distribution and provides suggestions for alternatives or replacements.
|
the distribution and provides suggestions for alternatives or
|
||||||
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
|
replacements. LAMMPS has special dummy styles implemented, that will
|
||||||
print a suitable error message in most cases, when a style/command is used
|
stop LAMMPS and print a suitable error message in most cases, when a
|
||||||
that has been removed.
|
style/command is used that has been removed or will replace the command
|
||||||
|
with the direct alternative (if available) and print a warning.
|
||||||
|
|
||||||
Fix ave/spatial and fix ave/spatial/sphere
|
Fix ave/spatial and fix ave/spatial/sphere
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
|
.. deprecated:: 11Dec2015
|
||||||
|
|
||||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||||
since they were superseded by the more general and extensible "chunk
|
since they were superseded by the more general and extensible "chunk
|
||||||
infrastructure". Here the system is partitioned in one of many possible
|
infrastructure". Here the system is partitioned in one of many possible
|
||||||
@ -17,10 +20,23 @@ ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
|
|||||||
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
||||||
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||||
|
|
||||||
Reset_ids command
|
Box command
|
||||||
-----------------
|
-----------
|
||||||
|
|
||||||
The reset_ids command has been renamed to :doc:`reset_atom_ids <reset_atom_ids>`.
|
.. deprecated:: TBD
|
||||||
|
|
||||||
|
The *box* command has been removed and the LAMMPS code changed so it won't
|
||||||
|
be needed. If present, LAMMPS will ignore the command and print a warning.
|
||||||
|
|
||||||
|
Reset_ids, reset_atom_ids, reset_mol_ids commands
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
.. deprecated:: TBD
|
||||||
|
|
||||||
|
The *reset_ids*, *reset_atom_ids*, and *reset_mol_ids* commands have
|
||||||
|
been folded into the :doc:`reset_atoms <reset_atoms>` command. If
|
||||||
|
present, LAMMPS will replace the commands accordingly and print a
|
||||||
|
warning.
|
||||||
|
|
||||||
MEAM package
|
MEAM package
|
||||||
------------
|
------------
|
||||||
@ -30,18 +46,21 @@ The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
|||||||
Fortran code of MEAM into C++, which removes several restrictions
|
Fortran code of MEAM into C++, which removes several restrictions
|
||||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||||
for some optimizations leading to better performance. The pair style
|
for some optimizations leading to better performance. The pair style
|
||||||
:doc:`meam <pair_meam>` has the exact same syntax.
|
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||||
|
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||||
|
coexist with the Fortran version.
|
||||||
|
|
||||||
REAX package
|
REAX package
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The REAX package has been removed since it was superseded by the
|
The REAX package has been removed since it was superseded by the
|
||||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF
|
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||||
package has been tested to yield equivalent results to the REAX package,
|
to yield equivalent results to the REAX package, offers better
|
||||||
offers better performance, supports OpenMP multi-threading via OPENMP,
|
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||||
and GPU and threading parallelization through KOKKOS. The new pair styles
|
threading parallelization through KOKKOS. The new pair styles are not
|
||||||
are not syntax compatible with the removed reax pair style, so input
|
syntax compatible with the removed reax pair style, so input files will
|
||||||
files will have to be adapted.
|
have to be adapted. The REAXFF package was originally called
|
||||||
|
USER-REAXC.
|
||||||
|
|
||||||
USER-CUDA package
|
USER-CUDA package
|
||||||
-----------------
|
-----------------
|
||||||
@ -60,5 +79,6 @@ restart2data tool
|
|||||||
The functionality of the restart2data tool has been folded into the
|
The functionality of the restart2data tool has been folded into the
|
||||||
LAMMPS executable directly instead of having a separate tool. A
|
LAMMPS executable directly instead of having a separate tool. A
|
||||||
combination of the commands :doc:`read_restart <read_restart>` and
|
combination of the commands :doc:`read_restart <read_restart>` and
|
||||||
:doc:`write_data <write_data>` can be used to the same effect. For added
|
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||||
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
|
added convenience this conversion can also be triggered by
|
||||||
|
:doc:`command line flags <Run_options>`
|
||||||
|
|||||||
@ -50,7 +50,7 @@ parallel each MPI process creates such an instance. This can be seen
|
|||||||
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
||||||
simulation are the following 3 lines of code:
|
simulation are the following 3 lines of code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||||
lammps->input->file();
|
lammps->input->file();
|
||||||
@ -78,7 +78,7 @@ LAMMPS makes extensive use of the object oriented programming (OOP)
|
|||||||
principles of *compositing* and *inheritance*. Classes like the
|
principles of *compositing* and *inheritance*. Classes like the
|
||||||
``LAMMPS`` class are a **composite** containing pointers to instances
|
``LAMMPS`` class are a **composite** containing pointers to instances
|
||||||
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||||
``Modify``, and so on. Each of these classes implement certain
|
``Modify``, and so on. Each of these classes implements certain
|
||||||
functionality by storing and manipulating data related to the
|
functionality by storing and manipulating data related to the
|
||||||
simulation and providing member functions that trigger certain
|
simulation and providing member functions that trigger certain
|
||||||
actions. Some of those classes like ``Force`` are themselves
|
actions. Some of those classes like ``Force`` are themselves
|
||||||
@ -87,9 +87,9 @@ interactions. Similarly the ``Modify`` class contains a list of
|
|||||||
``Fix`` and ``Compute`` classes. If the input commands that
|
``Fix`` and ``Compute`` classes. If the input commands that
|
||||||
correspond to these classes include the word *style*, then LAMMPS
|
correspond to these classes include the word *style*, then LAMMPS
|
||||||
stores only a single instance of that class. E.g. *atom_style*,
|
stores only a single instance of that class. E.g. *atom_style*,
|
||||||
*comm_style*, *pair_style*, *bond_style*. It the input command does
|
*comm_style*, *pair_style*, *bond_style*. If the input command does
|
||||||
not include the word *style*, there can be many instances of that
|
**not** include the word *style*, then there may be many instances of
|
||||||
class defined. E.g. *region*, *fix*, *compute*, *dump*.
|
that class defined, for example *region*, *fix*, *compute*, *dump*.
|
||||||
|
|
||||||
**Inheritance** enables creation of *derived* classes that can share
|
**Inheritance** enables creation of *derived* classes that can share
|
||||||
common functionality in their base class while providing a consistent
|
common functionality in their base class while providing a consistent
|
||||||
@ -232,7 +232,7 @@ macro ``PairStyle()`` will associate the style name "lj/cut"
|
|||||||
with a factory function creating an instance of the ``PairLJCut``
|
with a factory function creating an instance of the ``PairLJCut``
|
||||||
class.
|
class.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
// from force.h
|
// from force.h
|
||||||
typedef Pair *(*PairCreator)(LAMMPS *);
|
typedef Pair *(*PairCreator)(LAMMPS *);
|
||||||
@ -360,7 +360,7 @@ characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
|||||||
argument type must be compatible or else the {fmt} formatting code will
|
argument type must be compatible or else the {fmt} formatting code will
|
||||||
throw an exception. Some format string examples are given below:
|
throw an exception. Some format string examples are given below:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c++
|
||||||
|
|
||||||
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
||||||
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
||||||
|
|||||||
@ -105,7 +105,7 @@ list, where each pair of atoms is listed only once (except when the
|
|||||||
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
||||||
Thus these are the default settings when a neighbor list request is created in:
|
Thus these are the default settings when a neighbor list request is created in:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void Pair::init_style()
|
void Pair::init_style()
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ neighbor list request to the specific needs of a style an additional
|
|||||||
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
||||||
for example, needs a "full" neighbor list:
|
for example, needs a "full" neighbor list:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairTersoff::init_style()
|
void PairTersoff::init_style()
|
||||||
{
|
{
|
||||||
@ -141,7 +141,7 @@ When a pair style supports r-RESPA time integration with different cutoff region
|
|||||||
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
||||||
from pair style lj/cut:
|
from pair style lj/cut:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairLJCut::init_style()
|
void PairLJCut::init_style()
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ Granular pair styles need neighbor lists based on particle sizes and not cutoff
|
|||||||
and also may require to have the list of previous neighbors available ("history").
|
and also may require to have the list of previous neighbors available ("history").
|
||||||
For example with:
|
For example with:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
||||||
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
||||||
@ -170,7 +170,7 @@ settings each request can set an id which is then used in the corresponding
|
|||||||
``init_list()`` function to assign it to the suitable pointer variable. This is
|
``init_list()`` function to assign it to the suitable pointer variable. This is
|
||||||
done for example by the :doc:`pair style meam <pair_meam>`:
|
done for example by the :doc:`pair style meam <pair_meam>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairMEAM::init_style()
|
void PairMEAM::init_style()
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ just once) and this can also be indicated by a flag. As an example here
|
|||||||
is the request from the ``FixPeriNeigh`` class which is created
|
is the request from the ``FixPeriNeigh`` class which is created
|
||||||
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ than what is usually inferred from the pair style settings (largest cutoff of
|
|||||||
all pair styles plus neighbor list skin). The following is used in the
|
all pair styles plus neighbor list skin). The following is used in the
|
||||||
:doc:`compute rdf <compute_rdf>` command implementation:
|
:doc:`compute rdf <compute_rdf>` command implementation:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (cutflag)
|
if (cutflag)
|
||||||
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
||||||
@ -212,7 +212,7 @@ for printing the neighbor list summary the name of the requesting command
|
|||||||
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
||||||
command:
|
command:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
|||||||
``pair_morse2.cpp`` with the factory function and initialization
|
``pair_morse2.cpp`` with the factory function and initialization
|
||||||
function would look like this:
|
function would look like this:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -141,7 +141,7 @@ 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.
|
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||||
Below is an example for that:
|
Below is an example for that:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -176,7 +176,7 @@ demonstrated in the following example, which also shows that the
|
|||||||
implementation of the plugin class may be within the same source
|
implementation of the plugin class may be within the same source
|
||||||
file as the plugin interface code:
|
file as the plugin interface code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
|
|
||||||
|
|||||||
@ -194,7 +194,7 @@ macro. These tests operate by capturing the screen output when executing
|
|||||||
the failing command and then comparing that with a provided regular
|
the failing command and then comparing that with a provided regular
|
||||||
expression string pattern. Example:
|
expression string pattern. Example:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
TEST_F(SimpleCommandsTest, UnknownCommand)
|
TEST_F(SimpleCommandsTest, UnknownCommand)
|
||||||
{
|
{
|
||||||
@ -226,9 +226,9 @@ The following test programs are currently available:
|
|||||||
* - ``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>`
|
||||||
* - ``test_reset_ids.cpp``
|
* - ``test_reset_atoms.cpp``
|
||||||
- ResetIDs
|
- ResetAtoms
|
||||||
- Tests to validate the :doc:`reset_atom_ids <reset_atom_ids>` and :doc:`reset_mol_ids <reset_mol_ids>` commands
|
- Tests to validate the :doc:`reset_atoms <reset_atoms>` sub-commands
|
||||||
|
|
||||||
|
|
||||||
Tests for the C-style library interface
|
Tests for the C-style library interface
|
||||||
@ -249,7 +249,7 @@ MPI support. These include tests where LAMMPS is run in multi-partition
|
|||||||
mode or only on a subset of the MPI world communicator. The CMake
|
mode or only on a subset of the MPI world communicator. The CMake
|
||||||
script code for adding this kind of test looks like this:
|
script code for adding this kind of test looks like this:
|
||||||
|
|
||||||
.. code-block:: CMake
|
.. code-block:: cmake
|
||||||
|
|
||||||
if (BUILD_MPI)
|
if (BUILD_MPI)
|
||||||
add_executable(test_library_mpi test_library_mpi.cpp)
|
add_executable(test_library_mpi test_library_mpi.cpp)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ source files provided as a supplement to a publication) that are written
|
|||||||
for an older version of LAMMPS and thus need to be updated to be
|
for an older version of LAMMPS and thus need to be updated to be
|
||||||
compatible with the current version of LAMMPS. Due to the active
|
compatible with the current version of LAMMPS. Due to the active
|
||||||
development of LAMMPS it is likely to always be incomplete. Please
|
development of LAMMPS it is likely to always be incomplete. Please
|
||||||
contact developer@lammps.org in case you run across an issue that is not
|
contact developers@lammps.org in case you run across an issue that is not
|
||||||
(yet) listed here. Please also review the latest information about the
|
(yet) listed here. Please also review the latest information about the
|
||||||
LAMMPS :doc:`programming style conventions <Modify_style>`, especially
|
LAMMPS :doc:`programming style conventions <Modify_style>`, especially
|
||||||
if you are considering to submit the updated version for inclusion into
|
if you are considering to submit the updated version for inclusion into
|
||||||
@ -61,7 +61,7 @@ header file needs to be updated accordingly.
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
{
|
{
|
||||||
@ -112,14 +112,14 @@ Example from a pair style:
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag, vflag);
|
if (eflag || vflag) ev_setup(eflag, vflag);
|
||||||
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
|
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
|
||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
ev_init(eflag, vflag);
|
ev_init(eflag, vflag);
|
||||||
|
|
||||||
@ -142,14 +142,14 @@ when they are called from only one or a subset of the MPI processes.
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
val = force->numeric(FLERR, arg[1]);
|
val = force->numeric(FLERR, arg[1]);
|
||||||
num = force->inumeric(FLERR, arg[2]);
|
num = force->inumeric(FLERR, arg[2]);
|
||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
val = utils::numeric(FLERR, true, arg[1], lmp);
|
val = utils::numeric(FLERR, true, arg[1], lmp);
|
||||||
num = utils::inumeric(FLERR, false, arg[2], lmp);
|
num = utils::inumeric(FLERR, false, arg[2], lmp);
|
||||||
@ -183,14 +183,14 @@ copy them around for simulations.
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
fp = force->open_potential(filename);
|
fp = force->open_potential(filename);
|
||||||
fp = fopen(filename, "r");
|
fp = fopen(filename, "r");
|
||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
fp = utils::open_potential(filename, lmp);
|
fp = utils::open_potential(filename, lmp);
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ Example:
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (fptr == NULL) {
|
if (fptr == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
@ -217,7 +217,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (fptr == nullptr)
|
if (fptr == nullptr)
|
||||||
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
|
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
|
||||||
@ -237,7 +237,7 @@ an example from the ``FixWallReflect`` class:
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixWallReflect(class LAMMPS *, int, char **);
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
virtual ~FixWallReflect();
|
virtual ~FixWallReflect();
|
||||||
@ -247,7 +247,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixWallReflect(class LAMMPS *, int, char **);
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
~FixWallReflect() override;
|
~FixWallReflect() override;
|
||||||
@ -271,7 +271,7 @@ the type of the "this" pointer argument.
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
comm->forward_comm_pair(this);
|
comm->forward_comm_pair(this);
|
||||||
comm->forward_comm_fix(this);
|
comm->forward_comm_fix(this);
|
||||||
@ -284,7 +284,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
comm->forward_comm(this);
|
comm->forward_comm(this);
|
||||||
comm->reverse_comm(this);
|
comm->reverse_comm(this);
|
||||||
@ -304,7 +304,7 @@ requests can be :doc:`found here <Developer_notes>`. Example from the
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int irequest = neighbor->request(this,instance_me);
|
int irequest = neighbor->request(this,instance_me);
|
||||||
neighbor->requests[irequest]->pair = 0;
|
neighbor->requests[irequest]->pair = 0;
|
||||||
@ -317,7 +317,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||||
if (cutflag) req->set_cutoff(mycutneigh);
|
if (cutflag) req->set_cutoff(mycutneigh);
|
||||||
@ -340,7 +340,7 @@ these are internal fixes, there is no user visible change.
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "fix_store.h"
|
#include "fix_store.h"
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "fix_store_peratom.h"
|
#include "fix_store_peratom.h"
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ New:
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "fix_store.h"
|
#include "fix_store.h"
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "fix_store_global.h"
|
#include "fix_store_global.h"
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ the dump directly. Example:
|
|||||||
|
|
||||||
Old:
|
Old:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int idump = output->find_dump(arg[iarg+1]);
|
int idump = output->find_dump(arg[iarg+1]);
|
||||||
if (idump < 0)
|
if (idump < 0)
|
||||||
@ -412,7 +412,7 @@ Old:
|
|||||||
|
|
||||||
New:
|
New:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||||
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||||
|
|||||||
@ -317,7 +317,7 @@ are all "whitespace" characters, i.e. the space character, the tabulator
|
|||||||
character, the carriage return character, the linefeed character, and
|
character, the carriage return character, the linefeed character, and
|
||||||
the form feed character.
|
the form feed character.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Tokenizer class example listing entries of the PATH environment variable
|
:caption: Tokenizer class example listing entries of the PATH environment variable
|
||||||
|
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
@ -349,7 +349,7 @@ tokenizer into a ``try`` / ``catch`` block to handle errors. The
|
|||||||
when a (type of) number is requested as next token that is not
|
when a (type of) number is requested as next token that is not
|
||||||
compatible with the string representing the next word.
|
compatible with the string representing the next word.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: ValueTokenizer class example with exception handling
|
:caption: ValueTokenizer class example with exception handling
|
||||||
|
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
@ -427,7 +427,7 @@ one or two array indices "[<number>]" with numbers > 0.
|
|||||||
|
|
||||||
A typical code segment would look like this:
|
A typical code segment would look like this:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Usage example for ArgInfo class
|
:caption: Usage example for ArgInfo class
|
||||||
|
|
||||||
int nvalues = 0;
|
int nvalues = 0;
|
||||||
@ -476,7 +476,7 @@ open the file, and will call the :cpp:class:`LAMMPS_NS::Error` class in
|
|||||||
case of failures to read or to convert numbers, so that LAMMPS will be
|
case of failures to read or to convert numbers, so that LAMMPS will be
|
||||||
aborted.
|
aborted.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
||||||
|
|
||||||
PotentialFileReader reader(lmp, file, "coul/streitz");
|
PotentialFileReader reader(lmp, file, "coul/streitz");
|
||||||
@ -555,7 +555,7 @@ chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
|
|||||||
its size is registered later with :cpp:func:`MyPage::vgot()
|
its size is registered later with :cpp:func:`MyPage::vgot()
|
||||||
<LAMMPS_NS::MyPage::vgot>`.
|
<LAMMPS_NS::MyPage::vgot>`.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
|
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
|
||||||
|
|
||||||
#include "my_page.h"
|
#include "my_page.h"
|
||||||
|
|||||||
@ -26,7 +26,7 @@ constructor with the signature: ``FixPrintVel(class LAMMPS *, int, char **)``.
|
|||||||
Every fix must be registered in LAMMPS by writing the following lines
|
Every fix must be registered in LAMMPS by writing the following lines
|
||||||
of code in the header before include guards:
|
of code in the header before include guards:
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c++
|
||||||
|
|
||||||
#ifdef FIX_CLASS
|
#ifdef FIX_CLASS
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -47,7 +47,7 @@ keyword when it parses the input script.
|
|||||||
Let's write a simple fix which will print the average velocity at the end
|
Let's write a simple fix which will print the average velocity at the end
|
||||||
of each timestep. First of all, implement a constructor:
|
of each timestep. First of all, implement a constructor:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
|
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
|
||||||
: Fix(lmp, narg, arg)
|
: Fix(lmp, narg, arg)
|
||||||
@ -72,7 +72,7 @@ in the Fix class called ``nevery`` which specifies how often the method
|
|||||||
|
|
||||||
The next method we need to implement is ``setmask()``:
|
The next method we need to implement is ``setmask()``:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int FixPrintVel::setmask()
|
int FixPrintVel::setmask()
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ during execution. The constant ``END_OF_STEP`` corresponds to the
|
|||||||
are called during a timestep and the order in which they are called
|
are called during a timestep and the order in which they are called
|
||||||
are shown in the previous section.
|
are shown in the previous section.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void FixPrintVel::end_of_step()
|
void FixPrintVel::end_of_step()
|
||||||
{
|
{
|
||||||
@ -143,7 +143,7 @@ The group membership information of an atom is contained in the *mask*
|
|||||||
property of and atom and the bit corresponding to a given group is
|
property of and atom and the bit corresponding to a given group is
|
||||||
stored in the groupbit variable which is defined in Fix base class:
|
stored in the groupbit variable which is defined in Fix base class:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; ++i) {
|
for (int i = 0; i < nlocal; ++i) {
|
||||||
if (atom->mask[i] & groupbit) {
|
if (atom->mask[i] & groupbit) {
|
||||||
@ -174,7 +174,7 @@ to store positions of atoms from previous timestep, we need to add
|
|||||||
``double** xold`` to the header file. Than add allocation code
|
``double** xold`` to the header file. Than add allocation code
|
||||||
to the constructor:
|
to the constructor:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
|
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
|
||||||
{
|
{
|
||||||
@ -190,7 +190,7 @@ to the constructor:
|
|||||||
|
|
||||||
Implement the aforementioned methods:
|
Implement the aforementioned methods:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
double FixSavePos::memory_usage()
|
double FixSavePos::memory_usage()
|
||||||
{
|
{
|
||||||
|
|||||||
1890
doc/src/Fortran.rst
1890
doc/src/Fortran.rst
File diff suppressed because it is too large
Load Diff
@ -152,14 +152,14 @@ Creating a new instance of PyLammps
|
|||||||
To create a PyLammps object you need to first import the class from the lammps
|
To create a PyLammps object you need to first import the class from the lammps
|
||||||
module. By using the default constructor, a new *lammps* instance is created.
|
module. By using the default constructor, a new *lammps* instance is created.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import PyLammps
|
from lammps import PyLammps
|
||||||
L = PyLammps()
|
L = PyLammps()
|
||||||
|
|
||||||
You can also initialize PyLammps on top of this existing *lammps* object:
|
You can also initialize PyLammps on top of this existing *lammps* object:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps, PyLammps
|
from lammps import lammps, PyLammps
|
||||||
lmp = lammps()
|
lmp = lammps()
|
||||||
@ -180,14 +180,14 @@ For instance, let's take the following LAMMPS command:
|
|||||||
In the original interface this command can be executed with the following
|
In the original interface this command can be executed with the following
|
||||||
Python code if *L* was a lammps instance:
|
Python code if *L* was a lammps instance:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.command("region box block 0 10 0 5 -0.5 0.5")
|
L.command("region box block 0 10 0 5 -0.5 0.5")
|
||||||
|
|
||||||
With the PyLammps interface, any command can be split up into arbitrary parts
|
With the PyLammps interface, any command can be split up into arbitrary parts
|
||||||
separated by white-space, passed as individual arguments to a region method.
|
separated by white-space, passed as individual arguments to a region method.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||||
|
|
||||||
@ -199,14 +199,14 @@ The benefit of this approach is avoiding redundant command calls and easier
|
|||||||
parameterization. In the original interface parameterization needed to be done
|
parameterization. In the original interface parameterization needed to be done
|
||||||
manually by creating formatted strings.
|
manually by creating formatted strings.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||||
|
|
||||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||||
them automatically to a final command string.
|
them automatically to a final command string.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ LAMMPS variables can be both defined and accessed via the PyLammps interface.
|
|||||||
|
|
||||||
To define a variable you can use the :doc:`variable <variable>` command:
|
To define a variable you can use the :doc:`variable <variable>` command:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.variable("a index 2")
|
L.variable("a index 2")
|
||||||
|
|
||||||
@ -265,14 +265,14 @@ A dictionary of all variables is returned by L.variables
|
|||||||
you can access an individual variable by retrieving a variable object from the
|
you can access an individual variable by retrieving a variable object from the
|
||||||
L.variables dictionary by name
|
L.variables dictionary by name
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
a = L.variables['a']
|
a = L.variables['a']
|
||||||
|
|
||||||
The variable value can then be easily read and written by accessing the value
|
The variable value can then be easily read and written by accessing the value
|
||||||
property of this object.
|
property of this object.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
print(a.value)
|
print(a.value)
|
||||||
a.value = 4
|
a.value = 4
|
||||||
@ -284,7 +284,7 @@ LAMMPS expressions can be immediately evaluated by using the eval method. The
|
|||||||
passed string parameter can be any expression containing global thermo values,
|
passed string parameter can be any expression containing global thermo values,
|
||||||
variables, compute or fix data.
|
variables, compute or fix data.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
result = L.eval("ke") # kinetic energy
|
result = L.eval("ke") # kinetic energy
|
||||||
result = L.eval("pe") # potential energy
|
result = L.eval("pe") # potential energy
|
||||||
@ -298,7 +298,7 @@ All atoms in the current simulation can be accessed by using the L.atoms list.
|
|||||||
Each element of this list is an object which exposes its properties (id, type,
|
Each element of this list is an object which exposes its properties (id, type,
|
||||||
position, velocity, force, etc.).
|
position, velocity, force, etc.).
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# access first atom
|
# access first atom
|
||||||
L.atoms[0].id
|
L.atoms[0].id
|
||||||
@ -311,7 +311,7 @@ position, velocity, force, etc.).
|
|||||||
|
|
||||||
Some properties can also be used to set:
|
Some properties can also be used to set:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# set position in 2D simulation
|
# set position in 2D simulation
|
||||||
L.atoms[0].position = (1.0, 0.0)
|
L.atoms[0].position = (1.0, 0.0)
|
||||||
@ -328,7 +328,7 @@ after a run via the L.runs list. This list contains a growing list of run data.
|
|||||||
The first element is the output of the first run, the second element that of
|
The first element is the output of the first run, the second element that of
|
||||||
the second run.
|
the second run.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.run(1000)
|
L.run(1000)
|
||||||
L.runs[0] # data of first 1000 time steps
|
L.runs[0] # data of first 1000 time steps
|
||||||
@ -339,14 +339,14 @@ the second run.
|
|||||||
Each run contains a dictionary of all trajectories. Each trajectory is
|
Each run contains a dictionary of all trajectories. Each trajectory is
|
||||||
accessible through its thermo name:
|
accessible through its thermo name:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.runs[0].thermo.Step # list of time steps in first run
|
L.runs[0].thermo.Step # list of time steps in first run
|
||||||
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
||||||
|
|
||||||
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
import matplotlib.plot as plt
|
import matplotlib.plot as plt
|
||||||
steps = L.runs[0].thermo.Step
|
steps = L.runs[0].thermo.Step
|
||||||
@ -406,7 +406,7 @@ Four atoms are placed in the simulation and the dihedral potential is applied on
|
|||||||
them using a datafile. Then one of the atoms is rotated along the central axis by
|
them using a datafile. Then one of the atoms is rotated along the central axis by
|
||||||
setting its position from Python, which changes the dihedral angle.
|
setting its position from Python, which changes the dihedral angle.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
phi = [d \* math.pi / 180 for d in range(360)]
|
phi = [d \* math.pi / 180 for d in range(360)]
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ Initially, a 2D system is created in a state with minimal energy.
|
|||||||
|
|
||||||
It is then disordered by moving each atom by a random delta.
|
It is then disordered by moving each atom by a random delta.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
random.seed(27848)
|
random.seed(27848)
|
||||||
deltaperturb = 0.2
|
deltaperturb = 0.2
|
||||||
@ -458,7 +458,7 @@ It is then disordered by moving each atom by a random delta.
|
|||||||
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
||||||
moves random atoms by a random delta and only accepts certain moves.
|
moves random atoms by a random delta and only accepts certain moves.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
estart = L.eval("pe")
|
estart = L.eval("pe")
|
||||||
elast = estart
|
elast = estart
|
||||||
@ -517,7 +517,7 @@ PyLammps can be run in parallel using mpi4py. This python package can be install
|
|||||||
The following is a short example which reads in an existing LAMMPS input file and
|
The following is a short example which reads in an existing LAMMPS input file and
|
||||||
executes it in parallel. You can find in.melt in the examples/melt folder.
|
executes it in parallel. You can find in.melt in the examples/melt folder.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from mpi4py import MPI
|
from mpi4py import MPI
|
||||||
from lammps import PyLammps
|
from lammps import PyLammps
|
||||||
|
|||||||
@ -43,7 +43,7 @@ JSON
|
|||||||
"ke": $(ke)
|
"ke": $(ke)
|
||||||
}""" file current_state.json screen no
|
}""" file current_state.json screen no
|
||||||
|
|
||||||
.. code-block:: JSON
|
.. code-block:: json
|
||||||
:caption: current_state.json
|
:caption: current_state.json
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,18 +8,28 @@ This site M is located at a fixed distance away from the oxygen along
|
|||||||
the bisector of the HOH bond angle. A bond style of *harmonic* and an
|
the bisector of the HOH bond angle. A bond style of *harmonic* and an
|
||||||
angle style of *harmonic* or *charmm* should also be used.
|
angle style of *harmonic* or *charmm* should also be used.
|
||||||
|
|
||||||
A TIP4P model is run with LAMMPS using either this command
|
A TIP4P model is run with LAMMPS using either these commands
|
||||||
for a cutoff model:
|
for a cutoff model:
|
||||||
|
|
||||||
|
* :doc:`pair_style tip4p/cut <pair_lj_cut_tip4p>`
|
||||||
* :doc:`pair_style lj/cut/tip4p/cut <pair_lj_cut_tip4p>`
|
* :doc:`pair_style lj/cut/tip4p/cut <pair_lj_cut_tip4p>`
|
||||||
|
|
||||||
or these two commands for a long-range model:
|
or these commands for a long-range model:
|
||||||
|
|
||||||
|
* :doc:`pair_style tip4p/long <pair_coul>`
|
||||||
* :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>`
|
* :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>`
|
||||||
|
* :doc:`pair_style lj/long/tip4p/long <pair_lj_long>`
|
||||||
|
* :doc:`pair_style tip4p/long/soft <pair_fep_soft>`
|
||||||
|
* :doc:`pair_style lj/cut/tip4p/long/soft <pair_fep_soft>`
|
||||||
* :doc:`kspace_style pppm/tip4p <kspace_style>`
|
* :doc:`kspace_style pppm/tip4p <kspace_style>`
|
||||||
|
* :doc:`kspace_style pppm/disp/tip4p <kspace_style>`
|
||||||
|
|
||||||
For both models, the bond lengths and bond angles should be held fixed
|
The bond lengths and bond angles should be held fixed using the
|
||||||
using the :doc:`fix shake <fix_shake>` command.
|
:doc:`fix shake <fix_shake>` or :doc:`fix rattle <fix_shake>` command,
|
||||||
|
unless a parameterization for a flexible TIP4P model is used. The
|
||||||
|
parameter sets listed below are all for rigid TIP4P model variants and
|
||||||
|
thus the bond and angle force constants are not used and can be set to
|
||||||
|
any legal value; only equilibrium length and angle are used.
|
||||||
|
|
||||||
These are the additional parameters (in real units) to set for O and H
|
These are the additional parameters (in real units) to set for O and H
|
||||||
atoms and the water molecule to run a rigid TIP4P model with a cutoff
|
atoms and the water molecule to run a rigid TIP4P model with a cutoff
|
||||||
@ -87,15 +97,16 @@ solver (e.g. Ewald or PPPM in LAMMPS):
|
|||||||
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
|
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
|
||||||
|
|
|
|
||||||
|
|
||||||
Note that the when using the TIP4P pair style, the neighbor list
|
Note that the when using the TIP4P pair style, the neighbor list cutoff
|
||||||
cutoff for Coulomb interactions is effectively extended by a distance
|
for Coulomb interactions is effectively extended by a distance 2 \* (OM
|
||||||
2 \* (OM distance), to account for the offset distance of the
|
distance), to account for the offset distance of the fictitious charges
|
||||||
fictitious charges on O atoms in water molecules. Thus it is
|
on O atoms in water molecules. Thus it is typically best in an
|
||||||
typically best in an efficiency sense to use a LJ cutoff >= Coulomb
|
efficiency sense to use a LJ cutoff >= Coulomb cutoff + 2\*(OM
|
||||||
cutoff + 2\*(OM distance), to shrink the size of the neighbor list.
|
distance), to shrink the size of the neighbor list. This leads to
|
||||||
This leads to slightly larger cost for the long-range calculation, so
|
slightly larger cost for the long-range calculation, so you can test the
|
||||||
you can test the trade-off for your model. The OM distance and the LJ
|
trade-off for your model. The OM distance and the LJ and Coulombic
|
||||||
and Coulombic cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>` command.
|
cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long
|
||||||
|
<pair_lj_cut_tip4p>` command.
|
||||||
|
|
||||||
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||||
|
|
||||||
|
|||||||
@ -144,11 +144,6 @@ does not change the atom positions due to non-periodicity. In this
|
|||||||
mode, if you tilt the system to extreme angles, the simulation will
|
mode, if you tilt the system to extreme angles, the simulation will
|
||||||
simply become inefficient, due to the highly skewed simulation box.
|
simply become inefficient, due to the highly skewed simulation box.
|
||||||
|
|
||||||
The limitation on not creating a simulation box with a tilt factor
|
|
||||||
skewing the box more than half the distance of the parallel box length
|
|
||||||
can be overridden via the :doc:`box <box>` command. Setting the *tilt*
|
|
||||||
keyword to *large* allows any tilt factors to be specified.
|
|
||||||
|
|
||||||
Box flips that may occur using the :doc:`fix deform <fix_deform>` or
|
Box flips that may occur using the :doc:`fix deform <fix_deform>` or
|
||||||
:doc:`fix npt <fix_nh>` commands can be turned off using the *flip no*
|
:doc:`fix npt <fix_nh>` commands can be turned off using the *flip no*
|
||||||
option with either of the commands.
|
option with either of the commands.
|
||||||
|
|||||||
@ -2,12 +2,13 @@ LAMMPS Library Interfaces
|
|||||||
*************************
|
*************************
|
||||||
|
|
||||||
As described on the :doc:`library interface to LAMMPS <Howto_library>`
|
As described on the :doc:`library interface to LAMMPS <Howto_library>`
|
||||||
page, LAMMPS can be built as a library (static or shared), so that
|
page, LAMMPS can be built as a library (static or shared), so that it
|
||||||
it can be called by another code, used in a :doc:`coupled manner
|
can be called by another code, used in a :doc:`coupled manner
|
||||||
<Howto_couple>` with other codes, or driven through a :doc:`Python
|
<Howto_couple>` with other codes, or driven through a :doc:`Python
|
||||||
script <Python_head>`. Even the LAMMPS standalone executable is
|
script <Python_head>`. The LAMMPS standalone executable itself is
|
||||||
essentially a thin wrapper on top of the LAMMPS library, creating a
|
essentially a thin wrapper on top of the LAMMPS library, which creates a
|
||||||
LAMMPS instance, processing input and then existing.
|
LAMMPS instance, passes the input for processing to that instance, and
|
||||||
|
then exits.
|
||||||
|
|
||||||
Most of the APIs described below are based on C language wrapper
|
Most of the APIs described below are based on C language wrapper
|
||||||
functions in the files ``src/library.h`` and ``src/library.cpp``, but
|
functions in the files ``src/library.h`` and ``src/library.cpp``, but
|
||||||
@ -87,6 +88,18 @@ run LAMMPS in serial mode.
|
|||||||
message retrieved <lammps_get_last_error_message>`. We thus
|
message retrieved <lammps_get_last_error_message>`. We thus
|
||||||
recommend enabling C++ exceptions when using the library interface,
|
recommend enabling C++ exceptions when using the library interface,
|
||||||
|
|
||||||
|
.. admonition:: Using the C library interface as a plugin
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
Rather than including the C library directly and link to the LAMMPS
|
||||||
|
library at compile time, you can use the ``liblammpsplugin.h`` header
|
||||||
|
file and the ``liblammpsplugin.c`` C code in the
|
||||||
|
``examples/COUPLE/plugin`` folder for an interface to LAMMPS that is
|
||||||
|
largely identical to the regular library interface, only that it will
|
||||||
|
load a LAMMPS shared library file at runtime. This can be useful for
|
||||||
|
applications where the interface to LAMMPS would be an optional
|
||||||
|
feature.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
No checks are made on the arguments of the function calls of the C
|
No checks are made on the arguments of the function calls of the C
|
||||||
@ -163,5 +176,3 @@ The following links provide some examples and references to the C++ API.
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
Cplusplus
|
Cplusplus
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ crashes within LAMMPS may be recovered from by enabling
|
|||||||
:ref:`exceptions <exceptions>`, avoiding them proactively is a safer
|
:ref:`exceptions <exceptions>`, avoiding them proactively is a safer
|
||||||
approach.
|
approach.
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c
|
||||||
:caption: Example for using configuration settings functions
|
:caption: Example for using configuration settings functions
|
||||||
|
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
|
|||||||
@ -22,7 +22,7 @@ as the "handle" argument in subsequent function calls until that
|
|||||||
instance is destroyed by calling :cpp:func:`lammps_close`. Here is a
|
instance is destroyed by calling :cpp:func:`lammps_close`. Here is a
|
||||||
simple example demonstrating its use:
|
simple example demonstrating its use:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c
|
||||||
|
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@ -30,7 +30,7 @@ be included in the file or strings, and expansion of variables with
|
|||||||
``${name}`` or ``$(expression)`` syntax is performed.
|
``${name}`` or ``$(expression)`` syntax is performed.
|
||||||
Below is a short example using some of these functions.
|
Below is a short example using some of these functions.
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c
|
||||||
|
|
||||||
/* define to make the otherwise hidden prototype for "lammps_open()" visible */
|
/* define to make the otherwise hidden prototype for "lammps_open()" visible */
|
||||||
#define LAMMPS_LIB_MPI
|
#define LAMMPS_LIB_MPI
|
||||||
|
|||||||
@ -6,6 +6,7 @@ fixes, or variables in LAMMPS using the following functions:
|
|||||||
|
|
||||||
- :cpp:func:`lammps_extract_compute`
|
- :cpp:func:`lammps_extract_compute`
|
||||||
- :cpp:func:`lammps_extract_fix`
|
- :cpp:func:`lammps_extract_fix`
|
||||||
|
- :cpp:func:`lammps_extract_variable_datatype`
|
||||||
- :cpp:func:`lammps_extract_variable`
|
- :cpp:func:`lammps_extract_variable`
|
||||||
- :cpp:func:`lammps_set_variable`
|
- :cpp:func:`lammps_set_variable`
|
||||||
|
|
||||||
@ -21,6 +22,11 @@ fixes, or variables in LAMMPS using the following functions:
|
|||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
.. doxygenfunction:: lammps_extract_variable_datatype
|
||||||
|
:project: progguide
|
||||||
|
|
||||||
|
-----------------------
|
||||||
|
|
||||||
.. doxygenfunction:: lammps_extract_variable
|
.. doxygenfunction:: lammps_extract_variable
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
@ -36,3 +42,5 @@ fixes, or variables in LAMMPS using the following functions:
|
|||||||
.. doxygenenum:: _LMP_STYLE_CONST
|
.. doxygenenum:: _LMP_STYLE_CONST
|
||||||
|
|
||||||
.. doxygenenum:: _LMP_TYPE_CONST
|
.. doxygenenum:: _LMP_TYPE_CONST
|
||||||
|
|
||||||
|
.. doxygenenum:: _LMP_VAR_CONST
|
||||||
|
|||||||
@ -16,8 +16,8 @@ This section documents the following functions:
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
The library interface allows the extraction of different kinds of
|
The library interface allows the extraction of different kinds of
|
||||||
information about the active simulation instance and also - in some
|
information about the active simulation instance and also---in some
|
||||||
cases - to apply modifications to it. This enables combining of a
|
cases---to apply modifications to it. This enables combining of a
|
||||||
LAMMPS simulation with other processing and simulation methods computed
|
LAMMPS simulation with other processing and simulation methods computed
|
||||||
by the calling code, or by another code that is coupled to LAMMPS via
|
by the calling code, or by another code that is coupled to LAMMPS via
|
||||||
the library interface. In some cases the data returned is direct
|
the library interface. In some cases the data returned is direct
|
||||||
@ -25,14 +25,14 @@ reference to the original data inside LAMMPS, cast to a void pointer.
|
|||||||
In that case the data needs to be cast to a suitable pointer for the
|
In that case the data needs to be cast to a suitable pointer for the
|
||||||
calling program to access it, and you may need to know the correct
|
calling program to access it, and you may need to know the correct
|
||||||
dimensions and lengths. This also means you can directly change those
|
dimensions and lengths. This also means you can directly change those
|
||||||
value(s) from the calling program, e.g. to modify atom positions. Of
|
value(s) from the calling program (e.g., to modify atom positions). Of
|
||||||
course, this should be done with care. When accessing per-atom data,
|
course, changing values should be done with care. When accessing per-atom
|
||||||
please note that this data is the per-processor **local** data and is
|
data, please note that these data are the per-processor **local** data and are
|
||||||
indexed accordingly. Per-atom data can change sizes and ordering at
|
indexed accordingly. Per-atom data can change sizes and ordering at
|
||||||
every neighbor list rebuild or atom sort event as atoms migrate between
|
every neighbor list rebuild or atom sort event as atoms migrate between
|
||||||
sub-domains and processors.
|
sub-domains and processors.
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c
|
||||||
|
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@ -42,7 +42,7 @@ descriptions of all commands included in the LAMMPS code.
|
|||||||
.. only:: html
|
.. only:: html
|
||||||
|
|
||||||
Once you are familiar with LAMMPS, you may want to bookmark
|
Once you are familiar with LAMMPS, you may want to bookmark
|
||||||
:doc:`this page <Commands_all>` since it gives quick access
|
:doc:`this page <Commands_all>` since it gives quick access to
|
||||||
the documentation for all LAMMPS commands.
|
the documentation for all LAMMPS commands.
|
||||||
|
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
|
|||||||
@ -13,24 +13,65 @@ Here is a brief description of common methods you define in your
|
|||||||
new derived class. See bond.h, angle.h, dihedral.h, and improper.h
|
new derived class. See bond.h, angle.h, dihedral.h, and improper.h
|
||||||
for details and specific additional methods.
|
for details and specific additional methods.
|
||||||
|
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| init | check if all coefficients are set, calls *init_style* (optional) |
|
| Required | "pure" methods that *must* be overridden in a derived class |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+=======================+=====================================================================+
|
||||||
| init_style | check if style specific conditions are met (optional) |
|
| compute | compute the molecular interactions for all listed items |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| compute | compute the molecular interactions (required) |
|
| coeff | set coefficients for one type |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| settings | apply global settings for all types (optional) |
|
| equilibrium_distance | length of bond, used by SHAKE (bond styles only) |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| coeff | set coefficients for one type (required) |
|
| equilibrium_angle | opening of angle, used by SHAKE (angle styles only) |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| equilibrium_distance | length of bond, used by SHAKE (required, bond only) |
|
| write & read_restart | writes/reads coeffs to restart files |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| equilibrium_angle | opening of angle, used by SHAKE (required, angle only) |
|
| single | force/r (bond styles only) and energy of a single bond or angle |
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
+-----------------------+---------------------------------------------------------------------+
|
||||||
| write & read_restart | writes/reads coeffs to restart files (required) |
|
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
|
||||||
| single | force (bond only) and energy of a single bond or angle (required, bond or angle only) |
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
| Optional | methods that have a default or dummy implementation |
|
||||||
| memory_usage | tally memory allocated by the style (optional) |
|
+================================+======================================================================+
|
||||||
+-----------------------+---------------------------------------------------------------------------------------+
|
| init | check if all coefficients are set, calls init_style() |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| init_style | check if style specific conditions are met |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| settings | apply global settings for all types |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write & read_restart_settings | writes/reads global style settings to restart files |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write_data | write corresponding Coeffs section(s) in data file |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| memory_usage | tally memory allocated by the style |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| extract | provide access to internal data (bond or angle styles only) |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| reinit | reset all type-based parameters, called by fix adapt (bonds only) |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| pack & unpack_forward_comm | copy data to and from buffer in forward communication (bonds only) |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
| pack & unpack_reverse_comm | copy data to and from buffer in reverse communication (bonds only) |
|
||||||
|
+--------------------------------+----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
Here is a list of flags or settings that should be set in the
|
||||||
|
constructor of the derived class when they differ from the default
|
||||||
|
setting.
|
||||||
|
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| Name of flag | Description | default |
|
||||||
|
+=================================+==============================================================================+=========+
|
||||||
|
| writedata | 1 if write_data() is implemented | 1 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| single_extra | number of extra single values calculated (bond styles only) | 0 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| partial_flag | 1 if bond type can be set to 0 and deleted (bond styles only) | 0 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| reinitflag | 1 if style has reinit() and is compatible with fix adapt | 1 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| comm_forward | size of buffer (in doubles) for forward communication (bond styles only) | 0 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| comm_reverse | size of buffer (in doubles) for reverse communication (bond styles only) | 0 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
| comm_reverse_off | size of buffer for reverse communication with newton off (bond styles only) | 0 |
|
||||||
|
+---------------------------------+------------------------------------------------------------------------------+---------+
|
||||||
|
|||||||
@ -1,35 +1,121 @@
|
|||||||
Pair styles
|
Pair styles
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Classes that compute pairwise interactions are derived from the Pair
|
Classes that compute pairwise non-bonded interactions are derived from
|
||||||
class. In LAMMPS, pairwise calculation include many-body potentials
|
the Pair class. In LAMMPS, pairwise calculation include many-body
|
||||||
such as EAM or Tersoff where particles interact without a static bond
|
potentials such as EAM, Tersoff, or ReaxFF where particles interact
|
||||||
topology. New styles can be created to add new pair potentials to
|
without an explicit bond topology but include interactions beyond
|
||||||
LAMMPS.
|
pairwise non-bonded contributions. New styles can be created to add
|
||||||
|
support for additional pair potentials to LAMMPS. When the
|
||||||
|
modifications are small, sometimes it is more effective to derive from
|
||||||
|
an existing pair style class. This latter approach is also used by
|
||||||
|
:doc:`Accelerator packages <Speed_packages>` where the accelerated style
|
||||||
|
names differ from their base classes by an appended suffix.
|
||||||
|
|
||||||
Pair_lj_cut.cpp is a simple example of a Pair class, though it
|
The file ``src/pair_lj_cut.cpp`` is an example of a Pair class with a
|
||||||
includes some optional methods to enable its use with rRESPA.
|
very simple potential function. It includes several optional methods to
|
||||||
|
enable its use with :doc:`run_style respa <run_style>` and :doc:`compute
|
||||||
|
group/group <compute_group_group>`.
|
||||||
|
|
||||||
Here is a brief description of the class methods in pair.h:
|
Here is a brief list of some the class methods in the Pair class that
|
||||||
|
*must* be or *may* be overridden in a derived class.
|
||||||
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------+
|
||||||
|
| Required | "pure" methods that *must* be overridden in a derived class |
|
||||||
|
+=================================+=====================================================================+
|
||||||
| compute | workhorse routine that computes pairwise interactions |
|
| compute | workhorse routine that computes pairwise interactions |
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------+
|
||||||
| settings | reads the input script line with arguments you define |
|
| settings | processes the arguments to the pair_style command |
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------+
|
||||||
| coeff | set coefficients for one i,j type pair |
|
| coeff | set coefficients for one i,j type pair, called from pair_coeff |
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| init_one | perform initialization for one i,j type pair |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| init_style | initialization specific to this pair style |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| write & read_restart | write/read i,j pair coeffs to restart files |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| write & read_restart_settings | write/read global settings to restart files |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| single | force/r and energy of a single pairwise interaction between 2 atoms |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
|
||||||
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
|
||||||
+---------------------------------+---------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------+
|
||||||
|
|
||||||
The inner/middle/outer routines are optional.
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| Optional | methods that have a default or dummy implementation |
|
||||||
|
+=================================+======================================================================+
|
||||||
|
| init_one | perform initialization for one i,j type pair |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| init_style | style initialization: request neighbor list(s), error checks |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| init_list | Neighbor class callback function to pass neighbor list to pair style |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| single | force/r and energy of a single pairwise interaction between 2 atoms |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| compute_inner/middle/outer | versions of compute used by rRESPA |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| memory_usage | return estimated amount of memory used by the pair style |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| modify_params | process arguments to pair_modify command |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| extract | provide access to internal scalar or per-type data like cutoffs |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| extract_peratom | provide access to internal per-atom data |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| setup | initialization at the beginning of a run |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| finish | called at the end of a run, e.g. to print |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write & read_restart | write/read i,j pair coeffs to restart files |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write & read_restart_settings | write/read global settings to restart files |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write_data | write Pair Coeffs section to data file |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| write_data_all | write PairIJ Coeffs section to data file |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| pack & unpack_forward_comm | copy data to and from buffer if style uses forward communication |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| pack & unpack_reverse_comm | copy data to and from buffer if style uses reverse communication |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| reinit | reset all type-based parameters, called by fix adapt for example |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
| reset_dt | called when the time step is changed by timestep or fix reset/dt |
|
||||||
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
Here is a list of flags or settings that should be set in the
|
||||||
|
constructor of the derived pair class when they differ from the default
|
||||||
|
setting.
|
||||||
|
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| Name of flag | Description | default |
|
||||||
|
+=================================+=============================================================+=========+
|
||||||
|
| single_enable | 1 if single() method is implemented, 0 if missing | 1 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| respa_enable | 1 if pair style has compute_inner/middle/outer() | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| restartinfo | 1 if pair style writes its settings to a restart | 1 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| one_coeff | 1 if only a pair_coeff * * command is allowed | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| manybody_flag | 1 if pair style is a manybody potential | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| unit_convert_flag | value != 0 indicates support for unit conversion | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| no_virial_fdotr_compute | 1 if pair style does not call virial_fdotr_compute() | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| writedata | 1 if write_data() and write_data_all() are implemented | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| comm_forward | size of buffer (in doubles) for forward communication | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| comm_reverse | size of buffer (in doubles) for reverse communication | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| ghostneigh | 1 if cutghost is set and style uses neighbors of ghosts | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| finitecutflag | 1 if cutoff depends on diameter of atoms | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| reinitflag | 1 if style has reinit() and is compatible with fix adapt | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| ewaldflag | 1 if compatible with kspace_style ewald | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| pppmflag | 1 if compatible with kspace_style pppm | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| msmflag | 1 if compatible with kspace_style msm | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| dispersionflag | 1 if compatible with ewald/disp or pppm/disp | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| tip4pflag | 1 if compatible with kspace_style pppm/tip4p | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| dipoleflag | 1 if compatible with dipole kspace_style | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
| spinflag | 1 if compatible with spin kspace_style | 0 |
|
||||||
|
+---------------------------------+-------------------------------------------------------------+---------+
|
||||||
|
|||||||
@ -359,6 +359,12 @@ you are uncertain, please ask.
|
|||||||
|
|
||||||
- I/O is done via the C-style stdio library and **not** iostreams.
|
- I/O is done via the C-style stdio library and **not** iostreams.
|
||||||
|
|
||||||
|
- Do not use so-called "alternative tokens" like ``and``, ``or``,
|
||||||
|
``not`` and similar, but rather use the corresponding operators
|
||||||
|
``&&``, ``||``, and ``!``. The alternative tokens are not available
|
||||||
|
by default on all compilers, and also we want to maintain a consistent
|
||||||
|
programming style.
|
||||||
|
|
||||||
- Output to the screen and the logfile should be using the corresponding
|
- Output to the screen and the logfile should be using the corresponding
|
||||||
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
||||||
convenience function where possible.
|
convenience function where possible.
|
||||||
|
|||||||
@ -80,6 +80,7 @@ page gives those details.
|
|||||||
* :ref:`ML-HDNNP <PKG-ML-HDNNP>`
|
* :ref:`ML-HDNNP <PKG-ML-HDNNP>`
|
||||||
* :ref:`ML-IAP <PKG-ML-IAP>`
|
* :ref:`ML-IAP <PKG-ML-IAP>`
|
||||||
* :ref:`ML-PACE <PKG-ML-PACE>`
|
* :ref:`ML-PACE <PKG-ML-PACE>`
|
||||||
|
* :ref:`ML-POD <PKG-ML-POD>`
|
||||||
* :ref:`ML-QUIP <PKG-ML-QUIP>`
|
* :ref:`ML-QUIP <PKG-ML-QUIP>`
|
||||||
* :ref:`ML-RANN <PKG-ML-RANN>`
|
* :ref:`ML-RANN <PKG-ML-RANN>`
|
||||||
* :ref:`ML-SNAP <PKG-ML-SNAP>`
|
* :ref:`ML-SNAP <PKG-ML-SNAP>`
|
||||||
@ -200,6 +201,7 @@ particle models including ellipsoids, 2d lines, and 3d triangles.
|
|||||||
* :doc:`Howto spherical <Howto_spherical>`
|
* :doc:`Howto spherical <Howto_spherical>`
|
||||||
* :doc:`pair_style gayberne <pair_gayberne>`
|
* :doc:`pair_style gayberne <pair_gayberne>`
|
||||||
* :doc:`pair_style resquared <pair_resquared>`
|
* :doc:`pair_style resquared <pair_resquared>`
|
||||||
|
* :doc:`pair_style ylz <pair_ylz>`
|
||||||
* `doc/PDF/pair_gayberne_extra.pdf <PDF/pair_gayberne_extra.pdf>`_
|
* `doc/PDF/pair_gayberne_extra.pdf <PDF/pair_gayberne_extra.pdf>`_
|
||||||
* `doc/PDF/pair_resquared_extra.pdf <PDF/pair_resquared_extra.pdf>`_
|
* `doc/PDF/pair_resquared_extra.pdf <PDF/pair_resquared_extra.pdf>`_
|
||||||
* examples/ASPHERE
|
* examples/ASPHERE
|
||||||
@ -864,7 +866,7 @@ ELECTRODE package
|
|||||||
The ELECTRODE package allows the user to enforce a constant potential method for
|
The ELECTRODE package allows the user to enforce a constant potential method for
|
||||||
groups of atoms that interact with the remaining atoms as electrolyte.
|
groups of atoms that interact with the remaining atoms as electrolyte.
|
||||||
|
|
||||||
**Authors:** The ELECTRODE library is written and maintained by Ludwig
|
**Authors:** The ELECTRODE package is written and maintained by Ludwig
|
||||||
Ahrens-Iwers (TUHH, Hamburg, Germany), Shern Tee (UQ, Brisbane, Australia) and
|
Ahrens-Iwers (TUHH, Hamburg, Germany), Shern Tee (UQ, Brisbane, Australia) and
|
||||||
Robert Meissner (TUHH, Hamburg, Germany).
|
Robert Meissner (TUHH, Hamburg, Germany).
|
||||||
|
|
||||||
@ -877,7 +879,7 @@ This package has :ref:`specific installation instructions <electrode>` on the
|
|||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
* :doc:`fix electrode/conp <fix_electrode_conp>`
|
* :doc:`fix electrode/conp <fix_electrode>`
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -1736,8 +1738,6 @@ must be installed.
|
|||||||
|
|
||||||
.. versionadded:: 30Jun2020
|
.. versionadded:: 30Jun2020
|
||||||
|
|
||||||
.. versionadded:: 30Jun2020
|
|
||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
* src/ML-IAP: filenames -> commands
|
* src/ML-IAP: filenames -> commands
|
||||||
@ -1797,6 +1797,39 @@ This package has :ref:`specific installation instructions <ml-pace>` on the
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _PKG-ML-POD:
|
||||||
|
|
||||||
|
ML-POD package
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
**Contents:**
|
||||||
|
|
||||||
|
A pair style and fitpod style for Proper Orthogonal Descriptors
|
||||||
|
(POD). POD is a methodology for deriving descriptors based on the proper
|
||||||
|
orthogonal decomposition. The ML-POD package provides an efficient
|
||||||
|
implementation for running simulations with POD potentials, along with
|
||||||
|
fitting the potentials natively in LAMMPS.
|
||||||
|
|
||||||
|
**Authors:**
|
||||||
|
|
||||||
|
Ngoc Cuong Nguyen (MIT), Andrew Rohskopf (Sandia)
|
||||||
|
|
||||||
|
.. versionadded:: TBD
|
||||||
|
|
||||||
|
**Install:**
|
||||||
|
|
||||||
|
This package has :ref:`specific installation instructions <ml-pod>` on the
|
||||||
|
:doc:`Build extras <Build_extras>` page.
|
||||||
|
|
||||||
|
**Supporting info:**
|
||||||
|
|
||||||
|
* src/ML-POD: filenames -> commands
|
||||||
|
* :doc:`pair_style pod <pair_pod>`
|
||||||
|
* :doc:`command_style fitpod <fitpod_command>`
|
||||||
|
* examples/PACKAGES/pod
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _PKG-ML-QUIP:
|
.. _PKG-ML-QUIP:
|
||||||
|
|
||||||
ML-QUIP package
|
ML-QUIP package
|
||||||
|
|||||||
@ -155,7 +155,7 @@ whether an extra library is needed to build and use the package:
|
|||||||
- no
|
- no
|
||||||
* - :ref:`ELECTRODE <PKG-ELECTRODE>`
|
* - :ref:`ELECTRODE <PKG-ELECTRODE>`
|
||||||
- electrode charges to match potential
|
- electrode charges to match potential
|
||||||
- :doc:`fix electrode/conp <fix_electrode_conp>`
|
- :doc:`fix electrode/conp <fix_electrode>`
|
||||||
- PACKAGES/electrode
|
- PACKAGES/electrode
|
||||||
- no
|
- no
|
||||||
* - :ref:`EXTRA-COMPUTE <PKG-EXTRA-COMPUTE>`
|
* - :ref:`EXTRA-COMPUTE <PKG-EXTRA-COMPUTE>`
|
||||||
@ -298,6 +298,11 @@ whether an extra library is needed to build and use the package:
|
|||||||
- :doc:`pair pace <pair_pace>`
|
- :doc:`pair pace <pair_pace>`
|
||||||
- PACKAGES/pace
|
- PACKAGES/pace
|
||||||
- ext
|
- ext
|
||||||
|
* - :ref:`ML-POD <PKG-ML-POD>`
|
||||||
|
- Proper orthogonal decomposition potentials
|
||||||
|
- :doc:`pair pod <pair_pod>`
|
||||||
|
- pod
|
||||||
|
- ext
|
||||||
* - :ref:`ML-QUIP <PKG-ML-QUIP>`
|
* - :ref:`ML-QUIP <PKG-ML-QUIP>`
|
||||||
- QUIP/libatoms interface
|
- QUIP/libatoms interface
|
||||||
- :doc:`pair_style quip <pair_quip>`
|
- :doc:`pair_style quip <pair_quip>`
|
||||||
|
|||||||
@ -58,7 +58,7 @@ against invalid accesses.
|
|||||||
Each element of this list is a :py:class:`Atom <lammps.Atom>` or :py:class:`Atom2D <lammps.Atom2D>` object. The attributes of
|
Each element of this list is a :py:class:`Atom <lammps.Atom>` or :py:class:`Atom2D <lammps.Atom2D>` object. The attributes of
|
||||||
these objects provide access to their data (id, type, position, velocity, force, etc.):
|
these objects provide access to their data (id, type, position, velocity, force, etc.):
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# access first atom
|
# access first atom
|
||||||
L.atoms[0].id
|
L.atoms[0].id
|
||||||
@ -71,7 +71,7 @@ against invalid accesses.
|
|||||||
|
|
||||||
Some attributes can be changed:
|
Some attributes can be changed:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# set position in 2D simulation
|
# set position in 2D simulation
|
||||||
L.atoms[0].position = (1.0, 0.0)
|
L.atoms[0].position = (1.0, 0.0)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Configuration information
|
|||||||
The following methods can be used to query the LAMMPS library
|
The following methods can be used to query the LAMMPS library
|
||||||
about compile time settings and included packages and styles.
|
about compile time settings and included packages and styles.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
:caption: Example for using configuration settings functions
|
:caption: Example for using configuration settings functions
|
||||||
|
|
||||||
from lammps import lammps
|
from lammps import lammps
|
||||||
|
|||||||
@ -74,7 +74,7 @@ Here are simple examples using all three Python interfaces:
|
|||||||
:py:class:`PyLammps <lammps.PyLammps>` objects can also be created on top of an existing
|
:py:class:`PyLammps <lammps.PyLammps>` objects can also be created on top of an existing
|
||||||
:py:class:`lammps <lammps.lammps>` object:
|
:py:class:`lammps <lammps.lammps>` object:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps, PyLammps
|
from lammps import lammps, PyLammps
|
||||||
...
|
...
|
||||||
@ -113,7 +113,7 @@ Here are simple examples using all three Python interfaces:
|
|||||||
|
|
||||||
You can also initialize IPyLammps on top of an existing :py:class:`lammps` or :py:class:`PyLammps` object:
|
You can also initialize IPyLammps on top of an existing :py:class:`lammps` or :py:class:`PyLammps` object:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps, IPyLammps
|
from lammps import lammps, IPyLammps
|
||||||
...
|
...
|
||||||
@ -142,7 +142,7 @@ the MPI and/or Kokkos environment if enabled and active.
|
|||||||
Note that you can create multiple LAMMPS objects in your Python
|
Note that you can create multiple LAMMPS objects in your Python
|
||||||
script, and coordinate and run multiple simulations, e.g.
|
script, and coordinate and run multiple simulations, e.g.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps
|
from lammps import lammps
|
||||||
lmp1 = lammps()
|
lmp1 = lammps()
|
||||||
|
|||||||
@ -7,7 +7,7 @@ current Python process with an error message. C++ exceptions allow capturing
|
|||||||
them on the C++ side and rethrowing them on the Python side. This way
|
them on the C++ side and rethrowing them on the Python side. This way
|
||||||
LAMMPS errors can be handled through the Python exception handling mechanism.
|
LAMMPS errors can be handled through the Python exception handling mechanism.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps, MPIAbortException
|
from lammps import lammps, MPIAbortException
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ it is possible to "compute" what the next LAMMPS command should be.
|
|||||||
can be executed using with the lammps API with the following Python code if ``lmp`` is an
|
can be executed using with the lammps API with the following Python code if ``lmp`` is an
|
||||||
instance of :py:class:`lammps <lammps.lammps>`:
|
instance of :py:class:`lammps <lammps.lammps>`:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps
|
from lammps import lammps
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ it is possible to "compute" what the next LAMMPS command should be.
|
|||||||
The arguments of the command can be passed as one string, or
|
The arguments of the command can be passed as one string, or
|
||||||
individually.
|
individually.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import PyLammps
|
from lammps import PyLammps
|
||||||
|
|
||||||
@ -93,14 +93,14 @@ it is possible to "compute" what the next LAMMPS command should be.
|
|||||||
parameterization. In the lammps API parameterization needed to be done
|
parameterization. In the lammps API parameterization needed to be done
|
||||||
manually by creating formatted command strings.
|
manually by creating formatted command strings.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
lmp.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
lmp.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||||
|
|
||||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||||
them automatically to a final command string.
|
them automatically to a final command string.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ and you should see the same output as if you had typed
|
|||||||
|
|
||||||
Note that without the mpi4py specific lines from ``test.py``
|
Note that without the mpi4py specific lines from ``test.py``
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps
|
from lammps import lammps
|
||||||
lmp = lammps()
|
lmp = lammps()
|
||||||
|
|||||||
@ -38,6 +38,40 @@ using the NumPy access method.
|
|||||||
for n in np.nditer(nlist):
|
for n in np.nditer(nlist):
|
||||||
print(" atom {} with ID {}".format(n,tags[n]))
|
print(" atom {} with ID {}".format(n,tags[n]))
|
||||||
|
|
||||||
|
Another example for extracting a full neighbor list without evaluating a
|
||||||
|
potential is shown below.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from lammps import lammps
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
lmp = lammps()
|
||||||
|
lmp.commands_string("""
|
||||||
|
newton off
|
||||||
|
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 zero 1.0 full
|
||||||
|
pair_coeff * *
|
||||||
|
run 0 post no""")
|
||||||
|
|
||||||
|
# look up the neighbor list
|
||||||
|
nlidx = lmp.find_pair_neighlist('zero')
|
||||||
|
nl = lmp.numpy.get_neighlist(nlidx)
|
||||||
|
tags = lmp.extract_atom('id')
|
||||||
|
print("full 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):
|
||||||
|
pass
|
||||||
|
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
|
||||||
|
|||||||
@ -76,7 +76,7 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
|||||||
|
|
||||||
To define a variable you can use the :doc:`variable <variable>` command:
|
To define a variable you can use the :doc:`variable <variable>` command:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.variable("a index 2")
|
L.variable("a index 2")
|
||||||
|
|
||||||
@ -85,14 +85,14 @@ computes, fixes, or variables in LAMMPS using the :py:mod:`lammps` module.
|
|||||||
you can access an individual variable by retrieving a variable object from the
|
you can access an individual variable by retrieving a variable object from the
|
||||||
``L.variables`` dictionary by name
|
``L.variables`` dictionary by name
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
a = L.variables['a']
|
a = L.variables['a']
|
||||||
|
|
||||||
The variable value can then be easily read and written by accessing the value
|
The variable value can then be easily read and written by accessing the value
|
||||||
property of this object.
|
property of this object.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
print(a.value)
|
print(a.value)
|
||||||
a.value = 4
|
a.value = 4
|
||||||
|
|||||||
@ -105,7 +105,7 @@ against invalid accesses.
|
|||||||
variables, compute or fix data (see :doc:`Howto_output`):
|
variables, compute or fix data (see :doc:`Howto_output`):
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
result = L.eval("ke") # kinetic energy
|
result = L.eval("ke") # kinetic energy
|
||||||
result = L.eval("pe") # potential energy
|
result = L.eval("pe") # potential energy
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Scatter/gather operations
|
Scatter/gather operations
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
data = lmp.gather_atoms(name,type,count) # return per-atom property of all atoms gathered into data, ordered by atom ID
|
data = lmp.gather_atoms(name,type,count) # return per-atom property of all atoms gathered into data, ordered by atom ID
|
||||||
# name = "x", "charge", "type", etc
|
# name = "x", "charge", "type", etc
|
||||||
@ -42,7 +42,7 @@ For the scatter methods, the array of coordinates passed to must be a
|
|||||||
ctypes vector of ints or doubles, allocated and initialized something
|
ctypes vector of ints or doubles, allocated and initialized something
|
||||||
like this:
|
like this:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from ctypes import c_double
|
from ctypes import c_double
|
||||||
natoms = lmp.get_natoms()
|
natoms = lmp.get_natoms()
|
||||||
|
|||||||
@ -30,12 +30,13 @@ executable itself can be placed elsewhere.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
The redirection operator "<" will not always work when running
|
The redirection operator "<" will not always work when running in
|
||||||
in parallel with mpirun or mpiexec; for those systems the -in form is required.
|
parallel with ``mpirun`` or ``mpiexec``; for those systems the -in
|
||||||
|
form is required.
|
||||||
|
|
||||||
As LAMMPS runs it prints info to the screen and a logfile named
|
As LAMMPS runs it prints info to the screen and a logfile named
|
||||||
*log.lammps*\ . More info about output is given on the
|
*log.lammps*\ . More info about output is given on the :doc:`screen and
|
||||||
:doc:`screen and logfile output <Run_output>` page.
|
logfile output <Run_output>` page.
|
||||||
|
|
||||||
If LAMMPS encounters errors in the input script or while running a
|
If LAMMPS encounters errors in the input script or while running a
|
||||||
simulation it will print an ERROR message and stop or a WARNING
|
simulation it will print an ERROR message and stop or a WARNING
|
||||||
|
|||||||
@ -93,13 +93,13 @@ switch is not set (the default), LAMMPS will operate as if the KOKKOS
|
|||||||
package were not installed; i.e. you can run standard LAMMPS or with
|
package were not installed; i.e. you can run standard LAMMPS or with
|
||||||
the GPU or OPENMP packages, for testing or benchmarking purposes.
|
the GPU or OPENMP packages, for testing or benchmarking purposes.
|
||||||
|
|
||||||
Additional optional keyword/value pairs can be specified which
|
Additional optional keyword/value pairs can be specified which determine
|
||||||
determine how Kokkos will use the underlying hardware on your
|
how Kokkos will use the underlying hardware on your platform. These
|
||||||
platform. These settings apply to each MPI task you launch via the
|
settings apply to each MPI task you launch via the ``mpirun`` or
|
||||||
"mpirun" or "mpiexec" command. You may choose to run one or more MPI
|
``mpiexec`` command. You may choose to run one or more MPI tasks per
|
||||||
tasks per physical node. Note that if you are running on a desktop
|
physical node. Note that if you are running on a desktop machine, you
|
||||||
machine, you typically have one physical node. On a cluster or
|
typically have one physical node. On a cluster or supercomputer there
|
||||||
supercomputer there may be dozens or 1000s of physical nodes.
|
may be dozens or 1000s of physical nodes.
|
||||||
|
|
||||||
Either the full word or an abbreviation can be used for the keywords.
|
Either the full word or an abbreviation can be used for the keywords.
|
||||||
Note that the keywords do not use a leading minus sign. I.e. the
|
Note that the keywords do not use a leading minus sign. I.e. the
|
||||||
@ -148,9 +148,9 @@ one of these 4 environment variables
|
|||||||
MV2_COMM_WORLD_LOCAL_RANK (Mvapich)
|
MV2_COMM_WORLD_LOCAL_RANK (Mvapich)
|
||||||
OMPI_COMM_WORLD_LOCAL_RANK (OpenMPI)
|
OMPI_COMM_WORLD_LOCAL_RANK (OpenMPI)
|
||||||
|
|
||||||
which are initialized by the "srun", "mpirun" or "mpiexec" commands.
|
which are initialized by the ``srun``, ``mpirun``, or ``mpiexec``
|
||||||
The environment variable setting for each MPI rank is used to assign a
|
commands. The environment variable setting for each MPI rank is used to
|
||||||
unique GPU ID to the MPI task.
|
assign a unique GPU ID to the MPI task.
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
@ -262,6 +262,8 @@ Disable generating a citation reminder (see above) at all.
|
|||||||
|
|
||||||
**-nonbuf**
|
**-nonbuf**
|
||||||
|
|
||||||
|
.. versionadded:: 15Sep2022
|
||||||
|
|
||||||
Turn off buffering for screen and logfile output. For performance
|
Turn off buffering for screen and logfile output. For performance
|
||||||
reasons, output to the screen and logfile is usually buffered, i.e.
|
reasons, output to the screen and logfile is usually buffered, i.e.
|
||||||
output is only written to a file if its buffer - typically 4096 bytes -
|
output is only written to a file if its buffer - typically 4096 bytes -
|
||||||
|
|||||||
@ -16,46 +16,47 @@ simulation. An example set of statistics is shown here:
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
Loop time of 2.81192 on 4 procs for 300 steps with 2004 atoms
|
Loop time of 0.942801 on 4 procs for 300 steps with 2004 atoms
|
||||||
|
|
||||||
Performance: 18.436 ns/day 1.302 hours/ns 106.689 timesteps/s
|
Performance: 54.985 ns/day, 0.436 hours/ns, 318.201 timesteps/s, 637.674 katom-step/s
|
||||||
97.0% CPU use with 4 MPI tasks x no OpenMP threads
|
195.2% CPU use with 2 MPI tasks x 2 OpenMP threads
|
||||||
|
|
||||||
MPI task timings breakdown:
|
MPI task timing breakdown:
|
||||||
Section \| min time \| avg time \| max time \|%varavg\| %total
|
Section \| min time \| avg time \| max time \|%varavg\| %total
|
||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
Pair \| 1.9808 \| 2.0134 \| 2.0318 \| 1.4 \| 71.60
|
Pair \| 0.61419 \| 0.62872 \| 0.64325 \| 1.8 \| 66.69
|
||||||
Bond \| 0.0021894 \| 0.0060319 \| 0.010058 \| 4.7 \| 0.21
|
Bond \| 0.0028608 \| 0.0028899 \| 0.002919 \| 0.1 \| 0.31
|
||||||
Kspace \| 0.3207 \| 0.3366 \| 0.36616 \| 3.1 \| 11.97
|
Kspace \| 0.12652 \| 0.14048 \| 0.15444 \| 3.7 \| 14.90
|
||||||
Neigh \| 0.28411 \| 0.28464 \| 0.28516 \| 0.1 \| 10.12
|
Neigh \| 0.10242 \| 0.10242 \| 0.10242 \| 0.0 \| 10.86
|
||||||
Comm \| 0.075732 \| 0.077018 \| 0.07883 \| 0.4 \| 2.74
|
Comm \| 0.026753 \| 0.027593 \| 0.028434 \| 0.5 \| 2.93
|
||||||
Output \| 0.00030518 \| 0.00042665 \| 0.00078821 \| 1.0 \| 0.02
|
Output \| 0.00018341 \| 0.00030942 \| 0.00043542 \| 0.0 \| 0.03
|
||||||
Modify \| 0.086606 \| 0.086631 \| 0.086668 \| 0.0 \| 3.08
|
Modify \| 0.039117 \| 0.039348 \| 0.039579 \| 0.1 \| 4.17
|
||||||
Other \| \| 0.007178 \| \| \| 0.26
|
Other \| \| 0.001041 \| \| \| 0.11
|
||||||
|
|
||||||
Nlocal: 501 ave 508 max 490 min
|
Nlocal: 1002 ave 1006 max 998 min
|
||||||
Histogram: 1 0 0 0 0 0 1 1 0 1
|
Histogram: 1 0 0 0 0 0 0 0 0 1
|
||||||
Nghost: 6586.25 ave 6628 max 6548 min
|
Nghost: 8670.5 ave 8691 max 8650 min
|
||||||
Histogram: 1 0 1 0 0 0 1 0 0 1
|
Histogram: 1 0 0 0 0 0 0 0 0 1
|
||||||
Neighs: 177007 ave 180562 max 170212 min
|
Neighs: 354010 ave 357257 max 350763 min
|
||||||
Histogram: 1 0 0 0 0 0 0 1 1 1
|
Histogram: 1 0 0 0 0 0 0 0 0 1
|
||||||
|
|
||||||
Total # of neighbors = 708028
|
Total # of neighbors = 708020
|
||||||
Ave neighs/atom = 353.307
|
Ave neighs/atom = 353.30339
|
||||||
Ave special neighs/atom = 2.34032
|
Ave special neighs/atom = 2.3403194
|
||||||
Neighbor list builds = 26
|
Neighbor list builds = 26
|
||||||
Dangerous builds = 0
|
Dangerous builds = 0
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The first section provides a global loop timing summary. The *loop
|
The first section provides a global loop timing summary. The *loop time*
|
||||||
time* is the total wall-clock time for the simulation to run. The
|
is the total wall-clock time for the simulation to run. The
|
||||||
*Performance* line is provided for convenience to help predict how
|
*Performance* line is provided for convenience to help predict how long
|
||||||
long it will take to run a desired physical simulation. The *CPU use*
|
it will take to run a desired physical simulation and to have numbers
|
||||||
line provides the CPU utilization per MPI task; it should be close to
|
useful for performance comparison between different simulation settings
|
||||||
100% times the number of OpenMP threads (or 1 of not using OpenMP).
|
or system sizes. The *CPU use* line provides the CPU utilization per
|
||||||
Lower numbers correspond to delays due to file I/O or insufficient
|
MPI task; it should be close to 100% times the number of OpenMP threads
|
||||||
thread utilization.
|
(or 1 of not using OpenMP). Lower numbers correspond to delays due to
|
||||||
|
file I/O or insufficient thread utilization.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -76,10 +76,11 @@ instructions.
|
|||||||
|
|
||||||
**Run with the GPU package from the command line:**
|
**Run with the GPU package from the command line:**
|
||||||
|
|
||||||
The mpirun or mpiexec command sets the total number of MPI tasks used
|
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
|
||||||
by LAMMPS (one or multiple per compute node) and the number of MPI
|
used by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||||
tasks used per node. E.g. the mpirun command in MPICH does this via
|
tasks used per node. E.g. the ``mpirun`` command in MPICH does this via
|
||||||
its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode.
|
its ``-np`` and ``-ppn`` switches. Ditto for OpenMPI via ``-np`` and
|
||||||
|
``-npernode``.
|
||||||
|
|
||||||
When using the GPU package, you cannot assign more than one GPU to a
|
When using the GPU package, you cannot assign more than one GPU to a
|
||||||
single MPI task. However multiple MPI tasks can share the same GPU,
|
single MPI task. However multiple MPI tasks can share the same GPU,
|
||||||
@ -129,8 +130,8 @@ GPU package pair styles.
|
|||||||
|
|
||||||
**Or run with the GPU package by editing an input script:**
|
**Or run with the GPU package by editing an input script:**
|
||||||
|
|
||||||
The discussion above for the mpirun/mpiexec command, MPI tasks/node,
|
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
|
||||||
and use of multiple MPI tasks/GPU is the same.
|
tasks/node, and use of multiple MPI tasks/GPU is the same.
|
||||||
|
|
||||||
Use the :doc:`suffix gpu <suffix>` command, or you can explicitly add an
|
Use the :doc:`suffix gpu <suffix>` command, or you can explicitly add an
|
||||||
"gpu" suffix to individual styles in your input script, e.g.
|
"gpu" suffix to individual styles in your input script, e.g.
|
||||||
|
|||||||
@ -72,12 +72,12 @@ See the :ref:`Build extras <kokkos>` page for instructions.
|
|||||||
Running LAMMPS with the KOKKOS package
|
Running LAMMPS with the KOKKOS package
|
||||||
""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
All Kokkos operations occur within the context of an individual MPI
|
All Kokkos operations occur within the context of an individual MPI task
|
||||||
task running on a single node of the machine. The total number of MPI
|
running on a single node of the machine. The total number of MPI tasks
|
||||||
tasks used by LAMMPS (one or multiple per compute node) is set in the
|
used by LAMMPS (one or multiple per compute node) is set in the usual
|
||||||
usual manner via the mpirun or mpiexec commands, and is independent of
|
manner via the ``mpirun`` or ``mpiexec`` commands, and is independent of
|
||||||
Kokkos. E.g. the mpirun command in OpenMPI does this via its -np and
|
Kokkos. E.g. the mpirun command in OpenMPI does this via its ``-np`` and
|
||||||
-npernode switches. Ditto for MPICH via -np and -ppn.
|
``-npernode`` switches. Ditto for MPICH via ``-np`` and ``-ppn``.
|
||||||
|
|
||||||
Running on a multi-core CPU
|
Running on a multi-core CPU
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -310,7 +310,8 @@ Alternatively the effect of the "-sf" or "-pk" switches can be
|
|||||||
duplicated by adding the :doc:`package kokkos <package>` or :doc:`suffix kk <suffix>` commands to your input script.
|
duplicated by adding the :doc:`package kokkos <package>` or :doc:`suffix kk <suffix>` commands to your input script.
|
||||||
|
|
||||||
The discussion above for building LAMMPS with the KOKKOS package, the
|
The discussion above for building LAMMPS with the KOKKOS package, the
|
||||||
mpirun/mpiexec command, and setting appropriate thread are the same.
|
``mpirun`` or ``mpiexec`` command, and setting appropriate thread
|
||||||
|
properties are the same.
|
||||||
|
|
||||||
You must still use the "-k on" :doc:`command-line switch <Run_options>`
|
You must still use the "-k on" :doc:`command-line switch <Run_options>`
|
||||||
to enable the KOKKOS package, and specify its additional arguments for
|
to enable the KOKKOS package, and specify its additional arguments for
|
||||||
|
|||||||
@ -33,8 +33,8 @@ These examples assume one or more 16-core nodes.
|
|||||||
mpirun -np 4 lmp_omp -sf omp -pk omp 4 -in in.script # 4 MPI tasks, 4 threads/task
|
mpirun -np 4 lmp_omp -sf omp -pk omp 4 -in in.script # 4 MPI tasks, 4 threads/task
|
||||||
mpirun -np 32 -ppn 4 lmp_omp -sf omp -pk omp 4 -in in.script # 8 nodes, 4 MPI tasks/node, 4 threads/task
|
mpirun -np 32 -ppn 4 lmp_omp -sf omp -pk omp 4 -in in.script # 8 nodes, 4 MPI tasks/node, 4 threads/task
|
||||||
|
|
||||||
The mpirun or mpiexec command sets the total number of MPI tasks used
|
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
|
||||||
by LAMMPS (one or multiple per compute node) and the number of MPI
|
used by LAMMPS (one or multiple per compute node) and the number of MPI
|
||||||
tasks used per node. E.g. the mpirun command in MPICH does this via
|
tasks used per node. E.g. the mpirun command in MPICH does this via
|
||||||
its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode.
|
its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode.
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ OMP_NUM_THREADS environment variable.
|
|||||||
Or run with the OPENMP package by editing an input script
|
Or run with the OPENMP package by editing an input script
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The discussion above for the mpirun/mpiexec command, MPI tasks/node,
|
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
|
||||||
and threads/MPI task is the same.
|
tasks/node, and threads/MPI task is the same.
|
||||||
|
|
||||||
Use the :doc:`suffix omp <suffix>` command, or you can explicitly add an
|
Use the :doc:`suffix omp <suffix>` command, or you can explicitly add an
|
||||||
"omp" suffix to individual styles in your input script, e.g.
|
"omp" suffix to individual styles in your input script, e.g.
|
||||||
|
|||||||
@ -117,33 +117,15 @@ script.
|
|||||||
with all its accelerator packages installed. Note however that the
|
with all its accelerator packages installed. Note however that the
|
||||||
INTEL and KOKKOS packages require you to choose one of their
|
INTEL and KOKKOS packages require you to choose one of their
|
||||||
hardware options when building for a specific platform. I.e. CPU or
|
hardware options when building for a specific platform. I.e. CPU or
|
||||||
Phi option for the INTEL package. Or the OpenMP, Cuda, or Phi
|
Phi option for the INTEL package. Or the OpenMP, CUDA, HIP, SYCL,
|
||||||
option for the KOKKOS package.
|
or Phi option for the KOKKOS package. Or the OpenCL, HIP, or CUDA
|
||||||
|
option for the GPU package.
|
||||||
|
|
||||||
These are the exceptions. You cannot build a single executable with:
|
These are the exceptions. You cannot build a single executable with:
|
||||||
|
|
||||||
* both the INTEL Phi and KOKKOS Phi options
|
* both the INTEL Phi and KOKKOS Phi options
|
||||||
* the INTEL Phi or Kokkos Phi option, and the GPU package
|
* the INTEL Phi or Kokkos Phi option, and the GPU package
|
||||||
|
|
||||||
See the examples/accelerate/README and make.list files for sample
|
|
||||||
Make.py commands that build LAMMPS with any or all of the accelerator
|
|
||||||
packages. As an example, here is a command that builds with all the
|
|
||||||
GPU related packages installed (GPU, KOKKOS with Cuda), including
|
|
||||||
settings to build the needed auxiliary GPU libraries for Kepler GPUs:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
Make.py -j 16 -p omp gpu kokkos -cc nvcc wrap=mpi -gpu mode=double arch=35 -kokkos cuda arch=35 lib-all file mpi
|
|
||||||
|
|
||||||
The examples/accelerate directory also has input scripts that can be
|
|
||||||
used with all of the accelerator packages. See its README file for
|
|
||||||
details.
|
|
||||||
|
|
||||||
Likewise, the bench directory has FERMI and KEPLER and PHI
|
|
||||||
sub-directories with Make.py commands and input scripts for using all
|
|
||||||
the accelerator packages on various machines. See the README files in
|
|
||||||
those directories.
|
|
||||||
|
|
||||||
As mentioned above, the `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS website gives
|
As mentioned above, the `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS website gives
|
||||||
performance results for the various accelerator packages for several
|
performance results for the various accelerator packages for several
|
||||||
of the standard LAMMPS benchmark problems, as a function of problem
|
of the standard LAMMPS benchmark problems, as a function of problem
|
||||||
|
|||||||
@ -25,23 +25,25 @@ The *gaussian* angle style uses the potential:
|
|||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-(\theta-\theta_{i})^2}{w_i^2})\right) \right)
|
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-2(\theta-\theta_{i})^2}{w_i^2}\right) \right)
|
||||||
|
|
||||||
|
This analytical form is a suitable potential for obtaining mesoscale
|
||||||
|
effective force fields which can reproduce target atomistic
|
||||||
|
distributions :ref:`(Milano) <Milano1>`.
|
||||||
|
|
||||||
This analytical form is a suitable potential for obtaining
|
|
||||||
mesoscale effective force fields which can reproduce target atomistic distributions :ref:`(Milano) <Milano1>`
|
|
||||||
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>`
|
||||||
or :doc:`read_restart <read_restart>` commands:
|
or :doc:`read_restart <read_restart>` commands:
|
||||||
|
|
||||||
* T temperature at which the potential was derived
|
* :math:`T` temperature at which the potential was derived
|
||||||
* :math:`n` (integer >=1)
|
* :math:`n` (integer >=1)
|
||||||
* :math:`A_1` (-)
|
* :math:`A_1` (> 0, radians)
|
||||||
* :math:`w_1` (-)
|
* :math:`w_1` (> 0, radians)
|
||||||
* :math:`\theta_1` (degrees)
|
* :math:`\theta_1` (degrees)
|
||||||
* ...
|
* ...
|
||||||
* :math:`A_n` (-)
|
* :math:`A_n` (> 0, radians)
|
||||||
* :math:`w_n` (-)
|
* :math:`w_n` (> 0, radians)
|
||||||
* :math:`\theta_n` (degrees)
|
* :math:`\theta_n` (degrees)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@ quantities.
|
|||||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||||
| *charge* | charge | atomic system with charges |
|
| *charge* | charge | atomic system with charges |
|
||||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||||
| *dielectric* | dipole, area, curvature | system with surface polarization |
|
| *dielectric* | normx normy normz area/patch ed em epsilon curv | system with surface polarization |
|
||||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||||
| *dipole* | charge and dipole moment | system with dipolar particles |
|
| *dipole* | charge and dipole moment | system with dipolar particles |
|
||||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||||
@ -180,16 +180,21 @@ vector with the 3 diameters of the ellipsoid and a quaternion 4-vector
|
|||||||
with its orientation.
|
with its orientation.
|
||||||
|
|
||||||
For the *dielectric* style, each particle can be either a physical
|
For the *dielectric* style, each particle can be either a physical
|
||||||
particle (e.g. an ion), or an interface particle representing a
|
particle (e.g. an ion), or an interface particle representing a boundary
|
||||||
boundary element. For physical particles, the per-particle properties
|
element between two regions of different dielectric constant. For
|
||||||
are the same as atom_style full. For interface particles, in addition
|
interface particles, in addition to the properties associated with
|
||||||
to these properties, each particle also has an area, a normal unit
|
atom_style full, each particle also should be assigned a normal unit
|
||||||
vector, a mean local curvature, the mean and difference of the
|
vector (defined by normx, normy, normz), an area (area/patch), the
|
||||||
dielectric constants of two sides of the interface, and the local
|
difference and mean of the dielectric constants of two sides of the
|
||||||
dielectric constant at the boundary element. The distinction between
|
interface along the direction of the normal vector (ed and em), the
|
||||||
the physical and interface particles is only meaningful when :doc:`fix
|
local dielectric constant at the boundary element (epsilon), and a mean
|
||||||
polarize <fix_polarize>` commands are applied to the interface
|
local curvature (curv). Physical particles must be assigned these
|
||||||
particles.
|
values, as well, but only their local dielectric constants will be used;
|
||||||
|
see documentation for associated :doc:`pair styles <pair_dielectric>`
|
||||||
|
and :doc:`fixes <fix_polarize>`. The distinction between the physical
|
||||||
|
and interface particles is only meaningful when :doc:`fix polarize
|
||||||
|
<fix_polarize>` commands are applied to the interface particles. This
|
||||||
|
style is part of the DIELECTRIC package.
|
||||||
|
|
||||||
For the *dipole* style, a point dipole is defined for each point
|
For the *dipole* style, a point dipole is defined for each point
|
||||||
particle. Note that if you wish the particles to be finite-size
|
particle. Note that if you wish the particles to be finite-size
|
||||||
|
|||||||
@ -45,6 +45,8 @@ Examples
|
|||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
|
.. versionadded:: 4May2022
|
||||||
|
|
||||||
The *bpm/rotational* bond style computes forces and torques based on
|
The *bpm/rotational* bond style computes forces and torques based on
|
||||||
deviations from the initial reference state of the two atoms. The
|
deviations from the initial reference state of the two atoms. The
|
||||||
reference state is stored by each bond when it is first computed in
|
reference state is stored by each bond when it is first computed in
|
||||||
@ -211,9 +213,9 @@ command, as *b1*, *b2*, ..., *b7*\ .
|
|||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This bond style can only be used if LAMMPS was built with the BPM
|
This bond style is part of the BPM package. It is only enabled if
|
||||||
package. See the :doc:`Build package <Build_package>` doc page for
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
more info.
|
<Build_package>` page for more info.
|
||||||
|
|
||||||
By default if pair interactions are to be disabled, this bond style
|
By default if pair interactions are to be disabled, this bond style
|
||||||
requires setting
|
requires setting
|
||||||
|
|||||||
@ -45,6 +45,8 @@ Examples
|
|||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
|
.. versionadded:: 4May2022
|
||||||
|
|
||||||
The *bpm/spring* bond style computes forces and torques based on
|
The *bpm/spring* bond style computes forces and torques based on
|
||||||
deviations from the initial reference state of the two atoms. The
|
deviations from the initial reference state of the two atoms. The
|
||||||
reference state is stored by each bond when it is first computed in
|
reference state is stored by each bond when it is first computed in
|
||||||
@ -167,9 +169,9 @@ extra quantity can be accessed by the
|
|||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This bond style can only be used if LAMMPS was built with the BPM
|
This bond style is part of the BPM package. It is only enabled if
|
||||||
package. See the :doc:`Build package <Build_package>` doc page for
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
more info.
|
<Build_package>` page for more info.
|
||||||
|
|
||||||
By default if pair interactions are to be disabled, this bond style
|
By default if pair interactions are to be disabled, this bond style
|
||||||
requires setting
|
requires setting
|
||||||
|
|||||||
@ -21,7 +21,7 @@ Examples
|
|||||||
bond_coeff 5 80.0 1.2
|
bond_coeff 5 80.0 1.2
|
||||||
bond_coeff * 30.0 1.5 1.0 1.0
|
bond_coeff * 30.0 1.5 1.0 1.0
|
||||||
bond_coeff 1*4 30.0 1.5 1.0 1.0
|
bond_coeff 1*4 30.0 1.5 1.0 1.0
|
||||||
bond_coeff 1 harmonic 200.0 1.0 (for bond_style hybrid)
|
bond_coeff 1 harmonic 200.0 1.0 # (for bond_style hybrid)
|
||||||
|
|
||||||
labelmap bond 5 carbonyl
|
labelmap bond 5 carbonyl
|
||||||
bond_coeff carbonyl 80.0 1.2
|
bond_coeff carbonyl 80.0 1.2
|
||||||
|
|||||||
@ -25,33 +25,34 @@ The *gaussian* bond style uses the potential:
|
|||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-(r-r_{i})^2}{w_i^2})\right) \right)
|
E = -k_B T ln\left(\sum_{i=1}^{n} \frac{A_i}{w_i \sqrt{\pi/2}} exp\left( \frac{-2(r-r_{i})^2}{w_i^2}\right)\right)
|
||||||
|
|
||||||
This analytical form is a suitable potential for obtaining
|
This analytical form is a suitable potential for obtaining mesoscale
|
||||||
mesoscale effective force fields which can reproduce target atomistic distributions :ref:`(Milano) <Milano0>`
|
effective force fields which can reproduce target atomistic
|
||||||
|
distributions :ref:`(Milano) <Milano0>`
|
||||||
|
|
||||||
The following coefficients must be defined for each bond type via the
|
The following coefficients must be defined for each bond type via the
|
||||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||||
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>`
|
||||||
or :doc:`read_restart <read_restart>` commands:
|
or :doc:`read_restart <read_restart>` commands:
|
||||||
|
|
||||||
* T temperature at which the potential was derived
|
* :math:`T` temperature at which the potential was derived
|
||||||
* :math:`n` (integer >=1)
|
* :math:`n` (integer >=1)
|
||||||
* :math:`A_1` (-)
|
* :math:`A_1` (> 0, distance)
|
||||||
* :math:`w_1` (-)
|
* :math:`w_1` (> 0, distance)
|
||||||
* :math:`r_1` (length)
|
* :math:`r_1` (>= 0, distance)
|
||||||
* ...
|
* ...
|
||||||
* :math:`A_n` (-)
|
* :math:`A_n` (> 0, distance)
|
||||||
* :math:`w_n` (-)
|
* :math:`w_n` (> 0, distance)
|
||||||
* :math:`r_n` (length)
|
* :math:`r_n` (>= 0, distance)
|
||||||
|
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This bond style can only be used if LAMMPS was built with the
|
This bond style can only be used if LAMMPS was built with the
|
||||||
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
|
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
|
||||||
page for more info.
|
doc page for more info.
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -26,14 +26,14 @@ as defined in :ref:`(Allinger) <mm3-allinger1989>`
|
|||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
E = K (r - r_0)^2 \left[ 1 - 2.55(r-r_0) + (7/12) 2.55^2(r-r_0)^2 \right]
|
E = K (r - r_0)^2 \left[ 1 - 2.55(r-r_0) + \frac{7}{12} 2.55^2(r-r_0)^2 \right]
|
||||||
|
|
||||||
where :math:`r_0` is the equilibrium value of the bond, and :math:`K` is a
|
where :math:`r_0` is the equilibrium value of the bond, and :math:`K` is a
|
||||||
prefactor. The anharmonic prefactors have units angstrom\^(-n):
|
prefactor. The anharmonic prefactors have units :math:`\AA^{-n}`:
|
||||||
-2.55 angstrom\^(-1) and (7/12)2.55\^2 angstrom\^(-2). The code takes
|
:math:`-2.55 \AA^{-1}` and :math:`\frac{7}{12} 2.55^2 \AA^{-2}`. The code takes
|
||||||
care of the necessary unit conversion for these factors internally.
|
care of the necessary unit conversion for these factors internally.
|
||||||
Note that the MM3 papers contains an error in Eq (1):
|
Note that the MM3 papers contain an error in Eq (1):
|
||||||
(7/12)2.55 should be replaced with (7/12)2.55\^2
|
:math:`\frac{7}{12} 2.55` should be replaced with :math:`\frac{7}{12} 2.55^2`
|
||||||
|
|
||||||
The following coefficients must be defined for each bond type via the
|
The following coefficients must be defined for each bond type via the
|
||||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||||
|
|||||||
@ -28,11 +28,18 @@ The *quartic* bond style uses the potential
|
|||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
E = K (r - R_c)^ 2 (r - R_c - B_1) (r - R_c - B_2) + U_0 + 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 \right] + \epsilon
|
E & = E_q + E_{LJ} \\
|
||||||
|
E_q & = K (r - R_c)^ 2 (r - R_c - B_1) (r - R_c - B_2) + U_0 \\
|
||||||
|
E_{LJ} & = \left\{ \begin{array} {l@{\quad:\quad}l}
|
||||||
|
4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 \right] + \epsilon & r < 2^{\frac{1}{6}}, \epsilon = 1, \sigma = 1 \\
|
||||||
|
0 & r >= 2^{\frac{1}{6}}
|
||||||
|
\end{array} \right.
|
||||||
|
|
||||||
to define a bond that can be broken as the simulation proceeds (e.g.
|
to define a bond that can be broken as the simulation proceeds (e.g.
|
||||||
due to a polymer being stretched). The :math:`\sigma` and :math:`\epsilon` used in the
|
due to a polymer being stretched). The :math:`\sigma` and
|
||||||
LJ portion of the formula are both set equal to 1.0 by LAMMPS.
|
:math:`\epsilon` used in the LJ portion of the formula are both set
|
||||||
|
equal to 1.0 by LAMMPS and the LJ portion is cut off at its minimum,
|
||||||
|
i.e. at :math:`r_c = 2^{\frac{1}{6}}`.
|
||||||
|
|
||||||
The following coefficients must be defined for each bond type via the
|
The following coefficients must be defined for each bond type via the
|
||||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||||
@ -46,9 +53,9 @@ or :doc:`read_restart <read_restart>` commands:
|
|||||||
* :math:`U_0` (energy)
|
* :math:`U_0` (energy)
|
||||||
|
|
||||||
This potential was constructed to mimic the FENE bond potential for
|
This potential was constructed to mimic the FENE bond potential for
|
||||||
coarse-grained polymer chains. When monomers with :math:`\sigma = \epsilon = 1.0`
|
coarse-grained polymer chains. When monomers with :math:`\sigma =
|
||||||
are used, the following choice of parameters gives a quartic potential that
|
\epsilon = 1.0` are used, the following choice of parameters gives a
|
||||||
looks nearly like the FENE potential:
|
quartic potential that looks nearly like the FENE potential:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
|
|||||||
@ -1,70 +0,0 @@
|
|||||||
.. index:: box
|
|
||||||
|
|
||||||
box command
|
|
||||||
===========
|
|
||||||
|
|
||||||
Syntax
|
|
||||||
""""""
|
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
box keyword value ...
|
|
||||||
|
|
||||||
* one or more keyword/value pairs may be appended
|
|
||||||
* keyword = *tilt*
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
*tilt* value = *small* or *large*
|
|
||||||
|
|
||||||
Examples
|
|
||||||
""""""""
|
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
box tilt large
|
|
||||||
box tilt small
|
|
||||||
|
|
||||||
Description
|
|
||||||
"""""""""""
|
|
||||||
|
|
||||||
Set attributes of the simulation box.
|
|
||||||
|
|
||||||
For triclinic (non-orthogonal) simulation boxes, the *tilt* keyword
|
|
||||||
allows simulation domains to be created with arbitrary tilt factors,
|
|
||||||
e.g. via the :doc:`create_box <create_box>` or
|
|
||||||
:doc:`read_data <read_data>` commands. Tilt factors determine how
|
|
||||||
skewed the triclinic box is; see the :doc:`Howto triclinic <Howto_triclinic>` page for a discussion of triclinic
|
|
||||||
boxes in LAMMPS.
|
|
||||||
|
|
||||||
LAMMPS normally requires that no tilt factor can skew the box more
|
|
||||||
than half the distance of the parallel box length, which is the first
|
|
||||||
dimension in the tilt factor (x for xz). If *tilt* is set to
|
|
||||||
*small*, which is the default, then an error will be
|
|
||||||
generated if a box is created which exceeds this limit. If *tilt*
|
|
||||||
is set to *large*, then no limit is enforced. You can create
|
|
||||||
a box with any tilt factors you wish.
|
|
||||||
|
|
||||||
Note that if a simulation box has a large tilt factor, LAMMPS will run
|
|
||||||
less efficiently, due to the large volume of communication needed to
|
|
||||||
acquire ghost atoms around a processor's irregular-shaped sub-domain.
|
|
||||||
For extreme values of tilt, LAMMPS may also lose atoms and generate an
|
|
||||||
error.
|
|
||||||
|
|
||||||
Restrictions
|
|
||||||
""""""""""""
|
|
||||||
|
|
||||||
This command cannot be used after the simulation box is defined by a
|
|
||||||
:doc:`read_data <read_data>` or :doc:`create_box <create_box>` command or
|
|
||||||
:doc:`read_restart <read_restart>` command.
|
|
||||||
|
|
||||||
Related commands
|
|
||||||
""""""""""""""""
|
|
||||||
|
|
||||||
none
|
|
||||||
|
|
||||||
|
|
||||||
Default
|
|
||||||
"""""""
|
|
||||||
|
|
||||||
The default value is tilt = small.
|
|
||||||
@ -23,15 +23,16 @@ Description
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This command deletes all atoms, restores all settings to their default
|
This command deletes all atoms, restores all settings to their default
|
||||||
values, and frees all memory allocated by LAMMPS. Once a clear
|
values, and frees all memory allocated by LAMMPS. Once a clear command
|
||||||
command has been executed, it is almost as if LAMMPS were starting
|
has been executed, it is almost as if LAMMPS were starting over, with
|
||||||
over, with only the exceptions noted below. This command enables
|
only the exceptions noted below. This command enables multiple jobs to
|
||||||
multiple jobs to be run sequentially from one input script.
|
be run sequentially from one input script.
|
||||||
|
|
||||||
These settings are not affected by a clear command: the working
|
These settings are not affected by a clear command: the working
|
||||||
directory (:doc:`shell <shell>` command), log file status
|
directory (:doc:`shell <shell>` command), log file status (:doc:`log
|
||||||
(:doc:`log <log>` command), echo status (:doc:`echo <echo>` command), and
|
<log>` command), echo status (:doc:`echo <echo>` command), and input
|
||||||
input script variables (:doc:`variable <variable>` command).
|
script variables except for *atomfile* style variables (:doc:`variable
|
||||||
|
<variable>` command).
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -13,7 +13,6 @@ Commands
|
|||||||
bond_style
|
bond_style
|
||||||
bond_write
|
bond_write
|
||||||
boundary
|
boundary
|
||||||
box
|
|
||||||
change_box
|
change_box
|
||||||
clear
|
clear
|
||||||
comm_modify
|
comm_modify
|
||||||
@ -43,6 +42,7 @@ Commands
|
|||||||
echo
|
echo
|
||||||
fix
|
fix
|
||||||
fix_modify
|
fix_modify
|
||||||
|
fitpod_command
|
||||||
group
|
group
|
||||||
group2ndx
|
group2ndx
|
||||||
hyper
|
hyper
|
||||||
@ -90,8 +90,7 @@ Commands
|
|||||||
region
|
region
|
||||||
replicate
|
replicate
|
||||||
rerun
|
rerun
|
||||||
reset_atom_ids
|
reset_atoms
|
||||||
reset_mol_ids
|
|
||||||
reset_timestep
|
reset_timestep
|
||||||
restart
|
restart
|
||||||
run
|
run
|
||||||
|
|||||||
@ -602,8 +602,7 @@ be used. For non-orthogonal (triclinic) simulation boxes, only the
|
|||||||
*reduced* option may be used.
|
*reduced* option may be used.
|
||||||
|
|
||||||
A *box* value selects standard distance units as defined by the
|
A *box* value selects standard distance units as defined by the
|
||||||
:doc:`units <units>` command (e.g., :math:`\mathrm{\mathring A}`
|
:doc:`units <units>` command (e.g., :math:`\AA` for units = *real* or *metal*).
|
||||||
for units = *real* or *metal*).
|
|
||||||
A *lattice* value means the distance units are in lattice spacings.
|
A *lattice* value means the distance units are in lattice spacings.
|
||||||
The :doc:`lattice <lattice>` command must have been previously used to
|
The :doc:`lattice <lattice>` command must have been previously used to
|
||||||
define the lattice spacing. A *reduced* value means normalized
|
define the lattice spacing. A *reduced* value means normalized
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Syntax
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
*replace* arg = name of per-atom variable
|
*refresh* arg = name of per-atom variable
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
""""""""
|
""""""""
|
||||||
@ -95,7 +95,7 @@ something like the following commands:
|
|||||||
refresh c_dsp delay 100
|
refresh c_dsp delay 100
|
||||||
|
|
||||||
The :doc:`dump_modify thresh <dump_modify>` command will only output
|
The :doc:`dump_modify thresh <dump_modify>` command will only output
|
||||||
atoms that have displaced more than :math:`0.6~\mathrm{\mathring A}` on each
|
atoms that have displaced more than :math:`0.6~\AA` on each
|
||||||
snapshot (assuming metal units). The dump_modify *refresh* option triggers a
|
snapshot (assuming metal units). The dump_modify *refresh* option triggers a
|
||||||
call to this compute at the end of every dump.
|
call to this compute at the end of every dump.
|
||||||
|
|
||||||
|
|||||||
@ -97,13 +97,13 @@ by the corresponding volume. This option can be useful when dealing with
|
|||||||
inhomogeneous systems such as those that have surfaces.
|
inhomogeneous systems such as those that have surfaces.
|
||||||
|
|
||||||
Here are typical input parameters for fcc aluminum (lattice
|
Here are typical input parameters for fcc aluminum (lattice
|
||||||
constant :math:`4.05~\mathrm{\mathring A}`),
|
constant :math:`4.05~\AA`),
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
compute 1 all entropy/atom 0.25 5.7 avg yes 3.7
|
compute 1 all entropy/atom 0.25 5.7 avg yes 3.7
|
||||||
|
|
||||||
and for bcc sodium (lattice constant 4.23 Angstroms),
|
and for bcc sodium (lattice constant :math:`4.23~\AA`),
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@ Examples
|
|||||||
Description
|
Description
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
|
.. versionadded:: 4May2022
|
||||||
|
|
||||||
Define a computation that computes the number of bonds each atom is
|
Define a computation that computes the number of bonds each atom is
|
||||||
part of. Bonds which are broken are not counted in the tally. See
|
part of. Bonds which are broken are not counted in the tally. See
|
||||||
the :doc:`Howto broken bonds <Howto_bpm>` page for more information.
|
the :doc:`Howto broken bonds <Howto_bpm>` page for more information.
|
||||||
@ -40,8 +42,9 @@ LAMMPS output options.
|
|||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This fix can only be used if LAMMPS was built with the BPM package.
|
This compute is part of the BPM package. It is only enabled if LAMMPS was
|
||||||
See the :doc:`Build package <Build_package>` doc page for more info.
|
built with that package. See the :doc:`Build package <Build_package>`
|
||||||
|
page for more info.
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -59,7 +59,7 @@ commands.
|
|||||||
The value *dist* is the distance between the pair of atoms.
|
The value *dist* is the distance between the pair of atoms.
|
||||||
The values *dx*, *dy*, and *dz* are the :math:`(x,y,z)` components of the
|
The values *dx*, *dy*, and *dz* are the :math:`(x,y,z)` components of the
|
||||||
*distance* between the pair of atoms. This value is always the
|
*distance* between the pair of atoms. This value is always the
|
||||||
distance from the atom of lower to the one with the higher id.
|
distance from the atom of higher to the one with the lower atom ID.
|
||||||
|
|
||||||
The value *eng* is the interaction energy for the pair of atoms.
|
The value *eng* is the interaction energy for the pair of atoms.
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ compute rigid/local command
|
|||||||
Syntax
|
Syntax
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
compute ID group-ID rigid/local rigidID input1 input2 ...
|
compute ID group-ID rigid/local rigidID input1 input2 ...
|
||||||
|
|
||||||
@ -25,6 +25,9 @@ Syntax
|
|||||||
quatw, quati, quatj, quatk,
|
quatw, quati, quatj, quatk,
|
||||||
tqx, tqy, tqz,
|
tqx, tqy, tqz,
|
||||||
inertiax, inertiay, inertiaz
|
inertiax, inertiay, inertiaz
|
||||||
|
|
||||||
|
.. parsed-literal::
|
||||||
|
|
||||||
id = atom ID of atom within body which owns body properties
|
id = atom ID of atom within body which owns body properties
|
||||||
mol = molecule ID used to define body in :doc:`fix rigid/small <fix_rigid>` command
|
mol = molecule ID used to define body in :doc:`fix rigid/small <fix_rigid>` command
|
||||||
mass = total mass of body
|
mass = total mass of body
|
||||||
@ -69,8 +72,8 @@ the atoms owned on a processor. If the atom is not in the specified
|
|||||||
the atom within a body that is assigned to store the body information
|
the atom within a body that is assigned to store the body information
|
||||||
it is skipped (only one atom per body is so assigned). If it is the
|
it is skipped (only one atom per body is so assigned). If it is the
|
||||||
assigned atom, then the info for that body is output. This means that
|
assigned atom, then the info for that body is output. This means that
|
||||||
information for N bodies is generated. N may be less than the # of
|
information for :math:`N` bodies is generated. :math:`N` may be less than the
|
||||||
bodies defined by the fix rigid command, if the atoms in some bodies
|
number of bodies defined by the fix rigid command, if the atoms in some bodies
|
||||||
are not in the *group-ID*\ .
|
are not in the *group-ID*\ .
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -109,8 +112,7 @@ The *mass* attribute is the total mass of the rigid body.
|
|||||||
There are two options for outputting the coordinates of the center of
|
There are two options for outputting the coordinates of the center of
|
||||||
mass (COM) of the body. The *x*, *y*, *z* attributes write the COM
|
mass (COM) of the body. The *x*, *y*, *z* attributes write the COM
|
||||||
"unscaled", in the appropriate distance :doc:`units <units>`
|
"unscaled", in the appropriate distance :doc:`units <units>`
|
||||||
(:math:`\mathrm{\mathring A}`,
|
(:math:`\AA`, :math:`\sigma`, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by
|
||||||
sigma, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by
|
|
||||||
the image flags for each body. Unwrapped means that if the body
|
the image flags for each body. Unwrapped means that if the body
|
||||||
COM has passed through a periodic boundary one or more times, the value
|
COM has passed through a periodic boundary one or more times, the value
|
||||||
is generated what the COM coordinate would be if it had not been
|
is generated what the COM coordinate would be if it had not been
|
||||||
@ -120,7 +122,7 @@ The image flags for the body can be generated directly using the *ix*,
|
|||||||
*iy*, *iz* attributes. For periodic dimensions, they specify which
|
*iy*, *iz* attributes. For periodic dimensions, they specify which
|
||||||
image of the simulation box the COM is considered to be in. An image
|
image of the simulation box the COM is considered to be in. An image
|
||||||
of 0 means it is inside the box as defined. A value of 2 means add 2
|
of 0 means it is inside the box as defined. A value of 2 means add 2
|
||||||
box lengths to get the true value. A value of -1 means subtract 1 box
|
box lengths to get the true value. A value of :math:`-1` means subtract 1 box
|
||||||
length to get the true value. LAMMPS updates these flags as the rigid
|
length to get the true value. LAMMPS updates these flags as the rigid
|
||||||
body COMs cross periodic boundaries during the simulation.
|
body COMs cross periodic boundaries during the simulation.
|
||||||
|
|
||||||
@ -142,8 +144,8 @@ The *tqx*, *tqy*, *tqz* attributes are components of the torque acting
|
|||||||
on the body around its COM.
|
on the body around its COM.
|
||||||
|
|
||||||
The *inertiax*, *inertiay*, *inertiaz* attributes are components of
|
The *inertiax*, *inertiay*, *inertiaz* attributes are components of
|
||||||
diagonalized inertia tensor for the body, i.e the 3 moments of inertia
|
diagonalized inertia tensor for the body (i.e., the three moments of inertia
|
||||||
for the body around its principal axes, as computed internally by
|
for the body around its principal axes), as computed internally by
|
||||||
LAMMPS.
|
LAMMPS.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -170,10 +172,10 @@ corresponding attribute is in:
|
|||||||
* vx,vy,vz = velocity units
|
* vx,vy,vz = velocity units
|
||||||
* fx,fy,fz = force units
|
* fx,fy,fz = force units
|
||||||
* omegax,omegay,omegaz = radians/time units
|
* omegax,omegay,omegaz = radians/time units
|
||||||
* angmomx,angmomy,angmomz = mass\*distance\^2/time units
|
* angmomx,angmomy,angmomz = mass\*distance\ :math:`^2`\ /time units
|
||||||
* quatw,quati,quatj,quatk = unitless
|
* quatw,quati,quatj,quatk = unitless
|
||||||
* tqx,tqy,tqz = torque units
|
* tqx,tqy,tqz = torque units
|
||||||
* inertiax,inertiay,inertiaz = mass\*distance\^2 units
|
* inertiax,inertiay,inertiaz = mass\*distance\ :math:`^2` units
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -86,7 +86,7 @@ will defined using the *c* values for the spacing along each reciprocal
|
|||||||
lattice axis. Note that manual mapping of the reciprocal space mesh is
|
lattice axis. Note that manual mapping of the reciprocal space mesh is
|
||||||
good for comparing diffraction results from multiple simulations; however
|
good for comparing diffraction results from multiple simulations; however
|
||||||
it can reduce the likelihood that Bragg reflections will be satisfied
|
it can reduce the likelihood that Bragg reflections will be satisfied
|
||||||
unless small spacing parameters (:math:`<0.05~\mathrm{\mathring A}^-1`)
|
unless small spacing parameters (:math:`<0.05~\AA^-1`)
|
||||||
are implemented. Meshes with manual spacing do not require a periodic
|
are implemented. Meshes with manual spacing do not require a periodic
|
||||||
boundary.
|
boundary.
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ constant, and :math:`T` is the absolute temperature.
|
|||||||
The *units* keyword determines the meaning of the distance units used
|
The *units* keyword determines the meaning of the distance units used
|
||||||
for coordinates (*clo*, *chi*) and velocities (*vlo*, *vhi*). A *box* value
|
for coordinates (*clo*, *chi*) and velocities (*vlo*, *vhi*). A *box* value
|
||||||
selects standard distance units as defined by the :doc:`units <units>`
|
selects standard distance units as defined by the :doc:`units <units>`
|
||||||
command (e.g., :math:`\mathrm{\mathring{A}}` for units = real or metal). A
|
command (e.g., :math:`\AA` for units = real or metal). A
|
||||||
*lattice* value means the distance units are in lattice spacings (i.e.,
|
*lattice* value means the distance units are in lattice spacings (i.e.,
|
||||||
velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
|
velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
|
||||||
command must have been previously used to define the lattice spacing.
|
command must have been previously used to define the lattice spacing.
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Syntax
|
|||||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||||
* voronoi/atom = style name of this compute command
|
* voronoi/atom = style name of this compute command
|
||||||
* zero or more keyword/value pairs may be appended
|
* zero or more keyword/value pairs may be appended
|
||||||
* keyword = *only_group* or *surface* or *radius* or *edge_histo* or *edge_threshold* or *face_threshold* or *neighbors* or *peratom*
|
* keyword = *only_group* or *occupation* or *surface* or *radius* or *edge_histo* or *edge_threshold* or *face_threshold* or *neighbors* or *peratom*
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user