Compare commits
32 Commits
patch_17Fe
...
stable_29S
| Author | SHA1 | Date | |
|---|---|---|---|
| e890a0b45e | |||
| 68223f0385 | |||
| 1291a88bff | |||
| d9b687450a | |||
| bd950b37d7 | |||
| 21fcdf8c56 | |||
| 6b400fb4bf | |||
| d982298ab2 | |||
| 765fd7f763 | |||
| 0325047c01 | |||
| 2dce8923ee | |||
| 8d1ba074be | |||
| 4675a3b560 | |||
| 8999b1f69f | |||
| 6c2b19c11b | |||
| a425334928 | |||
| db2faf2789 | |||
| fdbb7d0da4 | |||
| 52cd99918f | |||
| a3e6a95ffb | |||
| 5b65169997 | |||
| 5f3bf69e30 | |||
| 507c02b9af | |||
| b7fe47ba48 | |||
| 7dfd11da4b | |||
| 97ba95f30e | |||
| c1945b4ec9 | |||
| c4291a4b8e | |||
| 5b5dfa86c5 | |||
| 3ca3f6959f | |||
| f7b7bfa406 | |||
| 3d2f29c92d |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -83,7 +83,7 @@ src/library.* @sjplimp
|
||||
src/main.cpp @sjplimp
|
||||
src/min_*.* @sjplimp
|
||||
src/memory.* @sjplimp
|
||||
src/modify.* @sjplimp @stanmoore1
|
||||
src/modify.* @sjplimp
|
||||
src/molecule.* @sjplimp
|
||||
src/my_page.h @sjplimp
|
||||
src/my_pool_chunk.h @sjplimp
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -3,7 +3,7 @@ name: "CodeQL Code Analysis"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
|
||||
46
.github/workflows/compile-msvc.yml
vendored
46
.github/workflows/compile-msvc.yml
vendored
@ -1,46 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Windows with Visual C++
|
||||
name: "Native Windows Compilation and Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Windows Compilation Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Select Python version
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install numpy
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-D PKG_PYTHON=on \
|
||||
-S cmake -B build \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on \
|
||||
-D ENABLE_TESTING=on
|
||||
cmake --build build --config Release
|
||||
|
||||
- name: Run LAMMPS executable
|
||||
shell: bash
|
||||
run: |
|
||||
./build/Release/lmp.exe -h
|
||||
./build/Release/lmp.exe -in bench/in.lj
|
||||
|
||||
- name: Run Unit Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V -C Release
|
||||
2
.github/workflows/unittest-macos.yml
vendored
2
.github/workflows/unittest-macos.yml
vendored
@ -3,7 +3,7 @@ name: "Unittest for MacOS"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -37,8 +37,8 @@ vgcore.*
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
.clang-format
|
||||
.lammps_history
|
||||
.vs
|
||||
|
||||
#cmake
|
||||
/build*
|
||||
@ -49,8 +49,3 @@ Thumbs.db
|
||||
/Testing
|
||||
/cmake_install.cmake
|
||||
/lmp
|
||||
out/Debug
|
||||
out/RelWithDebInfo
|
||||
out/Release
|
||||
out/x86
|
||||
out/x64
|
||||
|
||||
@ -23,10 +23,6 @@ either a user mistake or a bug in the code. Bugs can be reported in
|
||||
the LAMMPS project
|
||||
[issue tracker on GitHub](https://github.com/lammps/lammps/issues).
|
||||
|
||||
To mitigate issues with using homoglyphs or bidirectional reordering in
|
||||
unicode, which have been demonstrated as a vector to obfuscate and hide
|
||||
malicious changes to the source code, all LAMMPS submissions are checked
|
||||
for unicode characters and only all-ASCII source code is accepted.
|
||||
|
||||
# Version Updates
|
||||
|
||||
|
||||
@ -19,9 +19,6 @@ set(SOVERSION 0)
|
||||
|
||||
get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
|
||||
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
|
||||
# collect all executables and shared libs in the top level build folder
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib)
|
||||
@ -84,40 +81,22 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
# set required compiler flags and compiler/CPU arch specific optimizations
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "/QxCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "/QxHost")
|
||||
endif()
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
endif()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# we require C++11 without extensions. Kokkos requires at least C++14 (currently)
|
||||
# we require C++11 without extensions
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
# and prints lots of pointless warnings about "unsafe" functions
|
||||
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
if(MSVC)
|
||||
add_compile_options(/Zc:__cplusplus)
|
||||
add_compile_options(/wd4244)
|
||||
add_compile_options(/wd4267)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# export all symbols when building a .dll file on windows
|
||||
@ -136,7 +115,10 @@ endif()
|
||||
set(LAMMPS_BINARY lmp${LAMMPS_MACHINE})
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared library" OFF)
|
||||
option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared libraries" ON)
|
||||
if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
|
||||
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
|
||||
|
||||
@ -283,19 +265,28 @@ if(BUILD_MPI)
|
||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||
include(MPI4WIN)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
else()
|
||||
find_package(MPI REQUIRED)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG)
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
else()
|
||||
target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
|
||||
add_library(mpi_stubs INTERFACE)
|
||||
target_include_directories(mpi_stubs INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp)
|
||||
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
||||
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(lammps PRIVATE mpi_stubs)
|
||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_compile_definitions(lammps INTERFACE $<INSTALL_INTERFACE:LAMMPS_LIB_NO_MPI>)
|
||||
else()
|
||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||
endif()
|
||||
add_library(MPI::MPI_CXX ALIAS mpi_stubs)
|
||||
endif()
|
||||
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
@ -326,6 +317,7 @@ pkg_depends(ML-IAP ML-SNAP)
|
||||
pkg_depends(MPIIO MPI)
|
||||
pkg_depends(ATC MANYBODY)
|
||||
pkg_depends(LATBOLTZ MPI)
|
||||
pkg_depends(PHONON KSPACE)
|
||||
pkg_depends(SCAFACOS MPI)
|
||||
pkg_depends(DIELECTRIC KSPACE)
|
||||
pkg_depends(DIELECTRIC EXTRA-PAIR)
|
||||
@ -359,13 +351,11 @@ if(BUILD_OMP)
|
||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
||||
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
||||
# Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe.
|
||||
set(LAMMPS_OMP_COMPAT_LEVEL 4)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=4)
|
||||
else()
|
||||
set(LAMMPS_OMP_COMPAT_LEVEL 3)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=3)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=${LAMMPS_OMP_COMPAT_LEVEL})
|
||||
target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
|
||||
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
|
||||
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
|
||||
@ -478,12 +468,9 @@ foreach(HEADER cmath)
|
||||
endif(NOT FOUND_${HEADER})
|
||||
endforeach(HEADER)
|
||||
|
||||
# make the standard math library overrideable and autodetected (for systems that don't have it)
|
||||
find_library(STANDARD_MATH_LIB m DOC "Standard Math library")
|
||||
mark_as_advanced(STANDARD_MATH_LIB)
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(lammps PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
||||
mark_as_advanced( MATH_LIBRARIES )
|
||||
target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
|
||||
|
||||
######################################
|
||||
# Generate Basic Style files
|
||||
@ -579,10 +566,11 @@ if(PKG_ATC)
|
||||
if(LAMMPS_SIZES STREQUAL "BIGBIG")
|
||||
message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG")
|
||||
endif()
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES})
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX)
|
||||
target_link_libraries(atc PRIVATE MPI::MPI_CXX)
|
||||
else()
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs)
|
||||
target_link_libraries(atc PRIVATE mpi_stubs)
|
||||
endif()
|
||||
target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR})
|
||||
target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
@ -596,19 +584,22 @@ endif()
|
||||
# packages which selectively include variants based on enabled styles
|
||||
# e.g. accelerator packages
|
||||
######################################################################
|
||||
foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH PHONON QEQ OPENMP KOKKOS OPT INTEL GPU)
|
||||
foreach(PKG_WITH_INCL CORESHELL QEQ OPENMP DPD-SMOOTH KOKKOS OPT INTEL GPU)
|
||||
if(PKG_${PKG_WITH_INCL})
|
||||
include(Packages/${PKG_WITH_INCL})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(PKG_PLUGIN)
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
endif()
|
||||
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
else()
|
||||
message(WARNING "Plugin loading will not work unless BUILD_SHARED_LIBS is enabled")
|
||||
endif()
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
######################################################################
|
||||
@ -617,7 +608,7 @@ endif()
|
||||
# and after everything else that is compiled locally
|
||||
######################################################################
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE "wsock32;psapi")
|
||||
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
|
||||
endif()
|
||||
|
||||
######################################################
|
||||
@ -678,7 +669,6 @@ endif()
|
||||
|
||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||
@ -698,9 +688,6 @@ foreach(_DEF ${LAMMPS_DEFINES})
|
||||
endforeach()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(NOT BUILD_MPI)
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
@ -740,7 +727,7 @@ install(
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5)
|
||||
find_package(PythonInterp) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
@ -799,17 +786,11 @@ if(ClangFormat_FOUND)
|
||||
endif()
|
||||
|
||||
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
||||
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(BUILD_IS_MULTI_CONFIG)
|
||||
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
||||
else()
|
||||
set(LAMMPS_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
include(FeatureSummary)
|
||||
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
|
||||
message(STATUS "<<< Build configuration >>>
|
||||
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
||||
Build type: ${LAMMPS_BUILD_TYPE}
|
||||
Build type: ${CMAKE_BUILD_TYPE}
|
||||
Install path: ${CMAKE_INSTALL_PREFIX}
|
||||
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
||||
###############################################################################
|
||||
|
||||
@ -1,204 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug-MSVC",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Release-MSVC",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-Clang",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-OneAPI",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icx -DCMAKE_C_COMPILER=icx",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_MPI",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-Intel",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_CXX_COMPILER=icl -DCMAKE_C_COMPILER=icl -DCMAKE_Fortran_COMPILER=ifort",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "PKG_PYTHON",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "ENABLE_TESTING",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_MPI",
|
||||
"value": "False",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
# Build a CMake based external library as subdirectory.
|
||||
# The sources will be unpacked to ${CMAKE_BINARY_DIR}/_deps/${target}-src
|
||||
# The binaries will be built in ${CMAKE_BINARY_DIR}/_deps/${target}-build
|
||||
#
|
||||
function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
|
||||
# change settings locally
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
get_filename_component(archive ${url} NAME)
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||
message(STATUS "Downloading ${url}")
|
||||
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
||||
message(STATUS "Unpacking and configuring ${archive}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||
file(GLOB TARGET_SOURCE "${CMAKE_BINARY_DIR}/_deps/src/${basedir}*")
|
||||
list(LENGTH TARGET_SOURCE _num)
|
||||
if(_num GREATER 1)
|
||||
message(FATAL_ERROR "Inconsistent ${target} library sources. "
|
||||
"Please delete ${CMAKE_BINARY_DIR}/_deps/src and re-run cmake")
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/${target}-src)
|
||||
file(RENAME ${TARGET_SOURCE} ${CMAKE_BINARY_DIR}/_deps/${target}-src)
|
||||
if(NOT (cmakefile STREQUAL ""))
|
||||
file(COPY ${cmakefile} DESTINATION ${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/)
|
||||
get_filename_component(_cmakefile ${cmakefile} NAME)
|
||||
file(RENAME "${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/${_cmakefile}"
|
||||
"${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/CMakeLists.txt")
|
||||
endif()
|
||||
add_subdirectory("${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}"
|
||||
"${CMAKE_BINARY_DIR}/_deps/${target}-build")
|
||||
endfunction(ExternalCMakeProject)
|
||||
@ -8,19 +8,18 @@
|
||||
#=============================================================================
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||
find_package(PythonInterp 3.6 QUIET) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
else()
|
||||
find_package(Python 3.6 COMPONENTS Interpreter QUIET)
|
||||
find_package(Python3 3.6 COMPONENTS Interpreter QUIET)
|
||||
endif()
|
||||
|
||||
# Use the Cython executable that lives next to the Python executable
|
||||
# if it is a local installation.
|
||||
if(Python_EXECUTABLE)
|
||||
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
||||
if(Python3_EXECUTABLE)
|
||||
get_filename_component(_python_path ${Python3_EXECUTABLE} PATH)
|
||||
find_program(Cythonize_EXECUTABLE
|
||||
NAMES cythonize3 cythonize cythonize.bat
|
||||
HINTS ${_python_path})
|
||||
|
||||
81
cmake/Modules/GTest.cmake
Normal file
81
cmake/Modules/GTest.cmake
Normal file
@ -0,0 +1,81 @@
|
||||
message(STATUS "Downloading and building Google Test library")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(GTEST_LIB_POSTFIX d)
|
||||
else()
|
||||
set(GTEST_LIB_POSTFIX)
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
|
||||
set(GTEST_MD5 "ecd1fa65e7de707cd5c00bdac56022cd" CACHE STRING "MD5 checksum of GTest tarball")
|
||||
mark_as_advanced(GTEST_URL)
|
||||
mark_as_advanced(GTEST_MD5)
|
||||
ExternalProject_Add(googletest
|
||||
URL ${GTEST_URL}
|
||||
URL_MD5 ${GTEST_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
<BINARY_DIR>/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(googletest SOURCE_DIR)
|
||||
set(GTEST_INCLUDE_DIR ${SOURCE_DIR}/googletest/include)
|
||||
set(GMOCK_INCLUDE_DIR ${SOURCE_DIR}/googlemock/include)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
|
||||
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Get_Property(googletest BINARY_DIR)
|
||||
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
|
||||
# Prevent GoogleTest from overriding our compiler/linker options
|
||||
# when building with Visual Studio
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
find_package(Threads QUIET)
|
||||
|
||||
add_library(GTest::GTest UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTest PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GTest googletest)
|
||||
|
||||
add_library(GTest::GMock UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMock PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GMock googletest)
|
||||
|
||||
add_library(GTest::GTestMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTestMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GTestMain googletest)
|
||||
|
||||
add_library(GTest::GMockMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMockMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_dependencies(GTest::GMockMain googletest)
|
||||
@ -25,7 +25,7 @@ function(validate_option name values)
|
||||
endfunction(validate_option)
|
||||
|
||||
function(get_lammps_version version_header variable)
|
||||
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
||||
file(READ ${version_header} line)
|
||||
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
|
||||
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1" day "${line}")
|
||||
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\2" month "${line}")
|
||||
@ -85,7 +85,7 @@ endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
function(FetchPotentials pkgfolder potfolder)
|
||||
if(EXISTS "${pkgfolder}/potentials.txt")
|
||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||
foreach(line ${linelist})
|
||||
string(FIND ${line} " " blank)
|
||||
|
||||
@ -1,11 +1,50 @@
|
||||
message(STATUS "Downloading and building OpenCL loader library")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2022.01.04.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "8d3a801e87a2c6653bf0e27707063914" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.09.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "3b3882627964bd02e5c3b02065daac3c" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
mark_as_advanced(OPENCL_LOADER_URL)
|
||||
mark_as_advanced(OPENCL_LOADER_MD5)
|
||||
|
||||
set(INSTALL_LIBOPENCL OFF CACHE BOOL "" FORCE)
|
||||
include(ExternalCMakeProject)
|
||||
ExternalCMakeProject(opencl_loader ${OPENCL_LOADER_URL} ${OPENCL_LOADER_MD5} opencl-loader . "")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(opencl_loader
|
||||
URL ${OPENCL_LOADER_URL}
|
||||
URL_MD5 ${OPENCL_LOADER_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build"
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(opencl_loader SOURCE_DIR)
|
||||
set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Get_Property(opencl_loader BINARY_DIR)
|
||||
set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
find_package(Threads QUIET)
|
||||
if(NOT WIN32)
|
||||
set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}")
|
||||
else()
|
||||
set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject")
|
||||
endif()
|
||||
|
||||
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
|
||||
add_dependencies(OpenCL::OpenCL opencl_loader)
|
||||
|
||||
set_target_properties(OpenCL::OpenCL PROPERTIES
|
||||
IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR}
|
||||
INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}")
|
||||
|
||||
|
||||
add_library(OpenCL::OpenCL ALIAS OpenCL)
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
|
||||
if(Zstd_FOUND)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4)
|
||||
|
||||
if(Zstd_FOUND)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_ZSTD)
|
||||
target_link_libraries(lammps PRIVATE PkgConfig::Zstd)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -306,12 +306,12 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
|
||||
if(HIP_COMPILER STREQUAL "clang")
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
else()
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
endif()
|
||||
@ -422,12 +422,13 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
||||
RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h)
|
||||
|
||||
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
else()
|
||||
target_link_libraries(gpu PRIVATE mpi_stubs)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_MPI)
|
||||
# mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path
|
||||
target_link_libraries(gpu PRIVATE mpi_stubs)
|
||||
else()
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
endif()
|
||||
target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE})
|
||||
target_sources(lammps PRIVATE ${GPU_SOURCES})
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
########################################################################
|
||||
# As of version 3.3.0 Kokkos requires C++14
|
||||
if(CMAKE_CXX_STANDARD LESS 14)
|
||||
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
@ -11,14 +11,8 @@ if(Kokkos_ENABLE_CUDA)
|
||||
endif()
|
||||
# Adding OpenMP compiler flags without the checks done for
|
||||
# BUILD_OMP can result in compile failures. Enforce consistency.
|
||||
if(Kokkos_ENABLE_OPENMP)
|
||||
if(NOT BUILD_OMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
else()
|
||||
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
|
||||
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
|
||||
endif()
|
||||
endif()
|
||||
if(Kokkos_ENABLE_OPENMP AND NOT BUILD_OMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
endif()
|
||||
########################################################################
|
||||
|
||||
@ -33,8 +27,6 @@ if(DOWNLOAD_KOKKOS)
|
||||
endforeach()
|
||||
message(STATUS "KOKKOS download requested - we will build our own")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>")
|
||||
# build KOKKOS downloaded libraries as static libraries but with PIC, if needed
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DBUILD_SHARED_LIBS=OFF")
|
||||
if(CMAKE_REQUEST_PIC)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS ${CMAKE_REQUEST_PIC})
|
||||
endif()
|
||||
@ -47,48 +39,35 @@ if(DOWNLOAD_KOKKOS)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
include(ExternalProject)
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.5.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "079323d973ae0e1c38c0a54a150c674e" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "4c84698917c93a18985b311bb6caf84f" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
mark_as_advanced(KOKKOS_URL)
|
||||
mark_as_advanced(KOKKOS_MD5)
|
||||
ExternalProject_Add(kokkos_build
|
||||
URL ${KOKKOS_URL}
|
||||
URL_MD5 ${KOKKOS_MD5}
|
||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
|
||||
)
|
||||
ExternalProject_get_property(kokkos_build INSTALL_DIR)
|
||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||
add_library(LAMMPS::KOKKOSCORE UNKNOWN IMPORTED)
|
||||
add_library(LAMMPS::KOKKOSCONTAINERS UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::KOKKOSCORE PROPERTIES
|
||||
add_library(LAMMPS::KOKKOS UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::KOKKOS PROPERTIES
|
||||
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscore.a"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
|
||||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
set_target_properties(LAMMPS::KOKKOSCONTAINERS PROPERTIES
|
||||
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libkokkoscontainers.a")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
|
||||
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOSCORE LAMMPS::KOKKOSCONTAINERS)
|
||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||
target_link_libraries(lmp PRIVATE LAMMPS::KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 3.5.00 REQUIRED CONFIG)
|
||||
find_package(Kokkos 3.4.01 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
|
||||
# build KOKKOS internal libraries as static libraries but with PIC, if needed
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(BUILD_SHARED_LIBS_WAS_ON YES)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
if(CMAKE_REQUEST_PIC)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
||||
|
||||
|
||||
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
|
||||
@ -96,9 +75,6 @@ else()
|
||||
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
|
||||
target_link_libraries(lammps PRIVATE kokkos)
|
||||
target_link_libraries(lmp PRIVATE kokkos)
|
||||
if(BUILD_SHARED_LIBS_WAS_ON)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
endif()
|
||||
target_compile_definitions(lammps PUBLIC $<BUILD_INTERFACE:LMP_KOKKOS>)
|
||||
|
||||
@ -133,12 +109,6 @@ if(PKG_KSPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
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}/third_order_kokkos.cpp)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}")
|
||||
|
||||
# detects styles which have KOKKOS version
|
||||
|
||||
@ -8,7 +8,7 @@ option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed on
|
||||
if(DOWNLOAD_EIGEN3)
|
||||
message(STATUS "Eigen3 download requested - we will build our own")
|
||||
|
||||
set(EIGEN3_URL "${LAMMPS_THIRDPARTY_URL}/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_URL "https://download.lammps.org/thirdparty/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_MD5 "4c527a9171d71a72a9d4186e65bea559" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||
mark_as_advanced(EIGEN3_URL)
|
||||
mark_as_advanced(EIGEN3_MD5)
|
||||
|
||||
@ -46,10 +46,12 @@ if(DOWNLOAD_N2P2)
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -62,8 +64,8 @@ if(DOWNLOAD_N2P2)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
||||
set(N2P2_BUILD_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}} ${N2P2_CXX_STD}")
|
||||
set(N2P2_BUILD_OPTIONS INTERFACES=LAMMPS COMP=${N2P2_COMP} "PROJECT_OPTIONS=${N2P2_PROJECT_OPTIONS}" "PROJECT_DEBUG="
|
||||
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${CMAKE_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
|
||||
"PROJECT_AR=${N2P2_AR}" "APP_CORE=nnp-convert" "APP_TRAIN=nnp-train" "APP=nnp-convert")
|
||||
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${MPI_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
|
||||
"PROJECT_AR=${N2P2_AR}")
|
||||
# echo final flag for debugging
|
||||
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
|
||||
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "4db54962fbd6adcf8c18d46e1798ceb5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
|
||||
# download library sources to build folder
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5})
|
||||
|
||||
# uncompress downloaded sources
|
||||
execute_process(
|
||||
@ -14,19 +14,12 @@ execute_process(
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
|
||||
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)
|
||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE)
|
||||
file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-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})
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR})
|
||||
|
||||
|
||||
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
||||
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR})
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
|
||||
|
||||
@ -32,8 +32,7 @@ if(DOWNLOAD_QUIP)
|
||||
foreach(flag ${LAPACK_LIBRARIES})
|
||||
set(temp "${temp} ${flag}")
|
||||
endforeach()
|
||||
# Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment
|
||||
set(temp "${temp} -L/_DUMMY_PATH_\n")
|
||||
set(temp "${temp}\n")
|
||||
set(temp "${temp}PYTHON=python\nPIP=pip\nEXTRA_LINKOPTS=\n")
|
||||
set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n")
|
||||
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
|
||||
|
||||
@ -12,12 +12,41 @@ if(DOWNLOAD_MSCG)
|
||||
mark_as_advanced(MSCG_URL)
|
||||
mark_as_advanced(MSCG_MD5)
|
||||
|
||||
include(ExternalCMakeProject)
|
||||
ExternalCMakeProject(mscg ${MSCG_URL} ${MSCG_MD5} MSCG-release src/CMake "")
|
||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
||||
message(FATAL_ERROR "Cannot compile downloaded MSCG library due to a technical limitation")
|
||||
endif()
|
||||
|
||||
# set include and link library
|
||||
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/mscg-src/src")
|
||||
target_link_libraries(lammps PRIVATE mscg)
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(mscg_build
|
||||
URL ${MSCG_URL}
|
||||
URL_MD5 ${MSCG_MD5}
|
||||
SOURCE_SUBDIR src/CMake
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
|
||||
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target mscg
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/libmscg.a
|
||||
)
|
||||
ExternalProject_get_property(mscg_build BINARY_DIR)
|
||||
ExternalProject_get_property(mscg_build SOURCE_DIR)
|
||||
file(MAKE_DIRECTORY ${SOURCE_DIR}/src)
|
||||
add_library(LAMMPS::MSCG UNKNOWN IMPORTED)
|
||||
set_target_properties(LAMMPS::MSCG PROPERTIES
|
||||
IMPORTED_LOCATION "${BINARY_DIR}/libmscg.a"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src"
|
||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
|
||||
add_dependencies(LAMMPS::MSCG mscg_build)
|
||||
else()
|
||||
find_package(MSCG)
|
||||
if(NOT MSCG_FOUND)
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
# fix phonon may only be installed if also the FFT wrappers from KSPACE are installed
|
||||
if(NOT PKG_KSPACE)
|
||||
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
|
||||
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.h)
|
||||
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
|
||||
get_target_property(LAMMPS_SOURCES lammps SOURCES)
|
||||
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/PHONON/fix_phonon.cpp)
|
||||
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
|
||||
endif()
|
||||
@ -54,8 +54,8 @@ if(DOWNLOAD_PLUMED)
|
||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
||||
endif()
|
||||
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.3/plumed-src-2.7.3.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "f00cc82edfefe6bb3df934911dbe32fb" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.2/plumed-src-2.7.2.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "cfa0b4dd90a81c25d3302e8d97bfeaea" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
|
||||
@ -3,7 +3,7 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
||||
else()
|
||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||
find_package(Python REQUIRED COMPONENTS Development)
|
||||
target_link_libraries(lammps PRIVATE Python::Python)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)
|
||||
|
||||
@ -25,9 +25,7 @@ if(BUILD_TOOLS)
|
||||
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
||||
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
||||
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
target_link_libraries(msi2lmp PRIVATE ${MATH_LIBRARIES})
|
||||
install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
endif()
|
||||
|
||||
47
cmake/Modules/YAML.cmake
Normal file
47
cmake/Modules/YAML.cmake
Normal file
@ -0,0 +1,47 @@
|
||||
message(STATUS "Downloading and building YAML library")
|
||||
|
||||
include(ExternalProject)
|
||||
set(YAML_URL "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz" CACHE STRING "URL for libyaml tarball")
|
||||
set(YAML_MD5 "bb15429d8fb787e7d3f1c83ae129a999" CACHE STRING "MD5 checksum of libyaml tarball")
|
||||
mark_as_advanced(YAML_URL)
|
||||
mark_as_advanced(YAML_MD5)
|
||||
|
||||
# support cross-compilation to windows
|
||||
if(CMAKE_CROSSCOMPILING AND (CMAKE_SYSTEM_NAME STREQUAL "Windows"))
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||
set(YAML_CROSS_HOST --host=i686-mingw64)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set(YAML_CROSS_HOST --host=x86_64-mingw64)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported cross-compilation "
|
||||
" for ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}"
|
||||
" on ${CMAKE_HOST_SYSTEM}/${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(libyaml
|
||||
URL ${YAML_URL}
|
||||
URL_MD5 ${YAML_MD5}
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build"
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${CONFIGURE_REQUEST_PIC}
|
||||
CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}
|
||||
--prefix=<INSTALL_DIR> --disable-shared ${YAML_CROSS_HOST}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(libyaml INSTALL_DIR)
|
||||
set(YAML_INCLUDE_DIR ${INSTALL_DIR}/include)
|
||||
set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
|
||||
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
|
||||
|
||||
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
|
||||
add_library(Yaml::Yaml UNKNOWN IMPORTED)
|
||||
set_target_properties(Yaml::Yaml PROPERTIES
|
||||
IMPORTED_LOCATION ${YAML_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${YAML_INCLUDE_DIR})
|
||||
add_dependencies(Yaml::Yaml libyaml)
|
||||
@ -24,10 +24,10 @@ if(GIT_FOUND AND EXISTS ${LAMMPS_DIR}/.git)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
set(temp "${temp}bool LAMMPS_NS::LAMMPS::has_git_info() { return ${temp_git_info}; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_commit() { return \"${temp_git_commit}\"; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_branch() { return \"${temp_git_branch}\"; }\n")
|
||||
set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${temp_git_describe}\"; }\n")
|
||||
set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n")
|
||||
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n")
|
||||
set(temp "${temp}#endif\n\n")
|
||||
|
||||
message(STATUS "Generating lmpgitversion.h...")
|
||||
|
||||
@ -20,14 +20,9 @@
|
||||
{ include: [ "@\"kspace_.*.h\"", public, "\"style_kspace.h\"", public ] },
|
||||
{ include: [ "@\"nbin_.*.h\"", public, "\"style_nbin.h\"", public ] },
|
||||
{ include: [ "@\"npair_.*.h\"", public, "\"style_npair.h\"", public ] },
|
||||
{ include: [ "@\"nstencil_.*.h\"", public, "\"style_nstencil.h\"", public ] },
|
||||
{ include: [ "@\"nstenci_.*.h\"", public, "\"style_nstencil.h\"", public ] },
|
||||
{ include: [ "@\"ntopo_.*.h\"", public, "\"style_ntopo.h\"", public ] },
|
||||
{ include: [ "\"fmt/core.h\"", private, "\"fmt/format.h\"", public ] },
|
||||
{ include: [ "<float.h>", public, "<cfloat>", public ] },
|
||||
{ include: [ "\"float.h\"", public, "<cfloat>", public ] },
|
||||
{ include: [ "<limits.h>", public, "<climits>", public ] },
|
||||
{ include: [ "\"limits.h\"", public, "<climits>", public ] },
|
||||
{ include: [ "<stdio.h>", public, "<cstdio>", public ] },
|
||||
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/types.h>", public ] },
|
||||
{ include: [ "<bits/types/struct_tm.h>", private, "<ctime>", public ] },
|
||||
]
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX "g++" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(MPI_C "gcc" CACHE STRING "" FORCE)
|
||||
set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -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)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
@ -48,6 +48,7 @@ set(ALL_PACKAGES
|
||||
PHONON
|
||||
PLUGIN
|
||||
POEMS
|
||||
PYTHON
|
||||
QEQ
|
||||
REACTION
|
||||
REAXFF
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
set(WIN_PACKAGES
|
||||
ASPHERE
|
||||
BOCS
|
||||
BODY
|
||||
BROWNIAN
|
||||
CG-DNA
|
||||
CG-SDK
|
||||
CLASS2
|
||||
COLLOID
|
||||
COLVARS
|
||||
CORESHELL
|
||||
DIELECTRIC
|
||||
DIFFRACTION
|
||||
DIPOLE
|
||||
DPD-BASIC
|
||||
DPD-MESO
|
||||
DPD-REACT
|
||||
DPD-SMOOTH
|
||||
DRUDE
|
||||
EFF
|
||||
EXTRA-COMPUTE
|
||||
EXTRA-DUMP
|
||||
EXTRA-FIX
|
||||
EXTRA-MOLECULE
|
||||
EXTRA-PAIR
|
||||
FEP
|
||||
GRANULAR
|
||||
INTERLAYER
|
||||
KSPACE
|
||||
MANIFOLD
|
||||
MANYBODY
|
||||
MC
|
||||
MEAM
|
||||
MISC
|
||||
ML-IAP
|
||||
ML-SNAP
|
||||
MOFFF
|
||||
MOLECULE
|
||||
MOLFILE
|
||||
OPENMP
|
||||
ORIENT
|
||||
PERI
|
||||
PHONON
|
||||
POEMS
|
||||
PTM
|
||||
QEQ
|
||||
QTB
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
SPH
|
||||
SPIN
|
||||
SRD
|
||||
TALLY
|
||||
UEF
|
||||
YAFF)
|
||||
|
||||
foreach(PKG ${WIN_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
@ -435,8 +435,6 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \
|
||||
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.cpp \
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
||||
@ -33,9 +33,9 @@ when necessary.
|
||||
## Pull Requests
|
||||
|
||||
ALL changes to the LAMMPS code and documentation, however trivial, MUST
|
||||
be submitted as a pull request to GitHub. All changes to the "develop"
|
||||
be submitted as a pull request to GitHub. All changes to the "master"
|
||||
branch must be made exclusively through merging pull requests. The
|
||||
"release" and "stable" branches, respectively are only to be updated
|
||||
"unstable" and "stable" branches, respectively are only to be updated
|
||||
upon patch or stable releases with fast-forward merges based on the
|
||||
associated tags. Pull requests may also be submitted to (long-running)
|
||||
feature branches created by LAMMPS developers inside the LAMMPS project,
|
||||
@ -123,16 +123,16 @@ and thus were this comment should be placed.
|
||||
|
||||
LAMMPS uses a continuous release development model with incremental
|
||||
changes, i.e. significant effort is made - including automated pre-merge
|
||||
testing - that the code in the branch "develop" does not get easily
|
||||
testing - that the code in the branch "master" does not get easily
|
||||
broken. These tests are run after every update to a pull request. More
|
||||
extensive and time consuming tests (including regression testing) are
|
||||
performed after code is merged to the "develop" branch. There are patch
|
||||
performed after code is merged to the "master" branch. There are patch
|
||||
releases of LAMMPS every 3-5 weeks at a point, when the LAMMPS
|
||||
developers feel, that a sufficient amount of changes have happened, and
|
||||
the post-merge testing has been successful. These patch releases are
|
||||
marked with a `patch_<version date>` tag and the "release" branch
|
||||
marked with a `patch_<version date>` tag and the "unstable" branch
|
||||
follows only these versions (and thus is always supposed to be of
|
||||
production quality, unlike "develop", which may be temporary broken, in
|
||||
production quality, unlike "master", which may be temporary broken, in
|
||||
the case of larger change sets or unexpected incompatibilities or side
|
||||
effects.
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH LAMMPS "1" "17 February 2022" "2022-2-17"
|
||||
.TH LAMMPS "29 September 2021" "2021-09-29"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH MSI2LMP "1" "v3.9.9" "2018-11-05"
|
||||
.TH MSI2LMP "v3.9.9" "2018-11-05"
|
||||
.SH NAME
|
||||
.B MSI2LMP
|
||||
\- Converter for Materials Studio files to LAMMPS
|
||||
|
||||
@ -1123,12 +1123,9 @@ Bibliography
|
||||
**(Sun)**
|
||||
Sun, J. Phys. Chem. B, 102, 7338-7364 (1998).
|
||||
|
||||
**(Surblys2019)**
|
||||
**(Surblys)**
|
||||
Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
**(Surblys2021)**
|
||||
Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
|
||||
**(Sutmann)**
|
||||
Sutmann, Arnold, Fahrenberger, et. al., Physical review / E 88(6), 063308 (2013)
|
||||
|
||||
|
||||
@ -150,42 +150,6 @@ for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the *-G*
|
||||
command line flag. A list of available generator settings for your
|
||||
specific CMake version is given when running ``cmake --help``.
|
||||
|
||||
.. _cmake_multiconfig:
|
||||
|
||||
Multi-configuration build systems
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Throughout this manual it is mostly assumed that LAMMPS is being built
|
||||
on a Unix-like operating system with "make" as the underlying "builder",
|
||||
since this is the most common case. In this case the build "configuration"
|
||||
is chose using ``-D CMAKE_BUILD_TYPE=<configuration>`` with ``<configuration>``
|
||||
being one of "Release", "Debug", "RelWithDebInfo", or "MinSizeRel".
|
||||
Some build tools, however, can also use or even require to have a so-called
|
||||
multi-configuration build system setup. For those the built type (or
|
||||
configuration) is chosen at compile time using the same build files. E.g.
|
||||
with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake --build build-multi --config Release
|
||||
|
||||
In that case the resulting binaries are not in the build folder directly
|
||||
but in sub-directories corresponding to the build type (i.e. Release in
|
||||
the example from above). Similarly, for running unit tests the
|
||||
configuration is selected with the *-C* flag:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ctest -C Debug
|
||||
|
||||
The CMake scripts in LAMMPS have basic support for being compiled using a
|
||||
multi-config build system, but not all of it has been ported. This is in
|
||||
particular applicable to compiling packages that require additional libraries
|
||||
that would be downloaded and compiled by CMake. The "windows" preset file
|
||||
tries to keep track of which packages can be compiled natively with the
|
||||
MSVC compilers out-of-the box. Not all of those external libraries are
|
||||
portable to Windows either.
|
||||
|
||||
|
||||
Installing CMake
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -185,10 +185,6 @@ The ``ctest`` command has many options, the most important ones are:
|
||||
- run subset of tests matching the regular expression <regex>
|
||||
* - -E <regex>
|
||||
- exclude subset of tests matching the regular expression <regex>
|
||||
* - -L <regex>
|
||||
- run subset of tests with a label matching the regular expression <regex>
|
||||
* - -LE <regex>
|
||||
- exclude subset of tests with a label matching the regular expression <regex>
|
||||
* - -N
|
||||
- dry-run: display list of tests without running them
|
||||
* - -T memcheck
|
||||
@ -303,12 +299,6 @@ will destroy the original file, if the generation run does not complete,
|
||||
so using *-g* is recommended unless the YAML file is fully tested
|
||||
and working.
|
||||
|
||||
Some of the force style tests are rather slow to run and some are very
|
||||
sensitive to small differences like CPU architecture, compiler
|
||||
toolchain, compiler optimization. Those tests are flagged with a "slow"
|
||||
and/or "unstable" label, and thus those tests can be selectively
|
||||
excluded with the ``-LE`` flag or selected with the ``-L`` flag.
|
||||
|
||||
.. admonition:: Recommendations and notes for YAML files
|
||||
:class: note
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ environments with restricted disk space capacity it may be needed to
|
||||
reduce the storage requirements. Here are some suggestions:
|
||||
|
||||
- Create a so-called shallow repository by cloning only the last commit
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=develop``.
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
|
||||
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
|
||||
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
|
||||
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).
|
||||
|
||||
@ -341,18 +341,6 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||
|
||||
When using the "-b " option, the KIM library is built using its native
|
||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||
``CMAKE`` environment variable if the cmake executable is named other
|
||||
than ``cmake`` on your system. Additional environment variables may be
|
||||
provided on the command line for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the gnu version 11 compilers
|
||||
to build KIM, one could use the following command line.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||
|
||||
Settings for debugging OpenKIM web queries discussed below need to
|
||||
be applied by adding them to the ``LMP_INC`` variable through
|
||||
editing the ``Makefile.machine`` you are using. For example:
|
||||
@ -572,26 +560,11 @@ They must be specified in uppercase.
|
||||
* - VEGA908
|
||||
- GPU
|
||||
- AMD GPU MI100 GFX908
|
||||
* - VEGA90A
|
||||
* - INTEL_GEN
|
||||
- GPU
|
||||
- AMD GPU
|
||||
* - INTEL_DG1
|
||||
- GPU
|
||||
- Intel Iris XeMAX GPU
|
||||
* - INTEL_GEN9
|
||||
- GPU
|
||||
- Intel GPU Gen9
|
||||
* - INTEL_GEN11
|
||||
- GPU
|
||||
- Intel GPU Gen11
|
||||
* - INTEL_GEN12LP
|
||||
- GPU
|
||||
- Intel GPU Gen12LP
|
||||
* - INTEL_XEHP
|
||||
- GPU
|
||||
- Intel GPUs Xe-HP
|
||||
- Intel GPUs Gen9+
|
||||
|
||||
This list was last updated for version 3.5.0 of the Kokkos library.
|
||||
This list was last updated for version 3.4.1 of the Kokkos library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
|
||||
@ -33,15 +33,12 @@ various tools and files. Some of them have to be installed (see below). For
|
||||
the rest the build process will attempt to download and install them into
|
||||
a python virtual environment and local folders.
|
||||
|
||||
A current version of the manual (latest patch release, that is the state
|
||||
of the *release* branch) is is available online at:
|
||||
`https://docs.lammps.org/ <https://docs.lammps.org/>`_.
|
||||
A version of the manual corresponding to the ongoing development (that is
|
||||
the state of the *develop* branch) is available online at:
|
||||
`https://docs.lammps.org/latest/ <https://docs.lammps.org/latest/>`_
|
||||
A version of the manual corresponding to the latest stable LAMMPS release
|
||||
(that is the state of the *stable* branch) is available online at:
|
||||
`https://docs.lammps.org/stable/ <https://docs.lammps.org/stable/>`_
|
||||
A current version of the manual (latest patch release, aka unstable
|
||||
branch) is is available online at:
|
||||
`https://docs.lammps.org/Manual.html <https://docs.lammps.org/Manual.html>`_.
|
||||
A version of the manual corresponding to the ongoing development (aka master branch)
|
||||
is available online at: `https://docs.lammps.org/latest/
|
||||
<https://docs.lammps.org/latest/>`_
|
||||
|
||||
Build using GNU make
|
||||
--------------------
|
||||
|
||||
@ -321,7 +321,9 @@ following settings:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG <other LMP_INC settings>
|
||||
LMP_INC = -DLAMMPS_JPEG
|
||||
LMP_INC = -DLAMMPS_PNG
|
||||
LMP_INC = -DLAMMPS_FFMPEG
|
||||
|
||||
JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them
|
||||
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
|
||||
@ -352,10 +354,8 @@ Read or write compressed files
|
||||
-----------------------------------------
|
||||
|
||||
If this option is enabled, large files can be read or written with
|
||||
compression by ``gzip`` or similar tools by several LAMMPS commands,
|
||||
including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
|
||||
:doc:`dump <dump>`. Currently supported compression tools are:
|
||||
``gzip``, ``bzip2``, ``zstd``, and ``lzma``.
|
||||
gzip compression by several LAMMPS commands, including
|
||||
:doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and :doc:`dump <dump>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -364,23 +364,23 @@ including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
|
||||
.. code-block:: bash
|
||||
|
||||
-D WITH_GZIP=value # yes or no
|
||||
# default is yes if CMake can find the gzip program, else no
|
||||
# default is yes if CMake can find gzip, else no
|
||||
-D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP <other LMP_INC settings>
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
|
||||
This option requires that your operating system fully supports the
|
||||
"popen()" function in the standard runtime library and that a ``gzip``
|
||||
or other executable can be found by LAMMPS in the standard search path
|
||||
during a run.
|
||||
This option requires that your operating system fully supports the "popen()"
|
||||
function in the standard runtime library and that a ``gzip`` executable can be
|
||||
found by LAMMPS during a run.
|
||||
|
||||
.. note::
|
||||
|
||||
On clusters with high-speed networks, using the "fork()" library call
|
||||
(required by "popen()") can interfere with the fast communication
|
||||
On some clusters with high-speed networks, using the "fork()" library
|
||||
call (required by "popen()") can interfere with the fast communication
|
||||
library and lead to simulations using compressed output or input to
|
||||
hang or crash. For selected operations, compressed file I/O is also
|
||||
available using a compression library instead, which is what the
|
||||
@ -452,7 +452,7 @@ those systems:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG <other LMP_INC settings>
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
||||
|
||||
----------
|
||||
|
||||
@ -479,7 +479,7 @@ e.g. to Python. Of course, the calling code has to be set up to
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS <other LMP_INC settings>
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||
|
||||
.. note::
|
||||
|
||||
@ -520,7 +520,7 @@ executable, not the library.
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE <other LMP_INC settings>
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE
|
||||
|
||||
After compilation with this flag set, the LAMMPS executable will stop
|
||||
and produce a core dump when a division by zero, overflow, illegal math
|
||||
|
||||
@ -4,7 +4,6 @@ Notes for building LAMMPS on Windows
|
||||
* :ref:`General remarks <generic>`
|
||||
* :ref:`Running Linux on Windows <linux>`
|
||||
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
||||
* :ref:`Using Visual Studio <msvc>`
|
||||
* :ref:`Using a cross-compiler <cross>`
|
||||
|
||||
----------
|
||||
@ -32,13 +31,13 @@ pre-compiled Windows binary packages are sufficient for your needs. If
|
||||
it is necessary for you to compile LAMMPS on a Windows machine
|
||||
(e.g. because it is your main desktop), please also consider using a
|
||||
virtual machine software and compile and run LAMMPS in a Linux virtual
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10 or
|
||||
Windows 11 installation - consider using the Windows subsystem for
|
||||
Linux. This optional Windows feature allows you to run the bash shell
|
||||
from Ubuntu from within Windows and from there on, you can pretty much
|
||||
use that shell like you are running on an Ubuntu Linux machine
|
||||
(e.g. installing software via apt-get and more). For more details on
|
||||
that, please see :doc:`this tutorial <Howto_wsl>`.
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10
|
||||
installation - consider using the Windows subsystem for Linux. This
|
||||
optional Windows feature allows you to run the bash shell from Ubuntu
|
||||
from within Windows and from there on, you can pretty much use that
|
||||
shell like you are running on an Ubuntu Linux machine (e.g. installing
|
||||
software via apt-get and more). For more details on that, please see
|
||||
:doc:`this tutorial <Howto_wsl>`.
|
||||
|
||||
.. _gnu:
|
||||
|
||||
@ -68,40 +67,6 @@ requiring changes to the LAMMPS source code, or figure out corrections
|
||||
yourself, please report them on the lammps-users mailing list, or file
|
||||
them as an issue or pull request on the LAMMPS GitHub project.
|
||||
|
||||
.. _msvc:
|
||||
|
||||
Using Microsoft Visual Studio
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Following the integration of the :doc:`platform namespace
|
||||
<Developer_platform>` into the LAMMPS code base, portability of LAMMPS
|
||||
to be compiled on Windows using Visual Studio has been significantly
|
||||
improved. This has been tested with Visual Studio 2019 (aka version
|
||||
16). Not all features and packages in LAMMPS are currently supported
|
||||
out of the box, but a preset ``cmake/presets/windows.cmake`` is provided
|
||||
that contains the packages that have been compiled successfully. You
|
||||
must use the CMake based build procedure, and either use the integrated
|
||||
CMake support of Visual Studio or use an external CMake installation to
|
||||
create build files for the Visual Studio build system. Please note that
|
||||
on launching Visual Studio it will scan the directory tree and likely
|
||||
miss the correct master ``CMakeLists.txt``. Try to open the
|
||||
``cmake/CMakeSettings.json`` and use those CMake configurations as a
|
||||
starting point. It is also possible to configure and compile LAMMPS
|
||||
from the command line with a CMake binary from `cmake.org <https://cmake.org>`_.
|
||||
|
||||
Please note, that for either approach CMake will create a so-called
|
||||
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
|
||||
the command lines for building and testing LAMMPS must be adjusted
|
||||
accordingly.
|
||||
|
||||
To support running in parallel you can compile with OpenMP enabled using
|
||||
the OPENMP package or install Microsoft MPI (including the SDK) and compile
|
||||
LAMMPS with MPI enabled.
|
||||
|
||||
This is work in progress and you should contact the LAMMPS developers
|
||||
via GitHub, the forum, or the mailing list, if you have questions or
|
||||
LAMMPS specific problems.
|
||||
|
||||
.. _cross:
|
||||
|
||||
Using a cross-compiler
|
||||
|
||||
@ -47,7 +47,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`displace_atoms <displace_atoms>`
|
||||
* :doc:`dump <dump>`
|
||||
* :doc:`dump_modify <dump_modify>`
|
||||
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
|
||||
* :doc:`dynamical_matrix <dynamical_matrix>`
|
||||
* :doc:`echo <echo>`
|
||||
* :doc:`fix <fix>`
|
||||
* :doc:`fix_modify <fix_modify>`
|
||||
@ -117,7 +117,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`thermo <thermo>`
|
||||
* :doc:`thermo_modify <thermo_modify>`
|
||||
* :doc:`thermo_style <thermo_style>`
|
||||
* :doc:`third_order (k) <third_order>`
|
||||
* :doc:`third_order <third_order>`
|
||||
* :doc:`timer <timer>`
|
||||
* :doc:`timestep <timestep>`
|
||||
* :doc:`uncompute <uncompute>`
|
||||
|
||||
@ -35,7 +35,6 @@ OPT.
|
||||
* :doc:`class2 (ko) <bond_class2>`
|
||||
* :doc:`fene (iko) <bond_fene>`
|
||||
* :doc:`fene/expand (o) <bond_fene_expand>`
|
||||
* :doc:`fene/nm <bond_fene>`
|
||||
* :doc:`gaussian <bond_gaussian>`
|
||||
* :doc:`gromos (o) <bond_gromos>`
|
||||
* :doc:`harmonic (iko) <bond_harmonic>`
|
||||
|
||||
@ -28,7 +28,6 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`angle <compute_angle>`
|
||||
* :doc:`angle/local <compute_angle_local>`
|
||||
* :doc:`angmom/chunk <compute_angmom_chunk>`
|
||||
* :doc:`ave/sphere/atom (k) <compute_ave_sphere_atom>`
|
||||
* :doc:`basal/atom <compute_basal_atom>`
|
||||
* :doc:`body/local <compute_body_local>`
|
||||
* :doc:`bond <compute_bond>`
|
||||
|
||||
@ -23,7 +23,6 @@ OPT.
|
||||
:columns: 5
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>`
|
||||
* :doc:`acks2/reaxff (k) <fix_acks2_reaxff>`
|
||||
* :doc:`adapt <fix_adapt>`
|
||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||
* :doc:`addforce <fix_addforce>`
|
||||
@ -104,7 +103,6 @@ OPT.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>`
|
||||
* :doc:`mdi/engine <fix_mdi_engine>`
|
||||
* :doc:`meso/move <fix_meso_move>`
|
||||
* :doc:`mol/swap <fix_mol_swap>`
|
||||
* :doc:`momentum (k) <fix_momentum>`
|
||||
* :doc:`momentum/chunk <fix_momentum>`
|
||||
* :doc:`move <fix_move>`
|
||||
@ -129,7 +127,6 @@ OPT.
|
||||
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
||||
* :doc:`npt/uef <fix_nh_uef>`
|
||||
* :doc:`numdiff <fix_numdiff>`
|
||||
* :doc:`numdiff/virial <fix_numdiff_virial>`
|
||||
* :doc:`nve (giko) <fix_nve>`
|
||||
* :doc:`nve/asphere (gi) <fix_nve_asphere>`
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
||||
|
||||
@ -119,12 +119,10 @@ OPT.
|
||||
* :doc:`granular <pair_granular>`
|
||||
* :doc:`gw <pair_gw>`
|
||||
* :doc:`gw/zbl <pair_gw>`
|
||||
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
|
||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hdnnp <pair_hdnnp>`
|
||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
||||
* :doc:`ilp/tmd <pair_ilp_tmd>`
|
||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||
* :doc:`lcbop <pair_lcbop>`
|
||||
@ -212,7 +210,6 @@ OPT.
|
||||
* :doc:`nm/cut (o) <pair_nm>`
|
||||
* :doc:`nm/cut/coul/cut (o) <pair_nm>`
|
||||
* :doc:`nm/cut/coul/long (o) <pair_nm>`
|
||||
* :doc:`nm/cut/split <pair_nm>`
|
||||
* :doc:`oxdna/coaxstk <pair_oxdna>`
|
||||
* :doc:`oxdna/excv <pair_oxdna>`
|
||||
* :doc:`oxdna/hbond <pair_oxdna>`
|
||||
@ -242,7 +239,6 @@ OPT.
|
||||
* :doc:`reaxff (ko) <pair_reaxff>`
|
||||
* :doc:`rebo (io) <pair_airebo>`
|
||||
* :doc:`resquared (go) <pair_resquared>`
|
||||
* :doc:`saip/metal <pair_saip_metal>`
|
||||
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
|
||||
* :doc:`smd/hertz <pair_smd_hertz>`
|
||||
* :doc:`smd/tlsph <pair_smd_tlsph>`
|
||||
@ -266,7 +262,6 @@ OPT.
|
||||
* :doc:`spin/neel <pair_spin_neel>`
|
||||
* :doc:`srp <pair_srp>`
|
||||
* :doc:`sw (giko) <pair_sw>`
|
||||
* :doc:`sw/mod (o) <pair_sw>`
|
||||
* :doc:`table (gko) <pair_table>`
|
||||
* :doc:`table/rx (k) <pair_table_rx>`
|
||||
* :doc:`tdpd <pair_mesodpd>`
|
||||
|
||||
@ -11,7 +11,6 @@ of time and requests from the LAMMPS user community.
|
||||
:maxdepth: 1
|
||||
|
||||
Developer_org
|
||||
Developer_cxx_vs_c_style
|
||||
Developer_parallel
|
||||
Developer_flow
|
||||
Developer_write
|
||||
@ -19,5 +18,4 @@ of time and requests from the LAMMPS user community.
|
||||
Developer_plugins
|
||||
Developer_unittest
|
||||
Classes
|
||||
Developer_platform
|
||||
Developer_utils
|
||||
|
||||
@ -1,384 +0,0 @@
|
||||
Code design
|
||||
-----------
|
||||
|
||||
This section discusses some of the code design choices in LAMMPS and
|
||||
overall strategy in order to assist developers to write new code that
|
||||
will fit well with the remaining code. Please see the section on
|
||||
:doc:`Requirements for contributed code <Modify_style>` for more
|
||||
specific recommendations and guidelines. While that section is
|
||||
organized more in the form of a checklist for code contributors, the
|
||||
focus here is on overall code design strategy, choices made between
|
||||
possible alternatives, and to discuss of some relevant C++ programming
|
||||
language constructs.
|
||||
|
||||
Historically, the basic design philosophy of the LAMMPS C++ code was
|
||||
that of a "C with classes" style. The was motivated by the desire to
|
||||
make it easier to modify LAMMPS for people without significant training
|
||||
in C++ programming and by trying to use data structures and code constructs
|
||||
that somewhat resemble the previous implementation(s) in Fortran.
|
||||
A contributing factor for this choice also was that at the time the
|
||||
implementation of C++ compilers was not always very mature and some of
|
||||
the advanced features contained bugs or were not functioning exactly
|
||||
as the standard required; plus there was some disagreement between
|
||||
compiler vendors about how to interpret the C++ standard documents.
|
||||
|
||||
However, C++ compilers have advanced a lot since then and with the
|
||||
transition to requiring the C++11 standard in 2020 as the minimum C++ language
|
||||
standard for LAMMPS, the decision was made to also replace some of the
|
||||
C-style constructs with equivalent C++ functionality, either from the
|
||||
C++ standard library or as custom classes or function, in order to
|
||||
improve readability of the code and to increase code reuse through
|
||||
abstraction of commonly used functionality.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that as of spring 2022 there is still a sizable chunk of
|
||||
legacy code in LAMMPS that has not yet been refactored to reflect these
|
||||
style conventions in full. LAMMPS has a large code base and many
|
||||
different contributors and there also is a hierarchy of precedence
|
||||
in which the code is adapted. Highest priority has the code in the
|
||||
``src`` folder, followed by code in packages in order of their popularity
|
||||
and complexity (simpler code is adapted sooner), followed by code
|
||||
in the ``lib`` folder. Source code that is downloaded during compilation
|
||||
is not subject to the conventions discussed here.
|
||||
|
||||
Object oriented code
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS is designed to be an object oriented code, that is each
|
||||
simulation is represented by an instance of the LAMMPS class. When
|
||||
running in parallel, of course, each MPI process will create such an
|
||||
instance. This can be seen in the ``main.cpp`` file where the core
|
||||
steps of running a LAMMPS simulation are the following 3 lines of code:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||
lammps->input->file();
|
||||
delete lammps;
|
||||
|
||||
The first line creates a LAMMPS class instance and passes the command
|
||||
line arguments and the global communicator to its constructor. The
|
||||
second line tells the LAMMPS instance to process the input (either from
|
||||
standard input or the provided input file) until the end. And the third
|
||||
line deletes that instance again. The remainder of the main.cpp file
|
||||
are for error handling, MPI configuration and other special features.
|
||||
|
||||
In the constructor of the LAMMPS class instance the basic LAMMPS class hierarchy
|
||||
is created as shown in :ref:`class-topology`. While processing the input further
|
||||
class instances are created, or deleted, or replaced and specific member functions
|
||||
of specific classes are called to trigger actions like creating atoms, computing
|
||||
forces, computing properties, propagating the system, or writing output.
|
||||
|
||||
Compositing and Inheritance
|
||||
===========================
|
||||
|
||||
LAMMPS makes extensive use of the object oriented programming (OOP)
|
||||
principles of *compositing* and *inheritance*. Classes like the
|
||||
``LAMMPS`` class are a **composite** containing pointers to instances of
|
||||
other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||
``Modify``, and so on. Each of these classes implement certain
|
||||
functionality by storing and manipulating data related to the simulation
|
||||
and providing member functions that trigger certain actions. Some of
|
||||
those classes like ``Force`` are a composite again containing instances
|
||||
of classes describing the force interactions or ``Modify`` containing
|
||||
and calling fixes and computes. In most cases (e.g. ``AtomVec``, ``Comm``,
|
||||
``Pair``, or ``Bond``) there is only one instance of those member classes
|
||||
allowed, but in a few cases (e.g. ``Region``, ``Fix``, ``Compute``, or
|
||||
``Dump``) there can be multiple instances and the parent class is
|
||||
maintaining a list of the pointers of instantiated classes instead
|
||||
of a single pointer.
|
||||
|
||||
Changing behavior or adjusting how LAMMPS handles a simulation is
|
||||
implemented via **inheritance** where different variants of the
|
||||
functionality are realized by creating *derived* classes that can share
|
||||
common functionality in their base class and provide a consistent
|
||||
interface where the derived classes replace (dummy or pure) functions in
|
||||
the base class. The higher level classes can then call those methods of
|
||||
the instantiated classes without having to know which specific derived
|
||||
class variant was instantiated. In the LAMMPS documentation those
|
||||
derived classes are usually referred to a "styles", e.g. pair styles,
|
||||
fix styles, atom styles and so on.
|
||||
|
||||
This is the origin of the flexibility of LAMMPS and facilitates for
|
||||
example to compute forces for very different non-bonded potential
|
||||
functions by having different pair styles (implemented as different
|
||||
classes derived from the ``Pair`` class) where the evaluation of the
|
||||
potential function is confined to the implementation of the individual
|
||||
classes. Whenever a new :doc:`pair_style` or :doc:`bond_style` or
|
||||
:doc:`comm_style` or similar command is processed in the LAMMPS input
|
||||
any existing class instance is deleted and a new instance created in
|
||||
it place.
|
||||
|
||||
Classes derived from ``Fix`` or ``Compute`` represent a different facet
|
||||
of LAMMPS' flexibility as there can be multiple instances of them an
|
||||
their member functions will be called at different phases of the time
|
||||
integration process (as explained in `Developer_flow`). This way
|
||||
multiple manipulations of the entire or parts of the system can be
|
||||
programmed (with fix styles) or different computations can be performed
|
||||
and accessed and further processed or output through a common interface
|
||||
(with compute styles).
|
||||
|
||||
Further code sharing is possible by creating derived classes from the
|
||||
derived classes (for instance to implement an accelerated version of a
|
||||
pair style) where then only a subset of the methods are replaced with
|
||||
the accelerated versions.
|
||||
|
||||
Polymorphism
|
||||
============
|
||||
|
||||
Polymorphism and dynamic dispatch are another OOP feature that play an
|
||||
important part of how LAMMPS selects which code to execute. In a nutshell,
|
||||
this is a mechanism where the decision of which member function to call
|
||||
from a class is determined at runtime and not when the code is compiled.
|
||||
To enable it, the function has to be declared as ``virtual`` and all
|
||||
corresponding functions in derived classes should be using the ``override``
|
||||
property. Below is a brief example.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
class Base {
|
||||
public:
|
||||
virtual ~Base() = default;
|
||||
void call();
|
||||
void normal();
|
||||
virtual void poly();
|
||||
};
|
||||
|
||||
void Base::call() {
|
||||
normal();
|
||||
poly();
|
||||
}
|
||||
|
||||
class Derived : public Base {
|
||||
public:
|
||||
~Derived() override = default;
|
||||
void normal();
|
||||
void poly() override;
|
||||
};
|
||||
|
||||
// [....]
|
||||
|
||||
Base *base1 = new Base();
|
||||
Base *base2 = new Derived();
|
||||
|
||||
base1->call();
|
||||
base2->call();
|
||||
|
||||
The difference in behavior of the ``normal()`` and the ``poly()`` member
|
||||
functions is in which of the two member functions is called when
|
||||
executing `base1->call()` and `base2->call()`. Without polymorphism, a
|
||||
function within the base class will call only member functions within
|
||||
the same scope, that is ``Base::call()`` will always call
|
||||
``Base::normal()``. But for the `base2->call()` the call for the
|
||||
virtual member function will be dispatched to ``Derived::poly()``
|
||||
instead. This mechanism allows to always call functions within the
|
||||
scope of the class type that was used to create the class instance, even
|
||||
if they are assigned to a pointer using the type of a base class. This
|
||||
is the desired behavior, and thanks to dynamic dispatch, LAMMPS can even
|
||||
use styles that are loaded at runtime from a shared object file with the
|
||||
:doc:`plugin command <plugin>`.
|
||||
|
||||
A special case of virtual functions are so-called pure functions. These
|
||||
are virtual functions that are initialized to 0 in the class declaration
|
||||
(see example below).
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
class Base {
|
||||
public:
|
||||
virtual void pure() = 0;
|
||||
};
|
||||
|
||||
This has the effect that it will no longer be possible to create an
|
||||
instance of the base class and that derived classes **must** implement
|
||||
these functions. Many of the functions listed with the various class
|
||||
styles in the section :doc:`Modify` are such pure functions. The
|
||||
motivation for this is to define the interface or API of the functions
|
||||
but defer the implementation to the derived classes.
|
||||
|
||||
However, there are downsides to this. For example, calls to virtual
|
||||
functions from within a constructor, will not be in the scope of the
|
||||
derived class and thus it is good practice to either avoid calling them
|
||||
or to provide an explicit scope like in ``Base::poly()``. Furthermore,
|
||||
any destructors in classes containing virtual functions should be
|
||||
declared virtual, too, so they are processed in the expected order
|
||||
before types are removed from dynamic dispatch.
|
||||
|
||||
.. admonition:: Important Notes
|
||||
|
||||
In order to be able to detect incompatibilities and to avoid unexpected
|
||||
behavior already at compile time, it is crucial that all member functions
|
||||
that are intended to replace a virtual or pure function use the ``override``
|
||||
property keyword. For the same reason it should be avoided to use overloads
|
||||
or default arguments for virtual functions as they lead to confusion over
|
||||
which function is supposed to override which and which arguments need to be
|
||||
declared.
|
||||
|
||||
Style Factories
|
||||
===============
|
||||
|
||||
In order to create class instances of the different styles, LAMMPS often
|
||||
uses a programming pattern called `Factory`. Those are functions that create
|
||||
an instance of a specific derived class, say ``PairLJCut`` and return a pointer
|
||||
to the type of the common base class of that style, ``Pair`` in this case.
|
||||
To associate the factory function with the style keyword, an ``std::map``
|
||||
class is used in which function pointers are indexed by their keyword
|
||||
(for example "lj/cut" for ``PairLJCut`` and "morse" ``PairMorse``).
|
||||
A couple of typedefs help to keep the code readable and a template function
|
||||
is used to implement the actual factory functions for the individual classes.
|
||||
|
||||
I/O and output formatting
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
C-style stdio versus C++ style iostreams
|
||||
========================================
|
||||
|
||||
LAMMPS chooses to use the "stdio" library of the standard C library for
|
||||
reading from and writing to files and console instead of C++
|
||||
"iostreams". This is mainly motivated by the better performance, better
|
||||
control over formatting, and less effort to achieve specific formatting.
|
||||
|
||||
Since mixing "stdio" and "iostreams" can lead to unexpected behavior using
|
||||
the latter is strongly discouraged. Also output to the screen should not
|
||||
use the predefined ``stdout`` FILE pointer, but rather the ``screen`` and
|
||||
``logfile`` FILE pointers managed by the LAMMPS class. Furthermore, output
|
||||
should only be done by MPI rank 0 (``comm->me == 0``) and output that is
|
||||
send to both ``screen`` and ``logfile`` should use the
|
||||
:cpp:func:`utils::logmesg() convenience function <LAMMPS_NS::utils::logmesg>`.
|
||||
|
||||
We also discourage the use for stringstreams as the bundled {fmt} library
|
||||
and the customized tokenizer classes can provide the same functionality
|
||||
in a cleaner way with better performance. This will also help to retain
|
||||
a consistent programming style despite the many different contributors.
|
||||
|
||||
Formatting with the {fmt} library
|
||||
===================================
|
||||
|
||||
The LAMMPS source code includes a copy of the `{fmt} library
|
||||
<https://fmt.dev>`_ which is preferred over formatting with the
|
||||
"printf()" family of functions. The primary reason is that it allows a
|
||||
typesafe default format for any type of supported data. This is
|
||||
particularly useful for formatting integers of a given size (32-bit or
|
||||
64-bit) which may require different format strings depending on compile
|
||||
time settings or compilers/operating systems. Furthermore, {fmt} gives
|
||||
better performance, has more functionality, a familiar formatting syntax
|
||||
that has similarities to ``format()`` in Python, and provides a facility
|
||||
that can be used to integrate format strings and a variable number of
|
||||
arguments into custom functions in a much simpler way that the varargs
|
||||
mechanism of the C library. Finally, {fmt} has been included into the
|
||||
C++20 language standard, so changes to adopt it are future proof.
|
||||
|
||||
Formatted strings are frequently created by calling the
|
||||
``fmt::format()`` function which will return a string as ``std::string``
|
||||
class instance. In contrast to the ``%`` placeholder in ``printf()``,
|
||||
the {fmt} library uses ``{}`` to embed format descriptors. In the
|
||||
simplest case, no additional characters are needed as {fmt} will choose
|
||||
the default format based on the data type of the argument. Alternatively
|
||||
The ``fmt::print()`` function may be used instead of ``printf()`` or
|
||||
``fprintf()``. In addition, several LAMMPS output functions, that
|
||||
originally accepted a single string as arguments have been overloaded to
|
||||
accept a format string with optional arguments as well (e.g.
|
||||
``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
|
||||
|
||||
Summary of the {fmt} format syntax
|
||||
==================================
|
||||
|
||||
The syntax of the format string is "{[<argument id>][:<format spec>]}",
|
||||
where either the argument id or the format spec (separated by a colon
|
||||
':') is optional. The argument id is usually a number starting from 0
|
||||
that is the index to the arguments following the format string. By
|
||||
default these are assigned in order (i.e. 0, 1, 2, 3, 4 etc.). The most
|
||||
common case for using argument id would be to use the same argument in
|
||||
multiple places in the format string without having to provide it as an
|
||||
argument multiple times. In LAMMPS the argument id is rarely used.
|
||||
|
||||
More common is the use of the format specifier, which starts with a
|
||||
colon. This may optionally be followed by a fill character (default is
|
||||
' '). If provided, the fill character **must** be followed by an
|
||||
alignment character ('<', '^', '>' for left, centered, or right
|
||||
alignment (default)). The alignment character may be used without a fill
|
||||
character. The next important format parameter would be the minimum
|
||||
width, which may be followed by a dot '.' and a precision for floating
|
||||
point numbers. The final character in the format string would be an
|
||||
indicator for the "presentation", i.e. 'd' for decimal presentation of
|
||||
integers, 'x' for hexadecimal, 'o' for octal, 'c' for character
|
||||
etc. This mostly follows the "printf()" scheme but without requiring an
|
||||
additional length parameter to distinguish between different integer
|
||||
widths. The {fmt} library will detect those and adapt the formatting
|
||||
accordingly. For floating point numbers there are correspondingly, 'g'
|
||||
for generic presentation, 'e' for exponential presentation, and 'f' for
|
||||
fixed point presentation.
|
||||
|
||||
Thus "{:8}" would represent *any* type argument using at least 8
|
||||
characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
||||
"{:>8}" as right aligned. If a specific presentation is selected, the
|
||||
argument type must be compatible or else the {fmt} formatting code will
|
||||
throw an exception. Some format string examples are given below:
|
||||
|
||||
.. code-block:: C
|
||||
|
||||
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",
|
||||
label, time_min, time, time_max, time_sq, tmp);
|
||||
utils::logmesg(lmp,"{:>6} = max # of 1-2 neighbors\n",maxall);
|
||||
utils::logmesg(lmp,"Lattice spacing in x,y,z = {:.8} {:.8} {:.8}\n",
|
||||
xlattice,ylattice,zlattice);
|
||||
|
||||
which will create the following output lines:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
CPU time: 0:02:16
|
||||
Pair | 2.0133 | 2.0133 | 2.0133 | 0.0 | 84.21
|
||||
4 = max # of 1-2 neighbors
|
||||
Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962
|
||||
|
||||
A special feature of the {fmt} library is that format parameters like
|
||||
the width or the precision may be also provided as arguments. In that
|
||||
case a nested format is used where a pair of curly braces (with an
|
||||
optional argument id) "{}" are used instead of the value, for example
|
||||
"{:{}d}" will consume two integer arguments, the first will be the value
|
||||
shown and the second the minimum width.
|
||||
|
||||
For more details and examples, please consult the `{fmt} syntax
|
||||
documentation <https://fmt.dev/latest/syntax.html>`_ website.
|
||||
|
||||
|
||||
Memory management
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Dynamical allocation of data and objects should be done with either the
|
||||
C++ commands "new" and "delete/delete[]" or using member functions of
|
||||
the ``Memory`` class, most commonly, ``Memory::create()``,
|
||||
``Memory::grow()``, and ``Memory::destroy()``. The use of ``malloc()``,
|
||||
``calloc()``, ``realloc()`` and ``free()`` directly is strongly
|
||||
discouraged. To simplify adapting legacy code into the LAMMPS code base
|
||||
the member functions ``Memory::smalloc()``, ``Memory::srealloc()``, and
|
||||
``Memory::sfree()`` are available.
|
||||
|
||||
Using those custom memory allocation functions is motivated by the
|
||||
following considerations:
|
||||
|
||||
- memory allocation failures on *any* MPI rank during a parallel run
|
||||
will trigger an immediate abort of the entire parallel calculation
|
||||
instead of stalling it
|
||||
- a failing "new" will trigger an exception which is also captured by
|
||||
LAMMPS and triggers a global abort
|
||||
- allocation of multi-dimensional arrays will be done in a C compatible
|
||||
fashion but so that the storage of the actual data is stored in one
|
||||
large consecutive block and thus when MPI communication is needed,
|
||||
only this storage needs to be communicated (similar to Fortran arrays)
|
||||
- the "destroy()" and "sfree()" functions may safely be called on NULL
|
||||
pointers
|
||||
- the "destroy()" functions will nullify the pointer variables making
|
||||
"use after free" errors easy to detect
|
||||
- it is possible to use a larger than default memory alignment (not on
|
||||
all operating systems, since the allocated storage pointers must be
|
||||
compatible with ``free()`` for technical reasons)
|
||||
|
||||
In the practical implementation of code this means that any pointer variables
|
||||
that are class members should be initialized to a ``nullptr`` value in their
|
||||
respective constructors. That way it would be safe to call ``Memory::destroy()``
|
||||
or ``delete[]`` on them before *any* allocation outside the constructor.
|
||||
This helps to prevent memory leaks.
|
||||
@ -7,61 +7,6 @@ typically document what a variable stores, what a small section of
|
||||
code does, or what a function does and its input/outputs. The topics
|
||||
on this page are intended to document code functionality at a higher level.
|
||||
|
||||
Reading and parsing of text and text files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It is frequently required for a class in LAMMPS to read in additional
|
||||
data from a file, most commonly potential parameters from a potential
|
||||
file for manybody potentials. LAMMPS provides several custom classes
|
||||
and convenience functions to simplify the process. This offers the
|
||||
following benefits:
|
||||
|
||||
- better code reuse and fewer lines of code needed to implement reading
|
||||
and parsing data from a file
|
||||
- better detection of format errors, incompatible data, and better error messages
|
||||
- exit with an error message instead of silently converting only part of the
|
||||
text to a number or returning a 0 on unrecognized text and thus reading incorrect values
|
||||
- re-entrant code through avoiding global static variables (as used by ``strtok()``)
|
||||
- transparent support for translating unsupported UTF-8 characters to their ASCII equivalents
|
||||
(the text to value conversion functions **only** accept ASCII characters)
|
||||
|
||||
In most cases (e.g. potential files) the same data is needed on all MPI
|
||||
ranks. Then it is best to do the reading and parsing only on MPI rank
|
||||
0, and communicate the data later with one or more ``MPI_Bcast()``
|
||||
calls. For reading generic text and potential parameter files the
|
||||
custom classes :cpp:class:`TextFileReader <LAMMPS_NS::TextFileReader>`
|
||||
and :cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>`
|
||||
are available. Those classes allow to read the file as individual lines
|
||||
for which they can return a tokenizer class (see below) for parsing the
|
||||
line, or they can return blocks of numbers as a vector directly. The
|
||||
documentation on `File reader classes <file-reader-classes>`_ contains
|
||||
an example for a typical case.
|
||||
|
||||
When reading per-atom data, the data in the file usually needs include
|
||||
an atom ID so it can be associated with a particular atom. In that case
|
||||
the data can be read in multi-line chunks and broadcast to all MPI ranks
|
||||
with :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>`. Those chunks are then
|
||||
split into lines, parsed, and applied only to atoms the MPI rank
|
||||
"owns".
|
||||
|
||||
For splitting a string (incrementally) into words and optionally
|
||||
converting those to numbers, the :cpp:class:`Tokenizer
|
||||
<LAMMPS_NS::Tokenizer>` and :cpp:class:`ValueTokenizer
|
||||
<LAMMPS_NS::ValueTokenizer>` can be used. Those provide a superset of
|
||||
the functionality of ``strtok()`` from the C-library and the latter also
|
||||
includes conversion to different types. Any errors while processing the
|
||||
string in those classes will result in an exception, which can be caught
|
||||
and the error processed as needed. Unlike the C-library functions
|
||||
``atoi()``, ``atof()``, ``strtol()``, or ``strtod()`` the conversion
|
||||
will check if the converted text is a valid integer of floating point
|
||||
number and will not silently return an unexpected or incorrect value.
|
||||
For example, ``atoi()`` will return 12 when converting "12.5" while the
|
||||
ValueTokenizer class will throw an :cpp:class:`InvalidIntegerException
|
||||
<LAMMPS_NS::InvalidIntegerException>` if
|
||||
:cpp:func:`ValueTokenizer::next_int()
|
||||
<LAMMPS_NS::ValueTokenizer::next_int>` is called on the same string.
|
||||
|
||||
Fix contributions to instantaneous energy, virial, and cumulative energy
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -225,7 +225,7 @@ follows:
|
||||
commands in an input script.
|
||||
|
||||
- The Force class computes various forces between atoms. The Pair
|
||||
parent class is for non-bonded or pairwise forces, which in LAMMPS
|
||||
parent class is for non-bonded or pair-wise forces, which in LAMMPS
|
||||
also includes many-body forces such as the Tersoff 3-body potential if
|
||||
those are computed by walking pairwise neighbor lists. The Bond,
|
||||
Angle, Dihedral, Improper parent classes are styles for bonded
|
||||
|
||||
@ -1,155 +0,0 @@
|
||||
Platform abstraction functions
|
||||
------------------------------
|
||||
|
||||
The ``platform`` sub-namespace inside the ``LAMMPS_NS`` namespace
|
||||
provides a collection of wrapper and convenience functions and utilities
|
||||
that perform common tasks for which platform specific code would be
|
||||
required or for which a more high-level abstraction would be convenient
|
||||
and reduce duplicated code. This reduces redundant implementations and
|
||||
encourages consistent behavior and thus has some overlap with the
|
||||
:doc:`"utils" sub-namespace <Developer_utils>`.
|
||||
|
||||
Time functions
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: cputime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: walltime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: usleep
|
||||
:project: progguide
|
||||
|
||||
Platform information functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: os_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compiler_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: cxx_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: openmp_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_vendor
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compress_info
|
||||
:project: progguide
|
||||
|
||||
|
||||
File and path functions and global constants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: filepathsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenvariable:: pathvarsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: is_console
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_is_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: current_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: chdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mkdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: rmdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: unlink
|
||||
:project: progguide
|
||||
|
||||
Standard I/O function wrappers
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: END_OF_FILE
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftell
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: fseek
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftruncate
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: popen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: pclose
|
||||
:project: progguide
|
||||
|
||||
Environment variable functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: putenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: unsetenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_pathenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: find_exe_path
|
||||
:project: progguide
|
||||
|
||||
Dynamically loaded object or library functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: dlopen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlclose
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlsym
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlerror
|
||||
:project: progguide
|
||||
|
||||
Compressed file I/O functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: has_compress_extension
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_read
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_write
|
||||
:project: progguide
|
||||
@ -7,9 +7,7 @@ a collection of convenience functions and utilities that perform common
|
||||
tasks that are required repeatedly throughout the LAMMPS code like
|
||||
reading or writing to files with error checking or translation of
|
||||
strings into specific types of numbers with checking for validity. This
|
||||
reduces redundant implementations and encourages consistent behavior and
|
||||
thus has some overlap with the :doc:`"platform" sub-namespace
|
||||
<Developer_platform>`.
|
||||
reduces redundant implementations and encourages consistent behavior.
|
||||
|
||||
I/O with status check and similar functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -21,21 +19,18 @@ In that case, the functions will stop with an error message, indicating
|
||||
the name of the problematic file, if possible unless the *error* argument
|
||||
is a NULL pointer.
|
||||
|
||||
The :cpp:func:`utils::fgets_trunc() <LAMMPS_NS::utils::fgets_trunc>`
|
||||
function will work similar for ``fgets()`` but it will read in a whole
|
||||
line (i.e. until the end of line or end of file), but store only as many
|
||||
characters as will fit into the buffer including a final newline
|
||||
character and the terminating NULL byte. If the line in the file is
|
||||
longer it will thus be truncated in the buffer. This function is used
|
||||
by :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>` to read individual lines but
|
||||
make certain they follow the size constraints.
|
||||
The :cpp:func:`fgets_trunc` function will work similar for ``fgets()``
|
||||
but it will read in a whole line (i.e. until the end of line or end
|
||||
of file), but store only as many characters as will fit into the buffer
|
||||
including a final newline character and the terminating NULL byte.
|
||||
If the line in the file is longer it will thus be truncated in the buffer.
|
||||
This function is used by :cpp:func:`read_lines_from_file` to read individual
|
||||
lines but make certain they follow the size constraints.
|
||||
|
||||
The :cpp:func:`utils::read_lines_from_file()
|
||||
<LAMMPS_NS::utils::read_lines_from_file>` function will read the
|
||||
requested number of lines of a maximum length into a buffer and will
|
||||
return 0 if successful or 1 if not. It also guarantees that all lines
|
||||
are terminated with a newline character and the entire buffer with a
|
||||
The :cpp:func:`read_lines_from_file` function will read the requested
|
||||
number of lines of a maximum length into a buffer and will return 0
|
||||
if successful or 1 if not. It also guarantees that all lines are
|
||||
terminated with a newline character and the entire buffer with a
|
||||
NULL character.
|
||||
|
||||
----------
|
||||
@ -59,54 +54,33 @@ String to number conversions with validity check
|
||||
|
||||
These functions should be used to convert strings to numbers. They are
|
||||
are strongly preferred over C library calls like ``atoi()`` or
|
||||
``atof()`` since they check if the **entire** string is a valid
|
||||
``atof()`` since they check if the **entire** provided string is a valid
|
||||
(floating-point or integer) number, and will error out instead of
|
||||
silently returning the result of a partial conversion or zero in cases
|
||||
where the string is not a valid number. This behavior improves
|
||||
detecting typos or issues when processing input files.
|
||||
|
||||
Similarly the :cpp:func:`utils::logical() <LAMMPS_NS::utils::logical>` function
|
||||
will convert a string into a boolean and will only accept certain words.
|
||||
where the string is not a valid number. This behavior allows to more
|
||||
easily detect typos or issues when processing input files.
|
||||
|
||||
The *do_abort* flag should be set to ``true`` in case this function
|
||||
is called only on a single MPI rank, as that will then trigger the
|
||||
a call to ``Error::one()`` for errors instead of ``Error::all()``
|
||||
and avoids a "hanging" calculation when run in parallel.
|
||||
|
||||
Please also see :cpp:func:`utils::is_integer() <LAMMPS_NS::utils::is_integer>`
|
||||
and :cpp:func:`utils::is_double() <LAMMPS_NS::utils::is_double>` for testing
|
||||
Please also see :cpp:func:`is_integer() <LAMMPS_NS::utils::is_integer>`
|
||||
and :cpp:func:`is_double() <LAMMPS_NS::utils::is_double>` for testing
|
||||
strings for compliance without conversion.
|
||||
|
||||
----------
|
||||
|
||||
.. doxygenfunction:: numeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
.. doxygenfunction:: numeric
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
.. doxygenfunction:: inumeric
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: inumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
.. doxygenfunction:: bnumeric
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: bnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: tnumeric(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical(const char *file, int line, const std::string &str, bool do_abort, LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp)
|
||||
.. doxygenfunction:: tnumeric
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -121,12 +95,6 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: strdup
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: lowercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: uppercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: trim
|
||||
:project: progguide
|
||||
|
||||
@ -169,6 +137,21 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: is_double
|
||||
:project: progguide
|
||||
|
||||
File and path functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
Potential file functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -208,9 +191,6 @@ Convenience functions
|
||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: flush_buffers(LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: getsyserror
|
||||
:project: progguide
|
||||
|
||||
@ -343,11 +323,11 @@ This code example should produce the following output:
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::InvalidIntegerException
|
||||
:project: progguide
|
||||
:members:
|
||||
:members: what
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::InvalidFloatException
|
||||
:project: progguide
|
||||
:members:
|
||||
:members: what
|
||||
|
||||
----------
|
||||
|
||||
@ -396,26 +376,21 @@ A typical code segment would look like this:
|
||||
|
||||
----------
|
||||
|
||||
.. file-reader-classes:
|
||||
|
||||
File reader classes
|
||||
-------------------
|
||||
|
||||
The purpose of the file reader classes is to simplify the recurring task
|
||||
of reading and parsing files. They can use the
|
||||
:cpp:class:`ValueTokenizer <LAMMPS_NS::ValueTokenizer>` class to process
|
||||
the read in text. The :cpp:class:`TextFileReader
|
||||
<LAMMPS_NS::TextFileReader>` is a more general version while
|
||||
:cpp:class:`PotentialFileReader <LAMMPS_NS::PotentialFileReader>` is
|
||||
specialized to implement the behavior expected for looking up and
|
||||
reading/parsing files with potential parameters in LAMMPS. The
|
||||
potential file reader class requires a LAMMPS instance, requires to be
|
||||
run on MPI rank 0 only, will use the
|
||||
:cpp:func:`utils::get_potential_file_path
|
||||
<LAMMPS_NS::utils::get_potential_file_path>` function to look up and
|
||||
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
|
||||
aborted.
|
||||
:cpp:class:`LAMMPS_NS::ValueTokenizer` class to process the read in
|
||||
text. The :cpp:class:`LAMMPS_NS::TextFileReader` is a more general
|
||||
version while :cpp:class:`LAMMPS_NS::PotentialFileReader` is specialized
|
||||
to implement the behavior expected for looking up and reading/parsing
|
||||
files with potential parameters in LAMMPS. The potential file reader
|
||||
class requires a LAMMPS instance, requires to be run on MPI rank 0 only,
|
||||
will use the :cpp:func:`LAMMPS_NS::utils::get_potential_file_path`
|
||||
function to look up and 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 aborted.
|
||||
|
||||
.. code-block:: C++
|
||||
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
||||
@ -490,10 +465,10 @@ provided, as that is used to determine whether a new page of memory
|
||||
must be used.
|
||||
|
||||
The :cpp:class:`MyPage <LAMMPS_NS::MyPage>` class offers two ways to
|
||||
reserve a chunk: 1) with :cpp:func:`MyPage::get() <LAMMPS_NS::MyPage::get>` the
|
||||
chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
|
||||
reserve a chunk: 1) with :cpp:func:`get() <LAMMPS_NS::MyPage::get>` the
|
||||
chunk size needs to be known in advance, 2) with :cpp:func:`vget()
|
||||
<LAMMPS_NS::MyPage::vget>` a pointer to the next chunk is returned, but
|
||||
its size is registered later with :cpp:func:`MyPage::vgot()
|
||||
its size is registered later with :cpp:func:`vgot()
|
||||
<LAMMPS_NS::MyPage::vgot>`.
|
||||
|
||||
.. code-block:: C++
|
||||
@ -596,3 +571,4 @@ the communication buffers.
|
||||
|
||||
.. doxygenunion:: LAMMPS_NS::ubuf
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -29,9 +29,7 @@ of code in the header before include guards:
|
||||
.. code-block:: c
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
// clang-format off
|
||||
FixStyle(print/vel,FixPrintVel);
|
||||
// clang-format on
|
||||
FixStyle(print/vel,FixPrintVel)
|
||||
#else
|
||||
/* the definition of the FixPrintVel class comes here */
|
||||
...
|
||||
@ -55,7 +53,7 @@ of each timestep. First of all, implement a constructor:
|
||||
if (narg < 4)
|
||||
error->all(FLERR,"Illegal fix print/vel command");
|
||||
|
||||
nevery = utils::inumeric(FLERR,arg[3],false,lmp);
|
||||
nevery = force->inumeric(FLERR,arg[3]);
|
||||
if (nevery <= 0)
|
||||
error->all(FLERR,"Illegal fix print/vel command");
|
||||
}
|
||||
|
||||
@ -1941,9 +1941,6 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
*Compute ID for fix numdiff does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
*Compute ID for fix numdiff/virial does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
*Compute ID for fix store/state does not exist*
|
||||
Self-explanatory.
|
||||
|
||||
@ -3799,10 +3796,6 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
Self-explanatory. Efficient loop over all atoms for numerical
|
||||
difference requires consecutive atom IDs.
|
||||
|
||||
*Fix numdiff/virial must use group all*
|
||||
Virial contributions computed by this fix are
|
||||
computed on all atoms.
|
||||
|
||||
*Fix nve/asphere requires extended particles*
|
||||
This fix can only be used for particles with a shape setting.
|
||||
|
||||
@ -7779,6 +7772,9 @@ keyword to allow for additional bonds to be formed
|
||||
The system size must fit in a 32-bit integer to use this dump
|
||||
style.
|
||||
|
||||
*Too many atoms to dump sort*
|
||||
Cannot sort when running with more than 2\^31 atoms.
|
||||
|
||||
*Too many elements extracted from MEAM library.*
|
||||
Increase 'maxelt' in meam.h and recompile.
|
||||
|
||||
|
||||
@ -416,7 +416,7 @@ This will most likely cause errors in kinetic fluctuations.
|
||||
not defined for the specified atom style.
|
||||
|
||||
*Molecule has bond topology but no special bond settings*
|
||||
This means the bonded atoms will not be excluded in pairwise
|
||||
This means the bonded atoms will not be excluded in pair-wise
|
||||
interactions.
|
||||
|
||||
*Molecule template for create_atoms has multiple molecules*
|
||||
|
||||
@ -80,7 +80,7 @@ Lowercase directories
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| friction | frictional contact of spherical asperities between 2d surfaces |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| mc | Monte Carlo features via fix gcmc, widom and other commands |
|
||||
| gcmc | Grand Canonical Monte Carlo (GCMC) via the fix gcmc command |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| granregion | use of fix wall/region/gran as boundary on granular particles |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
@ -205,7 +205,7 @@ Uppercase directories
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| KAPPA | compute thermal conductivity via several methods |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| MC-LOOP | using LAMMPS in a Monte Carlo mode to relax the energy of a system in a input script loop |
|
||||
| MC | using LAMMPS in a Monte Carlo mode to relax the energy of a system |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| PACKAGES | examples for specific packages and contributed commands |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
|
||||
@ -491,6 +491,11 @@ NPT ensemble using Nose-Hoover thermostat:
|
||||
**(Schroeder)** Schroeder and Steinhauser, J Chem Phys, 133,
|
||||
154511 (2010).
|
||||
|
||||
.. _Jiang2:
|
||||
|
||||
**(Jiang)** Jiang, Hardy, Phillips, MacKerell, Schulten, and Roux,
|
||||
J Phys Chem Lett, 2, 87-92 (2011).
|
||||
|
||||
.. _Thole2:
|
||||
|
||||
**(Thole)** Chem Phys, 59, 341 (1981).
|
||||
|
||||
@ -7,11 +7,11 @@ LAMMPS GitHub tutorial
|
||||
|
||||
This document describes the process of how to use GitHub to integrate
|
||||
changes or additions you have made to LAMMPS into the official LAMMPS
|
||||
distribution. It uses the process of updating this very tutorial as an
|
||||
example to describe the individual steps and options. You need to be
|
||||
familiar with git and you may want to have a look at the `git book
|
||||
<http://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||
more advanced git features used below.
|
||||
distribution. It uses the process of updating this very tutorial as
|
||||
an example to describe the individual steps and options. You need to
|
||||
be familiar with git and you may want to have a look at the
|
||||
`git book <http://git-scm.com/book/>`_ to reacquaint yourself with some
|
||||
of the more advanced git features used below.
|
||||
|
||||
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
||||
on GitHub is the preferred option for integrating contributed features
|
||||
@ -37,15 +37,15 @@ username or e-mail address and password.
|
||||
**Forking the repository**
|
||||
|
||||
To get changes into LAMMPS, you need to first fork the `lammps/lammps`
|
||||
repository on GitHub. At the time of writing, *develop* is the preferred
|
||||
repository on GitHub. At the time of writing, *master* is the preferred
|
||||
target branch. Thus go to `LAMMPS on GitHub <https://github.com/lammps/lammps>`_
|
||||
and make sure branch is set to "develop", as shown in the figure below.
|
||||
and make sure branch is set to "master", as shown in the figure below.
|
||||
|
||||
.. image:: JPG/tutorial_branch.png
|
||||
:align: center
|
||||
|
||||
If it is not, use the button to change it to *develop*. Once it is, use
|
||||
the fork button to create a fork.
|
||||
If it is not, use the button to change it to *master*\ . Once it is, use the
|
||||
fork button to create a fork.
|
||||
|
||||
.. image:: JPG/tutorial_fork.png
|
||||
:align: center
|
||||
@ -64,12 +64,11 @@ LAMMPS development.
|
||||
**Adding changes to your own fork**
|
||||
|
||||
Additions to the upstream version of LAMMPS are handled using *feature
|
||||
branches*. For every new feature, a so-called feature branch is
|
||||
branches*\ . For every new feature, a so-called feature branch is
|
||||
created, which contains only those modification relevant to one specific
|
||||
feature. For example, adding a single fix would consist of creating a
|
||||
branch with only the fix header and source file and nothing else. It is
|
||||
explained in more detail here: `feature branch workflow
|
||||
<https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
explained in more detail here: `feature branch workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
|
||||
**Feature branches**
|
||||
|
||||
@ -95,8 +94,8 @@ The above command copies ("clones") the git repository to your local
|
||||
machine to a directory with the name you chose. If none is given, it will
|
||||
default to "lammps". Typical names are "mylammps" or something similar.
|
||||
|
||||
You can use this local clone to make changes and test them without
|
||||
interfering with the repository on GitHub.
|
||||
You can use this local clone to make changes and
|
||||
test them without interfering with the repository on GitHub.
|
||||
|
||||
To pull changes from upstream into this copy, you can go to the directory
|
||||
and use git pull:
|
||||
@ -104,46 +103,28 @@ and use git pull:
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd mylammps
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
$ git checkout master
|
||||
$ git pull https://github.com/lammps/lammps
|
||||
|
||||
You can also add this URL as a remote:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git remote add upstream https://www.github.com/lammps/lammps
|
||||
$ git remote add lammps_upstream https://www.github.com/lammps/lammps
|
||||
|
||||
From then on you can update your upstream branches with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
|
||||
and then refer to the upstream repository branches with
|
||||
`upstream/develop` or `upstream/release` and so on.
|
||||
|
||||
At this point, you typically make a feature branch from the updated
|
||||
At this point, you typically make a feature branch from the updated master
|
||||
branch for the feature you want to work on. This tutorial contains the
|
||||
workflow that updated this tutorial, and hence we will call the branch
|
||||
"github-tutorial-update":
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
$ git checkout -b github-tutorial-update upstream/develop
|
||||
$ git checkout -b github-tutorial-update master
|
||||
|
||||
Now that we have changed branches, we can make our changes to our local
|
||||
repository. Just remember that if you want to start working on another,
|
||||
unrelated feature, you should switch branches!
|
||||
|
||||
.. note::
|
||||
|
||||
Committing changes to the *develop*, *release*, or *stable* branches
|
||||
is strongly discouraged. While it may be convenient initially, it
|
||||
will create more work in the long run. Various texts and tutorials
|
||||
on using git effectively discuss the motivation for using feature
|
||||
branches instead.
|
||||
|
||||
**After changes are made**
|
||||
|
||||
After everything is done, add the files to the branch and commit them:
|
||||
@ -306,32 +287,28 @@ After each push, the automated checks are run again.
|
||||
|
||||
LAMMPS developers may add labels to your pull request to assign it to
|
||||
categories (mostly for bookkeeping purposes), but a few of them are
|
||||
important: *needs_work*, *work_in_progress*, *run_tests*,
|
||||
*test_for_regression*, and *ready_for_merge*. The first two indicate,
|
||||
that your pull request is not considered to be complete. With
|
||||
"needs_work" the burden is on exclusively on you; while
|
||||
"work_in_progress" can also mean, that a LAMMPS developer may want to
|
||||
add changes. Please watch the comments to the pull requests. The two
|
||||
"test" labels are used to trigger extended tests before the code is
|
||||
merged. This is sometimes done by LAMMPS developers, if they suspect
|
||||
that there may be some subtle side effects from your changes. It is not
|
||||
done by default, because those tests are very time consuming. The
|
||||
*ready_for_merge* label is usually attached when the LAMMPS developer
|
||||
assigned to the pull request considers this request complete and to
|
||||
trigger a final full test evaluation.
|
||||
important: needs_work, work_in_progress, test-for-regression, and
|
||||
full-regression-test. The first two indicate, that your pull request
|
||||
is not considered to be complete. With "needs_work" the burden is on
|
||||
exclusively on you; while "work_in_progress" can also mean, that a
|
||||
LAMMPS developer may want to add changes. Please watch the comments
|
||||
to the pull requests. The two "test" labels are used to trigger
|
||||
extended tests before the code is merged. This is sometimes done by
|
||||
LAMMPS developers, if they suspect that there may be some subtle
|
||||
side effects from your changes. It is not done by default, because
|
||||
those tests are very time consuming.
|
||||
|
||||
**Reviews**
|
||||
|
||||
As of Fall 2021, a pull request needs to pass all automatic tests and at
|
||||
least 1 approving review from a LAMMPS developer with write access to
|
||||
the repository before it is eligible for merging. In case your changes
|
||||
touch code that certain developers are associated with, they are
|
||||
auto-requested by the GitHub software. Those associations are set in
|
||||
the file `.github/CODEOWNERS
|
||||
<https://github.com/lammps/lammps/blob/develop/.github/CODEOWNERS>`_ Thus
|
||||
if you want to be automatically notified to review when anybody changes
|
||||
files or packages, that **you** have contributed to LAMMPS, you can add
|
||||
suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
As of Summer 2018, a pull request needs at least 1 approving review
|
||||
from a LAMMPS developer with write access to the repository.
|
||||
In case your changes touch code that certain developers are associated
|
||||
with, they are auto-requested by the GitHub software. Those associations
|
||||
are set in the file
|
||||
`.github/CODEOWNERS <https://github.com/lammps/lammps/blob/master/.github/CODEOWNERS>`_
|
||||
Thus if you want to be automatically notified to review when anybody
|
||||
changes files or packages, that you have contributed to LAMMPS, you can
|
||||
add suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
|
||||
Otherwise, you can also manually request reviews from specific developers,
|
||||
or LAMMPS developers - in their assessment of your pull request - may
|
||||
@ -352,7 +329,7 @@ LAMMPS developer (including him/herself) or c) Axel Kohlmeyer (akohlmey).
|
||||
After the review, the developer can choose to implement changes directly
|
||||
or suggest them to you.
|
||||
* Case c) means that the pull request has been assigned to the developer
|
||||
overseeing the merging of pull requests into the *develop* branch.
|
||||
overseeing the merging of pull requests into the master branch.
|
||||
|
||||
In this case, Axel assigned the tutorial to Steve:
|
||||
|
||||
@ -374,11 +351,11 @@ Sometimes, however, you might not feel comfortable having other people
|
||||
push changes into your own branch, or maybe the maintainers are not sure
|
||||
their idea was the right one. In such a case, they can make changes,
|
||||
reassign you as the assignee, and file a "reverse pull request", i.e.
|
||||
file a pull request in **your** forked GitHub repository to include
|
||||
changes in the branch, that you have submitted as a pull request
|
||||
yourself. In that case, you can choose to merge their changes back into
|
||||
your branch, possibly make additional changes or corrections and proceed
|
||||
from there. It looks something like this:
|
||||
file a pull request in your GitHub repository to include changes in the
|
||||
branch, that you have submitted as a pull request yourself. In that
|
||||
case, you can choose to merge their changes back into your branch,
|
||||
possibly make additional changes or corrections and proceed from there.
|
||||
It looks something like this:
|
||||
|
||||
.. image:: JPG/tutorial_reverse_pull_request.png
|
||||
:align: center
|
||||
@ -442,7 +419,7 @@ This merge also shows up on the lammps GitHub page:
|
||||
|
||||
**After a merge**
|
||||
|
||||
When everything is fine, the feature branch is merged into the *develop* branch:
|
||||
When everything is fine, the feature branch is merged into the master branch:
|
||||
|
||||
.. image:: JPG/tutorial_merged.png
|
||||
:align: center
|
||||
@ -456,8 +433,8 @@ branch!
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
$ git checkout master
|
||||
$ git pull master
|
||||
$ git branch -d github-tutorial-update
|
||||
|
||||
If you do not pull first, it is not really a problem but git will warn
|
||||
@ -465,7 +442,6 @@ you at the next statement that you are deleting a local branch that
|
||||
was not yet fully merged into HEAD. This is because git does not yet
|
||||
know your branch just got merged into LAMMPS upstream. If you
|
||||
first delete and then pull, everything should still be fine.
|
||||
You can display all branches that are fully merged by:
|
||||
|
||||
Finally, if you delete the branch locally, you might want to push this
|
||||
to your remote(s) as well:
|
||||
@ -477,14 +453,14 @@ to your remote(s) as well:
|
||||
**Recent changes in the workflow**
|
||||
|
||||
Some changes to the workflow are not captured in this tutorial. For
|
||||
example, in addition to the *develop* branch, to which all new features
|
||||
should be submitted, there is also a *release* and a *stable* branch;
|
||||
these have the same content as *develop*, but are only updated after a
|
||||
patch release or stable release was made. Furthermore, the naming of
|
||||
the patches now follow the pattern "patch_<Day><Month><Year>" to
|
||||
simplify comparisons between releases. Finally, all patches and
|
||||
submissions are subject to automatic testing and code checks to make
|
||||
sure they at the very least compile.
|
||||
example, in addition to the master branch, to which all new features
|
||||
should be submitted, there is now also an "unstable" and a "stable"
|
||||
branch; these have the same content as "master", but are only updated
|
||||
after a patch release or stable release was made.
|
||||
Furthermore, the naming of the patches now follow the pattern
|
||||
"patch_<Day><Month><Year>" to simplify comparisons between releases.
|
||||
Finally, all patches and submissions are subject to automatic testing
|
||||
and code checks to make sure they at the very least compile.
|
||||
|
||||
A discussion of the LAMMPS developer GitHub workflow can be found in the file
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/master/doc/github-development-workflow.md>`_
|
||||
|
||||
@ -545,6 +545,6 @@ Feedback and Contributing
|
||||
-------------------------
|
||||
|
||||
If you find this Python interface useful, please feel free to provide feedback
|
||||
and ideas on how to improve it to Richard Berger (richard.berger@outlook.com). We also
|
||||
and ideas on how to improve it to Richard Berger (richard.berger@temple.edu). We also
|
||||
want to encourage people to write tutorial style IPython notebooks showcasing LAMMPS usage
|
||||
and maybe their latest research results.
|
||||
|
||||
@ -2,8 +2,8 @@ Thermostats
|
||||
===========
|
||||
|
||||
Thermostatting means controlling the temperature of particles in an MD
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling
|
||||
the pressure. Since the pressure includes a kinetic component due to
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling the
|
||||
pressure. Since the pressure includes a kinetic component due to
|
||||
particle velocities, both these operations require calculation of the
|
||||
temperature. Typically a target temperature (T) and/or pressure (P)
|
||||
is specified by the user, and the thermostat or barostat attempts to
|
||||
@ -26,13 +26,11 @@ can be invoked via the *dpd/tstat* pair style:
|
||||
* :doc:`pair_style dpd/tstat <pair_dpd>`
|
||||
|
||||
:doc:`Fix nvt <fix_nh>` only thermostats the translational velocity of
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this,
|
||||
except that it subtracts out a velocity bias due to a deforming box
|
||||
and integrates the SLLOD equations of motion. See the :doc:`Howto
|
||||
nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere
|
||||
<fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>`
|
||||
thermostat not only translation velocities but also rotational
|
||||
velocities for spherical and aspherical particles.
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this, except
|
||||
that it subtracts out a velocity bias due to a deforming box and
|
||||
integrates the SLLOD equations of motion. See the :doc:`Howto nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere <fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>` thermostat not only translation
|
||||
velocities but also rotational velocities for spherical and aspherical
|
||||
particles.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -42,31 +40,25 @@ velocities for spherical and aspherical particles.
|
||||
e.g. molecular systems. The latter can be tricky to do correctly.
|
||||
|
||||
DPD thermostatting alters pairwise interactions in a manner analogous
|
||||
to the per-particle thermostatting of :doc:`fix langevin
|
||||
<fix_langevin>`.
|
||||
to the per-particle thermostatting of :doc:`fix langevin <fix_langevin>`.
|
||||
|
||||
Any of the thermostatting fixes can be instructed to use custom
|
||||
temperature computes that remove bias which has two effects: first,
|
||||
the current calculated temperature, which is compared to the requested
|
||||
target temperature, is calculated with the velocity bias removed;
|
||||
second, the thermostat adjusts only the thermal temperature component
|
||||
of the particle's velocities, which are the velocities with the bias
|
||||
removed. The removed bias is then added back to the adjusted
|
||||
velocities. See the doc pages for the individual fixes and for the
|
||||
:doc:`fix_modify <fix_modify>` command for instructions on how to
|
||||
assign a temperature compute to a thermostatting fix.
|
||||
Any of the thermostatting fixes can be instructed to use custom temperature
|
||||
computes that remove bias which has two effects: first, the current
|
||||
calculated temperature, which is compared to the requested target temperature,
|
||||
is calculated with the velocity bias removed; second, the thermostat adjusts
|
||||
only the thermal temperature component of the particle's velocities, which are
|
||||
the velocities with the bias removed. The removed bias is then added back
|
||||
to the adjusted velocities. See the doc pages for the individual
|
||||
fixes and for the :doc:`fix_modify <fix_modify>` command for
|
||||
instructions on how to assign a temperature compute to a
|
||||
thermostatting fix. For example, you can apply a thermostat to only
|
||||
the x and z components of velocity by using it in conjunction with
|
||||
:doc:`compute temp/partial <compute_temp_partial>`. Of you could
|
||||
thermostat only the thermal temperature of a streaming flow of
|
||||
particles without affecting the streaming velocity, by using
|
||||
:doc:`compute temp/profile <compute_temp_profile>`.
|
||||
|
||||
For example, you can apply a thermostat only to atoms in a spatial
|
||||
region by using it in conjunction with :doc:`compute temp/region
|
||||
<compute_temp_region>`. Or you can apply a thermostat to only the x
|
||||
and z components of velocity by using it with :doc:`compute
|
||||
temp/partial <compute_temp_partial>`. Of you could thermostat only
|
||||
the thermal temperature of a streaming flow of particles without
|
||||
affecting the streaming velocity, by using :doc:`compute temp/profile
|
||||
<compute_temp_profile>`.
|
||||
|
||||
Below is a list of custom temperature computes that can be used like
|
||||
that:
|
||||
Below is a list of some custom temperature computes that can be used like that:
|
||||
|
||||
* :doc:`compute_temp_asphere`
|
||||
* :doc:`compute_temp_body`
|
||||
@ -80,6 +72,8 @@ that:
|
||||
* :doc:`compute_temp_rotate`
|
||||
* :doc:`compute_temp_sphere`
|
||||
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Only the nvt fixes perform time integration, meaning they update
|
||||
@ -92,17 +86,17 @@ that:
|
||||
* :doc:`fix nve/sphere <fix_nve_sphere>`
|
||||
* :doc:`fix nve/asphere <fix_nve_asphere>`
|
||||
|
||||
Thermodynamic output, which can be setup via the :doc:`thermo_style
|
||||
<thermo_style>` command, often includes temperature values. As
|
||||
explained on the page for the :doc:`thermo_style <thermo_style>`
|
||||
command, the default temperature is setup by the thermo command
|
||||
itself. It is NOT the temperature associated with any thermostatting
|
||||
fix you have defined or with any compute you have defined that
|
||||
calculates a temperature. The doc pages for the thermostatting fixes
|
||||
explain the ID of the temperature compute they create. Thus if you
|
||||
want to view these temperatures, you need to specify them explicitly
|
||||
via the :doc:`thermo_style custom <thermo_style>` command. Or you can
|
||||
use the :doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
Thermodynamic output, which can be setup via the
|
||||
:doc:`thermo_style <thermo_style>` command, often includes temperature
|
||||
values. As explained on the page for the
|
||||
:doc:`thermo_style <thermo_style>` command, the default temperature is
|
||||
setup by the thermo command itself. It is NOT the temperature
|
||||
associated with any thermostatting fix you have defined or with any
|
||||
compute you have defined that calculates a temperature. The doc pages
|
||||
for the thermostatting fixes explain the ID of the temperature compute
|
||||
they create. Thus if you want to view these temperatures, you need to
|
||||
specify them explicitly via the :doc:`thermo_style custom <thermo_style>` command. Or you can use the
|
||||
:doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
temperature compute is used for default thermodynamic output.
|
||||
|
||||
----------
|
||||
|
||||
@ -9,8 +9,7 @@ has several advantages:
|
||||
command.
|
||||
* You can create your own development branches to add code to LAMMPS.
|
||||
* You can submit your new features back to GitHub for inclusion in
|
||||
LAMMPS. For that you should first create your own :doc:`fork on
|
||||
GitHub <Howto_github>`.
|
||||
LAMMPS.
|
||||
|
||||
You must have `git <git_>`_ installed on your system to use the
|
||||
commands explained below to communicate with the git servers on
|
||||
@ -21,56 +20,35 @@ provides `limited support for subversion clients <svn_>`_.
|
||||
|
||||
As of October 2016, the official home of public LAMMPS development is
|
||||
on GitHub. The previously advertised LAMMPS git repositories on
|
||||
git.lammps.org and bitbucket.org are now offline or deprecated.
|
||||
git.lammps.org and bitbucket.org are now deprecated or offline.
|
||||
|
||||
.. _git: https://git-scm.com
|
||||
.. _svn: https://help.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github
|
||||
|
||||
You can follow the LAMMPS development on 3 different git branches:
|
||||
You can follow LAMMPS development on 3 different git branches:
|
||||
|
||||
* **stable** : this branch is updated from the *release* branch with
|
||||
every stable release version and also has selected bug fixes and updates
|
||||
back-ported from the *develop* branch
|
||||
* **release** : this branch is updated with every patch release;
|
||||
updates are always "fast forward" merges from *develop*
|
||||
* **develop** : this branch follows the ongoing development and
|
||||
is updated with every merge commit of a pull request
|
||||
* **stable** : this branch is updated with every stable release
|
||||
* **unstable** : this branch is updated with every patch release
|
||||
* **master** : this branch continuously follows ongoing development
|
||||
|
||||
To access the git repositories on your box, use the clone command to
|
||||
create a local copy of the LAMMPS repository with a command like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||
$ git clone -b unstable https://github.com/lammps/lammps.git mylammps
|
||||
|
||||
where "mylammps" is the name of the directory you wish to create on
|
||||
your machine and "release" is one of the 3 branches listed above.
|
||||
your machine and "unstable" is one of the 3 branches listed above.
|
||||
(Note that you actually download all 3 branches; you can switch
|
||||
between them at any time using "git checkout <branch name>".)
|
||||
|
||||
.. admonition:: Saving time and disk space when using ``git clone``
|
||||
|
||||
The complete git history of the LAMMPS project is quite large because
|
||||
it contains the entire commit history of the project since fall 2006,
|
||||
which includes the time when LAMMPS was managed with subversion.
|
||||
This includes a few commits that have added and removed some large
|
||||
files (mostly by accident). If you do not need access to the entire
|
||||
commit history (most people don't), you can speed up the "cloning"
|
||||
process and reduce local disk space requirements by using the
|
||||
*--depth* git command line flag. That will create a "shallow clone"
|
||||
of the repository containing only a subset of the git history. Using
|
||||
a depth of 1000 is usually sufficient to include the head commits of
|
||||
the *develop* and the *release* branches. To include the head commit
|
||||
of the *stable* branch you may need a depth of up to 10000. If you
|
||||
later need more of the git history, you can always convert the
|
||||
shallow clone into a "full clone".
|
||||
|
||||
Once the command completes, your directory will contain the same files
|
||||
as if you unpacked a current LAMMPS tarball, with the exception, that
|
||||
the HTML documentation files are not included. They can be fetched
|
||||
from the LAMMPS website by typing ``make fetch`` in the doc directory.
|
||||
Or they can be generated from the content provided in ``doc/src`` by
|
||||
typing ``make html`` from the ``doc`` directory.
|
||||
Or they can be generated from the content provided in doc/src by
|
||||
typing ``make html`` from the doc directory.
|
||||
|
||||
After initial cloning, as bug fixes and new features are added to
|
||||
LAMMPS you can stay up-to-date by typing the following git commands
|
||||
@ -78,9 +56,9 @@ from within the "mylammps" directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout release # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout develop # to choose the branch to follow
|
||||
$ git checkout unstable # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout master # to choose the branch to follow
|
||||
$ git pull
|
||||
|
||||
Doing a "pull" will not change any files you have added to the LAMMPS
|
||||
@ -103,7 +81,7 @@ Stable versions and what tagID to use for a particular stable version
|
||||
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
||||
Note that this command will print some warnings, because in order to get
|
||||
back to the latest revision and to be able to update with ``git pull``
|
||||
again, you will need to do ``git checkout release`` (or
|
||||
again, you will need to do ``git checkout unstable`` (or
|
||||
check out any other desired branch) first.
|
||||
|
||||
Once you have updated your local files with a ``git pull`` (or ``git
|
||||
|
||||
@ -8,7 +8,7 @@ University:
|
||||
* Aidan Thompson, athomps at sandia.gov
|
||||
* Stan Moore, stamoor at sandia.gov
|
||||
* Axel Kohlmeyer, akohlmey at gmail.com
|
||||
* Richard Berger, richard.berger at outlook.com
|
||||
* Richard Berger, richard.berger at temple.edu
|
||||
|
||||
.. _sjp: http://www.cs.sandia.gov/~sjplimp
|
||||
.. _lws: https://www.lammps.org
|
||||
|
||||
@ -19,7 +19,7 @@ software and open-source distribution, see `www.gnu.org <gnuorg_>`_
|
||||
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
|
||||
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
||||
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/develop/LICENSE
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
|
||||
|
||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ functions. They do not directly call the LAMMPS library.
|
||||
- :cpp:func:`lammps_fix_external_set_virial_peratom`
|
||||
- :cpp:func:`lammps_fix_external_set_vector_length`
|
||||
- :cpp:func:`lammps_fix_external_set_vector`
|
||||
- :cpp:func:`lammps_flush_buffers`
|
||||
- :cpp:func:`lammps_free`
|
||||
- :cpp:func:`lammps_is_running`
|
||||
- :cpp:func:`lammps_force_timeout`
|
||||
@ -73,11 +72,6 @@ where such memory buffers were allocated that require the use of
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_flush_buffers
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_free
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -7,34 +7,26 @@ correctly and reliably at all times. You can follow its development
|
||||
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
|
||||
|
||||
Whenever we fix a bug or update or add a feature, it will be merged into
|
||||
the *develop* branch of the git repository. When a sufficient number of
|
||||
the `master` branch of the git repository. When a sufficient number of
|
||||
changes have accumulated *and* the software passes a set of automated
|
||||
tests, we release it in the next *patch* release, which are made every
|
||||
few weeks. The *release* branch of the git repository is updated with
|
||||
every such release. Info on patch releases are on `this website page
|
||||
few weeks. Info on patch releases are on `this website page
|
||||
<https://www.lammps.org/bug.html>`_.
|
||||
|
||||
Once or twice a year, we apply only bug fixes and small, non-intrusive
|
||||
changes to the *develop* branch and the code is subjected to more detailed
|
||||
Once or twice a year, only bug fixes and small, non-intrusive changes are
|
||||
included for a period of time, and the code is subjected to more detailed
|
||||
and thorough testing than the default automated testing. The latest
|
||||
patch release after such a period is then also labeled as a *stable* version
|
||||
and the *stable* branch is updated with it. Between stable releases
|
||||
we occasionally release some updates to the stable release containing
|
||||
only bug fixes and updates back-ported from *develop* but no new features
|
||||
and update the *stable* branch accordingly.
|
||||
patch release after such a period is then labeled as a *stable* version.
|
||||
|
||||
Each version of LAMMPS contains all the documented features up to and
|
||||
including its version date.
|
||||
Each version of LAMMPS contains all the features and bug-fixes up to
|
||||
and including its version date.
|
||||
|
||||
The version date is printed to the screen and logfile every time you
|
||||
run LAMMPS. It is also in the file src/version.h and in the LAMMPS
|
||||
directory name created when you unpack a tarball. And it is on the
|
||||
first page of the :doc:`manual <Manual>`.
|
||||
|
||||
* If you browse the HTML pages on the LAMMPS WWW site, they will by
|
||||
default describe the most current patch release version of LAMMPS.
|
||||
In the navigation bar on the bottom left, there is the option to
|
||||
view instead the documentation for the most recent *stable* version
|
||||
or the latest version from the current development branch.
|
||||
* If you browse the HTML pages on the LAMMPS WWW site, they always
|
||||
describe the most current patch release of LAMMPS.
|
||||
* If you browse the HTML pages included in your tarball, they
|
||||
describe the version you have, which may be older.
|
||||
|
||||
@ -12,24 +12,24 @@ includes some optional methods to enable its use with rRESPA.
|
||||
|
||||
Here is a brief description of the class methods in pair.h:
|
||||
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| compute | workhorse routine that computes pairwise interactions |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| settings | reads the input script line with arguments you define |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one i,j type pair |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+---------------------------------+---------------------------------------------------------------------+
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| compute | workhorse routine that computes pairwise interactions |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| settings | reads the input script line with arguments you define |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| coeff | set coefficients for one i,j type pair |
|
||||
+---------------------------------+-------------------------------------------------------------------+
|
||||
| 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 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.
|
||||
|
||||
@ -305,40 +305,6 @@ you are uncertain, please ask.
|
||||
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
||||
convenience function where possible.
|
||||
|
||||
- Usage of C++11 `virtual`, `override`, `final` keywords: Please follow the
|
||||
`C++ Core Guideline C.128 <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override>`_.
|
||||
That means, you should only use `virtual` to declare a new virtual
|
||||
function, `override` to indicate you are overriding an existing virtual
|
||||
function, and `final` to prevent any further overriding.
|
||||
|
||||
- Trivial destructors: Prefer not writing destructors when they are empty and `default`.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// don't write destructors for A or B like this
|
||||
class A : protected Pointers {
|
||||
public:
|
||||
A();
|
||||
~A() override {}
|
||||
};
|
||||
|
||||
class B : protected Pointers {
|
||||
public:
|
||||
B();
|
||||
~B() override = default;
|
||||
};
|
||||
|
||||
// instead, let the compiler create the implicit default destructor by not writing it
|
||||
class A : protected Pointers {
|
||||
public:
|
||||
A();
|
||||
};
|
||||
|
||||
class B : protected Pointers {
|
||||
public:
|
||||
B();
|
||||
};
|
||||
|
||||
- Header files, especially those defining a "style", should only use
|
||||
the absolute minimum number of include files and **must not** contain
|
||||
any ``using`` statements. Typically that would be only the header for
|
||||
|
||||
@ -1880,12 +1880,6 @@ MPIIO library. It adds :doc:`dump styles <dump>` with a "mpiio" in
|
||||
their style name. Restart files with an ".mpiio" suffix are also
|
||||
written and read in parallel.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
|
||||
**Install:**
|
||||
|
||||
The MPIIO package requires that LAMMPS is build in :ref:`MPI parallel mode <serial>`.
|
||||
|
||||
@ -106,7 +106,7 @@ individual ranks. Here is an example output for this section:
|
||||
----------
|
||||
|
||||
The third section above lists the number of owned atoms (Nlocal),
|
||||
ghost atoms (Nghost), and pairwise neighbors stored per processor.
|
||||
ghost atoms (Nghost), and pair-wise neighbors stored per processor.
|
||||
The max and min values give the spread of these values across
|
||||
processors with a 10-bin histogram showing the distribution. The total
|
||||
number of histogram counts is equal to the number of processors.
|
||||
@ -114,7 +114,7 @@ number of histogram counts is equal to the number of processors.
|
||||
----------
|
||||
|
||||
The last section gives aggregate statistics (across all processors)
|
||||
for pairwise neighbors and special neighbors that LAMMPS keeps track
|
||||
for pair-wise neighbors and special neighbors that LAMMPS keeps track
|
||||
of (see the :doc:`special_bonds <special_bonds>` command). The number
|
||||
of times neighbor lists were rebuilt is tallied, as is the number of
|
||||
potentially *dangerous* rebuilds. If atom movement triggered neighbor
|
||||
|
||||
@ -14,7 +14,7 @@ Intel Xeon Phi co-processors.
|
||||
|
||||
The `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS
|
||||
website gives performance results for the various accelerator
|
||||
packages discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
packages discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page, for several of the standard LAMMPS benchmark problems, as a
|
||||
function of problem size and number of compute nodes, on different
|
||||
hardware platforms.
|
||||
|
||||
@ -214,7 +214,7 @@ threads/task as Nt. The product of these two values should be N, i.e.
|
||||
The default for the :doc:`package kokkos <package>` command when
|
||||
running on KNL is to use "half" neighbor lists and set the Newton flag
|
||||
to "on" for both pairwise and bonded interactions. This will typically
|
||||
be best for many-body potentials. For simpler pairwise potentials, it
|
||||
be best for many-body potentials. For simpler pair-wise potentials, it
|
||||
may be faster to use a "full" neighbor list with Newton flag to "off".
|
||||
Use the "-pk kokkos" :doc:`command-line switch <Run_options>` to change
|
||||
the default :doc:`package kokkos <package>` options. See its page for
|
||||
|
||||
@ -277,34 +277,17 @@ at ens-lyon.fr, alain.dequidt at uca.fr
|
||||
eam database tool
|
||||
-----------------------------
|
||||
|
||||
The tools/eam_database directory contains a Fortran and a Python program
|
||||
that will generate EAM alloy setfl potential files for any combination
|
||||
of the 17 elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg,
|
||||
Co, Ti, Zr, Cr. The files can then be used with the :doc:`pair_style
|
||||
eam/alloy <pair_eam>` command.
|
||||
The tools/eam_database directory contains a Fortran program that will
|
||||
generate EAM alloy setfl potential files for any combination of 16
|
||||
elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti,
|
||||
Zr. The files can then be used with the :doc:`pair_style eam/alloy <pair_eam>` command.
|
||||
|
||||
The Fortran version of the tool was authored by Xiaowang Zhou (Sandia),
|
||||
xzhou at sandia.gov, with updates from Lucas Hale (NIST) lucas.hale at
|
||||
nist.gov and is based on his paper:
|
||||
The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov,
|
||||
and is based on his paper:
|
||||
|
||||
X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69,
|
||||
144113 (2004).
|
||||
|
||||
The parameters for Cr were taken from:
|
||||
|
||||
Lin Z B, Johnson R A and Zhigilei L V, Phys. Rev. B 77 214108 (2008).
|
||||
|
||||
The Python version of the tool was authored by Germain Clavier
|
||||
(TU Eindhoven) g.m.g.c.clavier at tue.nl or germain.clavier at gmail.com
|
||||
|
||||
.. note::
|
||||
|
||||
The parameters in the database are only optimized for individual
|
||||
elements. The mixed parameters for interactions between different
|
||||
elements generated by this tool are derived from simple mixing rules
|
||||
and are thus inferior to parameterizations that are specifically
|
||||
optimized for specific mixtures and combinations of elements.
|
||||
|
||||
----------
|
||||
|
||||
.. _eamgn:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
@ -13,5 +13,5 @@ You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Accelerator packages <Speed_packages>` page for more
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
|
||||
@ -56,7 +56,23 @@ radian\^2.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
These accelerated styles are part of the GPU, INTEL, KOKKOS,
|
||||
OPENMP and OPT packages, respectively. They are only enabled if
|
||||
LAMMPS was built with those packages. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -64,44 +64,34 @@ These are the 4 coefficients for the :math:`E_a` formula:
|
||||
radians internally; hence the various :math:`K` are effectively energy
|
||||
per radian\^2 or radian\^3 or radian\^4.
|
||||
|
||||
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff
|
||||
<angle_coeff>` command in the input script lists 4 coefficients, the
|
||||
first of which is "bb" to indicate they are BondBond coefficients. In
|
||||
a data file, these coefficients should be listed under a "BondBond
|
||||
Coeffs" heading and you must leave out the "bb", i.e. only list 3
|
||||
coefficients after the angle type.
|
||||
For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
|
||||
command in the input script lists 4 coefficients, the first of which
|
||||
is "bb" to indicate they are BondBond coefficients. In a data file,
|
||||
these coefficients should be listed under a "BondBond Coeffs" heading
|
||||
and you must leave out the "bb", i.e. only list 3 coefficients after
|
||||
the angle type.
|
||||
|
||||
* bb
|
||||
* :math:`M` (energy/distance\^2)
|
||||
* :math:`r_1` (distance)
|
||||
* :math:`r_2` (distance)
|
||||
|
||||
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff
|
||||
<angle_coeff>` command in the input script lists 5 coefficients, the
|
||||
first of which is "ba" to indicate they are BondAngle coefficients.
|
||||
In a data file, these coefficients should be listed under a "BondAngle
|
||||
Coeffs" heading and you must leave out the "ba", i.e. only list 4
|
||||
coefficients after the angle type.
|
||||
For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff <angle_coeff>`
|
||||
command in the input script lists 5 coefficients, the first of which
|
||||
is "ba" to indicate they are BondAngle coefficients. In a data file,
|
||||
these coefficients should be listed under a "BondAngle Coeffs" heading
|
||||
and you must leave out the "ba", i.e. only list 4 coefficients after
|
||||
the angle type.
|
||||
|
||||
* ba
|
||||
* :math:`N_1` (energy/distance)
|
||||
* :math:`N_2` (energy/distance)
|
||||
* :math:`N_1` (energy/distance\^2)
|
||||
* :math:`N_2` (energy/distance\^2)
|
||||
* :math:`r_1` (distance)
|
||||
* :math:`r_2` (distance)
|
||||
|
||||
The :math:`\theta_0` value in the :math:`E_{ba}` formula is not specified,
|
||||
since it is the same value from the :math:`E_a` formula.
|
||||
|
||||
.. note::
|
||||
|
||||
It is important that the order of the I,J,K atoms in each angle
|
||||
listed in the Angles section of the data file read by the
|
||||
:doc:`read_data <read_data>` command be consistent with the order
|
||||
of the :math:`r_1` and :math:`r_2` BondBond and BondAngle
|
||||
coefficients. This is because the terms in the formulas for
|
||||
:math:`E_{bb}` and :math:`E_{ba}` will use the I,J atoms to compute
|
||||
:math:`r_{ij}` and the J,K atoms to compute :math:`r_{jk}`.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
@ -319,9 +319,28 @@ styles; see the :doc:`Modify <Modify>` doc page.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
Styles with a *kk* suffix are functionally the same as the
|
||||
corresponding style without the suffix. They have been optimized to
|
||||
run faster, depending on your available hardware, as discussed in on
|
||||
the :doc:`Speed packages <Speed_packages>` doc page. The accelerated
|
||||
styles take the same arguments and should produce the same results,
|
||||
except for round-off and precision issues.
|
||||
|
||||
----------
|
||||
Note that other acceleration packages in LAMMPS, specifically the GPU,
|
||||
INTEL, OPENMP, and OPT packages do not use accelerated atom
|
||||
styles.
|
||||
|
||||
The accelerated styles are part of the KOKKOS package. They are only
|
||||
enabled if LAMMPS was built with those packages. See the :doc:`Build
|
||||
package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line
|
||||
switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -383,7 +383,7 @@ multiple groups, its weight is the product of the weight factors.
|
||||
|
||||
This weight style is useful in combination with pair style
|
||||
:doc:`hybrid <pair_hybrid>`, e.g. when combining a more costly many-body
|
||||
potential with a fast pairwise potential. It is also useful when
|
||||
potential with a fast pair-wise potential. It is also useful when
|
||||
using :doc:`run_style respa <run_style>` where some portions of the
|
||||
system have many bonded interactions and others none. It assumes that
|
||||
the computational cost for each group remains constant over time.
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
.. index:: bond_style fene
|
||||
.. index:: bond_style fene/nm
|
||||
.. index:: bond_style fene/intel
|
||||
.. index:: bond_style fene/kk
|
||||
.. index:: bond_style fene/omp
|
||||
@ -9,16 +8,12 @@ bond_style fene command
|
||||
|
||||
Accelerator Variants: *fene/intel*, *fene/kk*, *fene/omp*
|
||||
|
||||
bond_style fene/nm command
|
||||
==========================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
bond_style fene
|
||||
bond_style fene/nm
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -28,9 +23,6 @@ Examples
|
||||
bond_style fene
|
||||
bond_coeff 1 30.0 1.5 1.0 1.0
|
||||
|
||||
bond_style fene/nm
|
||||
bond_coeff 1 2.25344 1.5 1.0 1.12246 2 6
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
@ -46,36 +38,16 @@ term is attractive, the second Lennard-Jones term is repulsive. The
|
||||
first term extends to :math:`R_0`, the maximum extent of the bond. The second
|
||||
term is cutoff at :math:`2^\frac{1}{6} \sigma`, the minimum of the LJ potential.
|
||||
|
||||
The *fene/nm* bond style substitutes the standard LJ potential with the generalized LJ potential
|
||||
in the same form as in pair style :doc:`nm/cut <pair_nm>`. The bond energy is then given by
|
||||
|
||||
.. math::
|
||||
|
||||
E = -0.5 K r_0^2 \ln \left[ 1 - \left(\frac{r}{R_0}\right)^2\right] + \frac{E_0}{(n-m)} \left[ m \left(\frac{r_0}{r}\right)^n - n \left(\frac{r_0}{r}\right)^m \right]
|
||||
|
||||
Similar to the *fene* style, the generalized Lennard-Jones is cut off at
|
||||
the potential minimum, :math:`r_0`, to be repulsive only. The following
|
||||
coefficients must be defined for each bond type via the :doc:`bond_coeff
|
||||
<bond_coeff>` command as in the example above, or in the data file or
|
||||
restart files read by the :doc:`read_data <read_data>` or
|
||||
:doc:`read_restart <read_restart>` commands:
|
||||
The following coefficients must be defined for each bond type via the
|
||||
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in
|
||||
the data file or restart files read by the :doc:`read_data <read_data>`
|
||||
or :doc:`read_restart <read_restart>` commands:
|
||||
|
||||
* :math:`K` (energy/distance\^2)
|
||||
* :math:`R_0` (distance)
|
||||
* :math:`\epsilon` (energy)
|
||||
* :math:`\sigma` (distance)
|
||||
|
||||
For the *fene/nm* style, the following coefficients are used. Please
|
||||
note, that the standard LJ potential and thus the regular FENE potential
|
||||
is recovered for (n=12 m=6) and :math:`r_0 = 2^\frac{1}{6} \sigma`.
|
||||
|
||||
* :math:`K` (energy/distance\^2)
|
||||
* :math:`R_0` (distance)
|
||||
* :math:`E_0` (energy)
|
||||
* :math:`r_0` (distance)
|
||||
* :math:`n` (unitless)
|
||||
* :math:`m` (unitless)
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
@ -85,10 +57,9 @@ is recovered for (n=12 m=6) and :math:`r_0 = 2^\frac{1}{6} \sigma`.
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
The *fene* bond style can only be used if LAMMPS was built with the MOLECULE
|
||||
package; the *fene/nm* bond style can only be used if LAMMPS was built
|
||||
with the EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
|
||||
page for more info.
|
||||
This bond style can only be used if LAMMPS was built with the MOLECULE
|
||||
package. See the :doc:`Build package <Build_package>` page for more
|
||||
info.
|
||||
|
||||
You typically should specify :doc:`special_bonds fene <special_bonds>`
|
||||
or :doc:`special_bonds lj/coul 0 1 1 <special_bonds>` to use this bond
|
||||
@ -97,8 +68,7 @@ style. LAMMPS will issue a warning it that's not the case.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`,
|
||||
:doc:`pair style lj/cut <pair_lj>`, :doc:`pair style nm/cut <pair_nm>`.
|
||||
:doc:`bond_coeff <bond_coeff>`, :doc:`delete_bonds <delete_bonds>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -87,7 +87,6 @@ accelerated styles exist.
|
||||
* :doc:`class2 <bond_class2>` - COMPASS (class 2) bond
|
||||
* :doc:`fene <bond_fene>` - FENE (finite-extensible non-linear elastic) bond
|
||||
* :doc:`fene/expand <bond_fene_expand>` - FENE bonds with variable size particles
|
||||
* :doc:`fene/nm <bond_fene>` - FENE bonds with a generalized Lennard-Jones potential
|
||||
* :doc:`gaussian <bond_gaussian>` - multicentered Gaussian-based bond potential
|
||||
* :doc:`gromos <bond_gromos>` - GROMOS force field bond
|
||||
* :doc:`harmonic <bond_harmonic>` - harmonic bond
|
||||
|
||||
@ -174,7 +174,6 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
|
||||
* :doc:`angle <compute_angle>` - energy of each angle sub-style
|
||||
* :doc:`angle/local <compute_angle_local>` - theta and energy of each angle
|
||||
* :doc:`angmom/chunk <compute_angmom_chunk>` - angular momentum for each chunk
|
||||
* :doc:`ave/sphere/atom <compute_ave_sphere_atom>` - compute local density and temperature around each atom
|
||||
* :doc:`basal/atom <compute_basal_atom>` - calculates the hexagonal close-packed "c" lattice vector of each atom
|
||||
* :doc:`body/local <compute_body_local>` - attributes of body sub-particles
|
||||
* :doc:`bond <compute_bond>` - energy of each bond sub-style
|
||||
|
||||
@ -1,101 +0,0 @@
|
||||
.. index:: compute ave/sphere/atom
|
||||
.. index:: compute ave/sphere/atom/kk
|
||||
|
||||
compute ave/sphere/atom command
|
||||
================================
|
||||
|
||||
Accelerator Variants: *ave/sphere/atom/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
compute ID group-ID ave/sphere/atom keyword values ...
|
||||
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* ave/sphere/atom = style name of this compute command
|
||||
* one or more keyword/value pairs may be appended
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
keyword = *cutoff*
|
||||
*cutoff* value = distance cutoff
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute 1 all ave/sphere/atom
|
||||
|
||||
compute 1 all ave/sphere/atom cutoff 5.0
|
||||
comm_modify cutoff 5.0
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Define a computation that calculates the local density and temperature
|
||||
for each atom and neighbors inside a spherical cutoff.
|
||||
|
||||
The optional keyword *cutoff* defines the distance cutoff
|
||||
used when searching for neighbors. The default value is the cutoff
|
||||
specified by the pair style. If no pair style is defined, then a cutoff
|
||||
must be defined using this keyword. If the specified cutoff is larger than
|
||||
that of the pair_style plus neighbor skin (or no pair style is defined),
|
||||
the *comm_modify cutoff* option must also be set to match that of the
|
||||
*cutoff* keyword.
|
||||
|
||||
The neighbor list needed to compute this quantity is constructed each
|
||||
time the calculation is performed (i.e. each time a snapshot of atoms
|
||||
is dumped). Thus it can be inefficient to compute/dump this quantity
|
||||
too frequently.
|
||||
|
||||
.. note::
|
||||
|
||||
If you have a bonded system, then the settings of
|
||||
:doc:`special_bonds <special_bonds>` command can remove pairwise
|
||||
interactions between atoms in the same bond, angle, or dihedral. This
|
||||
is the default setting for the :doc:`special_bonds <special_bonds>`
|
||||
command, and means those pairwise interactions do not appear in the
|
||||
neighbor list. Because this fix uses the neighbor list, it also means
|
||||
those pairs will not be included in the order parameter. This
|
||||
difficulty can be circumvented by writing a dump file, and using the
|
||||
:doc:`rerun <rerun>` command to compute the order parameter for
|
||||
snapshots in the dump file. The rerun script can use a
|
||||
:doc:`special_bonds <special_bonds>` command that includes all pairs in
|
||||
the neighbor list.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
|
||||
----------
|
||||
|
||||
Output info
|
||||
"""""""""""
|
||||
|
||||
This compute calculates a per-atom array with two columns: density and temperature.
|
||||
|
||||
These values can be accessed by any command that uses per-atom values
|
||||
from a compute as input. See the :doc:`Howto output <Howto_output>` doc
|
||||
page for an overview of LAMMPS output options.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the EXTRA-COMPUTE package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`comm_modify <comm_modify>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The option defaults are *cutoff* = pair style cutoff
|
||||
|
||||
@ -13,7 +13,7 @@ Syntax
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* bond/local = style name of this compute command
|
||||
* one or more values may be appended
|
||||
* value = *dist* or *dx* or *dy* or *dz* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
|
||||
* value = *dist* or *engpot* or *force* or *fx* or *fy* or *fz* or *engvib* or *engrot* or *engtrans* or *omega* or *velvib* or *v_name*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -21,7 +21,6 @@ Syntax
|
||||
*engpot* = bond potential energy
|
||||
*force* = bond force
|
||||
|
||||
*dx*,\ *dy*,\ *dz* = components of pairwise distance
|
||||
*fx*,\ *fy*,\ *fz* = components of bond force
|
||||
*engvib* = bond kinetic energy of vibration
|
||||
*engrot* = bond kinetic energy of rotation
|
||||
@ -64,9 +63,6 @@ whether the 2 atoms represent a simple diatomic molecule, or are part
|
||||
of some larger molecule.
|
||||
|
||||
The value *dist* is the current length of the bond.
|
||||
The values *dx*, *dy*, and *dz* are the xyz components of 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.
|
||||
|
||||
The value *engpot* is the potential energy for the bond,
|
||||
based on the current separation of the pair of atoms in the bond.
|
||||
|
||||
@ -89,20 +89,13 @@ included in the calculation.
|
||||
.. warning::
|
||||
|
||||
The compute *heat/flux* has been reported to produce unphysical
|
||||
values for angle, dihedral, improper and constraint force contributions
|
||||
values for angle, dihedral and improper contributions
|
||||
when used with :doc:`compute stress/atom <compute_stress_atom>`,
|
||||
as discussed in :ref:`(Surblys2019) <Surblys3>`, :ref:`(Boone) <Boone>`
|
||||
and :ref:`(Surblys2021) <Surblys4>`. You are strongly advised to
|
||||
as discussed in :ref:`(Surblys) <Surblys2>` and :ref:`(Boone) <Boone>`.
|
||||
You are strongly advised to
|
||||
use :doc:`compute centroid/stress/atom <compute_stress_atom>`,
|
||||
which has been implemented specifically for such cases.
|
||||
|
||||
.. warning::
|
||||
|
||||
Due to an implementation detail, the :math:`y` and :math:`z`
|
||||
components of heat flux from :doc:`fix rigid <fix_rigid>`
|
||||
contribution when computed via :doc:`compute stress/atom <compute_stress_atom>`
|
||||
are highly unphysical and should not be used.
|
||||
|
||||
The Green-Kubo formulas relate the ensemble average of the
|
||||
auto-correlation of the heat flux :math:`\mathbf{J}`
|
||||
to the thermal conductivity :math:`\kappa`:
|
||||
@ -239,14 +232,10 @@ none
|
||||
|
||||
----------
|
||||
|
||||
.. _Surblys3:
|
||||
.. _Surblys2:
|
||||
|
||||
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
.. _Boone:
|
||||
|
||||
**(Boone)** Boone, Babaei, Wilmer, J Chem Theory Comput, 15, 5579--5587 (2019).
|
||||
|
||||
.. _Surblys4:
|
||||
|
||||
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
|
||||
@ -13,12 +13,11 @@ Syntax
|
||||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* pair/local = style name of this compute command
|
||||
* one or more values may be appended
|
||||
* value = *dist* or *dx* or *dy* or *dz* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
|
||||
* value = *dist* or *eng* or *force* or *fx* or *fy* or *fz* or *pN*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*dist* = pairwise distance
|
||||
*dx*,\ *dy*,\ *dz* = components of pairwise distance
|
||||
*eng* = pairwise energy
|
||||
*force* = pairwise force
|
||||
*fx*,\ *fy*,\ *fz* = components of pairwise force
|
||||
@ -57,9 +56,6 @@ force cutoff distance for that interaction, as defined by the
|
||||
commands.
|
||||
|
||||
The value *dist* is the distance between the pair of atoms.
|
||||
The values *dx*, *dy*, and *dz* are the xyz components of 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.
|
||||
|
||||
The value *eng* is the interaction energy for the pair of atoms.
|
||||
|
||||
@ -93,10 +89,10 @@ from the second of the two sub-styles. If the referenced *pN*
|
||||
is not computed for the specific pairwise interaction (based on
|
||||
atom types), then the output will be 0.0.
|
||||
|
||||
The value *dist*, *dx*, *dy* and *dz* will be in distance :doc:`units <units>`.
|
||||
The value *eng* will be in energy :doc:`units <units>`.
|
||||
The values *force*, *fx*, *fy*, and *fz* will be in force :doc:`units <units>`.
|
||||
The values *pN* will be in whatever units the pair style defines.
|
||||
The value *dist* will be in distance :doc:`units <units>`. The value
|
||||
*eng* will be in energy :doc:`units <units>`. The values *force*, *fx*,
|
||||
*fy*, and *fz* will be in force :doc:`units <units>`. The values *pN*
|
||||
will be in whatever units the pair style defines.
|
||||
|
||||
The optional *cutoff* keyword determines how the force cutoff distance
|
||||
for an interaction is determined. For the default setting of *type*,
|
||||
|
||||
@ -141,7 +141,7 @@ Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`compute temp <compute_temp>`, :doc:`compute stress/atom <compute_stress_atom>`,
|
||||
:doc:`thermo_style <thermo_style>`, :doc:`fix numdiff/virial <fix_numdiff_virial>`,
|
||||
:doc:`thermo_style <thermo_style>`,
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -61,7 +61,7 @@ Restrictions
|
||||
This compute currently calculates the pressure tensor contributions
|
||||
for pair styles only (i.e. no bond, angle, dihedral, etc. contributions
|
||||
and in the presence of bonded interactions, the result will be incorrect
|
||||
due to exclusions for special bonds) and requires pairwise force
|
||||
due to exclusions for special bonds) and requires pair-wise force
|
||||
calculations not available for most many-body pair styles. K-space
|
||||
calculations are also excluded. Note that this pressure compute outputs
|
||||
the configurational terms only; the kinetic contribution is not included
|
||||
|
||||
@ -87,10 +87,6 @@ Tersoff 3-body interaction) is assigned in equal portions to each atom
|
||||
in the set. E.g. 1/4 of the dihedral virial to each of the 4 atoms,
|
||||
or 1/3 of the fix virial due to SHAKE constraints applied to atoms in
|
||||
a water molecule via the :doc:`fix shake <fix_shake>` command.
|
||||
As an exception, the virial contribution from
|
||||
constraint forces in :doc:`fix rigid <fix_rigid>` on each atom
|
||||
is computed from the constraint force acting on the corresponding atom
|
||||
and its position, i.e. the total virial is not equally distributed.
|
||||
|
||||
In case of compute *centroid/stress/atom*, the virial contribution is:
|
||||
|
||||
@ -107,25 +103,13 @@ atom :math:`I` due to the interaction and the relative position
|
||||
:math:`\mathbf{r}_{I0}` of the atom :math:`I` to the geometric center
|
||||
of the interacting atoms, i.e. centroid, is used. As the geometric
|
||||
center is different for each interaction, the :math:`\mathbf{r}_{I0}`
|
||||
also differs. The sixth term, Kspace contribution,
|
||||
is computed identically to compute *stress/atom*.
|
||||
The seventh term is handed differently depending on
|
||||
if the constraint forces are due to :doc:`fix shake <fix_shake>`
|
||||
or :doc:`fix rigid <fix_rigid>`.
|
||||
In case of SHAKE constraints, each distance constraint is
|
||||
handed as a pairwise interaction.
|
||||
E.g. in case of a water molecule, two OH and one HH distance
|
||||
constraints are treated as three pairwise interactions.
|
||||
In case of :doc:`fix rigid <fix_rigid>`,
|
||||
all constraint forces in the molecule are treated
|
||||
as a single many-body interaction with a single centroid position.
|
||||
In case of water molecule, the formula expression would become
|
||||
identical to that of the three-body angle interaction.
|
||||
Although the total system virial is the same as
|
||||
also differs. The sixth and seventh terms, Kspace and :doc:`fix
|
||||
<fix>` contribution respectively, are computed identical to compute
|
||||
*stress/atom*. Although the total system virial is the same as
|
||||
compute *stress/atom*, compute *centroid/stress/atom* is know to
|
||||
result in more consistent heat flux values for angle, dihedrals,
|
||||
improper and constraint force contributions
|
||||
when computed via :doc:`compute heat/flux <compute_heat_flux>`.
|
||||
result in more consistent heat flux values for angle, dihedrals and
|
||||
improper contributions when computed via :doc:`compute heat/flux
|
||||
<compute_heat_flux>`.
|
||||
|
||||
If no extra keywords are listed, the kinetic contribution all of the
|
||||
virial contribution terms are included in the per-atom stress tensor.
|
||||
@ -150,8 +134,7 @@ contribution for the cluster interaction is divided evenly among those
|
||||
atoms.
|
||||
|
||||
Details of how compute *centroid/stress/atom* obtains the virial for
|
||||
individual atoms are given in :ref:`(Surblys2019) <Surblys1>` and
|
||||
:ref:`(Surblys2021) <Surblys2>`, where the
|
||||
individual atoms is given in :ref:`(Surblys) <Surblys1>`, where the
|
||||
idea is that the virial of the atom :math:`I` is the result of only
|
||||
the force :math:`\mathbf{F}_I` on the atom due to the interaction and
|
||||
its positional vector :math:`\mathbf{r}_{I0}`, relative to the
|
||||
@ -252,10 +235,10 @@ between the pair of particles. All bond styles are supported. All
|
||||
angle, dihedral, improper styles are supported with the exception of
|
||||
INTEL and KOKKOS variants of specific styles. It also does not
|
||||
support models with long-range Coulombic or dispersion forces,
|
||||
i.e. the kspace_style command in LAMMPS. It also does not implement the
|
||||
following fixes which add rigid-body constraints:
|
||||
:doc:`fix rigid/* <fix_rigid>` and the OpenMP accelerated version of :doc:`fix rigid/small <fix_rigid>`,
|
||||
while all other :doc:`fix rigid/*/small <fix_rigid>` are implemented.
|
||||
i.e. the kspace_style command in LAMMPS. It also does not support the
|
||||
following fixes which add rigid-body constraints: :doc:`fix shake
|
||||
<fix_shake>`, :doc:`fix rattle <fix_shake>`, :doc:`fix rigid
|
||||
<fix_rigid>`, :doc:`fix rigid/small <fix_rigid>`.
|
||||
|
||||
LAMMPS will generate an error if one of these options is included in
|
||||
your model. Extension of centroid stress calculations to these force
|
||||
@ -287,8 +270,4 @@ none
|
||||
|
||||
.. _Surblys1:
|
||||
|
||||
**(Surblys2019)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
.. _Surblys2:
|
||||
|
||||
**(Surblys2021)** Surblys, Matsubara, Kikugawa, Ohara, J Appl Phys 130, 215104 (2021).
|
||||
**(Surblys)** Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019).
|
||||
|
||||
@ -20,10 +20,8 @@ Syntax
|
||||
cutoff = delete one atom from pairs of atoms within the cutoff (distance units)
|
||||
group1-ID = one atom in pair must be in this group
|
||||
group2-ID = other atom in pair must be in this group
|
||||
*porosity* args = group-ID region-ID fraction seed
|
||||
group-ID = group within which to perform deletions
|
||||
*porosity* args = region-ID fraction seed
|
||||
region-ID = region within which to perform deletions
|
||||
or NULL to only impose the group criterion
|
||||
fraction = delete this fraction of atoms
|
||||
seed = random number seed (positive integer)
|
||||
|
||||
@ -45,8 +43,7 @@ Examples
|
||||
delete_atoms region sphere compress no
|
||||
delete_atoms overlap 0.3 all all
|
||||
delete_atoms overlap 0.5 solvent colloid
|
||||
delete_atoms porosity all cube 0.1 482793 bond yes
|
||||
delete_atoms porosity polymer cube 0.1 482793 bond yes
|
||||
delete_atoms porosity cube 0.1 482793 bond yes
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -79,17 +76,12 @@ have occurred that no atom pairs within the cutoff will remain
|
||||
minimum number of atoms will be deleted, or that the same atoms will
|
||||
be deleted when running on different numbers of processors.
|
||||
|
||||
For style *porosity* a specified *fraction* of atoms are deleted which
|
||||
are both in the specified group and within the specified region. The
|
||||
region-ID can be specified as NULL to only impose the group criterion.
|
||||
Likewise, specifying the group-ID as *all* will only impose the region
|
||||
criterion.
|
||||
|
||||
For example, if fraction is 0.1, then 10% of the eligible atoms will
|
||||
be deleted. The atoms to delete are chosen randomly. There is no
|
||||
guarantee that the exact fraction of atoms will be deleted, or that
|
||||
the same atoms will be deleted when running on different numbers of
|
||||
processors.
|
||||
For style *porosity* a specified *fraction* of atoms are deleted
|
||||
within the specified region. For example, if fraction is 0.1, then
|
||||
10% of the atoms will be deleted. The atoms to delete are chosen
|
||||
randomly. There is no guarantee that the exact fraction of atoms will
|
||||
be deleted, or that the same atoms will be deleted when running on
|
||||
different numbers of processors.
|
||||
|
||||
If the *compress* keyword is set to *yes*, then after atoms are
|
||||
deleted, then atom IDs are re-assigned so that they run from 1 to the
|
||||
@ -97,8 +89,8 @@ number of atoms in the system. Note that this is not done for
|
||||
molecular systems (see the :doc:`atom_style <atom_style>` command),
|
||||
regardless of the *compress* setting, since it would foul up the bond
|
||||
connectivity that has already been assigned. However, the
|
||||
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this
|
||||
command to accomplish the same thing.
|
||||
:doc:`reset_atom_ids <reset_atom_ids>` command can be used after this command to
|
||||
accomplish the same thing.
|
||||
|
||||
Note that the re-assignment of IDs is not really a compression, where
|
||||
gaps in atom IDs are removed by decrementing atom IDs that are larger.
|
||||
@ -108,15 +100,15 @@ the :doc:`create_atoms <create_atoms>` command explains.
|
||||
|
||||
A molecular system with fixed bonds, angles, dihedrals, or improper
|
||||
interactions, is one where the topology of the interactions is
|
||||
typically defined in the data file read by the :doc:`read_data
|
||||
<read_data>` command, and where the interactions themselves are
|
||||
defined with the :doc:`bond_style <bond_style>`, :doc:`angle_style
|
||||
<angle_style>`, etc commands. If you delete atoms from such a system,
|
||||
you must be careful not to end up with bonded interactions that are
|
||||
stored by remaining atoms but which include deleted atoms. This will
|
||||
cause LAMMPS to generate a "missing atoms" error when the bonded
|
||||
interaction is computed. The *bond* and *mol* keywords offer two ways
|
||||
to do that.
|
||||
typically defined in the data file read by the
|
||||
:doc:`read_data <read_data>` command, and where the interactions
|
||||
themselves are defined with the :doc:`bond_style <bond_style>`,
|
||||
:doc:`angle_style <angle_style>`, etc commands. If you delete atoms
|
||||
from such a system, you must be careful not to end up with bonded
|
||||
interactions that are stored by remaining atoms but which include
|
||||
deleted atoms. This will cause LAMMPS to generate a "missing atoms"
|
||||
error when the bonded interaction is computed. The *bond* and *mol*
|
||||
keywords offer two ways to do that.
|
||||
|
||||
It the *bond* keyword is set to *yes* then any bond or angle or
|
||||
dihedral or improper interaction that includes a deleted atom is also
|
||||
|
||||
@ -137,7 +137,7 @@ Examples
|
||||
dump myDump all atom/gz 100 dump.atom.gz
|
||||
dump myDump all atom/zstd 100 dump.atom.zst
|
||||
dump 2 subgroup atom 50 dump.run.bin
|
||||
dump 2 subgroup atom/mpiio 50 dump.run.mpiio.bin
|
||||
dump 2 subgroup atom 50 dump.run.mpiio.bin
|
||||
dump 4a all custom 100 dump.myforce.* id type x y vx fx
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke
|
||||
@ -169,12 +169,11 @@ or multiple smaller files).
|
||||
|
||||
.. note::
|
||||
|
||||
Because periodic boundary conditions are enforced only on timesteps
|
||||
when neighbor lists are rebuilt, the coordinates of an atom written
|
||||
to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the
|
||||
timesteps dump snapshots are written. See the :doc:`dump_modify
|
||||
pbc <dump_modify>` command if you with to force coordinates to be
|
||||
Because periodic boundary conditions are enforced only on
|
||||
timesteps when neighbor lists are rebuilt, the coordinates of an atom
|
||||
written to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the timesteps
|
||||
dump snapshots are written. See the :doc:`dump_modify pbc <dump_modify>` command if you with to force coordinates to be
|
||||
strictly inside the simulation box.
|
||||
|
||||
.. note::
|
||||
@ -190,21 +189,20 @@ or multiple smaller files).
|
||||
multiple processors, each of which owns a subset of the atoms.
|
||||
|
||||
For the *atom*, *custom*, *cfg*, and *local* styles, sorting is off by
|
||||
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting
|
||||
by atom ID is on by default. See the :doc:`dump_modify <dump_modify>`
|
||||
doc page for details.
|
||||
default. For the *dcd*, *xtc*, *xyz*, and *molfile* styles, sorting by
|
||||
atom ID is on by default. See the :doc:`dump_modify <dump_modify>` doc
|
||||
page for details.
|
||||
|
||||
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles
|
||||
are identical in command syntax to the corresponding styles without
|
||||
"gz", however, they generate compressed files using the zlib
|
||||
library. Thus the filename suffix ".gz" is mandatory. This is an
|
||||
alternative approach to writing compressed files via a pipe, as done
|
||||
by the regular dump styles, which may be required on clusters where
|
||||
the interface to the high-speed network disallows using the fork()
|
||||
library call (which is needed for a pipe). For the remainder of this
|
||||
doc page, you should thus consider the *atom* and *atom/gz* styles
|
||||
(etc) to be inter-changeable, with the exception of the required
|
||||
filename suffix.
|
||||
The *atom/gz*, *cfg/gz*, *custom/gz*, *local/gz*, and *xyz/gz* styles are identical
|
||||
in command syntax to the corresponding styles without "gz", however,
|
||||
they generate compressed files using the zlib library. Thus the filename
|
||||
suffix ".gz" is mandatory. This is an alternative approach to writing
|
||||
compressed files via a pipe, as done by the regular dump styles, which
|
||||
may be required on clusters where the interface to the high-speed network
|
||||
disallows using the fork() library call (which is needed for a pipe).
|
||||
For the remainder of this doc page, you should thus consider the *atom*
|
||||
and *atom/gz* styles (etc) to be inter-changeable, with the exception
|
||||
of the required filename suffix.
|
||||
|
||||
Similarly, the *atom/zstd*, *cfg/zstd*, *custom/zstd*, *local/zstd*,
|
||||
and *xyz/zstd* styles are identical to the gz styles, but use the Zstd
|
||||
@ -221,11 +219,6 @@ you should thus consider the *atom* and *atom/mpiio* styles (etc) to
|
||||
be inter-changeable. The one exception is how the filename is
|
||||
specified for the MPI-IO styles, as explained below.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
The precision of values output to text-based dump files can be
|
||||
controlled by the :doc:`dump_modify format <dump_modify>` command and
|
||||
its options.
|
||||
@ -282,11 +275,10 @@ This bounding box is convenient for many visualization programs. The
|
||||
meaning of the 6 character flags for "xx yy zz" is the same as above.
|
||||
|
||||
Note that the first two numbers on each line are now xlo_bound instead
|
||||
of xlo, etc, since they represent a bounding box. See the :doc:`Howto
|
||||
triclinic <Howto_triclinic>` page for a geometric description of
|
||||
triclinic boxes, as defined by LAMMPS, simple formulas for how the 6
|
||||
bounding box extents (xlo_bound,xhi_bound,etc) are calculated from the
|
||||
triclinic parameters, and how to transform those parameters to and
|
||||
of xlo, etc, since they represent a bounding box. See the :doc:`Howto triclinic <Howto_triclinic>` page for a geometric description
|
||||
of triclinic boxes, as defined by LAMMPS, simple formulas for how the
|
||||
6 bounding box extents (xlo_bound,xhi_bound,etc) are calculated from
|
||||
the triclinic parameters, and how to transform those parameters to and
|
||||
from other commonly used triclinic representations.
|
||||
|
||||
The "ITEM: ATOMS" line in each snapshot lists column descriptors for
|
||||
@ -318,24 +310,23 @@ written to the dump file. This local data is typically calculated by
|
||||
each processor based on the atoms it owns, but there may be zero or
|
||||
more entities per atom, e.g. a list of bond distances. An explanation
|
||||
of the possible dump local attributes is given below. Note that by
|
||||
using input from the :doc:`compute property/local
|
||||
<compute_property_local>` command with dump local, it is possible to
|
||||
generate information on bonds, angles, etc that can be cut and pasted
|
||||
directly into a data file read by the :doc:`read_data <read_data>`
|
||||
command.
|
||||
using input from the :doc:`compute property/local <compute_property_local>` command with dump local,
|
||||
it is possible to generate information on bonds, angles, etc that can
|
||||
be cut and pasted directly into a data file read by the
|
||||
:doc:`read_data <read_data>` command.
|
||||
|
||||
Style *cfg* has the same command syntax as style *custom* and writes
|
||||
extended CFG format files, as used by the `AtomEye
|
||||
<http://li.mit.edu/Archive/Graphics/A/>`_ visualization package.
|
||||
Since the extended CFG format uses a single snapshot of the system per
|
||||
file, a wildcard "\*" must be included in the filename, as discussed
|
||||
below. The list of atom attributes for style *cfg* must begin with
|
||||
either "mass type xs ys zs" or "mass type xsu ysu zsu" since these
|
||||
quantities are needed to write the CFG files in the appropriate format
|
||||
(though the "mass" and "type" fields do not appear explicitly in the
|
||||
file). Any remaining attributes will be stored as "auxiliary
|
||||
properties" in the CFG files. Note that you will typically want to
|
||||
use the :doc:`dump_modify element <dump_modify>` command with
|
||||
extended CFG format files, as used by the
|
||||
`AtomEye <http://li.mit.edu/Archive/Graphics/A/>`_ visualization
|
||||
package. Since the extended CFG format uses a single snapshot of the
|
||||
system per file, a wildcard "\*" must be included in the filename, as
|
||||
discussed below. The list of atom attributes for style *cfg* must
|
||||
begin with either "mass type xs ys zs" or "mass type xsu ysu zsu"
|
||||
since these quantities are needed to write the CFG files in the
|
||||
appropriate format (though the "mass" and "type" fields do not appear
|
||||
explicitly in the file). Any remaining attributes will be stored as
|
||||
"auxiliary properties" in the CFG files. Note that you will typically
|
||||
want to use the :doc:`dump_modify element <dump_modify>` command with
|
||||
CFG-formatted files, to associate element names with atom types, so
|
||||
that AtomEye can render atoms appropriately. When unwrapped
|
||||
coordinates *xsu*, *ysu*, and *zsu* are requested, the nominal AtomEye
|
||||
@ -461,11 +452,6 @@ use the :doc:`read_dump <read_dump>` command or perform other
|
||||
post-processing, just as if the dump file was not written using
|
||||
MPI-IO.
|
||||
|
||||
.. warning::
|
||||
|
||||
The MPIIO package is currently unmaintained and has become
|
||||
unreliable. Use with caution.
|
||||
|
||||
Note that MPI-IO dump files are one large file which all processors
|
||||
write to. You thus cannot use the "%" wildcard character described
|
||||
above in the filename since that specifies generation of multiple
|
||||
@ -722,9 +708,8 @@ are part of the MPIIO package. They are only enabled if LAMMPS was
|
||||
built with that package. See the :doc:`Build package <Build_package>`
|
||||
doc page for more info.
|
||||
|
||||
The *xtc* and *dcd* styles are part of the EXTRA-DUMP package. They
|
||||
are only enabled if LAMMPS was built with that package. See the
|
||||
:doc:`Build package <Build_package>` page for more info.
|
||||
The *xtc* style is part of the MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -6,8 +6,6 @@ dump image command
|
||||
dump movie command
|
||||
==================
|
||||
|
||||
(see below for :ref:`dump_modify options <dump_modify_image>` specific to dump image/movie)
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -17,7 +15,7 @@ Syntax
|
||||
|
||||
* ID = user-assigned name for the dump
|
||||
* group-ID = ID of the group of atoms to be imaged
|
||||
* style = *image* or *movie* = style of dump command (other styles such as *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
|
||||
* style = *image* or *movie* = style of dump command (other styles *atom* or *cfg* or *dcd* or *xtc* or *xyz* or *local* or *custom* are discussed on the :doc:`dump <dump>` doc page)
|
||||
* N = dump every this many timesteps
|
||||
* file = name of file to write image to
|
||||
* color = atom attribute that determines color of each atom
|
||||
@ -81,69 +79,6 @@ Syntax
|
||||
seed = random # seed (positive integer)
|
||||
dfactor = strength of shading from 0.0 to 1.0
|
||||
|
||||
|
||||
.. _dump_modify_image:
|
||||
|
||||
dump_modify options for dump image/movie
|
||||
========================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
dump_modify dump-ID keyword values ...
|
||||
|
||||
* these keywords apply only to the *image* and *movie* styles and are documented on this page
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
|
||||
* see the :doc:`dump modify <dump_modify>` doc page for more general keywords
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*acolor* args = type color
|
||||
type = atom type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*adiam* args = type diam
|
||||
type = atom type or range of types (see below)
|
||||
diam = diameter of atoms of that type (distance units)
|
||||
*amap* args = lo hi style delta N entry1 entry2 ... entryN
|
||||
lo = number or *min* = lower bound of range of color map
|
||||
hi = number or *max* = upper bound of range of color map
|
||||
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
|
||||
"c" for continuous
|
||||
"d" for discrete
|
||||
"s" for sequential
|
||||
"a" for absolute
|
||||
"f" for fractional
|
||||
delta = binsize (only used for style "s", otherwise ignored)
|
||||
binsize = range is divided into bins of this width
|
||||
N = # of subsequent entries
|
||||
entry = value color (for continuous style)
|
||||
value = number or *min* or *max* = single value within range
|
||||
color = name of color used for that value
|
||||
entry = lo hi color (for discrete style)
|
||||
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
|
||||
color = name of color used for that subset of values
|
||||
entry = color (for sequential style)
|
||||
color = name of color used for a bin of values
|
||||
*backcolor* arg = color
|
||||
color = name of color for background
|
||||
*bcolor* args = type color
|
||||
type = bond type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*bdiam* args = type diam
|
||||
type = bond type or range of types (see below)
|
||||
diam = diameter of bonds of that type (distance units)
|
||||
*boxcolor* arg = color
|
||||
color = name of color for simulation box lines and processor sub-domain lines
|
||||
*color* args = name R G B
|
||||
name = name of color
|
||||
R,G,B = red/green/blue numeric values from 0.0 to 1.0
|
||||
*bitrate* arg = rate
|
||||
rate = target bitrate for movie in kbps
|
||||
*framerate* arg = fps
|
||||
fps = frames per second for movie
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -156,8 +91,6 @@ Examples
|
||||
dump m1 all movie 1000 movie.avi type type size 640 480
|
||||
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720
|
||||
|
||||
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
@ -212,10 +145,10 @@ is used.
|
||||
Similarly, the format of the resulting movie is chosen with the
|
||||
*movie* dump style. This is handled by the underlying FFmpeg converter
|
||||
and thus details have to be looked up in the `FFmpeg documentation
|
||||
<http://ffmpeg.org/ffmpeg.html>`_. Typical examples are: .avi, .mpg,
|
||||
.m4v, .mp4, .mkv, .flv, .mov, .gif Additional settings of the movie
|
||||
compression like bitrate and framerate can be set using the
|
||||
dump_modify command as described below.
|
||||
<http://ffmpeg.org/ffmpeg.html>`_.
|
||||
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
|
||||
Additional settings of the movie compression like bitrate and
|
||||
framerate can be set using the :doc:`dump_modify <dump_modify>` command.
|
||||
|
||||
To write out JPEG and PNG format files, you must build LAMMPS with
|
||||
support for the corresponding JPEG or PNG library. To convert images
|
||||
@ -277,20 +210,19 @@ to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. This mapping can be changed by the
|
||||
"dump_modify acolor" command, as described below.
|
||||
:doc:`dump_modify acolor <dump_modify>` command.
|
||||
|
||||
If *type* is specified for the *diameter* setting then the diameter of
|
||||
each atom is determined by its atom type. By default all types have
|
||||
diameter 1.0. This mapping can be changed by the "dump_modify adiam"
|
||||
command, as described below.
|
||||
diameter 1.0. This mapping can be changed by the :doc:`dump_modify adiam <dump_modify>` command.
|
||||
|
||||
If *element* is specified for the *color* and/or *diameter* setting,
|
||||
then the color and/or diameter of each atom is determined by which
|
||||
element it is, which in turn is specified by the element-to-type
|
||||
mapping specified by the "dump_modify element" command, as described
|
||||
below. By default every atom type is C (carbon). Every element has a
|
||||
color and diameter associated with it, which is the same as the colors
|
||||
and sizes used by the `AtomEye <atomeye_>`_ visualization package.
|
||||
mapping specified by the "dump_modify element" command. By default
|
||||
every atom type is C (carbon). Every element has a color and diameter
|
||||
associated with it, which is the same as the colors and sizes used by
|
||||
the `AtomEye <atomeye_>`_ visualization package.
|
||||
|
||||
.. _atomeye: http://li.mit.edu/Archive/Graphics/A/
|
||||
|
||||
@ -300,13 +232,13 @@ settings, they are interpreted in the following way.
|
||||
If "vx", for example, is used as the *color* setting, then the color
|
||||
of the atom will depend on the x-component of its velocity. The
|
||||
association of a per-atom value with a specific color is determined by
|
||||
a "color map", which can be specified via the dump_modify command, as
|
||||
described below. The basic idea is that the atom-attribute will be
|
||||
within a range of values, and every value within the range is mapped
|
||||
to a specific color. Depending on how the color map is defined, that
|
||||
mapping can take place via interpolation so that a value of -3.2 is
|
||||
halfway between "red" and "blue", or discretely so that the value of
|
||||
-3.2 is "orange".
|
||||
a "color map", which can be specified via the
|
||||
:doc:`dump_modify <dump_modify>` command. The basic idea is that the
|
||||
atom-attribute will be within a range of values, and every value
|
||||
within the range is mapped to a specific color. Depending on how the
|
||||
color map is defined, that mapping can take place via interpolation so
|
||||
that a value of -3.2 is halfway between "red" and "blue", or
|
||||
discretely so that the value of -3.2 is "orange".
|
||||
|
||||
If "vx", for example, is used as the *diameter* setting, then the atom
|
||||
will be rendered using the x-component of its velocity as the
|
||||
@ -319,10 +251,9 @@ diameter, which can be used as the *diameter* setting.
|
||||
|
||||
The various keywords listed above control how the image is rendered.
|
||||
As listed below, all of the keywords have defaults, most of which you
|
||||
will likely not need to change. As described below, the dump modify
|
||||
command also has options specific to the dump image style,
|
||||
particularly for assigning colors to atoms, bonds, and other image
|
||||
features.
|
||||
will likely not need to change. The :doc:`dump modify <dump_modify>`
|
||||
also has options specific to the dump image style, particularly for
|
||||
assigning colors to atoms, bonds, and other image features.
|
||||
|
||||
----------
|
||||
|
||||
@ -364,7 +295,7 @@ types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for bond types > 6. This mapping can be changed by
|
||||
the "dump_modify bcolor" command, as described below.
|
||||
the :doc:`dump_modify bcolor <dump_modify>` command.
|
||||
|
||||
The bond *width* value can be a numeric value or *atom* or *type* (or
|
||||
*none* as indicated above).
|
||||
@ -379,8 +310,7 @@ of the 2 atoms in the bond.
|
||||
|
||||
If *type* is specified for the *width* value then the diameter of each
|
||||
bond is determined by its bond type. By default all types have
|
||||
diameter 0.5. This mapping can be changed by the "dump_modify bdiam" command,
|
||||
as described below.
|
||||
diameter 0.5. This mapping can be changed by the :doc:`dump_modify bdiam <dump_modify>` command.
|
||||
|
||||
----------
|
||||
|
||||
@ -400,7 +330,7 @@ mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the dump_modify command.
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
|
||||
The line *width* can only be a numeric value, which specifies that all
|
||||
lines will be drawn as cylinders with that diameter, e.g. 1.0, which
|
||||
@ -427,7 +357,7 @@ default the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the dump_modify command.
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
|
||||
----------
|
||||
|
||||
@ -460,7 +390,7 @@ particle. By default the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the dump_modify command.
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
|
||||
----------
|
||||
|
||||
@ -484,7 +414,7 @@ the mapping of types to colors is as follows:
|
||||
* type 6 = cyan
|
||||
|
||||
and repeats itself for types > 6. There is not yet an option to
|
||||
change this via the dump_modify command.
|
||||
change this via the :doc:`dump_modify <dump_modify>` command.
|
||||
|
||||
----------
|
||||
|
||||
@ -558,8 +488,7 @@ are rendered as thin cylinders in the image. If *no* is set, then the
|
||||
box boundaries are not drawn and the *diam* setting is ignored. If
|
||||
*yes* is set, the 12 edges of the box are drawn, with a diameter that
|
||||
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
|
||||
2d). The color of the box boundaries can be set with the "dump_modify
|
||||
boxcolor" command.
|
||||
2d). The color of the box boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
|
||||
|
||||
The *axes* keyword determines if and how the coordinate axes are
|
||||
rendered as thin cylinders in the image. If *no* is set, then the
|
||||
@ -578,8 +507,7 @@ set (default), then the sub-domain boundaries are not drawn and the
|
||||
*diam* setting is ignored. If *yes* is set, the 12 edges of each
|
||||
processor sub-domain are drawn, with a diameter that is a fraction of
|
||||
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
|
||||
of the sub-domain boundaries can be set with the "dump_modify
|
||||
boxcolor" command.
|
||||
of the sub-domain boundaries can be set with the :doc:`dump_modify boxcolor <dump_modify>` command.
|
||||
|
||||
----------
|
||||
|
||||
@ -679,272 +607,9 @@ Play the movie:
|
||||
|
||||
----------
|
||||
|
||||
Dump_modify keywords for dump image and dump movie
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
The following dump_modify keywords apply only to the dump image and
|
||||
dump movie styles. Any keyword that works with dump image also works
|
||||
with dump movie, since the movie is simply a collection of images.
|
||||
Some of the keywords only affect the dump movie style. The
|
||||
descriptions give details.
|
||||
|
||||
----------
|
||||
|
||||
The *acolor* keyword can be used with the dump image command, when its
|
||||
atom color setting is *type*, to set the color that atoms of each type
|
||||
will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Ntypes = the
|
||||
number of atom types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of atom
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
|
||||
the number of atom types, then an asterisk with no numeric values
|
||||
means all types from 1 to N. A leading asterisk means all types from
|
||||
1 to n (inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
"dump_modify color" command, as described below. Or it can be two or
|
||||
more colors separated by a "/" character, e.g. red/green/blue. In the
|
||||
former case, that color is assigned to all the specified atom types.
|
||||
In the latter case, the list of colors are assigned in a round-robin
|
||||
fashion to each of the specified atom types.
|
||||
|
||||
----------
|
||||
|
||||
The *adiam* keyword can be used with the dump image command, when its
|
||||
atom diameter setting is *type*, to set the size that atoms of each
|
||||
type will be drawn in the image. The specified *type* should be an
|
||||
integer from 1 to Ntypes. As with the *acolor* keyword, a wildcard
|
||||
asterisk can be used as part of the *type* argument to specify a range
|
||||
of atom types. The specified *diam* is the size in whatever distance
|
||||
:doc:`units <units>` the input script is using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *amap* keyword can be used with the dump image command, with its
|
||||
*atom* keyword, when its atom setting is an atom-attribute, to setup a
|
||||
color map. The color map is used to assign a specific RGB
|
||||
(red/green/blue) color value to an individual atom when it is drawn,
|
||||
based on the atom's attribute, which is a numeric value, e.g. its
|
||||
x-component of velocity if the atom-attribute "vx" was specified.
|
||||
|
||||
The basic idea of a color map is that the atom-attribute will be
|
||||
within a range of values, and that range is associated with a series
|
||||
of colors (e.g. red, blue, green). An atom's specific value (vx =
|
||||
-3.2) can then mapped to the series of colors (e.g. halfway between
|
||||
red and blue), and a specific color is determined via an interpolation
|
||||
procedure.
|
||||
|
||||
There are many possible options for the color map, enabled by the
|
||||
*amap* keyword. Here are the details.
|
||||
|
||||
The *lo* and *hi* settings determine the range of values allowed for
|
||||
the atom attribute. If numeric values are used for *lo* and/or *hi*,
|
||||
then values that are lower/higher than that value are set to the
|
||||
value. I.e. the range is static. If *lo* is specified as *min* or
|
||||
*hi* as *max* then the range is dynamic, and the lower and/or
|
||||
upper bound will be calculated each time an image is drawn, based
|
||||
on the set of atoms being visualized.
|
||||
|
||||
The *style* setting is two letters, such as "ca". The first letter is
|
||||
either "c" for continuous, "d" for discrete, or "s" for sequential.
|
||||
The second letter is either "a" for absolute, or "f" for fractional.
|
||||
|
||||
A continuous color map is one in which the color changes continuously
|
||||
from value to value within the range. A discrete color map is one in
|
||||
which discrete colors are assigned to sub-ranges of values within the
|
||||
range. A sequential color map is one in which discrete colors are
|
||||
assigned to a sequence of sub-ranges of values covering the entire
|
||||
range.
|
||||
|
||||
An absolute color map is one in which the values to which colors are
|
||||
assigned are specified explicitly as values within the range. A
|
||||
fractional color map is one in which the values to which colors are
|
||||
assigned are specified as a fractional portion of the range. For
|
||||
example if the range is from -10.0 to 10.0, and the color red is to be
|
||||
assigned to atoms with a value of 5.0, then for an absolute color map
|
||||
the number 5.0 would be used. But for a fractional map, the number
|
||||
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
|
||||
|
||||
The *delta* setting must be specified for all styles, but is only used
|
||||
for the sequential style; otherwise the value is ignored. It
|
||||
specifies the bin size to use within the range for assigning
|
||||
consecutive colors to. For example, if the range is from -10.0 to
|
||||
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
|
||||
the range. The first will be from -10.0 <= color1 < -9.0, then second
|
||||
from -9.0 <= color2 < -8.0, etc.
|
||||
|
||||
The *N* setting is how many entries follow. The format of the entries
|
||||
depends on whether the color map style is continuous, discrete or
|
||||
sequential. In all cases the *color* setting can be any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
For continuous color maps, each entry has a *value* and a *color*\ .
|
||||
The *value* is either a number within the range of values or *min* or
|
||||
*max*\ . The *value* of the first entry must be *min* and the *value*
|
||||
of the last entry must be *max*\ . Any entries in between must have
|
||||
increasing values. Note that numeric values can be specified either
|
||||
as absolute numbers or as fractions (0.0 to 1.0) of the range,
|
||||
depending on the "a" or "f" in the style setting for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. X will fall
|
||||
between 2 of the entry values. The color of the atom is linearly
|
||||
interpolated (in each of the RGB values) between the 2 colors
|
||||
associated with those entries. For example, if X = -5.0 and the 2
|
||||
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
|
||||
atom's color will be halfway between "red" and "blue", which happens
|
||||
to be "purple".
|
||||
|
||||
For discrete color maps, each entry has a *lo* and *hi* value and a
|
||||
*color*\ . The *lo* and *hi* settings are either numbers within the
|
||||
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
|
||||
and *hi* settings of the last entry must be *min* and *max*\ . Other
|
||||
entries can have any *lo* and *hi* values and the sub-ranges of
|
||||
different values can overlap. Note that numeric *lo* and *hi* values
|
||||
can be specified either as absolute numbers or as fractions (0.0 to
|
||||
1.0) of the range, depending on the "a" or "f" in the style setting
|
||||
for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. The entries
|
||||
are scanned from first to last. The first time that *lo* <= X <=
|
||||
*hi*, X is assigned the color associated with that entry. You can
|
||||
think of the last entry as assigning a default color (since it will
|
||||
always be matched by X), and the earlier entries as colors that
|
||||
override the default. Also note that no interpolation of a color RGB
|
||||
is done. All atoms will be drawn with one of the colors in the list
|
||||
of entries.
|
||||
|
||||
For sequential color maps, each entry has only a *color*\ . Here is how
|
||||
the entries are used to determine the color of an individual atom,
|
||||
given the value X of its atom attribute. The range is partitioned
|
||||
into N bins of width *binsize*\ . Thus X will fall in a specific bin
|
||||
from 1 to N, say the Mth bin. If it falls on a boundary between 2
|
||||
bins, it is considered to be in the higher of the 2 bins. Each bin is
|
||||
assigned a color from the E entries. If E < N, then the colors are
|
||||
repeated. For example if 2 entries with colors red and green are
|
||||
specified, then the odd numbered bins will be red and the even bins
|
||||
green. The color of the atom is the color of its bin. Note that the
|
||||
sequential color map is really a shorthand way of defining a discrete
|
||||
color map without having to specify where all the bin boundaries are.
|
||||
|
||||
Here is an example of using a sequential color map to color all the
|
||||
atoms in individual molecules with a different color. See the
|
||||
examples/pour/in.pour.2d.molecule input script for an example of how
|
||||
this is used.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable colors string &
|
||||
"red green blue yellow white &
|
||||
purple pink orange lime gray"
|
||||
variable mol atom mol%10
|
||||
dump 1 all image 250 image.*.jpg v_mol type &
|
||||
zoom 1.6 adiam 1.5
|
||||
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
|
||||
|
||||
In this case, 10 colors are defined, and molecule IDs are
|
||||
mapped to one of the colors, even if there are 1000s of molecules.
|
||||
|
||||
----------
|
||||
|
||||
The *backcolor* sets the background color of the images. The color
|
||||
name can be any of the 140 pre-defined colors (see below) or a color
|
||||
name defined by the dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *bcolor* keyword can be used with the dump image command, with its
|
||||
*bond* keyword, when its color setting is *type*, to set the color
|
||||
that bonds of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Nbondtypes = the
|
||||
number of bond types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of bond
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N =
|
||||
the number of bond types, then an asterisk with no numeric values
|
||||
means all types from 1 to N. A leading asterisk means all types from
|
||||
1 to n (inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified bond types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified bond types.
|
||||
|
||||
----------
|
||||
|
||||
The *bdiam* keyword can be used with the dump image command, with its
|
||||
*bond* keyword, when its diam setting is *type*, to set the diameter
|
||||
that bonds of each type will be drawn in the image. The specified
|
||||
*type* should be an integer from 1 to Nbondtypes. As with the
|
||||
*bcolor* keyword, a wildcard asterisk can be used as part of the
|
||||
*type* argument to specify a range of bond types. The specified
|
||||
*diam* is the size in whatever distance :doc:`units <units>` you are
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *bitrate* keyword can be used with the :doc:`dump movie
|
||||
<dump_image>` command to define the size of the resulting movie file
|
||||
and its quality via setting how many kbits per second are to be used
|
||||
for the movie file. Higher bitrates require less compression and will
|
||||
result in higher quality movies. The quality is also determined by
|
||||
the compression format and encoder. The default setting is 2000
|
||||
kbit/s, which will result in average quality with older compression
|
||||
formats.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all movie file formats supported by dump movie allow the
|
||||
bitrate to be set. If not, the setting is silently ignored.
|
||||
|
||||
----------
|
||||
|
||||
The *boxcolor* keyword sets the color of the simulation box drawn
|
||||
around the atoms in each image as well as the color of processor
|
||||
sub-domain boundaries. See the "dump image box" command for how to
|
||||
specify that a box be drawn via the *box* keyword, and the sub-domain
|
||||
boundaries via the *subbox* keyword. The color name can be any of the
|
||||
140 pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *color* keyword allows definition of a new color name, in addition
|
||||
to the 140-predefined colors (see below), and associates 3
|
||||
red/green/blue RGB values with that color name. The color name can
|
||||
then be used with any other dump_modify keyword that takes a color
|
||||
name as a value. The RGB values should each be floating point values
|
||||
between 0.0 and 1.0 inclusive.
|
||||
|
||||
When a color name is converted to RGB values, the user-defined color
|
||||
names are searched first, then the 140 pre-defined color names. This
|
||||
means you can also use the *color* keyword to overwrite one of the
|
||||
pre-defined color names with new RBG values.
|
||||
|
||||
----------
|
||||
|
||||
The *framerate* keyword can be used with the :doc:`dump movie
|
||||
<dump_image>` command to define the duration of the resulting movie
|
||||
file. Movie files written by the dump *movie* command have a default
|
||||
frame rate of 24 frames per second and the images generated will be
|
||||
converted at that rate. Thus a sequence of 1000 dump images will
|
||||
result in a movie of about 42 seconds. To make a movie run longer you
|
||||
can either generate images more frequently or lower the frame rate.
|
||||
To speed a movie up, you can do the inverse. Using a frame rate
|
||||
higher than 24 is not recommended, as it will result in simply
|
||||
dropping the rendered images. It is more efficient to dump images less
|
||||
frequently.
|
||||
See the :doc:`Modify <Modify>` page for information on how to add
|
||||
new compute and fix styles to LAMMPS to calculate per-atom quantities
|
||||
which could then be output into dump files.
|
||||
|
||||
----------
|
||||
|
||||
@ -999,7 +664,7 @@ Related commands
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The defaults for the dump image and dump movie keywords are as follows:
|
||||
The defaults for the keywords are as follows:
|
||||
|
||||
* adiam = not specified (use diameter setting)
|
||||
* atom = yes
|
||||
@ -1017,101 +682,3 @@ The defaults for the dump image and dump movie keywords are as follows:
|
||||
* subbox no 0.0
|
||||
* shiny = 1.0
|
||||
* ssao = no
|
||||
|
||||
----------
|
||||
|
||||
The defaults for the dump_modify keywords specific to dump image and dump movie are as follows:
|
||||
|
||||
* acolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* adiam = \* 1.0
|
||||
* amap = min max cf 0.0 2 min blue max red
|
||||
* backcolor = black
|
||||
* bcolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* bdiam = \* 0.5
|
||||
* bitrate = 2000
|
||||
* boxcolor = yellow
|
||||
* color = 140 color names are pre-defined as listed below
|
||||
* framerate = 24
|
||||
|
||||
----------
|
||||
|
||||
These are the standard 109 element names that LAMMPS pre-defines for
|
||||
use with the dump image and dump_modify commands.
|
||||
|
||||
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
|
||||
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
|
||||
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
|
||||
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
|
||||
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
|
||||
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
|
||||
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
|
||||
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
|
||||
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
|
||||
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
|
||||
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
|
||||
|
||||
----------
|
||||
|
||||
These are the 140 colors that LAMMPS pre-defines for use with the dump
|
||||
image and dump_modify commands. Additional colors can be defined with
|
||||
the dump_modify color command. The 3 numbers listed for each name are
|
||||
the RGB (red/green/blue) values. Divide each value by 255 to get the
|
||||
equivalent 0.0 to 1.0 value.
|
||||
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
|
||||
@ -3,9 +3,6 @@
|
||||
dump_modify command
|
||||
===================
|
||||
|
||||
:doc:`dump_modify <dump_image>` command for image/movie options
|
||||
===============================================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -15,16 +12,14 @@ Syntax
|
||||
|
||||
* dump-ID = ID of dump to modify
|
||||
* one or more keyword/value pairs may be appended
|
||||
|
||||
* these keywords apply to various dump styles
|
||||
* keyword = *append* or *at* or *balance* or *buffer* or *delay* or *element* or *every* or *every/time* or *fileper* or *first* or *flush* or *format* or *header* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
|
||||
* keyword = *append* or *at* or *buffer* or *delay* or *element* or *every* or *fileper* or *first* or *flush* or *format* or *image* or *label* or *maxfiles* or *nfile* or *pad* or *pbc* or *precision* or *region* or *refresh* or *scale* or *sfactor* or *sort* or *tfactor* or *thermo* or *thresh* or *time* or *units* or *unwrap*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*append* arg = *yes* or *no*
|
||||
*at* arg = N
|
||||
N = index of frame written upon first dump
|
||||
*balance* arg = *yes* or *no*
|
||||
*buffer* arg = *yes* or *no*
|
||||
*delay* arg = Dstep
|
||||
Dstep = delay output until this timestep
|
||||
@ -33,9 +28,6 @@ Syntax
|
||||
*every* arg = N
|
||||
N = dump every this many timesteps
|
||||
N can be a variable (see below)
|
||||
*every/time* arg = Delta
|
||||
Delta = dump every this interval in simulation time (time units)
|
||||
Delta can be a variable (see below)
|
||||
*fileper* arg = Np
|
||||
Np = write one file for every this many processors
|
||||
*first* arg = *yes* or *no*
|
||||
@ -43,9 +35,6 @@ Syntax
|
||||
*format* args = *line* string, *int* string, *float* string, M string, or *none*
|
||||
string = C-style format string
|
||||
M = integer from 1 to N, where N = # of per-atom quantities being output
|
||||
*header* arg = *yes* or *no*
|
||||
*yes* to write the header
|
||||
*no* to not write the header
|
||||
*image* arg = *yes* or *no*
|
||||
*label* arg = string
|
||||
string = character string (e.g. BONDS) to use in header of dump local file
|
||||
@ -77,11 +66,56 @@ Syntax
|
||||
*unwrap* arg = *yes* or *no*
|
||||
|
||||
* these keywords apply only to the *image* and *movie* :doc:`styles <dump_image>`
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate*
|
||||
* keyword = *acolor* or *adiam* or *amap* or *backcolor* or *bcolor* or *bdiam* or *boxcolor* or *color* or *bitrate* or *framerate* or *header*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
see the :doc:`dump image <dump_image>` doc page for details
|
||||
*acolor* args = type color
|
||||
type = atom type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*adiam* args = type diam
|
||||
type = atom type or range of types (see below)
|
||||
diam = diameter of atoms of that type (distance units)
|
||||
*amap* args = lo hi style delta N entry1 entry2 ... entryN
|
||||
lo = number or *min* = lower bound of range of color map
|
||||
hi = number or *max* = upper bound of range of color map
|
||||
style = 2 letters = "c" or "d" or "s" plus "a" or "f"
|
||||
"c" for continuous
|
||||
"d" for discrete
|
||||
"s" for sequential
|
||||
"a" for absolute
|
||||
"f" for fractional
|
||||
delta = binsize (only used for style "s", otherwise ignored)
|
||||
binsize = range is divided into bins of this width
|
||||
N = # of subsequent entries
|
||||
entry = value color (for continuous style)
|
||||
value = number or *min* or *max* = single value within range
|
||||
color = name of color used for that value
|
||||
entry = lo hi color (for discrete style)
|
||||
lo/hi = number or *min* or *max* = lower/upper bound of subset of range
|
||||
color = name of color used for that subset of values
|
||||
entry = color (for sequential style)
|
||||
color = name of color used for a bin of values
|
||||
*backcolor* arg = color
|
||||
color = name of color for background
|
||||
*bcolor* args = type color
|
||||
type = bond type or range of types (see below)
|
||||
color = name of color or color1/color2/...
|
||||
*bdiam* args = type diam
|
||||
type = bond type or range of types (see below)
|
||||
diam = diameter of bonds of that type (distance units)
|
||||
*boxcolor* arg = color
|
||||
color = name of color for simulation box lines and processor sub-domain lines
|
||||
*color* args = name R G B
|
||||
name = name of color
|
||||
R,G,B = red/green/blue numeric values from 0.0 to 1.0
|
||||
*bitrate* arg = rate
|
||||
rate = target bitrate for movie in kbps
|
||||
*framerate* arg = fps
|
||||
fps = frames per second for movie
|
||||
*header* arg = *yes* or *no*
|
||||
*yes* to write the header
|
||||
*no* to not write the header
|
||||
|
||||
* these keywords apply only to the */gz* and */zstd* dump styles
|
||||
* keyword = *compression_level*
|
||||
@ -92,7 +126,7 @@ Syntax
|
||||
level = integer specifying the compression level that should be used (see below for supported levels)
|
||||
|
||||
* these keywords apply only to the */zstd* dump styles
|
||||
* keyword = *checksum*
|
||||
* keyword = *compression_level*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -110,6 +144,7 @@ Examples
|
||||
dump_modify xtcdump precision 10000 sfactor 0.1
|
||||
dump_modify 1 every 1000 nfile 20
|
||||
dump_modify 1 every v_myVar
|
||||
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -128,9 +163,8 @@ which allow for use of MPI-IO.
|
||||
|
||||
----------
|
||||
|
||||
Unless otherwise noted, the following keywords apply to all the
|
||||
various dump styles, including the :doc:`dump image <dump_image>` and
|
||||
:doc:`dump movie <dump_image>` styles.
|
||||
These keywords apply to various dump styles, including the :doc:`dump image <dump_image>` and :doc:`dump movie <dump_image>` styles. The
|
||||
description gives details.
|
||||
|
||||
----------
|
||||
|
||||
@ -201,19 +235,11 @@ will be accepted.
|
||||
|
||||
----------
|
||||
|
||||
The *every* keyword can be used with any dump style except the *dcd*
|
||||
and *xtc* styles. It does two things. It specifies that the interval
|
||||
between dump snapshots will be set in timesteps, which is the default
|
||||
if the *every* or *every/time* keywords are not used. See the
|
||||
*every/time* keyword for how to specify the interval in simulation
|
||||
time, i.e. in time units of the :doc:`units <units>` command. The
|
||||
*every* keyword also sets the interval value, which overrides the dump
|
||||
frequency originally specified by the :doc:`dump <dump>` command.
|
||||
|
||||
The *every* keyword can be specified in one of two ways. It can be a
|
||||
numeric value in which case it must be > 0. Or it can be an
|
||||
:doc:`equal-style variable <variable>`, which should be specified as
|
||||
v_name, where name is the variable name.
|
||||
The *every* keyword changes the dump frequency originally specified by
|
||||
the :doc:`dump <dump>` command to a new value. The every keyword can be
|
||||
specified in one of two ways. It can be a numeric value in which case
|
||||
it must be > 0. Or it can be an :doc:`equal-style variable <variable>`,
|
||||
which should be specified as v_name, where name is the variable name.
|
||||
|
||||
In this case, the variable is evaluated at the beginning of a run to
|
||||
determine the next timestep at which a dump snapshot will be written
|
||||
@ -222,12 +248,11 @@ determine the next timestep, etc. Thus the variable should return
|
||||
timestep values. See the stagger() and logfreq() and stride() math
|
||||
functions for :doc:`equal-style variables <variable>`, as examples of
|
||||
useful functions to use in this context. Other similar math functions
|
||||
could easily be added as options for :doc:`equal-style variables
|
||||
<variable>`. Also see the next() function, which allows use of a
|
||||
file-style variable which reads successive values from a file, each
|
||||
time the variable is evaluated. Used with the *every* keyword, if the
|
||||
file contains a list of ascending timesteps, you can output snapshots
|
||||
whenever you wish.
|
||||
could easily be added as options for :doc:`equal-style variables <variable>`. Also see the next() function, which allows
|
||||
use of a file-style variable which reads successive values from a
|
||||
file, each time the variable is evaluated. Used with the *every*
|
||||
keyword, if the file contains a list of ascending timesteps, you can
|
||||
output snapshots whenever you wish.
|
||||
|
||||
Note that when using the variable option with the *every* keyword, you
|
||||
need to use the *first* option if you want an initial snapshot written
|
||||
@ -268,103 +293,14 @@ in file tmp.times:
|
||||
|
||||
----------
|
||||
|
||||
The *every/time* keyword can be used with any dump style except the
|
||||
*dcd* and *xtc* styles. It does two things. It specifies that the
|
||||
interval between dump snapshots will be set in simulation time,
|
||||
i.e. in time units of the :doc:`units <units>` command. This can be
|
||||
useful when the timestep size varies during a simulation run, e.g. by
|
||||
use of the :doc:`fix dt/reset <fix_dt_reset>` command. The default is
|
||||
to specify the interval in timesteps; see the *every* keyword. The
|
||||
*every/time* command also sets the interval value.
|
||||
|
||||
.. note::
|
||||
|
||||
If you wish dump styles *atom*, *custom*, *local*, or *xyz* to
|
||||
include the simulation time as a field in the header portion of
|
||||
each snapshot, you also need to use the dump_modify *time* keyword
|
||||
with a setting of *yes*. See its documentation below.
|
||||
|
||||
Note that since snapshots are output on simulation steps, each
|
||||
snapshot will be written on the first timestep whose associated
|
||||
simulation time is >= the exact snapshot time value.
|
||||
|
||||
As with the *every* option, the *Delta* value can be specified in one
|
||||
of two ways. It can be a numeric value in which case it must be >
|
||||
0.0. Or it can be an :doc:`equal-style variable <variable>`, which
|
||||
should be specified as v_name, where name is the variable name.
|
||||
|
||||
In this case, the variable is evaluated at the beginning of a run to
|
||||
determine the next simulation time at which a dump snapshot will be
|
||||
written out. On that timestep the variable will be evaluated again to
|
||||
determine the next simulation time, etc. Thus the variable should
|
||||
return values in time units. Note the current timestep or simulation
|
||||
time can be used in an :doc:`equal-style variables <variable>` since
|
||||
they are both thermodynamic keywords. Also see the next() function,
|
||||
which allows use of a file-style variable which reads successive
|
||||
values from a file, each time the variable is evaluated. Used with
|
||||
the *every/time* keyword, if the file contains a list of ascending
|
||||
simulation times, you can output snapshots whenever you wish.
|
||||
|
||||
Note that when using the variable option with the *every/time*
|
||||
keyword, you need to use the *first* option if you want an initial
|
||||
snapshot written to the dump file. The *every/time* keyword cannot be
|
||||
used with the dump *dcd* style.
|
||||
|
||||
For example, the following commands will write snapshots at successive
|
||||
simulation times which grow by a factor of 1.5 with each interval.
|
||||
The dt value used in the variable is to avoid a zero result when the
|
||||
initial simulation time is 0.0.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable increase equal 1.5*(time+dt)
|
||||
dump 1 all atom 100 tmp.dump
|
||||
dump_modify 1 every/time v_increase first yes
|
||||
|
||||
The following commands would write snapshots at the times listed in
|
||||
file tmp.times:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable f file tmp.times
|
||||
variable s equal next(f)
|
||||
dump 1 all atom 100 tmp.dump
|
||||
dump_modify 1 every/time v_s
|
||||
|
||||
.. note::
|
||||
|
||||
When using a file-style variable with the *every/time* keyword, the
|
||||
file of timesteps must list a first time that is beyond the time
|
||||
associated with the current timestep (e.g. it cannot be 0.0). And
|
||||
it must list one or more times beyond the length of the run you
|
||||
perform. This is because the dump command will generate an error
|
||||
if the next time it reads from the file is not a value greater than
|
||||
the current time. Thus if you wanted output at times 0,15,100 of a
|
||||
run of length 100 in simulation time, the file should contain the
|
||||
values 15,100,101 and you should also use the dump_modify first
|
||||
command. Any final value > 100 could be used in place of 101.
|
||||
|
||||
----------
|
||||
|
||||
The *first* keyword determines whether a dump snapshot is written on
|
||||
the very first timestep after the dump command is invoked. This will
|
||||
always occur if the current timestep is a multiple of $N$, the
|
||||
frequency specified in the :doc:`dump <dump>` command or
|
||||
:doc:`dump_modify every <dump_modify>` command, including timestep 0.
|
||||
It will also always occur if the current simulation time is a multiple
|
||||
of *Delta*, the time interval specified in the doc:`dump_modify
|
||||
every/time <dump_modify>` command.
|
||||
|
||||
But if this is not the case, a dump snapshot will only be written if
|
||||
the setting of this keyword is *yes*\ . If it is *no*, which is the
|
||||
always occur if the current timestep is a multiple of N, the frequency
|
||||
specified in the :doc:`dump <dump>` command, including timestep 0. But
|
||||
if this is not the case, a dump snapshot will only be written if the
|
||||
setting of this keyword is *yes*\ . If it is *no*, which is the
|
||||
default, then it will not be written.
|
||||
|
||||
Note that if the argument to the :doc:`dump_modify every
|
||||
<dump_modify>` doc:`dump_modify every/time <dump_modify>` commands is
|
||||
a variable and not a numeric value, then specifying *first yes* is the
|
||||
only way to write a dump snapshot on the first timestep after the dump
|
||||
command is invoked.
|
||||
|
||||
----------
|
||||
|
||||
The *flush* keyword determines whether a flush operation is invoked
|
||||
@ -444,13 +380,6 @@ The *fileper* keyword is documented below with the *nfile* keyword.
|
||||
|
||||
----------
|
||||
|
||||
The *header* keyword toggles whether the dump file will include a
|
||||
header. Excluding a header will reduce the size of the dump file for
|
||||
fixes such as :doc:`fix pair/tracker <fix_pair_tracker>` which do not
|
||||
require the information typically written to the header.
|
||||
|
||||
----------
|
||||
|
||||
The *image* keyword applies only to the dump *atom* style. If the
|
||||
image value is *yes*, 3 flags are appended to each atom's coords which
|
||||
are the absolute box image of the atom in each dimension. For
|
||||
@ -663,19 +592,9 @@ The dump *local* style cannot be sorted by atom ID, since there are
|
||||
typically multiple lines of output per atom. Some dump styles, such
|
||||
as *dcd* and *xtc*, require sorting by atom ID to format the output
|
||||
file correctly. If multiple processors are writing the dump file, via
|
||||
the "%" wildcard in the dump filename and the *nfile* or *fileper*
|
||||
keywords are set to non-default values (i.e. the number of dump file
|
||||
pieces is not equal to the number of procs), then sorting cannot be
|
||||
the "%" wildcard in the dump filename, then sorting cannot be
|
||||
performed.
|
||||
|
||||
In a parallel run, the per-processor dump file pieces can have
|
||||
significant imbalance in number of lines of per-atom info. The *balance*
|
||||
keyword determines whether the number of lines in each processor
|
||||
snapshot are balanced to be nearly the same. A balance value of *no*
|
||||
means no balancing will be done, while *yes* means balancing will be
|
||||
performed. This balancing preserves dump sorting order. For a serial
|
||||
run, this option is ignored since the output is already balanced.
|
||||
|
||||
.. note::
|
||||
|
||||
Unless it is required by the dump style, sorting dump file
|
||||
@ -751,20 +670,16 @@ threshold criterion is met. Otherwise it is not met.
|
||||
|
||||
----------
|
||||
|
||||
The *time* keyword only applies to the dump *atom*, *custom*, *local*,
|
||||
and *xyz* styles (and their COMPRESS package versions *atom/gz*,
|
||||
*custom/gz* and *local/gz*\ ). For the first 3 styles, if set to
|
||||
*yes*, each frame will will contain two extra lines before the "ITEM:
|
||||
TIMESTEP" entry:
|
||||
The *time* keyword only applies to the dump *atom*, *custom*, and
|
||||
*local* styles (and their COMPRESS package versions *atom/gz*,
|
||||
*custom/gz* and *local/gz*\ ). If set to *yes*, each frame will will
|
||||
contain two extra lines before the "ITEM: TIMESTEP" entry:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ITEM: TIME
|
||||
\<elapsed time\>
|
||||
|
||||
For the *xyz* style, the simulation time is included on the same line
|
||||
as the timestep value.
|
||||
|
||||
This will output the current elapsed simulation time in current
|
||||
time units equivalent to the :doc:`thermo keyword <thermo_style>` *time*\ .
|
||||
This is to simplify post-processing of trajectories using a variable time
|
||||
@ -800,35 +715,305 @@ box size stored with the snapshot.
|
||||
|
||||
----------
|
||||
|
||||
The COMPRESS package offers both GZ and Zstd compression variants of
|
||||
styles atom, custom, local, cfg, and xyz. When using these styles the
|
||||
compression level can be controlled by the :code:`compression_level`
|
||||
keyword. File names with these styles have to end in either
|
||||
:code:`.gz` or :code:`.zst`.
|
||||
These keywords apply only to the :doc:`dump image <dump_image>` and
|
||||
:doc:`dump movie <dump_image>` styles. Any keyword that affects an
|
||||
image, also affects a movie, since the movie is simply a collection of
|
||||
images. Some of the keywords only affect the :doc:`dump movie <dump_image>` style. The descriptions give details.
|
||||
|
||||
GZ supports compression levels from -1 (default), 0 (no compression),
|
||||
and 1 to
|
||||
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9
|
||||
as default compression level.
|
||||
----------
|
||||
|
||||
The *acolor* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, when its atom color setting is *type*, to set the color that
|
||||
atoms of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Ntypes = the
|
||||
number of atom types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of atom
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
|
||||
number of atom types, then an asterisk with no numeric values means
|
||||
all types from 1 to N. A leading asterisk means all types from 1 to n
|
||||
(inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified atom types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified atom types.
|
||||
|
||||
----------
|
||||
|
||||
The *adiam* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, when its atom diameter setting is *type*, to set the size
|
||||
that atoms of each type will be drawn in the image. The specified
|
||||
*type* should be an integer from 1 to Ntypes. As with the *acolor*
|
||||
keyword, a wildcard asterisk can be used as part of the *type*
|
||||
argument to specify a range of atom types. The specified *diam* is
|
||||
the size in whatever distance :doc:`units <units>` the input script is
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *amap* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *atom* keyword, when its atom setting is an
|
||||
atom-attribute, to setup a color map. The color map is used to assign
|
||||
a specific RGB (red/green/blue) color value to an individual atom when
|
||||
it is drawn, based on the atom's attribute, which is a numeric value,
|
||||
e.g. its x-component of velocity if the atom-attribute "vx" was
|
||||
specified.
|
||||
|
||||
The basic idea of a color map is that the atom-attribute will be
|
||||
within a range of values, and that range is associated with a series
|
||||
of colors (e.g. red, blue, green). An atom's specific value (vx =
|
||||
-3.2) can then mapped to the series of colors (e.g. halfway between
|
||||
red and blue), and a specific color is determined via an interpolation
|
||||
procedure.
|
||||
|
||||
There are many possible options for the color map, enabled by the
|
||||
*amap* keyword. Here are the details.
|
||||
|
||||
The *lo* and *hi* settings determine the range of values allowed for
|
||||
the atom attribute. If numeric values are used for *lo* and/or *hi*,
|
||||
then values that are lower/higher than that value are set to the
|
||||
value. I.e. the range is static. If *lo* is specified as *min* or
|
||||
*hi* as *max* then the range is dynamic, and the lower and/or
|
||||
upper bound will be calculated each time an image is drawn, based
|
||||
on the set of atoms being visualized.
|
||||
|
||||
The *style* setting is two letters, such as "ca". The first letter is
|
||||
either "c" for continuous, "d" for discrete, or "s" for sequential.
|
||||
The second letter is either "a" for absolute, or "f" for fractional.
|
||||
|
||||
A continuous color map is one in which the color changes continuously
|
||||
from value to value within the range. A discrete color map is one in
|
||||
which discrete colors are assigned to sub-ranges of values within the
|
||||
range. A sequential color map is one in which discrete colors are
|
||||
assigned to a sequence of sub-ranges of values covering the entire
|
||||
range.
|
||||
|
||||
An absolute color map is one in which the values to which colors are
|
||||
assigned are specified explicitly as values within the range. A
|
||||
fractional color map is one in which the values to which colors are
|
||||
assigned are specified as a fractional portion of the range. For
|
||||
example if the range is from -10.0 to 10.0, and the color red is to be
|
||||
assigned to atoms with a value of 5.0, then for an absolute color map
|
||||
the number 5.0 would be used. But for a fractional map, the number
|
||||
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
|
||||
|
||||
The *delta* setting must be specified for all styles, but is only used
|
||||
for the sequential style; otherwise the value is ignored. It
|
||||
specifies the bin size to use within the range for assigning
|
||||
consecutive colors to. For example, if the range is from -10.0 to
|
||||
10.0 and a *delta* of 1.0 is used, then 20 colors will be assigned to
|
||||
the range. The first will be from -10.0 <= color1 < -9.0, then second
|
||||
from -9.0 <= color2 < -8.0, etc.
|
||||
|
||||
The *N* setting is how many entries follow. The format of the entries
|
||||
depends on whether the color map style is continuous, discrete or
|
||||
sequential. In all cases the *color* setting can be any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
For continuous color maps, each entry has a *value* and a *color*\ .
|
||||
The *value* is either a number within the range of values or *min* or
|
||||
*max*\ . The *value* of the first entry must be *min* and the *value*
|
||||
of the last entry must be *max*\ . Any entries in between must have
|
||||
increasing values. Note that numeric values can be specified either
|
||||
as absolute numbers or as fractions (0.0 to 1.0) of the range,
|
||||
depending on the "a" or "f" in the style setting for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. X will fall
|
||||
between 2 of the entry values. The color of the atom is linearly
|
||||
interpolated (in each of the RGB values) between the 2 colors
|
||||
associated with those entries. For example, if X = -5.0 and the 2
|
||||
surrounding entries are "red" at -10.0 and "blue" at 0.0, then the
|
||||
atom's color will be halfway between "red" and "blue", which happens
|
||||
to be "purple".
|
||||
|
||||
For discrete color maps, each entry has a *lo* and *hi* value and a
|
||||
*color*\ . The *lo* and *hi* settings are either numbers within the
|
||||
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
|
||||
and *hi* settings of the last entry must be *min* and *max*\ . Other
|
||||
entries can have any *lo* and *hi* values and the sub-ranges of
|
||||
different values can overlap. Note that numeric *lo* and *hi* values
|
||||
can be specified either as absolute numbers or as fractions (0.0 to
|
||||
1.0) of the range, depending on the "a" or "f" in the style setting
|
||||
for the color map.
|
||||
|
||||
Here is how the entries are used to determine the color of an
|
||||
individual atom, given the value X of its atom attribute. The entries
|
||||
are scanned from first to last. The first time that *lo* <= X <=
|
||||
*hi*, X is assigned the color associated with that entry. You can
|
||||
think of the last entry as assigning a default color (since it will
|
||||
always be matched by X), and the earlier entries as colors that
|
||||
override the default. Also note that no interpolation of a color RGB
|
||||
is done. All atoms will be drawn with one of the colors in the list
|
||||
of entries.
|
||||
|
||||
For sequential color maps, each entry has only a *color*\ . Here is how
|
||||
the entries are used to determine the color of an individual atom,
|
||||
given the value X of its atom attribute. The range is partitioned
|
||||
into N bins of width *binsize*\ . Thus X will fall in a specific bin
|
||||
from 1 to N, say the Mth bin. If it falls on a boundary between 2
|
||||
bins, it is considered to be in the higher of the 2 bins. Each bin is
|
||||
assigned a color from the E entries. If E < N, then the colors are
|
||||
repeated. For example if 2 entries with colors red and green are
|
||||
specified, then the odd numbered bins will be red and the even bins
|
||||
green. The color of the atom is the color of its bin. Note that the
|
||||
sequential color map is really a shorthand way of defining a discrete
|
||||
color map without having to specify where all the bin boundaries are.
|
||||
|
||||
Here is an example of using a sequential color map to color all the
|
||||
atoms in individual molecules with a different color. See the
|
||||
examples/pour/in.pour.2d.molecule input script for an example of how
|
||||
this is used.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable colors string &
|
||||
"red green blue yellow white &
|
||||
purple pink orange lime gray"
|
||||
variable mol atom mol%10
|
||||
dump 1 all image 250 image.*.jpg v_mol type &
|
||||
zoom 1.6 adiam 1.5
|
||||
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}
|
||||
|
||||
In this case, 10 colors are defined, and molecule IDs are
|
||||
mapped to one of the colors, even if there are 1000s of molecules.
|
||||
|
||||
----------
|
||||
|
||||
The *backcolor* sets the background color of the images. The color
|
||||
name can be any of the 140 pre-defined colors (see below) or a color
|
||||
name defined by the dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *bcolor* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *bond* keyword, when its color setting is *type*, to
|
||||
set the color that bonds of each type will be drawn in the image.
|
||||
|
||||
The specified *type* should be an integer from 1 to Nbondtypes = the
|
||||
number of bond types. A wildcard asterisk can be used in place of or
|
||||
in conjunction with the *type* argument to specify a range of bond
|
||||
types. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
|
||||
number of bond types, then an asterisk with no numeric values means
|
||||
all types from 1 to N. A leading asterisk means all types from 1 to n
|
||||
(inclusive). A trailing asterisk means all types from n to N
|
||||
(inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
The specified *color* can be a single color which is any of the 140
|
||||
pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option. Or it can be two or more colors separated
|
||||
by a "/" character, e.g. red/green/blue. In the former case, that
|
||||
color is assigned to all the specified bond types. In the latter
|
||||
case, the list of colors are assigned in a round-robin fashion to each
|
||||
of the specified bond types.
|
||||
|
||||
----------
|
||||
|
||||
The *bdiam* keyword can be used with the :doc:`dump image <dump_image>`
|
||||
command, with its *bond* keyword, when its diam setting is *type*, to
|
||||
set the diameter that bonds of each type will be drawn in the image.
|
||||
The specified *type* should be an integer from 1 to Nbondtypes. As
|
||||
with the *bcolor* keyword, a wildcard asterisk can be used as part of
|
||||
the *type* argument to specify a range of bond types. The specified
|
||||
*diam* is the size in whatever distance :doc:`units <units>` you are
|
||||
using, e.g. Angstroms.
|
||||
|
||||
----------
|
||||
|
||||
The *bitrate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the size of the resulting
|
||||
movie file and its quality via setting how many kbits per second are
|
||||
to be used for the movie file. Higher bitrates require less
|
||||
compression and will result in higher quality movies. The quality is
|
||||
also determined by the compression format and encoder. The default
|
||||
setting is 2000 kbit/s, which will result in average quality with
|
||||
older compression formats.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all movie file formats supported by dump movie allow the
|
||||
bitrate to be set. If not, the setting is silently ignored.
|
||||
|
||||
----------
|
||||
|
||||
The *boxcolor* keyword sets the color of the simulation box drawn
|
||||
around the atoms in each image as well as the color of processor
|
||||
sub-domain boundaries. See the "dump image box" command for how to
|
||||
specify that a box be drawn via the *box* keyword, and the sub-domain
|
||||
boundaries via the *subbox* keyword. The color name can be any of the
|
||||
140 pre-defined colors (see below) or a color name defined by the
|
||||
dump_modify color option.
|
||||
|
||||
----------
|
||||
|
||||
The *color* keyword allows definition of a new color name, in addition
|
||||
to the 140-predefined colors (see below), and associates 3
|
||||
red/green/blue RGB values with that color name. The color name can
|
||||
then be used with any other dump_modify keyword that takes a color
|
||||
name as a value. The RGB values should each be floating point values
|
||||
between 0.0 and 1.0 inclusive.
|
||||
|
||||
When a color name is converted to RGB values, the user-defined color
|
||||
names are searched first, then the 140 pre-defined color names. This
|
||||
means you can also use the *color* keyword to overwrite one of the
|
||||
pre-defined color names with new RBG values.
|
||||
|
||||
----------
|
||||
|
||||
The *framerate* keyword can be used with the :doc:`dump movie <dump_image>` command to define the duration of the resulting
|
||||
movie file. Movie files written by the dump *movie* command have a
|
||||
default frame rate of 24 frames per second and the images generated
|
||||
will be converted at that rate. Thus a sequence of 1000 dump images
|
||||
will result in a movie of about 42 seconds. To make a movie run
|
||||
longer you can either generate images more frequently or lower the
|
||||
frame rate. To speed a movie up, you can do the inverse. Using a
|
||||
frame rate higher than 24 is not recommended, as it will result in
|
||||
simply dropping the rendered images. It is more efficient to dump
|
||||
images less frequently.
|
||||
|
||||
----------
|
||||
|
||||
The *header* keyword toggles whether the dump file will include a header.
|
||||
Excluding a header will reduce the size of the dump file for fixes such as
|
||||
:doc:`fix pair/tracker <fix_pair_tracker>` which do not require the information
|
||||
typically written to the header.
|
||||
|
||||
----------
|
||||
|
||||
The COMPRESS package offers both GZ and Zstd compression variants of styles
|
||||
atom, custom, local, cfg, and xyz. When using these styles the compression
|
||||
level can be controlled by the :code:`compression_level` parameter. File names
|
||||
with these styles have to end in either :code:`.gz` or :code:`.zst`.
|
||||
|
||||
GZ supports compression levels from -1 (default), 0 (no compression), and 1 to
|
||||
9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9 as
|
||||
default compression level.
|
||||
|
||||
Zstd offers a wider range of compression levels, including negative
|
||||
levels that sacrifice compression for performance. 0 is the default,
|
||||
positive levels are 1 to 22, with 22 being the most expensive
|
||||
levels that sacrifice compression for performance. 0 is the
|
||||
default, positive levels are 1 to 22, with 22 being the most expensive
|
||||
compression. Zstd promises higher compression/decompression speeds for
|
||||
similar compression ratios. For more details see
|
||||
`http://facebook.github.io/zstd/`.
|
||||
|
||||
In addition, Zstd compressed files can include a checksum of the
|
||||
entire contents. The Zstd enabled dump styles enable this feature by
|
||||
default and it can be disabled with the :code:`checksum` keyword.
|
||||
In addition, Zstd compressed files can have a checksum of the entire
|
||||
contents. The Zstd enabled dump styles enable this feature by default and it
|
||||
can be disabled with the :code:`checksum` parameter.
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
Not all *dump_modify* options can be applied to all dump styles.
|
||||
Details are in the discussions of the individual options.
|
||||
*dump_modify sort* is not supported for dumps of groups containing
|
||||
more than 2 billion atoms.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
@ -841,7 +1026,6 @@ Default
|
||||
The option defaults are
|
||||
|
||||
* append = no
|
||||
* balance = no
|
||||
* buffer = yes for dump styles *atom*, *custom*, *loca*, and *xyz*
|
||||
* element = "C" for every atom type
|
||||
* every = whatever it was set to via the :doc:`dump <dump>` command
|
||||
@ -864,7 +1048,100 @@ The option defaults are
|
||||
* units = no
|
||||
* unwrap = no
|
||||
|
||||
* acolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* adiam = \* 1.0
|
||||
* amap = min max cf 0.0 2 min blue max red
|
||||
* backcolor = black
|
||||
* bcolor = \* red/green/blue/yellow/aqua/cyan
|
||||
* bdiam = \* 0.5
|
||||
* bitrate = 2000
|
||||
* boxcolor = yellow
|
||||
* color = 140 color names are pre-defined as listed below
|
||||
* framerate = 24
|
||||
|
||||
* compression_level = 9 (gz variants)
|
||||
* compression_level = 0 (zstd variants)
|
||||
* checksum = yes (zstd variants)
|
||||
|
||||
----------
|
||||
|
||||
These are the standard 109 element names that LAMMPS pre-defines for
|
||||
use with the :doc:`dump image <dump_image>` and dump_modify commands.
|
||||
|
||||
* 1-10 = "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne"
|
||||
* 11-20 = "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
|
||||
* 21-30 = "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn"
|
||||
* 31-40 = "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr"
|
||||
* 41-50 = "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn"
|
||||
* 51-60 = "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd"
|
||||
* 61-70 = "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb"
|
||||
* 71-80 = "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg"
|
||||
* 81-90 = "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th"
|
||||
* 91-100 = "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm"
|
||||
* 101-109 = "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt"
|
||||
|
||||
----------
|
||||
|
||||
These are the 140 colors that LAMMPS pre-defines for use with the
|
||||
:doc:`dump image <dump_image>` and dump_modify commands. Additional
|
||||
colors can be defined with the dump_modify color command. The 3
|
||||
numbers listed for each name are the RGB (red/green/blue) values.
|
||||
Divide each value by 255 to get the equivalent 0.0 to 1.0 value.
|
||||
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| aliceblue = 240, 248, 255 | antiquewhite = 250, 235, 215 | aqua = 0, 255, 255 | aquamarine = 127, 255, 212 | azure = 240, 255, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| beige = 245, 245, 220 | bisque = 255, 228, 196 | black = 0, 0, 0 | blanchedalmond = 255, 255, 205 | blue = 0, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| blueviolet = 138, 43, 226 | brown = 165, 42, 42 | burlywood = 222, 184, 135 | cadetblue = 95, 158, 160 | chartreuse = 127, 255, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| chocolate = 210, 105, 30 | coral = 255, 127, 80 | cornflowerblue = 100, 149, 237 | cornsilk = 255, 248, 220 | crimson = 220, 20, 60 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| cyan = 0, 255, 255 | darkblue = 0, 0, 139 | darkcyan = 0, 139, 139 | darkgoldenrod = 184, 134, 11 | darkgray = 169, 169, 169 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkgreen = 0, 100, 0 | darkkhaki = 189, 183, 107 | darkmagenta = 139, 0, 139 | darkolivegreen = 85, 107, 47 | darkorange = 255, 140, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkorchid = 153, 50, 204 | darkred = 139, 0, 0 | darksalmon = 233, 150, 122 | darkseagreen = 143, 188, 143 | darkslateblue = 72, 61, 139 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| darkslategray = 47, 79, 79 | darkturquoise = 0, 206, 209 | darkviolet = 148, 0, 211 | deeppink = 255, 20, 147 | deepskyblue = 0, 191, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| dimgray = 105, 105, 105 | dodgerblue = 30, 144, 255 | firebrick = 178, 34, 34 | floralwhite = 255, 250, 240 | forestgreen = 34, 139, 34 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| fuchsia = 255, 0, 255 | gainsboro = 220, 220, 220 | ghostwhite = 248, 248, 255 | gold = 255, 215, 0 | goldenrod = 218, 165, 32 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| gray = 128, 128, 128 | green = 0, 128, 0 | greenyellow = 173, 255, 47 | honeydew = 240, 255, 240 | hotpink = 255, 105, 180 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| indianred = 205, 92, 92 | indigo = 75, 0, 130 | ivory = 255, 240, 240 | khaki = 240, 230, 140 | lavender = 230, 230, 250 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lavenderblush = 255, 240, 245 | lawngreen = 124, 252, 0 | lemonchiffon = 255, 250, 205 | lightblue = 173, 216, 230 | lightcoral = 240, 128, 128 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightcyan = 224, 255, 255 | lightgoldenrodyellow = 250, 250, 210 | lightgreen = 144, 238, 144 | lightgrey = 211, 211, 211 | lightpink = 255, 182, 193 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightsalmon = 255, 160, 122 | lightseagreen = 32, 178, 170 | lightskyblue = 135, 206, 250 | lightslategray = 119, 136, 153 | lightsteelblue = 176, 196, 222 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| lightyellow = 255, 255, 224 | lime = 0, 255, 0 | limegreen = 50, 205, 50 | linen = 250, 240, 230 | magenta = 255, 0, 255 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| maroon = 128, 0, 0 | mediumaquamarine = 102, 205, 170 | mediumblue = 0, 0, 205 | mediumorchid = 186, 85, 211 | mediumpurple = 147, 112, 219 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| mediumseagreen = 60, 179, 113 | mediumslateblue = 123, 104, 238 | mediumspringgreen = 0, 250, 154 | mediumturquoise = 72, 209, 204 | mediumvioletred = 199, 21, 133 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| midnightblue = 25, 25, 112 | mintcream = 245, 255, 250 | mistyrose = 255, 228, 225 | moccasin = 255, 228, 181 | navajowhite = 255, 222, 173 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| navy = 0, 0, 128 | oldlace = 253, 245, 230 | olive = 128, 128, 0 | olivedrab = 107, 142, 35 | orange = 255, 165, 0 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| orangered = 255, 69, 0 | orchid = 218, 112, 214 | palegoldenrod = 238, 232, 170 | palegreen = 152, 251, 152 | paleturquoise = 175, 238, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| palevioletred = 219, 112, 147 | papayawhip = 255, 239, 213 | peachpuff = 255, 239, 213 | peru = 205, 133, 63 | pink = 255, 192, 203 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| plum = 221, 160, 221 | powderblue = 176, 224, 230 | purple = 128, 0, 128 | red = 255, 0, 0 | rosybrown = 188, 143, 143 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| royalblue = 65, 105, 225 | saddlebrown = 139, 69, 19 | salmon = 250, 128, 114 | sandybrown = 244, 164, 96 | seagreen = 46, 139, 87 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| seashell = 255, 245, 238 | sienna = 160, 82, 45 | silver = 192, 192, 192 | skyblue = 135, 206, 235 | slateblue = 106, 90, 205 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| slategray = 112, 128, 144 | snow = 255, 250, 250 | springgreen = 0, 255, 127 | steelblue = 70, 130, 180 | tan = 210, 180, 140 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| teal = 0, 128, 128 | thistle = 216, 191, 216 | tomato = 253, 99, 71 | turquoise = 64, 224, 208 | violet = 238, 130, 238 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
| wheat = 245, 222, 179 | white = 255, 255, 255 | whitesmoke = 245, 245, 245 | yellow = 255, 255, 0 | yellowgreen = 154, 205, 50 |
|
||||
+-------------------------------+--------------------------------------+---------------------------------+--------------------------------+--------------------------------+
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
.. index:: dynamical_matrix
|
||||
.. index:: dynamical_matrix/kk
|
||||
|
||||
dynamical_matrix command
|
||||
========================
|
||||
|
||||
Accelerator Variants: dynamical_matrix/kk
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -59,12 +56,6 @@ If the style eskm is selected, the dynamical matrix will be in units of
|
||||
inverse squared femtoseconds. These units will then conveniently leave
|
||||
frequencies in THz.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
|
||||
@ -166,7 +166,6 @@ page are followed by one or more of (g,i,k,o,t) to indicate which
|
||||
accelerated styles exist.
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>` - apply cosine-shaped acceleration to atoms
|
||||
* :doc:`acks2/reaxff <fix_acks2_reaxff>` - apply ACKS2 charge equilibration
|
||||
* :doc:`adapt <fix_adapt>` - change a simulation parameter over time
|
||||
* :doc:`adapt/fep <fix_adapt_fep>` - enhanced version of fix adapt
|
||||
* :doc:`addforce <fix_addforce>` - add a force to each atom
|
||||
@ -247,7 +246,6 @@ accelerated styles exist.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>` - restrain atoms to a manifold during minimization
|
||||
* :doc:`mdi/engine <fix_mdi_engine>` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI)
|
||||
* :doc:`meso/move <fix_meso_move>` - move mesoscopic SPH/SDPD particles in a prescribed fashion
|
||||
* :doc:`mol/swap <fix_mol_swap>` - Monte Carlo atom type swapping with a molecule
|
||||
* :doc:`momentum <fix_momentum>` - zero the linear and/or angular momentum of a group of atoms
|
||||
* :doc:`momentum/chunk <fix_momentum>` - zero the linear and/or angular momentum of a chunk of atoms
|
||||
* :doc:`move <fix_move>` - move atoms in a prescribed fashion
|
||||
@ -271,8 +269,7 @@ accelerated styles exist.
|
||||
* :doc:`npt/eff <fix_nh_eff>` - NPT for nuclei and electrons in the electron force field model
|
||||
* :doc:`npt/sphere <fix_npt_sphere>` - NPT for spherical particles
|
||||
* :doc:`npt/uef <fix_nh_uef>` - NPT style time integration with diagonal flow
|
||||
* :doc:`numdiff <fix_numdiff>` - numerically approximate atomic forces using finite energy differences
|
||||
* :doc:`numdiff/virial <fix_numdiff_virial>` - numerically approximate virial stress tensor using finite energy differences
|
||||
* :doc:`numdiff <fix_numdiff>` - compute derivatives of per-atom data from finite differences
|
||||
* :doc:`nve <fix_nve>` - constant NVE time integration
|
||||
* :doc:`nve/asphere <fix_nve_asphere>` - NVE for aspherical particles
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>` - NVE for aspherical particles without forces
|
||||
|
||||
@ -1,118 +0,0 @@
|
||||
.. index:: fix acks2/reaxff
|
||||
.. index:: fix acks2/reaxff/kk
|
||||
|
||||
fix acks2/reaxff command
|
||||
========================
|
||||
|
||||
Accelerator Variants: *acks2/reaxff/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID acks2/reaxff Nevery cutlo cuthi tolerance params args
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* acks2/reaxff = style name of this fix command
|
||||
* Nevery = perform ACKS2 every this many steps
|
||||
* cutlo,cuthi = lo and hi cutoff for Taper radius
|
||||
* tolerance = precision to which charges will be equilibrated
|
||||
* params = reaxff or a filename
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 reaxff
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Perform the atom-condensed Kohn-Sham DFT to second order (ACKS2) charge
|
||||
equilibration method as described in :ref:`(Verstraelen) <Verstraelen>`.
|
||||
ACKS2 impedes unphysical long-range charge transfer sometimes seen with
|
||||
QEq (e.g. for dissociation of molecules), at increased computational
|
||||
cost. It is typically used in conjunction with the ReaxFF force field
|
||||
model as implemented in the :doc:`pair_style reaxff <pair_reaxff>`
|
||||
command, but it can be used with any potential in LAMMPS, so long as it
|
||||
defines and uses charges on each atom. For more technical details about
|
||||
the charge equilibration performed by fix acks2/reaxff, see the
|
||||
:ref:`(O'Hearn) <O'Hearn>` paper.
|
||||
|
||||
The ACKS2 method minimizes the electrostatic energy of the system by
|
||||
adjusting the partial charge on individual atoms based on interactions
|
||||
with their neighbors. It requires some parameters for each atom type.
|
||||
If the *params* setting above is the word "reaxff", then these are
|
||||
extracted from the :doc:`pair_style reaxff <pair_reaxff>` command and
|
||||
the ReaxFF force field file it reads in. If a file name is specified
|
||||
for *params*\ , then the parameters are taken from the specified file
|
||||
and the file must contain one line for each atom type. The latter form
|
||||
must be used when performing QeQ with a non-ReaxFF potential. The lines
|
||||
should be formatted as follows:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
bond_softness
|
||||
itype chi eta gamma bcut
|
||||
|
||||
where the first line is the global parameter *bond_softness*. The
|
||||
remaining 1 to Ntypes lines include *itype*, the atom type from 1 to
|
||||
Ntypes, *chi*, the electronegativity in eV, *eta*, the self-Coulomb
|
||||
potential in eV, *gamma*, the valence orbital exponent, and *bcut*, the
|
||||
bond cutoff distance. Note that these 4 quantities are also in the
|
||||
ReaxFF potential file, except that eta is defined here as twice the eta
|
||||
value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units
|
||||
of this fix are hard-coded to be A, eV, and electronic charge.
|
||||
|
||||
**Restart, fix_modify, output, run start/stop, minimize info:**
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. No global scalar or vector or per-atom quantities are
|
||||
stored by this fix for access by various :doc:`output commands
|
||||
<Howto_output>`. No parameter of this fix can be used with the
|
||||
*start/stop* keywords of the :doc:`run <run>` command.
|
||||
|
||||
This fix is invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the REAXFF package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
This fix does not correctly handle interactions involving multiple
|
||||
periodic images of the same atom. Hence, it should not be used for
|
||||
periodic cell dimensions less than 10 angstroms.
|
||||
|
||||
This fix may be used in combination with :doc:`fix efield <fix_efield>`
|
||||
and will apply the external electric field during charge equilibration,
|
||||
but there may be only one fix efield instance used, it may only use a
|
||||
constant electric field, and the electric field vector may only have
|
||||
components in non-periodic directions.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`pair_style reaxff <pair_reaxff>`, :doc:`fix qeq/reaxff <fix_qeq_reaxff>`
|
||||
|
||||
**Default:** none
|
||||
|
||||
----------
|
||||
|
||||
.. _O'Hearn:
|
||||
|
||||
**(O'Hearn)** O'Hearn, Alperen, Aktulga, SIAM J. Sci. Comput., 42(1), C1-C22 (2020).
|
||||
|
||||
.. _Verstraelen:
|
||||
|
||||
**(Verstraelen)** Verstraelen, Ayers, Speybroeck, Waroquier, J. Chem. Phys. 138, 074108 (2013).
|
||||
@ -99,7 +99,7 @@ invoked by the :doc:`minimize <minimize>` command.
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the EXTRA-FIX package. It is only enabled if
|
||||
This fix is part of the MISC package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
|
||||
@ -73,51 +73,51 @@ is the same after the swap as it was before the swap, even though the
|
||||
atom masses have changed.
|
||||
|
||||
The *semi-grand* keyword can be set to *yes* to switch to the
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh)
|
||||
<Sadigh>`. This means that the total number of each particle type does
|
||||
not need to be conserved. The default is *no*, which means that the
|
||||
only kind of swap allowed exchanges an atom of one type with an atom
|
||||
of a different given type. In other words, the relative mole fractions
|
||||
of the swapped atoms remains constant. Whereas in the semi-grand
|
||||
canonical ensemble, the composition of the system can change. Note
|
||||
that when using *semi-grand*, atoms in the fix group whose type is not
|
||||
listed in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch the selected atom (if
|
||||
eligible) to one of the other listed types with equal
|
||||
probability. Acceptance of each attempt depends upon the Metropolis
|
||||
criterion.
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh) <Sadigh>`. This
|
||||
means that the total number of each particle type does not need to be
|
||||
conserved. The default is *no*, which means that the only kind of swap
|
||||
allowed exchanges an atom of one type with an atom of a different
|
||||
given type. In other words, the relative mole fractions of the swapped
|
||||
atoms remains constant. Whereas in the semi-grand canonical ensemble,
|
||||
the composition of the system can change. Note that when using
|
||||
*semi-grand*, atoms in the fix group whose type is not listed
|
||||
in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch
|
||||
the selected atom (if eligible) to one of the other listed types
|
||||
with equal probability. Acceptance of each attempt depends upon the Metropolis criterion.
|
||||
|
||||
The *mu* keyword allows users to specify chemical potentials. This is
|
||||
required and allowed only when using *semi-grand*\ . All chemical
|
||||
potentials are absolute, so there is one for each swap type listed
|
||||
following the *types* keyword. In semi-grand canonical ensemble
|
||||
simulations the chemical composition of the system is controlled by
|
||||
the difference in these values. So shifting all values by a constant
|
||||
amount will have no effect on the simulation.
|
||||
The *mu* keyword allows users to specify chemical
|
||||
potentials. This is required and allowed only when using *semi-grand*\ .
|
||||
All chemical potentials are absolute, so there is one for
|
||||
each swap type listed following the *types* keyword.
|
||||
In semi-grand canonical ensemble simulations the chemical composition
|
||||
of the system is controlled by the difference in these values. So
|
||||
shifting all values by a constant amount will have no effect
|
||||
on the simulation.
|
||||
|
||||
This command may optionally use the *region* keyword to define swap
|
||||
volume. The specified region must have been previously defined with a
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\
|
||||
. Swap attempts occur only between atoms that are both within the
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\ .
|
||||
Swap attempts occur only between atoms that are both within the
|
||||
specified region. Swaps are not otherwise attempted.
|
||||
|
||||
You should ensure you do not swap atoms belonging to a molecule, or
|
||||
LAMMPS will eventually generate an error when it tries to find those
|
||||
atoms. LAMMPS will warn you if any of the atoms eligible for swapping
|
||||
have a non-zero molecule ID, but does not check for this at the time of
|
||||
LAMMPS will soon generate an error when it tries to find those atoms.
|
||||
LAMMPS will warn you if any of the atoms eligible for swapping have a
|
||||
non-zero molecule ID, but does not check for this at the time of
|
||||
swapping.
|
||||
|
||||
If not using *semi-grand* this fix checks to ensure all atoms of the
|
||||
given types have the same atomic charge. LAMMPS does not enforce this
|
||||
in general, but it is needed for this fix to simplify the swapping
|
||||
procedure. Successful swaps will swap the atom type and charge of the
|
||||
swapped atoms. Conversely, when using *semi-grand*, it is assumed that
|
||||
all the atom types involved in switches have the same
|
||||
charge. Otherwise, charge would not be conserved. As a consequence, no
|
||||
checks on atomic charges are performed, and successful switches update
|
||||
the atom type but not the atom charge. While it is possible to use
|
||||
*semi-grand* with groups of atoms that have different charges, these
|
||||
charges will not be changed when the atom types change.
|
||||
in general, but it is needed for this fix to simplify the
|
||||
swapping procedure. Successful swaps will swap the atom type and charge
|
||||
of the swapped atoms. Conversely, when using *semi-grand*, it is assumed that all the atom
|
||||
types involved in switches have the same charge. Otherwise, charge
|
||||
would not be conserved. As a consequence, no checks on atomic charges are
|
||||
performed, and successful switches update the atom type but not the
|
||||
atom charge. While it is possible to use *semi-grand* with groups of
|
||||
atoms that have different charges, these charges will not be changed when the
|
||||
atom types change.
|
||||
|
||||
Since this fix computes total potential energies before and after
|
||||
proposed swaps, so even complicated potential energy calculations are
|
||||
@ -133,24 +133,23 @@ OK, including the following:
|
||||
Some fixes have an associated potential energy. Examples of such fixes
|
||||
include: :doc:`efield <fix_efield>`, :doc:`gravity <fix_gravity>`,
|
||||
:doc:`addforce <fix_addforce>`, :doc:`langevin <fix_langevin>`,
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen
|
||||
<fix_temp_berendsen>`, :doc:`temp/rescale <fix_temp_rescale>`, and
|
||||
:doc:`wall fixes <fix_wall>`. For that energy to be included in the
|
||||
total potential energy of the system (the quantity used when
|
||||
performing GCMC moves), you MUST enable the :doc:`fix_modify
|
||||
<fix_modify>` *energy* option for that fix. The doc pages for
|
||||
individual :doc:`fix <fix>` commands specify if this should be done.
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen <fix_temp_berendsen>`,
|
||||
:doc:`temp/rescale <fix_temp_rescale>`, and :doc:`wall fixes <fix_wall>`.
|
||||
For that energy to be included in the total potential energy of the
|
||||
system (the quantity used when performing GCMC moves),
|
||||
you MUST enable the :doc:`fix_modify <fix_modify>` *energy* option for
|
||||
that fix. The doc pages for individual :doc:`fix <fix>` commands
|
||||
specify if this should be done.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the state of the fix to :doc:`binary restart files
|
||||
<restart>`. This includes information about the random number
|
||||
generator seed, the next timestep for MC exchanges, the number of
|
||||
exchange attempts and successes etc. See the :doc:`read_restart
|
||||
<read_restart>` command for info on how to re-specify a fix in an
|
||||
input script that reads a restart file, so that the operation of the
|
||||
fix continues in an uninterrupted fashion.
|
||||
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
|
||||
number generator seed, the next timestep for MC exchanges, the number
|
||||
of exchange attempts and successes etc. See
|
||||
the :doc:`read_restart <read_restart>` command for info on how to
|
||||
re-specify a fix in an input script that reads a restart file, so that
|
||||
the operation of the fix continues in an uninterrupted fashion.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -166,13 +165,12 @@ by various :doc:`output commands <Howto_output>`. The vector values are
|
||||
the following global cumulative quantities:
|
||||
|
||||
* 1 = swap attempts
|
||||
* 2 = swap accepts
|
||||
* 2 = swap successes
|
||||
|
||||
The vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
@ -186,8 +184,7 @@ Related commands
|
||||
|
||||
:doc:`fix nvt <fix_nh>`, :doc:`neighbor <neighbor>`,
|
||||
:doc:`fix deposit <fix_deposit>`, :doc:`fix evaporate <fix_evaporate>`,
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`,
|
||||
:doc:`fix mol/swap <fix_mol_swap>`
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -20,13 +20,13 @@ Syntax
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
keyword = *pH*, *pKa*, *pKb*, *pIp*, *pIm*, *pKs*, *acid_type*, *base_type*, *lunit_nm*, *temp*, *tempfixid*, *nevery*, *nmc*, *rxd*, *seed*, *tag*, *group*, *onlysalt*, *pmcmoves*
|
||||
keyword = *pH*, *pKa*, *pKb*, *pIp*, *pIm*, *pKs*, *acid_type*, *base_type*, *lunit_nm*, *temp*, *tempfixid*, *nevery*, *nmc*, *xrd*, *seed*, *tag*, *group*, *onlysalt*, *pmcmoves*
|
||||
*pH* value = pH of the solution (can be specified as an equal-style variable)
|
||||
*pKa* value = acid dissociation constant (in the -log10 representation)
|
||||
*pKb* value = base dissociation constant (in the -log10 representation)
|
||||
*pIp* value = activity (effective concentration) of free cations (in the -log10 representation)
|
||||
*pIm* value = activity (effective concentration) of free anions (in the -log10 representation)
|
||||
*pKs* value = solvent self-dissociation constant (in the -log10 representation)
|
||||
*pKa* value = acid dissociation constant
|
||||
*pKb* value = base dissociation constant
|
||||
*pIp* value = chemical potential of free cations
|
||||
*pIm* value = chemical potential of free anions
|
||||
*pKs* value = solution self-dissociation constant
|
||||
*acid_type* = atom type of acid groups
|
||||
*base_type* = atom type of base groups
|
||||
*lunit_nm* value = unit length used by LAMMPS (# in the units of nanometers)
|
||||
@ -34,7 +34,7 @@ Syntax
|
||||
*tempfixid* value = fix ID of temperature thermostat
|
||||
*nevery* value = invoke this fix every nevery steps
|
||||
*nmc* value = number of charge regulation MC moves to attempt every nevery steps
|
||||
*rxd* value = cutoff distance for acid/base reaction
|
||||
*xrd* value = cutoff distance for acid/base reaction
|
||||
*seed* value = random # seed (positive integer)
|
||||
*tag* value = yes or no (yes: The code assign unique tags to inserted ions; no: The tag of all inserted ions is "0")
|
||||
*group* value = group-ID, inserted ions are assigned to group group-ID. Can be used multiple times to assign inserted ions to multiple groups.
|
||||
@ -47,7 +47,7 @@ Examples
|
||||
""""""""
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix chareg all charge/regulation 1 2 acid_type 3 base_type 4 pKa 5.0 pKb 6.0 pH 7.0 pIp 3.0 pIm 3.0 nevery 200 nmc 200 seed 123 tempfixid fT
|
||||
fix chareg all charge/regulation 1 2 acid_type 3 base_type 4 pKa 5 pKb 7 lb 1.0 nevery 200 nexchange 200 seed 123 tempfixid fT
|
||||
|
||||
fix chareg all charge/regulation 1 2 pIp 3 pIm 3 onlysalt yes 2 -1 seed 123 tag yes temp 1.0
|
||||
|
||||
@ -92,11 +92,7 @@ where the fix attempts to charge :math:`\mathrm{A}` (discharge
|
||||
:math:`\mathrm{A}^-`) to :math:`\mathrm{A}^-` (:math:`\mathrm{A}`) and
|
||||
insert (delete) a proton (atom type 2). Besides, the fix implements
|
||||
self-ionization reaction of water :math:`\emptyset \rightleftharpoons
|
||||
\mathrm{H}^++\mathrm{OH}^-`.
|
||||
|
||||
|
||||
|
||||
However, this approach is highly
|
||||
\mathrm{H}^++\mathrm{OH}^-`. However, this approach is highly
|
||||
inefficient at :math:`\mathrm{pH} \approx 7` when the concentration of
|
||||
both protons and hydroxyl ions is low, resulting in a relatively low
|
||||
acceptance rate of MC moves.
|
||||
@ -106,31 +102,24 @@ reactions, which can be easily achieved via
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix acid_reaction2 all charge/regulation 4 5 acid_type 1 pH 7.0 pKa 5.0 pIp 2.0 pIm 2.0
|
||||
fix acid_reaction all charge/regulation 4 5 acid_type 1 pH 7.0 pKa 5.0 pIp 2.0 pIm 2.0
|
||||
|
||||
where particles of atom type 4 and 5 are the salt cations and anions, both at activity (effective concentration) of :math:`10^{-2}` mol/l, see :ref:`(Curk1) <Curk1>` and
|
||||
where particles of atom type 4 and 5 are the salt cations and anions,
|
||||
both at chemical potential pI=2.0, see :ref:`(Curk1) <Curk1>` and
|
||||
:ref:`(Landsgesell) <Landsgesell>` for more details.
|
||||
|
||||
We could have simultaneously added a base ionization reaction (:math:`\mathrm{B} \rightleftharpoons \mathrm{B}^++\mathrm{OH}^-`)
|
||||
|
||||
Similarly, we could have simultaneously added a base ionization reaction
|
||||
(:math:`\mathrm{B} \rightleftharpoons \mathrm{B}^++\mathrm{OH}^-`)
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix acid_base_reaction all charge/regulation 2 3 acid_type 1 base_type 6 pH 7.0 pKa 5.0 pKb 6.0 pIp 7.0 pIm 7.0
|
||||
fix base_reaction all charge/regulation 2 3 base_type 6 pH 7.0 pKb 6.0 pIp 7.0 pIm 7.0
|
||||
|
||||
where the fix will attempt to charge :math:`\mathrm{B}` (discharge
|
||||
:math:`\mathrm{B}^+`) to :math:`\mathrm{B}^+` (:math:`\mathrm{B}`) and
|
||||
insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3.
|
||||
|
||||
|
||||
Dissociated ions and salt ions can be combined into a single particle type, which reduces the number of necessary MC moves and increases sampling performance, see :ref:`(Curk1) <Curk1>`. The :math:`\mathrm{H}^+` and monovalent salt cation (:math:`\mathrm{S}^+`) are combined into a single particle type, :math:`\mathrm{X}^+ = \{\mathrm{H}^+, \mathrm{S}^+\}`. In this case "pIp" refers to the effective concentration of the combined cation type :math:`\mathrm{X}^+` and its value is determined by :math:`10^{-\mathrm{pIp}} = 10^{-\mathrm{pH}} + 10^{-\mathrm{pSp}}`, where :math:`10^{-\mathrm{pSp}}` is the effective concentration of salt cations. For example, at pH=7 and pSp=6 we would find pIp~5.958 and the command that performs reactions with combined ions could read,
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix acid_reaction_combined all charge/regulation 2 3 acid_type 1 pH 7.0 pKa 5.0 pIp 5.958 pIm 5.958
|
||||
|
||||
|
||||
|
||||
If neither the acid or the base type is specified, for example,
|
||||
insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3. If
|
||||
neither the acid or the base type is specified, for example,
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -138,11 +127,11 @@ If neither the acid or the base type is specified, for example,
|
||||
|
||||
the fix simply inserts or deletes an ion pair of a free cation (atom
|
||||
type 4) and a free anion (atom type 5) as done in a conventional
|
||||
grand-canonical MC simulation. Multivalent ions can be inserted (deleted) by using the *onlysalt* keyword.
|
||||
grand-canonical MC simulation.
|
||||
|
||||
|
||||
The fix is compatible with LAMMPS sub-packages such as *molecule* or
|
||||
*rigid*. The acid and base particles can be part of larger
|
||||
*rigid*. That said, the acid and base particles can be part of larger
|
||||
molecules or rigid bodies. Free ions that are inserted to or deleted
|
||||
from the system must be defined as single particles (no bonded
|
||||
interactions allowed) and cannot be part of larger molecules or rigid
|
||||
@ -164,14 +153,14 @@ Langevin thermostat:
|
||||
fix fT all langevin 1.0 1.0 1.0 123
|
||||
fix_modify fT temp dtemp
|
||||
|
||||
The units of pH, pKa, pKb, pIp, pIm are considered to be in the standard -log10
|
||||
The chemical potential units (e.g. pH) are in the standard log10
|
||||
representation assuming reference concentration :math:`\rho_0 =
|
||||
\mathrm{mol}/\mathrm{l}`. For example, in the dilute
|
||||
ideal solution limit, the concentration of free cations will be
|
||||
:math:`c_\mathrm{I} = 10^{-\mathrm{pIp}}\mathrm{mol}/\mathrm{l}`. To perform the internal unit
|
||||
conversion, the the value of the LAMMPS unit length must be
|
||||
specified in nanometers via *lunit_nm*. The default value is set to the Bjerrum length in water
|
||||
at room temperature (0.71 nm), *lunit_nm* = 0.71.
|
||||
\mathrm{mol}/\mathrm{l}`. Therefore, to perform the internal unit
|
||||
conversion, the length (in nanometers) of the LAMMPS unit length must be
|
||||
specified via *lunit_nm* (default is set to the Bjerrum length in water
|
||||
at room temperature *lunit_nm* = 0.71nm). For example, in the dilute
|
||||
ideal solution limit, the concentration of free ions will be
|
||||
:math:`c_\mathrm{I} = 10^{-\mathrm{pIp}}\mathrm{mol}/\mathrm{l}`.
|
||||
|
||||
The temperature used in MC acceptance probability is set by *temp*. This
|
||||
temperature should be the same as the temperature set by the molecular
|
||||
@ -182,10 +171,10 @@ thermostat fix-ID is *fT*. The inserted particles attain a random
|
||||
velocity corresponding to the specified temperature. Using *tempfixid*
|
||||
overrides any fixed temperature set by *temp*.
|
||||
|
||||
The *rxd* keyword can be used to restrict the inserted/deleted
|
||||
The *xrd* keyword can be used to restrict the inserted/deleted
|
||||
counterions to a specific radial distance from an acid or base particle
|
||||
that is currently participating in a reaction. This can be used to
|
||||
simulate more realist reaction dynamics. If *rxd* = 0 or *rxd* > *L* /
|
||||
simulate more realist reaction dynamics. If *xrd* = 0 or *xrd* > *L* /
|
||||
2, where *L* is the smallest box dimension, the radial restriction is
|
||||
automatically turned off and free ion can be inserted or deleted
|
||||
anywhere in the simulation box.
|
||||
@ -269,18 +258,18 @@ Default
|
||||
|
||||
pH = 7.0; pKa = 100.0; pKb = 100.0; pIp = 5.0; pIm = 5.0; pKs = 14.0;
|
||||
acid_type = -1; base_type = -1; lunit_nm = 0.71; temp = 1.0; nevery =
|
||||
100; nmc = 100; rxd = 0; seed = 0; tag = no; onlysalt = no, pmcmoves =
|
||||
100; nmc = 100; xrd = 0; seed = 0; tag = no; onlysalt = no, pmcmoves =
|
||||
[1/3, 1/3, 1/3], group-ID = all
|
||||
|
||||
----------
|
||||
|
||||
.. _Curk1:
|
||||
|
||||
**(Curk1)** T. Curk, J. Yuan, and E. Luijten, "Accelerated simulation method for charge regulation effects", JCP 156 (2022).
|
||||
**(Curk1)** T. Curk, J. Yuan, and E. Luijten, "Coarse-grained simulation of charge regulation using LAMMPS", preprint (2021).
|
||||
|
||||
.. _Curk2:
|
||||
|
||||
**(Curk2)** T. Curk and E. Luijten, "Charge-regulation effects in nanoparticle self-assembly", PRL 126 (2021)
|
||||
**(Curk2)** T. Curk and E. Luijten, "Charge-regulation effects in nanoparticle self-assembly", PRL (2021)
|
||||
|
||||
.. _Landsgesell:
|
||||
|
||||
|
||||
@ -78,20 +78,13 @@ outer loop (largest) timestep, which is the same timestep that the
|
||||
|
||||
Note that the cumulative simulation time (in time units), which
|
||||
accounts for changes in the timestep size as a simulation proceeds,
|
||||
can be accessed by the :doc:`thermo_style time <thermo_style>`
|
||||
keyword.
|
||||
|
||||
Also note that the :doc:`dump_modify every/time <dump_modify>` option
|
||||
allows dump files to be written at intervals specified by simulation
|
||||
time, rather than by timesteps. Simulation time is in time units;
|
||||
see the :doc:`units <units>` doc page for details.
|
||||
can be accessed by the :doc:`thermo_style time <thermo_style>` keyword.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. None of the :doc:`fix_modify <fix_modify>` options are
|
||||
relevant to this fix.
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
|
||||
are relevant to this fix.
|
||||
|
||||
This fix computes a global scalar which can be accessed by various
|
||||
:doc:`output commands <Howto_output>`. The scalar stores the last
|
||||
@ -100,8 +93,7 @@ timestep on which the timestep was reset to a new value.
|
||||
The scalar value calculated by this fix is "intensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
@ -110,7 +102,7 @@ Restrictions
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`timestep <timestep>`, :doc:`dump_modify every/time <dump_modify>`
|
||||
:doc:`timestep <timestep>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user