Merge branch 'lammps:develop' into compute-snap

This commit is contained in:
Drew Rohskopf
2022-06-23 14:05:11 -04:00
committed by GitHub
568 changed files with 45452 additions and 18426 deletions

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -5,12 +5,19 @@ on:
push:
branches: [develop]
workflow_dispatch:
jobs:
analyze:
name: Analyze
if: ${{ github.repository == 'lammps/lammps' }}
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
@ -18,17 +25,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/${{ matrix.language }}.yml
@ -46,4 +53,4 @@ jobs:
cmake --build . --parallel 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

View File

@ -5,6 +5,8 @@ on:
push:
branches: [develop]
workflow_dispatch:
jobs:
build:
name: Windows Compilation Test
@ -13,12 +15,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Select Python version
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'

View File

@ -5,6 +5,8 @@ on:
push:
branches: [develop]
workflow_dispatch:
jobs:
build:
name: MacOS Unit Test
@ -15,7 +17,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
@ -26,7 +28,7 @@ jobs:
run: mkdir build
- name: Set up ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: macos-ccache-${{ github.sha }}

615
cmake/CMakeLists.jpeg Normal file
View File

@ -0,0 +1,615 @@
cmake_minimum_required(VERSION 3.10)
# When using CMake 3.4 and later, don't export symbols from executables unless
# the CMAKE_ENABLE_EXPORTS variable is set.
if(POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
if(CMAKE_EXECUTABLE_SUFFIX)
set(CMAKE_EXECUTABLE_SUFFIX_TMP ${CMAKE_EXECUTABLE_SUFFIX})
endif()
project(libjpeg-turbo C)
set(VERSION 2.1.3)
set(COPYRIGHT_YEAR "1991-2022")
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
list(GET VERSION_TRIPLET 2 VERSION_REVISION)
function(pad_number NUMBER OUTPUT_LEN)
string(LENGTH "${${NUMBER}}" INPUT_LEN)
if(INPUT_LEN LESS OUTPUT_LEN)
math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
set(NUM ${${NUMBER}})
foreach(C RANGE ${ZEROES})
set(NUM "0${NUM}")
endforeach()
set(${NUMBER} ${NUM} PARENT_SCOPE)
endif()
endfunction()
pad_number(VERSION_MINOR 3)
pad_number(VERSION_REVISION 3)
set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
# CMake 3.14 and later sets CMAKE_MACOSX_BUNDLE to TRUE by default when
# CMAKE_SYSTEM_NAME is iOS, tvOS, or watchOS, which breaks the libjpeg-turbo
# build. (Specifically, when CMAKE_MACOSX_BUNDLE is TRUE, executables for
# Apple platforms are built as application bundles, which causes CMake to
# complain that our install() directives for executables do not specify a
# BUNDLE DESTINATION. Even if CMake did not complain, building executables as
# application bundles would break our iOS packages.)
set(CMAKE_MACOSX_BUNDLE FALSE)
string(TIMESTAMP DEFAULT_BUILD "%Y%m%d")
set(BUILD ${DEFAULT_BUILD} CACHE STRING "Build string (default: ${DEFAULT_BUILD})")
# NOTE: On Windows, this does nothing except when using MinGW or Cygwin.
# CMAKE_BUILD_TYPE has no meaning in Visual Studio, and it always defaults to
# Debug when using NMake.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
include(cmakescripts/PackageInfo.cmake)
# Detect CPU type and whether we're building 64-bit or 32-bit code
math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
set(COUNT 1)
foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
if(COUNT GREATER 1)
message(FATAL_ERROR "The libjpeg-turbo build system does not support multiple values in CMAKE_OSX_ARCHITECTURES.")
endif()
math(EXPR COUNT "${COUNT}+1")
endforeach()
if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "ia32")
if(BITS EQUAL 64 OR CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
set(CPU_TYPE x86_64)
else()
set(CPU_TYPE i386)
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ${CPU_TYPE})
set(CMAKE_SYSTEM_PROCESSOR ${CPU_TYPE})
endif()
elseif(CMAKE_SYSTEM_PROCESSOR_LC STREQUAL "aarch64" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^arm")
if(BITS EQUAL 64)
set(CPU_TYPE arm64)
else()
set(CPU_TYPE arm)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^ppc" OR
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^powerpc")
set(CPU_TYPE powerpc)
else()
set(CPU_TYPE ${CMAKE_SYSTEM_PROCESSOR_LC})
endif()
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR
CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR
CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(CPU_TYPE ${CMAKE_OSX_ARCHITECTURES})
endif()
if(CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(CPU_TYPE powerpc)
endif()
if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")
set(CPU_TYPE arm64)
endif()
message(STATUS "${BITS}-bit build (${CPU_TYPE})")
macro(report_directory var)
if(CMAKE_INSTALL_${var} STREQUAL CMAKE_INSTALL_FULL_${var})
message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}}")
else()
message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}} (${CMAKE_INSTALL_FULL_${var}})")
endif()
mark_as_advanced(CLEAR CMAKE_INSTALL_${var})
endmacro()
set(DIRLIST "BINDIR;DATAROOTDIR;DOCDIR;INCLUDEDIR;LIBDIR")
if(UNIX)
list(APPEND DIRLIST "MANDIR")
endif()
foreach(dir ${DIRLIST})
report_directory(${dir})
endforeach()
###############################################################################
# CONFIGURATION OPTIONS
###############################################################################
macro(boolean_number var)
if(${var})
set(${var} 1 ${ARGN})
else()
set(${var} 0 ${ARGN})
endif()
endmacro()
option(ENABLE_SHARED "Build shared libraries" FALSE)
boolean_number(ENABLE_SHARED)
option(ENABLE_STATIC "Build static libraries" TRUE)
boolean_number(ENABLE_STATIC)
option(REQUIRE_SIMD "Generate a fatal error if SIMD extensions are not available for this platform (default is to fall back to a non-SIMD build)" FALSE)
boolean_number(REQUIRE_SIMD)
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_ARITH_DEC=0 WITH_ARITH_ENC=0 WITH_JAVA=0 WITH_SIMD=0 WITH_TURBOJPEG=0 )" FALSE)
boolean_number(WITH_12BIT)
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
boolean_number(WITH_ARITH_DEC)
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
boolean_number(WITH_ARITH_ENC)
if(CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
set(WITH_JAVA 0)
else()
option(WITH_JAVA "Build Java wrapper for the TurboJPEG API library (implies ENABLE_SHARED=1)" FALSE)
boolean_number(WITH_JAVA)
endif()
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
boolean_number(WITH_JPEG7)
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
boolean_number(WITH_JPEG8)
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
boolean_number(WITH_MEM_SRCDST)
option(WITH_SIMD "Include SIMD extensions, if available for this platform" FALSE)
boolean_number(WITH_SIMD)
option(WITH_TURBOJPEG "Include the TurboJPEG API library and associated test programs" FALSE)
boolean_number(WITH_TURBOJPEG)
option(WITH_FUZZ "Build fuzz targets" FALSE)
macro(report_option var desc)
if(${var})
message(STATUS "${desc} enabled (${var} = ${${var}})")
else()
message(STATUS "${desc} disabled (${var} = ${${var}})")
endif()
endmacro()
if(WITH_JAVA)
set(ENABLE_SHARED 1)
endif()
# Explicitly setting CMAKE_POSITION_INDEPENDENT_CODE=FALSE disables PIC for all
# targets, which will cause the shared library builds to fail. Thus, if shared
# libraries are enabled and CMAKE_POSITION_INDEPENDENT_CODE is explicitly set
# to FALSE, we need to unset it, thus restoring the default behavior
# (automatically using PIC for shared library targets.)
if(DEFINED CMAKE_POSITION_INDEPENDENT_CODE AND
NOT CMAKE_POSITION_INDEPENDENT_CODE AND ENABLE_SHARED)
unset(CMAKE_POSITION_INDEPENDENT_CODE CACHE)
endif()
report_option(ENABLE_SHARED "Shared libraries")
report_option(ENABLE_STATIC "Static libraries")
if(ENABLE_SHARED)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
endif()
if(WITH_JPEG8 OR WITH_JPEG7)
set(WITH_ARITH_ENC 1)
set(WITH_ARITH_DEC 1)
endif()
if(WITH_JPEG8)
set(WITH_MEM_SRCDST 0)
endif()
if(WITH_12BIT)
set(WITH_ARITH_DEC 0)
set(WITH_ARITH_ENC 0)
set(WITH_JAVA 0)
set(WITH_SIMD 0)
set(WITH_TURBOJPEG 0)
set(BITS_IN_JSAMPLE 12)
else()
set(BITS_IN_JSAMPLE 8)
endif()
report_option(WITH_12BIT "12-bit JPEG support")
if(WITH_ARITH_DEC)
set(D_ARITH_CODING_SUPPORTED 1)
endif()
if(NOT WITH_12BIT)
report_option(WITH_ARITH_DEC "Arithmetic decoding support")
endif()
if(WITH_ARITH_ENC)
set(C_ARITH_CODING_SUPPORTED 1)
endif()
if(NOT WITH_12BIT)
report_option(WITH_ARITH_ENC "Arithmetic encoding support")
endif()
if(NOT WITH_12BIT)
report_option(WITH_TURBOJPEG "TurboJPEG API library")
report_option(WITH_JAVA "TurboJPEG Java wrapper")
endif()
if(WITH_MEM_SRCDST)
set(MEM_SRCDST_SUPPORTED 1)
set(MEM_SRCDST_FUNCTIONS "global: jpeg_mem_dest; jpeg_mem_src;")
endif()
if(NOT WITH_JPEG8)
report_option(WITH_MEM_SRCDST "In-memory source/destination managers")
endif()
set(SO_AGE 2)
if(WITH_MEM_SRCDST)
set(SO_AGE 3)
endif()
if(WITH_JPEG8)
set(JPEG_LIB_VERSION 80)
elseif(WITH_JPEG7)
set(JPEG_LIB_VERSION 70)
else()
set(JPEG_LIB_VERSION 62)
endif()
math(EXPR JPEG_LIB_VERSION_DIV10 "${JPEG_LIB_VERSION} / 10")
math(EXPR JPEG_LIB_VERSION_MOD10 "${JPEG_LIB_VERSION} % 10")
if(JPEG_LIB_VERSION STREQUAL "62")
set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION})
else()
set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION_DIV10})
endif()
if(JPEG_LIB_VERSION STREQUAL "80")
set(DEFAULT_SO_MINOR_VERSION 2)
else()
set(DEFAULT_SO_MINOR_VERSION 0)
endif()
# This causes SO_MAJOR_VERSION/SO_MINOR_VERSION to reset to defaults if
# WITH_JPEG7 or WITH_JPEG8 has changed.
if((DEFINED WITH_JPEG7_INT AND NOT WITH_JPEG7 EQUAL WITH_JPEG7_INT) OR
(DEFINED WITH_JPEG8_INT AND NOT WITH_JPEG8 EQUAL WITH_JPEG8_INT))
set(FORCE_SO_VERSION "FORCE")
endif()
set(WITH_JPEG7_INT ${WITH_JPEG7} CACHE INTERNAL "")
set(WITH_JPEG8_INT ${WITH_JPEG8} CACHE INTERNAL "")
set(SO_MAJOR_VERSION ${DEFAULT_SO_MAJOR_VERSION} CACHE STRING
"Major version of the libjpeg API shared library (default: ${DEFAULT_SO_MAJOR_VERSION})"
${FORCE_SO_VERSION})
set(SO_MINOR_VERSION ${DEFAULT_SO_MINOR_VERSION} CACHE STRING
"Minor version of the libjpeg API shared library (default: ${DEFAULT_SO_MINOR_VERSION})"
${FORCE_SO_VERSION})
set(JPEG_LIB_VERSION_DECIMAL "${JPEG_LIB_VERSION_DIV10}.${JPEG_LIB_VERSION_MOD10}")
message(STATUS "Emulating libjpeg API/ABI v${JPEG_LIB_VERSION_DECIMAL} (WITH_JPEG7 = ${WITH_JPEG7}, WITH_JPEG8 = ${WITH_JPEG8})")
message(STATUS "libjpeg API shared library version = ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION}")
# Because the TurboJPEG API library uses versioned symbols and changes the
# names of functions whenever they are modified in a backward-incompatible
# manner, it is always backward-ABI-compatible with itself, so the major and
# minor SO versions don't change. However, we increase the middle number (the
# SO "age") whenever functions are added to the API.
set(TURBOJPEG_SO_MAJOR_VERSION 0)
set(TURBOJPEG_SO_AGE 2)
set(TURBOJPEG_SO_VERSION 0.${TURBOJPEG_SO_AGE}.0)
###############################################################################
# COMPILER SETTINGS
###############################################################################
if(MSVC)
option(WITH_CRT_DLL
"Link all ${CMAKE_PROJECT_NAME} libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The default is to use the C run-time DLL only with the libraries and executables that need it."
FALSE)
if(NOT WITH_CRT_DLL)
# Use the static C library for all build types
foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
endif()
endforeach()
endif()
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
# Use the maximum optimization level for release builds
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${var} MATCHES "-O2")
string(REGEX REPLACE "-O2" "-O3" ${var} "${${var}}")
endif()
endforeach()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
# Use the maximum optimization level for release builds
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${var} MATCHES "-xO3")
string(REGEX REPLACE "-xO3" "-xO5" ${var} "${${var}}")
endif()
if(${var} MATCHES "-xO2")
string(REGEX REPLACE "-xO2" "-xO5" ${var} "${${var}}")
endif()
endforeach()
endif()
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}")
set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}")
include(CheckCSourceCompiles)
include(CheckIncludeFiles)
include(CheckTypeSize)
check_type_size("size_t" SIZE_T)
check_type_size("unsigned long" UNSIGNED_LONG)
if(SIZE_T EQUAL UNSIGNED_LONG)
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
HAVE_BUILTIN_CTZL)
endif()
if(MSVC)
check_include_files("intrin.h" HAVE_INTRIN_H)
endif()
if(UNIX)
if(CMAKE_CROSSCOMPILING)
set(RIGHT_SHIFT_IS_UNSIGNED 0)
else()
include(CheckCSourceRuns)
check_c_source_runs("
#include <stdio.h>
#include <stdlib.h>
int is_shifting_signed (long arg) {
long res = arg >> 4;
if (res == -0x7F7E80CL)
return 1; /* right shift is signed */
/* see if unsigned-shift hack will fix it. */
/* we can't just test exact value since it depends on width of long... */
res |= (~0L) << (32-4);
if (res == -0x7F7E80CL)
return 0; /* right shift is unsigned */
printf(\"Right shift isn't acting as I expect it to.\\\\n\");
printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
return 0; /* try it with unsigned anyway */
}
int main (void) {
exit(is_shifting_signed(-0x7F7E80B1L));
}" RIGHT_SHIFT_IS_UNSIGNED)
endif()
endif()
if(MSVC)
set(INLINE_OPTIONS "__inline;inline")
else()
set(INLINE_OPTIONS "__inline__;inline")
endif()
option(FORCE_INLINE "Force function inlining" TRUE)
boolean_number(FORCE_INLINE)
if(FORCE_INLINE)
if(MSVC)
list(INSERT INLINE_OPTIONS 0 "__forceinline")
else()
list(INSERT INLINE_OPTIONS 0 "inline __attribute__((always_inline))")
list(INSERT INLINE_OPTIONS 0 "__inline__ __attribute__((always_inline))")
endif()
endif()
foreach(inline ${INLINE_OPTIONS})
check_c_source_compiles("${inline} static int foo(void) { return 0; } int main(void) { return foo(); }"
INLINE_WORKS)
if(INLINE_WORKS)
set(INLINE ${inline})
break()
endif()
endforeach()
if(NOT INLINE_WORKS)
message(FATAL_ERROR "Could not determine how to inline functions.")
endif()
message(STATUS "INLINE = ${INLINE} (FORCE_INLINE = ${FORCE_INLINE})")
if(WITH_TURBOJPEG)
if(MSVC)
set(THREAD_LOCAL "__declspec(thread)")
else()
set(THREAD_LOCAL "__thread")
endif()
check_c_source_compiles("${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }" HAVE_THREAD_LOCAL)
if(HAVE_THREAD_LOCAL)
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
else()
message(WARNING "Thread-local storage is not available. The TurboJPEG API library's global error handler will not be thread-safe.")
unset(THREAD_LOCAL)
endif()
endif()
if(UNIX AND NOT APPLE)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map "VERS_1 { global: *; };")
set(CMAKE_REQUIRED_FLAGS
"-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSION_SCRIPT)
set(CMAKE_REQUIRED_FLAGS)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
if(HAVE_VERSION_SCRIPT)
message(STATUS "Linker supports GNU-style version scripts")
set(MAPFLAG "-Wl,--version-script,")
set(TJMAPFLAG "-Wl,--version-script,")
else()
message(STATUS "Linker does not support GNU-style version scripts")
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
# The Solaris linker doesn't like our version script for the libjpeg API
# library, but the version script for the TurboJPEG API library should
# still work.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map
"VERS_1 { global: foo; local: *; }; VERS_2 { global: foo2; } VERS_1;")
set(CMAKE_REQUIRED_FLAGS "-Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/conftest.map -shared")
check_c_source_compiles("int foo() { return 0; } int foo2() { return 2; }"
HAVE_MAPFILE)
set(CMAKE_REQUIRED_FLAGS)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
if(HAVE_MAPFILE)
message(STATUS "Linker supports mapfiles")
set(TJMAPFLAG "-Wl,-M,")
else()
message(STATUS "Linker does not support mapfiles")
endif()
endif()
endif()
endif()
# Generate files
if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/win/jconfig.h.in jconfig.h)
else()
configure_file(jconfig.h.in jconfig.h)
endif()
configure_file(jconfigint.h.in jconfigint.h)
configure_file(jversion.h.in jversion.h)
if(UNIX)
configure_file(libjpeg.map.in libjpeg.map)
endif()
# Include directories and compiler definitions
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
###############################################################################
# TARGETS
###############################################################################
if(CMAKE_EXECUTABLE_SUFFIX_TMP)
set(CMAKE_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX_TMP})
endif()
message(STATUS "CMAKE_EXECUTABLE_SUFFIX = ${CMAKE_EXECUTABLE_SUFFIX}")
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
jcicc.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
endif()
if(WITH_ARITH_ENC)
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
endif()
if(WITH_ARITH_DEC)
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
endif()
if(WITH_SIMD)
add_subdirectory(simd)
if(NEON_INTRINSICS)
add_definitions(-DNEON_INTRINSICS)
endif()
elseif(NOT WITH_12BIT)
message(STATUS "SIMD extensions: None (WITH_SIMD = ${WITH_SIMD})")
endif()
if(WITH_SIMD)
message(STATUS "SIMD extensions: ${CPU_TYPE} (WITH_SIMD = ${WITH_SIMD})")
if(MSVC_IDE OR XCODE)
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
endif()
else()
add_library(simd OBJECT jsimd_none.c)
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
endif()
if(WITH_JAVA)
add_subdirectory(java)
endif()
if(ENABLE_SHARED)
add_subdirectory(sharedlib)
endif()
if(ENABLE_STATIC)
add_library(jpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
${SIMD_OBJS})
if(NOT MSVC)
set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)
endif()
endif()
if(WITH_TURBOJPEG)
if(ENABLE_SHARED)
set(TURBOJPEG_SOURCES ${JPEG_SOURCES} $<TARGET_OBJECTS:simd> ${SIMD_OBJS}
turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c rdppm.c
wrbmp.c wrppm.c)
set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile)
if(WITH_JAVA)
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile.jni)
endif()
if(MSVC)
configure_file(${CMAKE_SOURCE_DIR}/win/turbojpeg.rc.in
${CMAKE_BINARY_DIR}/win/turbojpeg.rc)
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES}
${CMAKE_BINARY_DIR}/win/turbojpeg.rc)
endif()
add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
set_property(TARGET turbojpeg PROPERTY COMPILE_FLAGS
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
if(WIN32)
set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
endif()
if(MINGW)
set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
endif()
if(APPLE AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4))
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
endif()
set_target_properties(turbojpeg PROPERTIES MACOSX_RPATH 1)
endif()
set_target_properties(turbojpeg PROPERTIES
SOVERSION ${TURBOJPEG_SO_MAJOR_VERSION} VERSION ${TURBOJPEG_SO_VERSION})
if(TJMAPFLAG)
set_target_properties(turbojpeg PROPERTIES
LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
endif()
endif()
if(ENABLE_STATIC)
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
${SIMD_OBJS} turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c
rdppm.c wrbmp.c wrppm.c)
set_property(TARGET turbojpeg-static PROPERTY COMPILE_FLAGS
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
if(NOT MSVC)
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
endif()
endif()
endif()
if(WIN32)
set(USE_SETMODE "-DUSE_SETMODE")
endif()
if(WITH_12BIT)
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
else()
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
endif()

741
cmake/CMakeLists.png Normal file
View File

@ -0,0 +1,741 @@
# CMakeLists.txt
# Copyright (C) 2018 Cosmin Truta
# Copyright (C) 2007,2009-2018 Glenn Randers-Pehrson
# Written by Christian Ehrlicher, 2007
# Revised by Roger Lowman, 2009-2010
# Revised by Clifford Yapp, 2011-2012,2017
# Revised by Roger Leigh, 2016
# Revised by Andreas Franek, 2016
# Revised by Sam Serrels, 2017
# Revised by Vadim Barkov, 2017
# Revised by Vicky Pfau, 2018
# Revised by Cameron Cawley, 2018
# Revised by Cosmin Truta, 2018
# Revised by Kyle Bentley, 2018
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
cmake_minimum_required(VERSION 3.10)
cmake_policy(VERSION 3.1)
# When using CMake 3.4 and later, don't export symbols from executables unless
# the CMAKE_ENABLE_EXPORTS variable is set.
if(POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(libpng C ASM)
enable_testing()
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
set(PNGLIB_RELEASE 37)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
include(GNUInstallDirs)
# needed packages
# Allow users to specify location of Zlib.
# Useful if zlib is being built alongside this as a sub-project.
option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" ON)
if(NOT PNG_BUILD_ZLIB)
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})
endif()
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
find_library(M_LIBRARY m)
else()
# libm is not needed and/or not available
set(M_LIBRARY "")
endif()
# COMMAND LINE OPTIONS
option(PNG_SHARED "Build shared lib" OFF)
option(PNG_STATIC "Build static lib" ON)
option(PNG_TESTS "Build libpng tests" OFF)
# Many more configuration options could be added here
option(PNG_FRAMEWORK "Build OS X framework" OFF)
option(PNG_DEBUG "Build with debug output" OFF)
option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" OFF)
set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
if(PNG_HARDWARE_OPTIMIZATIONS)
# set definitions and sources for arm
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
check: (default) use internal checking code;
off: disable the optimizations;
on: turn on unconditionally.")
set_property(CACHE PNG_ARM_NEON PROPERTY STRINGS
${PNG_ARM_NEON_POSSIBLE_VALUES})
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
if(index EQUAL -1)
message(FATAL_ERROR
"PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
elseif(NOT ${PNG_ARM_NEON} STREQUAL "off")
set(libpng_arm_sources
arm/arm_init.c
arm/filter_neon.S
arm/filter_neon_intrinsics.c
arm/palette_neon_intrinsics.c)
if(${PNG_ARM_NEON} STREQUAL "on")
add_definitions(-DPNG_ARM_NEON_OPT=2)
elseif(${PNG_ARM_NEON} STREQUAL "check")
add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED)
endif()
else()
add_definitions(-DPNG_ARM_NEON_OPT=0)
endif()
endif()
# set definitions and sources for powerpc
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*")
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
off: disable the optimizations.")
set_property(CACHE PNG_POWERPC_VSX PROPERTY STRINGS
${PNG_POWERPC_VSX_POSSIBLE_VALUES})
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
if(index EQUAL -1)
message(FATAL_ERROR
"PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "off")
set(libpng_powerpc_sources
powerpc/powerpc_init.c
powerpc/filter_vsx_intrinsics.c)
if(${PNG_POWERPC_VSX} STREQUAL "on")
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
endif()
else()
add_definitions(-DPNG_POWERPC_VSX_OPT=0)
endif()
endif()
# set definitions and sources for intel
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
off: disable the optimizations")
set_property(CACHE PNG_INTEL_SSE PROPERTY STRINGS
${PNG_INTEL_SSE_POSSIBLE_VALUES})
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
if(index EQUAL -1)
message(FATAL_ERROR
"PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
elseif(NOT ${PNG_INTEL_SSE} STREQUAL "off")
set(libpng_intel_sources
intel/intel_init.c
intel/filter_sse2_intrinsics.c)
if(${PNG_INTEL_SSE} STREQUAL "on")
add_definitions(-DPNG_INTEL_SSE_OPT=1)
endif()
else()
add_definitions(-DPNG_INTEL_SSE_OPT=0)
endif()
endif()
# set definitions and sources for MIPS
if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*")
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
off: disable the optimizations")
set_property(CACHE PNG_MIPS_MSA PROPERTY STRINGS
${PNG_MIPS_MSA_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index)
if(index EQUAL -1)
message(FATAL_ERROR
"PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
elseif(NOT ${PNG_MIPS_MSA} STREQUAL "off")
set(libpng_mips_sources
mips/mips_init.c
mips/filter_msa_intrinsics.c)
if(${PNG_MIPS_MSA} STREQUAL "on")
add_definitions(-DPNG_MIPS_MSA_OPT=2)
endif()
else()
add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif()
endif()
else(PNG_HARDWARE_OPTIMIZATIONS)
# set definitions and sources for arm
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
add_definitions(-DPNG_ARM_NEON_OPT=0)
endif()
# set definitions and sources for powerpc
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*")
add_definitions(-DPNG_POWERPC_VSX_OPT=0)
endif()
# set definitions and sources for intel
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
add_definitions(-DPNG_INTEL_SSE_OPT=0)
endif()
# set definitions and sources for MIPS
if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*")
add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif()
endif(PNG_HARDWARE_OPTIMIZATIONS)
# SET LIBNAME
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
# to distinguish between debug and release lib
set(CMAKE_DEBUG_POSTFIX "d")
include(CheckCSourceCompiles)
option(ld-version-script "Enable linker version script" ON)
if(ld-version-script AND NOT APPLE)
# Check if LD supports linker scripts.
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
global: sym;
local: *;
};
VERS_2 {
global: sym2;
main;
} VERS_1;
")
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
check_c_source_compiles("void sym(void) {}
void sym2(void) {}
int main(void) {return 0;}
" HAVE_LD_VERSION_SCRIPT)
if(NOT HAVE_LD_VERSION_SCRIPT)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE} "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
check_c_source_compiles("void sym(void) {}
void sym2(void) {}
int main(void) {return 0;}
" HAVE_SOLARIS_LD_VERSION_SCRIPT)
endif()
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
# Find symbol prefix. Likely obsolete and unnecessary with recent
# toolchains (it's not done in many other projects).
function(symbol_prefix)
set(SYMBOL_PREFIX)
execute_process(COMMAND "${CMAKE_C_COMPILER}" "-E" "-"
INPUT_FILE /dev/null
OUTPUT_VARIABLE OUT
RESULT_VARIABLE STATUS)
if(CPP_FAIL)
message(WARNING "Failed to run the C preprocessor")
endif()
string(REPLACE "\n" ";" OUT "${OUT}")
foreach(line ${OUT})
string(REGEX MATCH "^PREFIX=" found_match "${line}")
if(found_match)
string(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}")
string(REGEX MATCH "__USER_LABEL_PREFIX__" found_match "${prefix}")
if(found_match)
string(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}")
endif()
set(SYMBOL_PREFIX "${prefix}")
endif()
endforeach()
message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}")
set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE)
endfunction()
if(UNIX)
symbol_prefix()
endif()
find_program(AWK NAMES gawk awk)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(NOT AWK OR ANDROID)
# No awk available to generate sources; use pre-built pnglibconf.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
add_custom_target(genfiles) # Dummy
else()
include(CMakeParseArguments)
# Generate .chk from .out with awk
# generate_chk(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
function(generate_chk)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GC_INPUT)
message(FATAL_ERROR "generate_chk: Missing INPUT argument")
endif()
if(NOT _GC_OUTPUT)
message(FATAL_ERROR "generate_chk: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${_GC_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GC_INPUT}"
"-DOUTPUT=${_GC_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake"
DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
# Generate .out from .c with awk
# generate_out(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
function(generate_out)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GO_INPUT)
message(FATAL_ERROR "generate_out: Missing INPUT argument")
endif()
if(NOT _GO_OUTPUT)
message(FATAL_ERROR "generate_out: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${_GO_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GO_INPUT}"
"-DOUTPUT=${_GO_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake"
DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
# Generate specific source file with awk
# generate_source(OUTPUT outputfile [DEPENDS dep1 [dep2...]])
function(generate_source)
set(options)
set(oneValueArgs OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GSO_OUTPUT)
message(FATAL_ERROR "generate_source: Missing OUTPUT argument")
endif()
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=${_GSO_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
DEPENDS ${_GSO_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
# Copy file
function(generate_copy source destination)
add_custom_command(OUTPUT "${destination}"
COMMAND "${CMAKE_COMMAND}" -E remove "${destination}"
COMMAND "${CMAKE_COMMAND}" -E copy "${source}"
"${destination}"
DEPENDS "${source}")
endfunction()
# Generate scripts/pnglibconf.h
generate_source(OUTPUT "scripts/pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
# Generate pnglibconf.c
generate_source(OUTPUT "pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
if(PNG_PREFIX)
set(PNGLIBCONF_H_EXTRA_DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/macro.lst")
set(PNGPREFIX_H_EXTRA_DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
endif()
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
# Generate pnglibconf.h
generate_source(OUTPUT "pnglibconf.h"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
${PNGLIBCONF_H_EXTRA_DEPENDS})
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/prefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
# Generate pngprefix.h
generate_source(OUTPUT "pngprefix.h"
DEPENDS ${PNGPREFIX_H_EXTRA_DEPENDS})
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
add_custom_target(symbol-check DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
add_custom_target(genvers DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
add_custom_target(gensym DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
add_custom_target("genprebuilt"
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=scripts/pnglibconf.h.prebuilt"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
# A single target handles generation of all generated files. If
# they are depended upon separately by multiple targets, this
# confuses parallel make (it would require a separate top-level
# target for each file to track the dependencies properly).
add_custom_target(genfiles DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
endif(NOT AWK OR ANDROID)
# OUR SOURCES
set(libpng_public_hdrs
png.h
pngconf.h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
)
set(libpng_private_hdrs
pngpriv.h
pngdebug.h
pnginfo.h
pngstruct.h
)
if(AWK AND NOT ANDROID)
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
endif()
set(libpng_sources
${libpng_public_hdrs}
${libpng_private_hdrs}
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.c
pngwutil.c
${libpng_arm_sources}
${libpng_intel_sources}
${libpng_mips_sources}
${libpng_powerpc_sources}
)
set(pngtest_sources
pngtest.c
)
set(pngvalid_sources
contrib/libtests/pngvalid.c
)
set(pngstest_sources
contrib/libtests/pngstest.c
)
set(pngunknown_sources
contrib/libtests/pngunknown.c
)
set(pngimage_sources
contrib/libtests/pngimage.c
)
set(pngfix_sources
contrib/tools/pngfix.c
)
set(png_fix_itxt_sources
contrib/tools/png-fix-itxt.c
)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()
if(PNG_DEBUG)
add_definitions(-DPNG_DEBUG)
endif()
# NOW BUILD OUR TARGET
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
unset(PNG_LIB_TARGETS)
if(PNG_STATIC)
# does not work without changing name
set(PNG_LIB_NAME_STATIC png_static)
add_library(png_static STATIC ${libpng_sources})
add_dependencies(png_static genfiles)
# MSVC doesn't use a different file extension for shared vs. static
# libs. We are able to change OUTPUT_NAME to remove the _static
# for all other platforms.
if(NOT MSVC)
set_target_properties(png_static PROPERTIES
OUTPUT_NAME "${PNG_LIB_NAME}"
CLEAN_DIRECT_OUTPUT 1)
else()
set_target_properties(png_static PROPERTIES
OUTPUT_NAME "${PNG_LIB_NAME}_static"
CLEAN_DIRECT_OUTPUT 1)
endif()
list(APPEND PNG_LIB_TARGETS png_static)
if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(png_static PROPERTIES PREFIX "lib")
endif()
target_link_libraries(png_static ${M_LIBRARY})
endif()
if(NOT PNG_LIB_TARGETS)
message(SEND_ERROR
"No library variant selected to build. "
"Please enable at least one of the following options: "
"PNG_STATIC, PNG_SHARED, PNG_FRAMEWORK")
endif()
# Set a variable with CMake code which:
# Creates a symlink from src to dest (if possible) or alternatively
# copies if different.
include(CMakeParseArguments)
function(create_symlink DEST_FILE)
cmake_parse_arguments(S "" "FILE;TARGET" "" ${ARGN})
if(NOT S_TARGET AND NOT S_FILE)
message(FATAL_ERROR "create_symlink: Missing TARGET or FILE argument")
endif()
if(S_TARGET AND S_FILE)
message(FATAL_ERROR "create_symlink: Both source file ${S_FILE} and build target ${S_TARGET} arguments are present; can only have one.")
endif()
if(S_FILE)
# If we don't need to symlink something that's coming from a build target,
# we can go ahead and symlink/copy at configure time.
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
execute_process(
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
else()
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
endif()
if(S_TARGET)
# We need to use generator expressions, which can be a bit tricky, so for
# simplicity make the symlink a POST_BUILD step and use the TARGET
# signature of add_custom_command.
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
add_custom_command(TARGET ${S_TARGET} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE})
else()
add_custom_command(TARGET ${S_TARGET} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E create_symlink $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE})
endif()
endif()
endfunction()
# Create source generation scripts.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genchk.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genout.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gensrc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake @ONLY)
# libpng is a library so default to 'lib'
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
endif()
# CREATE PKGCONFIG FILES
# We use the same files like ./configure, so we have to set its vars.
# Only do this on Windows for Cygwin - the files don't make much sense outside
# of a UNIX look-alike.
if(NOT WIN32 OR CYGWIN OR MINGW)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
create_symlink(libpng-config FILE ${PNGLIB_NAME}-config)
endif()
# SET UP LINKS
if(PNG_SHARED)
set_target_properties(png PROPERTIES
# VERSION 16.${PNGLIB_RELEASE}.1.6.37
VERSION 16.${PNGLIB_RELEASE}.0
SOVERSION 16
CLEAN_DIRECT_OUTPUT 1)
endif()
# INSTALL
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${PNG_LIB_TARGETS}
EXPORT libpng
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(PNG_SHARED)
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
if(CYGWIN OR MINGW)
create_symlink(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png)
install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT WIN32)
create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png)
install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
if(PNG_STATIC)
if(NOT WIN32 OR CYGWIN OR MINGW)
create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES ${libpng_public_hdrs} DESTINATION include)
install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME})
endif()
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL)
if(NOT WIN32 OR CYGWIN OR MINGW)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
endif()
endif()
if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${PNG_BIN_TARGETS}
RUNTIME DESTINATION bin)
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
# Install man pages
if(NOT PNG_MAN_DIR)
set(PNG_MAN_DIR "share/man")
endif()
install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3)
install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5)
# Install pkg-config files
if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
DESTINATION bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
DESTINATION bin)
endif()
endif()
# Create an export file that CMake users can include() to import our targets.
if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
endif()
# what's with libpng-manual.txt and all the extra files?
# UNINSTALL
# do we need this?
# DIST
# do we need this?
# to create msvc import lib for mingw compiled shared lib
# pexports libpng.dll > libpng.def
# lib /def:libpng.def /machine:x86

View File

@ -107,7 +107,7 @@ endif()
# silence excessive warnings for new Intel Compilers
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_TUNE_DEFAULT "-Wno-tautological-constant-compare")
set(CMAKE_TUNE_DEFAULT "-Wno-tautological-constant-compare -Wno-unused-command-line-argument")
endif()
# silence excessive warnings for PGI/NVHPC compilers
@ -116,7 +116,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "
endif()
# silence nvcc warnings
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA))
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT} -Xcudafe --diag_suppress=unrecognized_pragma")
endif()
@ -135,9 +135,14 @@ 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
if(MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
if(LAMMPS_EXCEPTIONS)
add_compile_options(/EHsc)
endif()
endif()
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
@ -161,10 +166,12 @@ option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared lib
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
# allow enabling clang-tidy for C++ files
# Support using clang-tidy for C++ files with selected options
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling")
if(ENABLE_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*-header-filter=.*" CACHE STRING "")
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=-*,performance-trivially-destructible,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,modernize-use-override,modernize-use-bool-literals,modernize-use-emplace,modernize-return-braced-init-list,modernize-use-equals-default,modernize-use-equals-delete,modernize-replace-random-shuffle,modernize-deprecated-headers,modernize-use-nullptr,modernize-use-noexcept,modernize-redundant-void-arg;-fix;-header-filter=.*,header-filter=library.h,header-filter=fmt/*.h" CACHE STRING "clang-tidy settings")
else()
unset(CMAKE_CXX_CLANG_TIDY CACHE)
endif()
include(GNUInstallDirs)
@ -328,7 +335,9 @@ string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
target_compile_definitions(lammps PUBLIC -DLAMMPS_${LAMMPS_SIZES})
# posix_memalign is not available on Windows
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# with INTEL package and Intel compilers we use TBB's aligned malloc
if((CMAKE_SYSTEM_NAME STREQUAL "Windows")
AND NOT (PKG_INTEL AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))))
set(LAMMPS_MEMALIGN "0" CACHE STRING "posix_memalign() is not available on Windows" FORCE)
else()
set(LAMMPS_MEMALIGN "64" CACHE STRING "enables the use of the posix_memalign() call instead of malloc() when large chunks or memory are allocated by LAMMPS. Set to 0 to disable")
@ -777,14 +786,16 @@ if(BUILD_SHARED_LIBS)
find_package(Python COMPONENTS Interpreter)
endif()
if(BUILD_IS_MULTI_CONFIG)
set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/$<CONFIG>/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}/$<CONFIG>)
else()
set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(MY_BUILD_DIR ${CMAKE_BINARY_DIR})
endif()
set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
if(Python_EXECUTABLE)
add_custom_target(
install-python ${CMAKE_COMMAND} -E remove_directory build
COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps -l ${LIBLAMMPS_SHARED_BINARY}
COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps
-l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR}
COMMENT "Installing LAMMPS Python module")
else()
add_custom_target(

195
cmake/CMakeLists.zlib Normal file
View File

@ -0,0 +1,195 @@
cmake_minimum_required(VERSION 3.10)
# When using CMake 3.4 and later, don't export symbols from executables unless
# the CMAKE_ENABLE_EXPORTS variable is set.
if(POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
set(VERSION "1.2.11")
option(ASM686 "Enable building i686 assembly implementation" OFF)
option(AMD64 "Enable building amd64 assembly implementation" OFF)
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
check_type_size(off64_t OFF64_T)
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
check_include_file(unistd.h Z_HAVE_UNISTD_H)
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif()
endif()
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
#============================================================================
# zlib
#============================================================================
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
)
if(NOT MINGW)
set(ZLIB_DLL_SRCS
win32/zlib1.rc # If present will override custom build rule below.
)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
if(ASM686)
set(ZLIB_ASMS contrib/asm686/match.S)
elseif (AMD64)
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
endif ()
if(ZLIB_ASMS)
add_definitions(-DASMV)
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
endif()
endif()
if(MSVC)
if(ASM686)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx86/inffas32.asm
contrib/masmx86/match686.asm
)
elseif (AMD64)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx64/gvmat64.asm
contrib/masmx64/inffasx64.asm
)
endif()
if(ZLIB_ASMS)
add_definitions(-DASMV -DASMINF)
endif()
endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(MINGW)
# This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe)
endif()
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)
endif()

View File

@ -8,7 +8,7 @@
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
@ -26,11 +26,6 @@
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
@ -46,7 +41,7 @@
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
@ -64,11 +59,6 @@
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
@ -102,11 +92,6 @@
"value": "True",
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
@ -122,7 +107,7 @@
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [ "clang_cl_x64" ],
"variables": [
{
@ -141,7 +126,40 @@
"type": "BOOL"
},
{
"name": "PKG_PYTHON",
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
}
]
},
{
"name": "x64-Debug-IntelLLVM",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"buildCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [],
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-llvm.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"variables": [
{
"name": "PKG_ELECTRODE",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
@ -149,8 +167,142 @@
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
},
{
"name": "FFT",
"value": "MKL",
"type": "STRING"
}
]
},
{
"name": "x64-Release-IntelLLVM",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-llvm.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [],
"variables": [
{
"name": "PKG_ELECTRODE",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "True",
"type": "BOOL"
},
{
"name": "FFT",
"value": "MKL",
"type": "STRING"
}
]
},
{
"name": "x64-Debug-Intel-Classic",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-classic.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [],
"variables": [
{
"name": "PKG_ELECTRODE",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "False",
"type": "BOOL"
},
{
"name": "FFT",
"value": "MKL",
"type": "STRING"
}
]
},
{
"name": "x64-Release-Intel-Classic",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-classic.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
"buildCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [],
"variables": [
{
"name": "PKG_ELECTRODE",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_SHARED_LIBS",
"value": "True",
"type": "BOOL"
},
{
"name": "BUILD_TOOLS",
"value": "True",
"type": "BOOL"
},
{
"name": "LAMMPS_EXCEPTIONS",
"value": "True",
"type": "BOOL"
},
{
"name": "ENABLE_TESTING",
"value": "False",
"type": "BOOL"
},
{
"name": "FFT",
"value": "MKL",
"type": "STRING"
}
]
}
]
}
}

View File

@ -0,0 +1,197 @@
# CMake script code to define LAMMPS settings required for building LAMMPS plugins
# enforce out-of-source build
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. "
"Please remove CMakeCache.txt and CMakeFiles first.")
endif()
# global LAMMPS/plugin build settings
set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder")
if(NOT LAMMPS_SOURCE_DIR)
message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR")
endif()
# by default, install into $HOME/.local (not /usr/local),
# so that no root access (and sudo) is needed
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
endif()
# 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
if(MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
if(LAMMPS_EXCEPTIONS)
add_compile_options(/EHsc)
endif()
endif()
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
# C++11 is required
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Need -restrict with Intel compilers
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
#######
# helper functions from LAMMPSUtils.cmake
function(validate_option name values)
string(TOLOWER ${${name}} needle_lower)
string(TOUPPER ${${name}} needle_upper)
list(FIND ${values} ${needle_lower} IDX_LOWER)
list(FIND ${values} ${needle_upper} IDX_UPPER)
if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0)
list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}})
message(FATAL_ERROR "\n########################################################################\n"
"Invalid value '${${name}}' for option ${name}\n"
"\n"
"Possible values are:\n"
"${POSSIBLE_VALUE_LIST}"
"########################################################################")
endif()
endfunction(validate_option)
# helper function for getting the most recently modified file or folder from a glob pattern
function(get_newest_file path variable)
file(GLOB _dirs ${path})
set(_besttime 2000-01-01T00:00:00)
set(_bestfile "<unknown>")
foreach(_dir ${_dirs})
file(TIMESTAMP ${_dir} _newtime)
if(_newtime IS_NEWER_THAN _besttime)
set(_bestfile ${_dir})
set(_besttime ${_newtime})
endif()
endforeach()
if(_bestfile STREQUAL "<unknown>")
message(FATAL_ERROR "Could not find valid path at: ${path}")
endif()
set(${variable} ${_bestfile} PARENT_SCOPE)
endfunction()
#################################################################################
# LAMMPS C++ interface. We only need the header related parts except on windows.
add_library(lammps INTERFACE)
target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR})
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a)
endif()
################################################################################
# MPI configuration
if(NOT CMAKE_CROSSCOMPILING)
find_package(MPI QUIET)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
else()
option(BUILD_MPI "Build MPI version" OFF)
endif()
if(BUILD_MPI)
# do not include the (obsolete) MPI C++ bindings which makes
# for leaner object files and avoids namespace conflicts
set(MPI_CXX_SKIP_MPICXX TRUE)
# We use a non-standard procedure to cross-compile with MPI on Windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
# Download and configure custom MPICH files for Windows
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
else()
find_package(MPI REQUIRED)
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 INTERFACE -DLAMMPS_LONGLONG_TO_LONG)
endif()
endif()
target_link_libraries(lammps INTERFACE MPI::MPI_CXX)
else()
add_library(mpi_stubs INTERFACE)
target_include_directories(mpi_stubs INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
target_link_libraries(lammps INTERFACE mpi_stubs)
endif()
################################################################################
# detect if we may enable OpenMP support by default
set(BUILD_OMP_DEFAULT OFF)
find_package(OpenMP QUIET)
if(OpenMP_FOUND)
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
if(HAVE_OMP_H_INCLUDE)
set(BUILD_OMP_DEFAULT ON)
endif()
endif()
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
if(BUILD_OMP)
find_package(OpenMP REQUIRED)
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
if(NOT HAVE_OMP_H_INCLUDE)
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
endif()
if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
((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.
target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4)
else()
target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3)
endif()
target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX)
endif()
################
# integer size selection
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES})

View File

@ -24,6 +24,24 @@ function(validate_option name values)
endif()
endfunction(validate_option)
# helper function for getting the most recently modified file or folder from a glob pattern
function(get_newest_file path variable)
file(GLOB _dirs ${path})
set(_besttime 2000-01-01T00:00:00)
set(_bestfile "<unknown>")
foreach(_dir ${_dirs})
file(TIMESTAMP ${_dir} _newtime)
if(_newtime IS_NEWER_THAN _besttime)
set(_bestfile ${_dir})
set(_besttime ${_newtime})
endif()
endforeach()
if(_bestfile STREQUAL "<unknown>")
message(FATAL_ERROR "Could not find valid path at: ${path}")
endif()
set(${variable} ${_bestfile} PARENT_SCOPE)
endfunction()
function(get_lammps_version version_header variable)
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)

View File

@ -38,7 +38,7 @@ if(INTEL_LRT_MODE STREQUAL "C++11")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
message(FATAL_ERROR "INTEL needs at least a 2016 Intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}")
endif()
@ -46,12 +46,12 @@ else()
message(WARNING "INTEL gives best performance with Intel compilers")
endif()
find_package(TBB_MALLOC QUIET)
find_package(TBB_MALLOC)
if(TBB_MALLOC_FOUND)
target_link_libraries(lammps PRIVATE TBB::TBB_MALLOC)
else()
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_NO_TBB)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
message(WARNING "INTEL with Intel compilers should use TBB malloc libraries")
endif()
endif()

View File

@ -50,6 +50,7 @@ if(DOWNLOAD_MDI)
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-Dlanguage=C
-Dlibtype=STATIC
-Dmpi=${MDI_USE_MPI}

View File

@ -1,6 +1,6 @@
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_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.fix2.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
set(PACELIB_MD5 "32394d799bc282bb57696c78c456e64f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
mark_as_advanced(PACELIB_URL)
mark_as_advanced(PACELIB_MD5)
@ -13,8 +13,12 @@ execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
# enforce building libyaml-cpp as static library and turn off optional features
set(YAML_BUILD_SHARED_LIBS OFF)
set(YAML_CPP_BUILD_CONTRIB OFF)
set(YAML_CPP_BUILD_TOOLS OFF)
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
@ -28,5 +32,6 @@ target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_
target_link_libraries(pace PRIVATE yaml-cpp-pace)
target_link_libraries(lammps PRIVATE pace)
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
target_link_libraries(lammps PRIVATE pace)
endif()

View File

@ -43,6 +43,7 @@ if(DOWNLOAD_QUIP)
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")
message(STATUS "QUIP download via git requested - we will build our own")
set(CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY CHECKOUT)
# QUIP has no releases (except for a tag marking the end of Python 2 support). We use the current "public" branch
# The LAMMPS interface wrapper has a compatibility constant that is being checked at runtime.
include(ExternalProject)

View File

@ -3,6 +3,9 @@ if(BUILD_TOOLS)
target_compile_definitions(binary2txt PRIVATE -DLAMMPS_${LAMMPS_SIZES})
install(TARGETS binary2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
add_executable(stl_bin2txt ${LAMMPS_TOOLS_DIR}/stl_bin2txt.cpp)
install(TARGETS stl_bin2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
include(CheckGeneratorSupport)
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
include(CheckLanguage)

View File

@ -31,5 +31,7 @@ set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${te
set(temp "${temp}#endif\n\n")
message(STATUS "Generating lmpgitversion.h...")
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
string(REPLACE "\\ " " " LAMMPS_GIT_HEADER "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
file(WRITE "${LAMMPS_GIT_HEADER}.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_GIT_HEADER}.tmp" "${LAMMPS_GIT_HEADER}")

View File

@ -3,7 +3,9 @@
# that is compatible with all higher CC, but not the default CC 3.5
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)
set(Kokkos_ARCH_PASCAL60 ON CACHE BOOL "" FORCE)
set(BUILD_OMP ON CACHE BOOL "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)

View File

@ -12,6 +12,9 @@ set(BUILD_OMP ON CACHE BOOL "" FORCE)
set(CMAKE_CXX_COMPILER hipcc CACHE STRING "" FORCE)
set(CMAKE_TUNE_FLAGS "-munsafe-fp-atomics" CACHE STRING "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
# these flags are needed to build with Cray MPICH on OLCF Crusher
#-D CMAKE_CXX_FLAGS="-I/${MPICH_DIR}/include"
#-D MPI_CXX_LIBRARIES="-L${MPICH_DIR}/lib -lmpi -L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_hsa"

View File

@ -4,3 +4,6 @@ set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
set(BUILD_OMP ON CACHE BOOL "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)

View File

@ -3,3 +3,6 @@ set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)

View File

@ -8,6 +8,9 @@ set(Kokkos_ENABLE_SYCL ON CACHE BOOL "" FORCE)
set(Kokkos_ARCH_MAXWELL50 on CACHE BOOL "" FORCE)
set(BUILD_OMP ON CACHE BOOL "" FORCE)
# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
set(CMAKE_CXX_COMPILER clang++ CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE)

View File

@ -46,8 +46,8 @@ set(WIN_PACKAGES
MISC
ML-HDNNP
ML-IAP
ML-SNAP
ML-RANN
ML-SNAP
MOFFF
MOLECULE
MOLFILE
@ -56,6 +56,7 @@ set(WIN_PACKAGES
ORIENT
PERI
PHONON
PLUGIN
POEMS
PTM
QEQ

View File

@ -0,0 +1,8 @@
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
set(CMAKE_CXX_COMPILER "icl" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "icl" CACHE STRING "" FORCE)
set(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)

View File

@ -0,0 +1,8 @@
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
set(CMAKE_CXX_COMPILER "icx" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "icx" CACHE STRING "" FORCE)
set(CMAKE_Fortran_COMPILER "ifx" CACHE STRING "" FORCE)
set(INTEL_LRT_MODE "C++11" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(CMAKE_TUNE_FLAGS -Wno-unused-command-line-argument)

View File

@ -43,6 +43,7 @@ set(WIN_PACKAGES
PERI
PHONON
POEMS
PLUGIN
PTM
QEQ
QTB

View File

@ -13,6 +13,7 @@ VENV = $(BUILDDIR)/docenv
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
MATHJAXTAG = 3.2.2
PYTHON = $(word 3,$(shell type python3))
DOXYGEN = $(word 3,$(shell type doxygen))
@ -230,12 +231,13 @@ $(VENV):
$(PYTHON) -m venv $(VENV); \
. $(VENV)/bin/activate; \
pip $(PIP_OPTIONS) install --upgrade pip; \
pip $(PIP_OPTIONS) install --upgrade wheel; \
pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \
deactivate;\
)
$(MATHJAX):
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
@git clone -b $(MATHJAXTAG) -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
$(ANCHORCHECK): $(VENV)
@( \

View File

@ -1,7 +1,7 @@
.TH LAMMPS "1" "4 May 2022" "2022-5-4"
.TH LAMMPS "1" "23 June 2022" "2022-6-23"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator. Version 24 March 2022
\- Molecular Dynamics Simulator. Version 23 June 2022
.SH SYNOPSIS
.B lmp

View File

@ -655,14 +655,13 @@ This list was last updated for version 3.5.0 of the Kokkos library.
platform-appropriate vendor library: rocFFT on AMD GPUs or cuFFT on
NVIDIA GPUs.
To simplify compilation, four preset files are included in the
To simplify compilation, five preset files are included in the
``cmake/presets`` folder, ``kokkos-serial.cmake``,
``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``, and
``kokkos-sycl.cmake``. They will enable the KOKKOS package and
enable some hardware choice. So to compile with OpenMP host
parallelization, CUDA device parallelization (for GPUs with CC 5.0
and up) with some common packages enabled, you can do the
following:
``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``,
``kokkos-hip.cmake``, and ``kokkos-sycl.cmake``. They will enable
the KOKKOS package and enable some hardware choice. So to compile
with CUDA device parallelization (for GPUs with CC 5.0 and up)
with some common packages enabled, you can do the following:
.. code-block:: bash

View File

@ -150,7 +150,7 @@ other files dependent on that package are also excluded.
.. _cmake_presets:
CMake presets for installing many packages
""""""""""""""""""""""""""""""""""""""""""
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Instead of specifying all the CMake options via the command-line,
CMake allows initializing its settings cache using script files.
@ -178,6 +178,11 @@ one of them as a starting point and customize it to your needs.
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
Presets that have names starting with "windows" are specifically for
compiling LAMMPS :doc:`natively on Windows <Build_windows>` and
presets that have names starting with "kokkos" are specifically for
selecting configurations for compiling LAMMPS with :ref:`KOKKOS <kokkos>`.
.. note::
Running cmake this way manipulates the CMake settings cache in your

View File

@ -287,8 +287,8 @@ Output of JPG, PNG, and movie files
The :doc:`dump image <dump_image>` command has options to output JPEG or
PNG image files. Likewise the :doc:`dump movie <dump_image>` command
outputs movie files in MPEG format. Using these options requires the
following settings:
outputs movie files in a variety of movie formats. Using these options
requires the following settings:
.. tabs::
@ -328,11 +328,12 @@ following settings:
JPG_LIB = -ljpeg -lpng -lz # library names
As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``,
if make can find the graphics header and library files. You must
specify ``JPG_LIB`` with a list of graphics libraries to include
in the link. You must insure ffmpeg is in a directory where
LAMMPS can find it at runtime, that is a directory in your PATH
environment variable.
if make can find the graphics header and library files in their
default system locations. You must specify ``JPG_LIB`` with a
list of graphics libraries to include in the link. You must make
certain that the ffmpeg executable (or ffmpeg.exe on Windows) is
in a directory where LAMMPS can find it at runtime; that is
usually a directory list in your ``PATH`` environment variable.
Using ``ffmpeg`` to output movie files requires that your machine
supports the "popen" function in the standard runtime library.

View File

@ -5,6 +5,7 @@ Notes for building LAMMPS on Windows
* :ref:`Running Linux on Windows <linux>`
* :ref:`Using GNU GCC ported to Windows <gnu>`
* :ref:`Using Visual Studio <msvc>`
* :ref:`Using Intel oneAPI compilers and libraries <oneapi>`
* :ref:`Using a cross-compiler <cross>`
----------
@ -25,8 +26,10 @@ assistance in resolving portability issues. This is particularly true
for compiling LAMMPS on Windows, since this platform has significant
differences in some low-level functionality. As of LAMMPS version 14
December 2021, large parts of LAMMPS can be compiled natively with the
Microsoft Visual C++ Compilers. This is largely facilitated by using
the :doc:`Developer_platform` in the ``platform`` namespace.
Microsoft Visual C++ Compilers. As of LAMMPS version 31 May 2022, also
the Intel oneAPI compilers can compile large parts of LAMMPS natively on
Windows. This is mostly facilitated by using the
:doc:`Developer_platform` in the ``platform`` namespace and CMake.
Before trying to build LAMMPS on Windows yourself, please consider the
`pre-compiled Windows installer packages <https://packages.lammps.org/windows.html>`_
@ -129,6 +132,53 @@ LAMMPS with MPI enabled.
via GitHub or the `LAMMPS forum at MatSci <https://matsci.org/c/lammps/lammps-development/>`_,
if you have questions or LAMMPS specific problems.
.. _oneapi:
Using Intel oneAPI Compilers and Libraries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionadded:: 31May2022
After installing the `Intel oneAPI
<https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html>`_
base toolkit and the HPC toolkit, it is also possible to compile large
parts of LAMMPS natively on Windows using Intel compilers. The HPC
toolkit provides two sets of C/C++ and Fortran compilers: the so-called
"classic" compilers (``icl.exe`` and ``ifort.exe``) and newer, LLVM
based compilers (``icx.exe`` and ``ifx.exe``). In addition to the
compilers and their dependent modules, also the thread building blocks
(TBB) and the math kernel library (MKL) need to be installed. Two
presets (``cmake/presets/windows-intel-llvm.cmake`` and
``cmake/presets/windows-intel-classic.cmake``) are provided for
selecting the LLVM based or classic compilers, respectively. The preset
``cmake/presets/windows.cmake`` enables compatible packages that are not
dependent on additional features or libraries. You **must** use the
CMake based build procedure and use Ninja as build tool. For compiling
from the command prompt, thus both `CMake <https://cmake.org>`_ and
`Ninja-build <https://ninja-build.org>`_ binaries must be installed. It
is also possible to use Visual Studio, if it is started (``devenv.exe``)
from a command prompt that has the Intel oneAPI compilers enabled. The
Visual Studio settings file in the ``cmake`` folder contains
configurations for both compiler variants in debug and release settings.
Those will use the CMake and Ninja binaries bundled with Visual Studio,
thus a separate installation is not required.
.. admonition:: Known Limitations
:class: note
In addition to portability issues with several packages and external
libraries, the classic Intel compilers are currently not able to
compile the googletest libraries and thus enabling the ``-DENABLE_TESTING``
option will result in compilation failure. The LLVM based compilers
are compatible.
.. note::
This is work in progress and you should contact the LAMMPS developers
via GitHub or the `LAMMPS forum at MatSci <https://matsci.org/c/lammps/lammps-development/>`_,
if you have questions or LAMMPS specific problems.
.. _cross:
Using a cross-compiler

View File

@ -14,7 +14,7 @@
General commands
================
An alphabetic list of all general LAMMPS commands.
An alphabetic list of general LAMMPS commands.
.. table_from_list::
:columns: 5
@ -47,35 +47,26 @@ 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:`echo <echo>`
* :doc:`fix <fix>`
* :doc:`fix_modify <fix_modify>`
* :doc:`group <group>`
* :doc:`group2ndx <group2ndx>`
* :doc:`hyper <hyper>`
* :doc:`if <if>`
* :doc:`improper_coeff <improper_coeff>`
* :doc:`improper_style <improper_style>`
* :doc:`include <include>`
* :doc:`info <info>`
* :doc:`jump <jump>`
* :doc:`kim <kim_commands>`
* :doc:`kspace_modify <kspace_modify>`
* :doc:`kspace_style <kspace_style>`
* :doc:`label <label>`
* :doc:`lattice <lattice>`
* :doc:`log <log>`
* :doc:`mass <mass>`
* :doc:`mdi <mdi>`
* :doc:`minimize <minimize>`
* :doc:`min_modify <min_modify>`
* :doc:`min_style <min_style>`
* :doc:`min_style spin <min_spin>`
* :doc:`molecule <molecule>`
* :doc:`ndx2group <group2ndx>`
* :doc:`neb <neb>`
* :doc:`neb/spin <neb_spin>`
* :doc:`neigh_modify <neigh_modify>`
* :doc:`neighbor <neighbor>`
* :doc:`newton <newton>`
@ -86,11 +77,8 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`pair_style <pair_style>`
* :doc:`pair_write <pair_write>`
* :doc:`partition <partition>`
* :doc:`plugin <plugin>`
* :doc:`prd <prd>`
* :doc:`print <print>`
* :doc:`processors <processors>`
* :doc:`python <python>`
* :doc:`quit <quit>`
* :doc:`read_data <read_data>`
* :doc:`read_dump <read_dump>`
@ -108,14 +96,9 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`shell <shell>`
* :doc:`special_bonds <special_bonds>`
* :doc:`suffix <suffix>`
* :doc:`tad <tad>`
* :doc:`temper <temper>`
* :doc:`temper/grem <temper_grem>`
* :doc:`temper/npt <temper_npt>`
* :doc:`thermo <thermo>`
* :doc:`thermo_modify <thermo_modify>`
* :doc:`thermo_style <thermo_style>`
* :doc:`third_order (k) <third_order>`
* :doc:`timer <timer>`
* :doc:`timestep <timestep>`
* :doc:`uncompute <uncompute>`
@ -128,3 +111,27 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`write_data <write_data>`
* :doc:`write_dump <write_dump>`
* :doc:`write_restart <write_restart>`
Additional general LAMMPS commands provided by packages. A few
commands have accelerated versions. This is indicated by an
additional letter in parenthesis: k = KOKKOS.
.. table_from_list::
:columns: 5
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
* :doc:`group2ndx <group2ndx>`
* :doc:`hyper <hyper>`
* :doc:`kim <kim_commands>`
* :doc:`mdi <mdi>`
* :doc:`ndx2group <group2ndx>`
* :doc:`neb <neb>`
* :doc:`neb/spin <neb_spin>`
* :doc:`plugin <plugin>`
* :doc:`prd <prd>`
* :doc:`python <python>`
* :doc:`tad <tad>`
* :doc:`temper <temper>`
* :doc:`temper/grem <temper_grem>`
* :doc:`temper/npt <temper_npt>`
* :doc:`third_order (k) <third_order>`

View File

@ -88,7 +88,7 @@ OPT.
* :doc:`dipole (o) <angle_dipole>`
* :doc:`fourier (o) <angle_fourier>`
* :doc:`fourier/simple (o) <angle_fourier_simple>`
* :doc:`gaussian <angle_gaussian>` - multicentered Gaussian-based angle potential
* :doc:`gaussian <angle_gaussian>`
* :doc:`harmonic (iko) <angle_harmonic>`
* :doc:`mm3 <angle_mm3>`
* :doc:`quartic (o) <angle_quartic>`

View File

@ -269,6 +269,7 @@ OPT.
* :doc:`spin/neel <pair_spin_neel>`
* :doc:`srp <pair_srp>`
* :doc:`sw (giko) <pair_sw>`
* :doc:`sw/angle/table <pair_sw_angle_table>`
* :doc:`sw/mod (o) <pair_sw>`
* :doc:`table (gko) <pair_table>`
* :doc:`table/rx (k) <pair_table_rx>`
@ -279,6 +280,7 @@ OPT.
* :doc:`tersoff/table (o) <pair_tersoff>`
* :doc:`tersoff/zbl (gko) <pair_tersoff_zbl>`
* :doc:`thole <pair_thole>`
* :doc:`threebody/table <pair_threebody_table>`
* :doc:`tip4p/cut (o) <pair_coul>`
* :doc:`tip4p/long (o) <pair_coul>`
* :doc:`tip4p/long/soft (o) <pair_fep_soft>`

View File

@ -276,10 +276,27 @@ Compilation of the plugin can be managed via both, CMake or traditional
GNU makefiles. Some examples that can be used as a template are in the
``examples/plugins`` folder. The CMake script code has some small
adjustments to allow building the plugins for running unit tests with
them. Another example that converts the KIM package into a plugin can be
found in the ``examples/kim/plugin`` folder. No changes to the sources
of the KIM package themselves are needed; only the plugin interface and
loader code needs to be added. This example only supports building with
CMake, but is probably a more typical example. To compile you need to
run CMake with -DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>. Other
them.
Another example that converts the KIM package into a plugin can be found
in the ``examples/kim/plugin`` folder. No changes to the sources of the
KIM package themselves are needed; only the plugin interface and loader
code needs to be added. This example only supports building with CMake,
but is probably a more typical example. To compile you need to run CMake
with -DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>. Other
configuration setting are identical to those for compiling LAMMPS.
A second example for a plugin from a package is in the
``examples/PACKAGES/pace/plugin`` folder that will create a plugin from
the ML-PACE package. In this case the bulk of the code is in a static
external library that is being downloaded and compiled first and then
combined with the pair style wrapper and the plugin loader. This
example also contains a NSIS script that can be used to create an
Installer package for Windows (the mutual licensing terms of the
external library and LAMMPS conflict when distributing binaries, so the
ML-PACE package cannot be linked statically, but the LAMMPS headers
required to build the plugin are also available under a less restrictive
license). This will automatically set the required environment variable
and launching a (compatible) LAMMPS binary will load and register the
plugin and the ML-PACE package can then be used as it was linked into
LAMMPS.

View File

@ -239,7 +239,7 @@ is consistent with the 6 moments of inertia: ixx iyy izz ixy ixz iyz =
.. parsed-literal::
3 1 27
3 1 19
4
1 1 4 0 0 0
-0.7071 -0.7071 0

View File

@ -19,7 +19,7 @@ atoms and the water molecule to run a rigid SPC model.
| LJ :math:`\sigma` of OO = 3.166
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
| :math:`r_0` of OH bond = 1.0
| :math:`\theta` of HOH angle = 109.47\ :math:`^{\circ}`
| :math:`\theta_0` of HOH angle = 109.47\ :math:`^{\circ}`
|
Note that as originally proposed, the SPC model was run with a 9

View File

@ -184,7 +184,7 @@ frame.
.. code-block:: python
import re, yaml
import yaml
import pandas as pd
try:
@ -193,7 +193,7 @@ frame.
from yaml import SafeLoader as Loader
with open("ave.yaml") as f:
ave = yaml.load(docs, Loader=Loader)
ave = yaml.load(f, Loader=Loader)
keys = ave['keywords']
df = {}

View File

@ -30,8 +30,8 @@ initial versions of LAMMPS is:
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
DOI for the LAMMPS code
^^^^^^^^^^^^^^^^^^^^^^^
DOI for the LAMMPS source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LAMMPS developers use the `Zenodo service at CERN <https://zenodo.org/>`_
to create digital object identifies (DOI) for stable releases of the

View File

@ -657,7 +657,7 @@ advection-diffusion-reaction systems. The equations of motion of these
DPD extensions are integrated through a modified velocity-Verlet (MVV)
algorithm.
**Author:** Zhen Li (Division of Applied Mathematics, Brown University)
**Author:** Zhen Li (Department of Mechanical Engineering, Clemson University)
**Supporting info:**

View File

@ -42,5 +42,4 @@ inaccurate relative timing data, because processors have to wait when
communication occurs for other processors to catch up. Thus the
reported times for "Communication" or "Other" may be higher than they
really are, due to load-imbalance. If this is an issue, you can
uncomment the MPI_Barrier() lines in src/timer.cpp, and re-compile
LAMMPS, to obtain synchronized timings.
use the :doc:`timer sync <timer>` command to obtain synchronized timings.

View File

@ -56,6 +56,7 @@ Pre-processing tools
* :ref:`moltemplate <moltemplate>`
* :ref:`msi2lmp <msi>`
* :ref:`polybond <polybond>`
* :ref:`stl_bin2txt <stlconvert>`
Post-processing tools
@ -94,7 +95,7 @@ Miscellaneous tools
* :ref:`LAMMPS shell <lammps_shell>`
* :ref:`LAMMPS magic patterns for file(1) <magic>`
* :ref:`Offline build tool <offline>`
* :ref:`singularity <singularity_tool>`
* :ref:`singularity/apptainer <singularity_tool>`
* :ref:`SWIG interface <swig>`
* :ref:`vim <vim>`
@ -1006,14 +1007,37 @@ Ivanov, at University of Iceland (ali5 at hi.is).
.. _singularity_tool:
singularity tool
----------------------------------------
singularity/apptainer tool
--------------------------
The singularity sub-directory contains container definitions files
that can be used to build container images for building and testing
LAMMPS on specific OS variants using the `Singularity <https://sylabs.io>`_
container software. Contributions for additional variants are welcome.
For more details please see the README.md file in that folder.
The singularity sub-directory contains container definitions files that
can be used to build container images for building and testing LAMMPS on
specific OS variants using the `Apptainer <https://apptainer.org>`_ or
`Singularity <https://sylabs.io>`_ container software. Contributions for
additional variants are welcome. For more details please see the
README.md file in that folder.
----------
.. _stlconvert:
stl_bin2txt tool
----------------
The file stl_bin2txt.cpp converts binary STL files - like they are
frequently offered for download on the web - into ASCII format STL files
that LAMMPS can read with the :doc:`create_atoms mesh <create_atoms>` or
the :doc:`fix smd/wall_surface <fix_smd_wall_surface>` commands. The syntax
for running the tool is
.. code-block:: bash
stl_bin2txt infile.stl outfile.stl
which creates outfile.stl from infile.stl. This tool must be compiled
on a platform compatible with the byte-ordering that was used to create
the binary file. This usually is a so-called little endian hardware
(like x86).
----------

View File

@ -87,7 +87,7 @@ of (g,i,k,o,t) to indicate which accelerated styles exist.
* :doc:`dipole <angle_dipole>` - angle that controls orientation of a point dipole
* :doc:`fourier <angle_fourier>` - angle with multiple cosine terms
* :doc:`fourier/simple <angle_fourier_simple>` - angle with a single cosine term
* :doc:`gaussian <angle_gaussian>` - multicentered Gaussian-based angle potential
* :doc:`gaussian <angle_gaussian>` - multi-centered Gaussian-based angle potential
* :doc:`harmonic <angle_harmonic>` - harmonic angle
* :doc:`mm3 <angle_mm3>` - anharmonic angle
* :doc:`quartic <angle_quartic>` - angle with cubic and quartic terms

View File

@ -35,16 +35,24 @@ Examples
Description
"""""""""""
Define a computation that calculates the local density and temperature
for each atom and neighbors inside a spherical cutoff.
Define a computation that calculates the local mass density and
temperature for each atom based on its neighbors inside a spherical
cutoff. If an atom has M neighbors, then its local mass density is
calculated as the sum of its mass and its M neighbor masses, divided
by the volume of the cutoff sphere (or circle in 2d). The local
temperature of the atom is calculated as the temperature of the
collection of M+1 atoms, after subtracting the center-of-mass velocity
of the M+1 atoms from each of the M+1 atom's velocities. This is
effectively the thermal velocity of the neighborhood of the central
atom, similar to :doc:`compute temp/com <compute_temp_com>`.
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 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
@ -55,16 +63,16 @@ too frequently.
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.
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 compute 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.
----------
@ -77,17 +85,20 @@ too frequently.
Output info
"""""""""""
This compute calculates a per-atom array with two columns: density and temperature.
This compute calculates a per-atom array with two columns: mass
density in density :doc:`units <units>` and temperature in temperature
:doc:`units <units>`.
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.
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.
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
""""""""""""""""
@ -97,5 +108,5 @@ Related commands
Default
"""""""
The option defaults are *cutoff* = pair style cutoff
The option defaults are *cutoff* = pair style cutoff.

View File

@ -11,7 +11,7 @@ Syntax
create_atoms type style args keyword values ...
* type = atom type (1-Ntypes) of atoms to create (offset for molecule creation)
* style = *box* or *region* or *single* or *random*
* style = *box* or *region* or *single* or *mesh* or *random*
.. parsed-literal::
@ -20,6 +20,8 @@ Syntax
region-ID = particles will only be created if contained in the region
*single* args = x y z
x,y,z = coordinates of a single particle (distance units)
*mesh* args = STL-file
STL-file = file with triangle mesh in STL format
*random* args = N seed region-ID
N = number of particles to create
seed = random # seed (positive integer)
@ -47,6 +49,14 @@ Syntax
*set* values = dim name
dim = *x* or *y* or *z*
name = name of variable to set with x, y, or z atom position
*radscale* value = factor
factor = scale factor for setting atom radius
*meshmode* values = mode arg
mode = *bisect* or *qrand*
*bisect* arg = radthresh
radthresh = threshold value for *mesh* to determine when to split triangles (distance units)
*qrand* arg = density
density = minimum number density for atoms place on *mesh* triangles (inverse distance squared units)
*rotate* values = theta Rx Ry Rz
theta = rotation angle for single molecule (degrees)
Rx,Ry,Rz = rotation vector for single molecule
@ -69,21 +79,23 @@ Examples
create_atoms 3 single 0 0 5
create_atoms 1 box var v set x xpos set y ypos
create_atoms 2 random 50 12345 NULL overlap 2.0 maxtry 50
create_atoms 1 mesh open_box.stl meshmode qrand 0.1 units box
create_atoms 1 mesh funnel.stl meshmode bisect 4.0 units box radscale 0.9
Description
"""""""""""
This command creates atoms (or molecules) within the simulation box,
either on a lattice, or a single atom (or molecule), or a random
collection of atoms (or molecules). It is an alternative to reading
in atom coordinates explicitly via a :doc:`read_data <read_data>` or
:doc:`read_restart <read_restart>` command. A simulation box must
already exist, which is typically created via the :doc:`create_box
<create_box>` command. Before using this command, a lattice must also
be defined using the :doc:`lattice <lattice>` command, unless you
specify the *single* style with units = box or the *random* style.
For the remainder of this doc page, a created atom or molecule is
referred to as a "particle".
either on a lattice, or a single atom (or molecule), or on a surface
defined by a triangulated mesh, or a random collection of atoms (or
molecules). It is an alternative to reading in atom coordinates
explicitly via a :doc:`read_data <read_data>` or :doc:`read_restart
<read_restart>` command. A simulation box must already exist, which is
typically created via the :doc:`create_box <create_box>` command.
Before using this command, a lattice must also be defined using the
:doc:`lattice <lattice>` command, unless you specify the *single* style
with units = box or the *random* style. For the remainder of this doc
page, a created atom or molecule is referred to as a "particle".
If created particles are individual atoms, they are assigned the
specified atom *type*, though this can be altered via the *basis*
@ -119,6 +131,62 @@ the specified coordinates. This can be useful for debugging purposes
or to create a tiny system with a handful of particles at specified
positions.
.. figure:: img/marble_race.jpg
:figwidth: 33%
:align: right
:target: _images/marble_race.jpg
For the *mesh* style, a file with a triangle mesh in `STL format
<https://en.wikipedia.org/wiki/STL_(file_format)>`_ is read and one or
more particles are placed into the area of each triangle. The reader
supports both ASCII and binary files conforming to the format on the
Wikipedia page. Binary STL files (e.g. as frequently offered for
3d-printing) can also be first converted to ASCII for editing with the
:ref:`stl_bin2txt tool <stlconvert>`. The use of the *units box* option
is required. There are two algorithms available for placing atoms:
*bisect* and *qrand*. They can be selected via the *meshmode* option;
*bisect* is the default. If the atom style allows it, the radius will
be set to a value depending on the algorithm and the value of the
*radscale* parameter (see below), and the atoms created from the mesh
are assigned a new molecule ID.
In *bisect* mode a particle is created at the center of each triangle
unless the average distance of the triangle vertices from its center is
larger than the *radthresh* value (default is lattice spacing in
x-direction). In case the average distance is over the threshold, the
triangle is recursively split into two halves along the the longest side
until the threshold is reached. There will be at least one sphere per
triangle. The value of *radthresh* is set as an argument to *meshmode
bisect*. The average distance of the vertices from the center is also
used to set the radius.
In *qrand* mode a quasi-random sequence is used to distribute particles
on mesh triangles using an approach by :ref:`(Roberts) <Roberts2019>`.
Particles are added to the triangle until the minimum number density is
met or exceeded such that every triangle will have at least one
particle. The minimum number density is set as an argument to the
*qrand* option. The radius will be set so that the sum of the area of
the radius of the particles created in place of a triangle will be equal
to the area of that triangle.
.. note::
The atom placement algorithms in the *mesh* style benefit from meshes
where triangles are close to equilateral. It is therefore
recommended to pre-process STL files to optimize the mesh
accordingly. There are multiple open source and commercial software
tools available with the capability to generate optimized meshes.
.. note::
In most cases the atoms created in *mesh* style will become an
immobile or rigid object that would not be time integrated or moved
by :doc:`fix move <fix_move>` or :doc:`fix rigid <fix_rigid>`. For
computational efficiency *and* to avoid undesired contributions to
pressure and potential energy due to close contacts, it is usually
beneficial to exclude computing interactions between the created
particles using :doc:`neigh_modify exclude <neigh_modify>`.
For the *random* style, *N* particles are added to the system at
randomly generated coordinates, which can be useful for generating an
amorphous system. The particles are created one by one using the
@ -316,6 +384,13 @@ the atoms around the rotation axis is consistent with the right-hand
rule: if your right-hand's thumb points along *R*, then your fingers
wrap around the axis in the direction of rotation.
The *radscale* keyword only applies to the *mesh* style and adjusts the
radius of created particles (see above), provided this is supported by
the atom style. Its value is a prefactor (must be > 0.0, default is
1.0) that is applied to the atom radius inferred from the size of the
individual triangles in the triangle mesh that the particle corresponds
to.
The *overlap* keyword only applies to the *random* style. It prevents
newly created particles from being created closer than the specified
*Doverlap* distance from any other particle. When the particles being
@ -424,9 +499,11 @@ values specified in the file read by the :doc:`molecule <molecule>`
command. E.g. the file typically defines bonds (angles,etc) between
atoms in the molecule, and can optionally define charges on each atom.
Note that the *sphere* atom style sets the default particle diameter
to 1.0 as well as the density. This means the mass for the particle
is not 1.0, but is PI/6 \* diameter\^3 = 0.5236.
Note that the *sphere* atom style sets the default particle diameter to
1.0 as well as the density. This means the mass for the particle is not
1.0, but is PI/6 \* diameter\^3 = 0.5236. When using the *mesh* style,
the particle diameter is adjusted from the size of the individual
triangles in the triangle mesh.
Note that the *ellipsoid* atom style sets the default particle shape
to (0.0 0.0 0.0) and the density to 1.0 which means it is a point
@ -460,5 +537,13 @@ Default
The default for the *basis* keyword is that all created atoms are
assigned the argument *type* as their atom type (when single atoms are
being created). The other defaults are *remap* = no, *rotate* =
random, *overlap* not checked, *maxtry* = 10, and *units* = lattice.
being created). The other defaults are *remap* = no, *rotate* = random,
*radscale* = 1.0, *radthresh* = x-lattice spacing, *overlap* not
checked, *maxtry* = 10, and *units* = lattice.
----------
.. _Roberts2019:
**(Roberts)** R. Roberts (2019) "Evenly Distributing Points in a Triangle." Extreme Learning.
`<http://extremelearning.com.au/evenly-distributing-points-in-a-triangle/>`_

View File

@ -10,7 +10,7 @@ Syntax
delete_atoms style args keyword value ...
* style = *group* or *region* or *overlap* or *porosity* or *variable*
* style = *group* or *region* or *overlap* or *random* or *variable*
.. parsed-literal::
@ -20,11 +20,17 @@ 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
*random* args = ranstyle value eflag group-ID region-ID seed
ranstyle = *fraction* or *count*
for *fraction*:
value = fraction (0.0 to 1.0) of eligible atoms to delete
eflag = *no* for fast approximate deletion, *yes* for exact deletion
for *count*:
value = number of atoms to delete
eflag = *no* for warning if count > eligible atoms, *yes* for error
group-ID = group within which to perform deletions
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)
*variable* args = variable-name
@ -46,16 +52,17 @@ 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 random fraction 0.1 yes all cube 482793 bond yes
delete_atoms random fraction 0.3 no polymer NULL 482793 bond yes
delete_atoms random count 500 no ions NULL 482793
detele_atoms variable checkers
Description
"""""""""""
Delete the specified atoms. This command can be used to carve out
voids from a block of material or to delete created atoms that are too
close to each other (e.g. at a grain boundary).
Delete the specified atoms. This command can be used, for example, to
carve out voids from a block of material or to delete created atoms
that are too close to each other (e.g. at a grain boundary).
For style *group*, all atoms belonging to the group are deleted.
@ -81,17 +88,33 @@ 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 style *random* a subset of eligible atoms are deleted. Which
atoms to delete are chosen randomly using the specified random number
*seed*. Which atoms are deleted may vary when running on different
numbers of processors.
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 *ranstyle* = *fraction*, the specified fractional *value* (0.0 to
1.0) of eligible atoms are deleted. If *eflag* is set to *no*, then
the number of deleted atoms will be approximate, but the operation
will be fast. If *eflag* is set to *yes*, then the number deleted
will match the requested fraction, but for large systems the selection
of deleted atoms may take additional time to determine.
For *ranstyle* = *count*, the specified integer *value* is the number
of eligible atoms are deleted. If *eflag* is set to *no*, then if the
requested number is larger then the number of eligible atoms, a
warning is issued and only the eligible atoms are deleted instead of
the requested *value*. If *eflag* is set to *yes*, an error is
triggered instead and LAMMPS will exit. For large systems the
selection of atoms to delete may take additional time to determine,
the same as for requesting an exact fraction with *pstyle* =
*fraction*.
Which atoms are eligible for deletion for style *random* is determined
by the specified *group-ID* and *region-ID*. To be eligible, an atom
must be in both the specified group and region. If *group-ID* = all,
there is effectively no group criterion. If *region-ID* is specified
as NULL, no region criterion is imposed.
For style *variable*, all atoms for which the atom-style variable with
the given name evaluates to non-zero will be deleted. Additional atoms
@ -100,6 +123,10 @@ were deleted within the region; see the *mol* keyword discussion below.
This option allows complex selections of atoms not covered by the
other options listed above.
----------
Here is the meaning of the optional keywords.
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
number of atoms in the system. Note that this is not done for

View File

@ -133,13 +133,14 @@ Examples
.. code-block:: LAMMPS
dump myDump all atom 100 dump.atom
dump myDump all atom 100 dump.lammpstrj
dump myDump all atom/mpiio 100 dump.atom.mpiio
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 4a all custom 100 dump.myforce.* id type x y vx fx
dump 4a all custom 100 dump.myvel.lammpsbin id type x y z vx vy vz
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
dump 2 inner cfg 10 dump.snap.*.cfg mass type xs ys zs vx vy vz
@ -419,6 +420,7 @@ style.
.. code-block:: yaml
---
creator: LAMMPS
timestep: 0
units: lj
time: 0
@ -534,11 +536,11 @@ MPI-IO.
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
files. You can use the ".bin" suffix described below in an MPI-IO
files. You can use the ".bin" or ".lammpsbin" suffix described below in an MPI-IO
dump file; again this file will be written in parallel and have the
same binary format as if it were written without MPI-IO.
If the filename ends with ".bin", the dump file (or files, if "\*" or
If the filename ends with ".bin" or ".lammpsbin", the dump file (or files, if "\*" or
"%" is also used) is written in binary format. A binary dump file
will be about the same size as a text version, but will typically
write out much faster. Of course, when post-processing, you will need

View File

@ -44,7 +44,7 @@ Syntax
color = *type*
bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
*fix* = fixID color fflag1 fflag2
fixID = ID of fix that generates objects to dray
fixID = ID of fix that generates objects to draw
color = *type*
fflag1,fflag2 = 2 numeric flags to affect how fix objects are drawn
*size* values = width height = size of images

View File

@ -392,9 +392,8 @@ keyword. For *atom* dump styles only the keywords "id", "type", "x",
"y", "z", "ix", "iy", "iz" can be accessed via string regardless of
whether scaled or unwrapped coordinates were enabled or disabled, and
it always assumes 8 columns for indexing regardless of whether image
flags are enabled or not. For dump style *cfg* only the "auxiliary"
keywords (6th or later keyword) may be changed and the column indexing
considers only them (i.e. the 6th keyword is the the 1st column).
flags are enabled or not. For dump style *cfg* only changes to the
"auxiliary" keywords (6th or later keyword) will become visible.
The *colname* keyword can be used multiple times. If multiple *colname*
settings refer to the same keyword, the last setting has precedence. A

View File

@ -75,7 +75,7 @@ doc page. This description of LHD builds on the GHD description.
The definition of bonds and :math:`E_{ij}` are the same for GHD and LHD.
The formulas for :math:`V^{max}_{ij}` and :math:`F^{max}_{ij}` are also
the same except for a pre-factor :math:`C_{ij}`, explained below.
the same except for a prefactor :math:`C_{ij}`, explained below.
The bias energy :math:`V_{ij}` applied to a bond *ij* with maximum strain is
@ -256,7 +256,7 @@ Note that this fix does not know the *cutevent* parameter, but uses
half the *cutbond* parameter as an estimate to warn if the ghost
cutoff is not long enough.
As described above the *alpha* argument is a pre-factor in the
As described above the *alpha* argument is a prefactor in the
boostostat update equation for each bond's :math:`C_{ij}` prefactor.
*Alpha* is specified in time units, similar to other thermostat or barostat
damping parameters. It is roughly the physical time it will take the

View File

@ -12,7 +12,6 @@ Syntax
* ID, group-ID are documented in :doc:`fix <fix>` command
* mdi/aimd = style name of this fix command
* optional keyword = *plugin*
Examples
""""""""
@ -20,7 +19,6 @@ Examples
.. code-block:: LAMMPS
fix 1 all mdi/aimd
fix 1 all mdi/aimd plugin
Description
"""""""""""
@ -53,14 +51,6 @@ same time as LAMMPS, or as a plugin library. See the :doc:`mdi plugin
Again, the examples/mdi/README file explains how to launch both driver
and engine codes so that engine is used in plugin mode.
To use this fix with a plugin engine, you must specify the
*plugin* keyword as the last argument, as illustrated above.
.. note::
As of April 2022, the *plugin* keyword is needed. In a future
version of the MDI library it will no longer be necessary.
----------
This fix performs the timestepping portion of an AIMD simulation.

View File

@ -21,7 +21,8 @@ Syntax
* momentum = style name of this fix command
* N = adjust the momentum every this many timesteps
one or more keyword/value pairs may be appended
* keyword = *linear* or *angular* or *rescale*
.. parsed-literal::
fix ID group-ID momentum/chunk N chunkID keyword values ...
@ -30,7 +31,7 @@ Syntax
* N = adjust the momentum per chunk every this many timesteps
* chunkID = ID of :doc:`compute chunk/atom <compute_chunk_atom>` command
one or more keyword/value pairs may be appended
one or more keyword/value settings may be appended to each of the fix commands:
* keyword = *linear* or *angular* or *rescale*
.. parsed-literal::

View File

@ -59,7 +59,7 @@ of a bond or angle or dihedral interaction whose strength can vary
over time during a simulation. This is functionally similar to
creating a bond or angle or dihedral for the same atoms in a data
file, as specified by the :doc:`read_data <read_data>` command, albeit
with a time-varying pre-factor coefficient, and except for exclusion
with a time-varying prefactor coefficient, and except for exclusion
rules, as explained below.
For the purpose of force field parameter-fitting or mapping a molecular

View File

@ -199,7 +199,7 @@ inside the colloid particle and wall. Note that the cutoff distance Rc
in this case is the distance from the colloid particle center to the
wall. The prefactor :math:`\epsilon` can be thought of as an effective
Hamaker constant with energy units for the strength of the colloid-wall
interaction. More specifically, the :math:`\epsilon` pre-factor is
interaction. More specifically, the :math:`\epsilon` prefactor is
:math:`4\pi^2 \rho_{wall} \rho_{colloid} \epsilon \sigma^6`, where
:math:`\epsilon` and :math:`\sigma` are the LJ parameters for the
constituent LJ particles. :math:`\rho_{wall}` and :math:`\rho_{colloid}`
@ -211,7 +211,7 @@ constituent LJ particles of size :math:`\sigma` within the colloid particle
and a 3d half-lattice of Lennard-Jones 12/6 particles of size :math:`\sigma`
in the wall. As mentioned in the preceding paragraph, the density of
particles in the wall and colloid can be different, as specified by
the :math:`\epsilon` pre-factor.
the :math:`\epsilon` prefactor.
For the *wall/harmonic* style, :math:`\epsilon` is effectively the spring
constant K, and has units (energy/distance\^2). The input parameter

View File

@ -88,7 +88,7 @@ examples/ directory.
The prefactor :math:`\epsilon` can be thought of as an
effective Hamaker constant with energy units for the strength of the
ellipsoid-wall interaction. More specifically, the :math:`\epsilon`
pre-factor is
prefactor is
.. math::

BIN
doc/src/img/marble_race.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -129,8 +129,8 @@ Examples
kspace_style pppm 1.0e-4
kspace_style pppm/cg 1.0e-5 1.0e-6
kspace style msm 1.0e-4
kspace style scafacos fmm 1.0e-4
kspace_style msm 1.0e-4
kspace_style scafacos fmm 1.0e-4
kspace_style none
Used in input scripts:
@ -475,8 +475,8 @@ that package **and** the KSPACE package. See the :doc:`Build package
<Build_package>` page for more info.
For MSM, a simulation must be 3d and one can use any combination of
periodic, non-periodic, or shrink-wrapped boundaries (specified using
the :doc:`boundary <boundary>` command).
periodic, non-periodic, but not shrink-wrapped boundaries (specified
using the :doc:`boundary <boundary>` command).
For Ewald and PPPM, a simulation must be 3d and periodic in all
dimensions. The only exception is if the slab option is set with

View File

@ -98,6 +98,10 @@ see their implementation reported in :ref:`(Ivanov) <Ivanov1>`.
Restrictions
""""""""""""
The *spin*, *spin/cg*, and *spin/lbfgps* styles are part of the SPIN
package. They are only enabled if LAMMPS was built with that package.
See the :doc:`Build package <Build_package>` page for more info.
This minimization procedure is only applied to spin degrees of
freedom for a frozen lattice configuration.

View File

@ -1,25 +1,55 @@
.. index:: min_style
min_style command
=================
min_style cg command
====================
min_style hftn command
======================
min_style sd command
====================
min_style quickmin command
==========================
min_style fire command
======================
min_style fire/old command
==========================
:doc:`min_style spin <min_spin>` command
========================================
:doc:`min_style spin/cg <min_spin>` command
===========================================
:doc:`min_style spin/lbfgs <min_spin>` command
==============================================
Syntax
""""""
.. code-block:: LAMMPS
.. parsed-literal::
min_style style
* style = *cg* or *hftn* or *sd* or *quickmin* or *fire* or *fire/old* or *spin* or *spin/cg* or *spin/lbfgs*
.. parsed-literal::
*spin* is discussed briefly here and fully on :doc:`min_style spin <min_spin>` doc page
*spin/cg* is discussed briefly here and fully on :doc:`min_style spin <min_spin>` doc page
*spin/lbfgs* is discussed briefly here and fully on :doc:`min_style spin <min_spin>` doc page
Examples
""""""""
.. code-block:: LAMMPS
min_style cg
min_style spin
min_style fire
min_style spin
Description
"""""""""""
@ -124,7 +154,9 @@ calculations via the :doc:`neb/spin <neb_spin>` command.
Restrictions
""""""""""""
none
The *spin*, *spin/cg*, and *spin/lbfgps* styles are part of the SPIN
package. They are only enabled if LAMMPS was built with that package.
See the :doc:`Build package <Build_package>` page for more info.
Related commands
""""""""""""""""

View File

@ -50,6 +50,12 @@ Examples
pair_style hybrid/overlay e3b 1 lj/cut/tip4p/long 1 2 1 1 0.15 8.5
pair_coeff * * e3b preset 2011
Used in example input script:
.. parsed-literal::
examples/PACKAGES/e3b/in.e3b-tip4p2005
Description
"""""""""""
@ -68,21 +74,27 @@ The *e3b* style computes an \"explicit three-body\" (E3B) potential for water :r
0 & r>R_f\\
\end{cases}
This potential was developed as a water model that includes the three-body cooperativity of hydrogen bonding explicitly.
To use it in this way, it must be applied in conjunction with a conventional two-body water model, through *pair_style hybrid/overlay*.
The three body interactions are split into three types: A, B, and C.
Type A corresponds to anti-cooperative double hydrogen bond donor interactions.
Type B corresponds to the cooperative interaction of molecules that both donate and accept a hydrogen bond.
Type C corresponds to anti-cooperative double hydrogen bond acceptor interactions.
The three-body interactions are smoothly cutoff by the switching function s(r) between Rs and Rc3.
The two-body interactions are designed to correct for the effective many-body interactions implicitly included in the conventional two-body potential.
The two-body interactions are cut off sharply at Rc2, because K3 is typically significantly smaller than K2.
See :ref:`(Kumar 2008) <Kumar>` for more details.
This potential was developed as a water model that includes the
three-body cooperativity of hydrogen bonding explicitly. To use it in
this way, it must be applied in conjunction with a conventional two-body
water model, through pair style :doc:`hybrid/overlay <pair_hybrid>`. The
three body interactions are split into three types: A, B, and C. Type A
corresponds to anti-cooperative double hydrogen bond donor interactions.
Type B corresponds to the cooperative interaction of molecules that both
donate and accept a hydrogen bond. Type C corresponds to
anti-cooperative double hydrogen bond acceptor interactions. The
three-body interactions are smoothly cutoff by the switching function
s(r) between Rs and Rc3. The two-body interactions are designed to
correct for the effective many-body interactions implicitly included in
the conventional two-body potential. The two-body interactions are cut
off sharply at Rc2, because K3 is typically significantly smaller than
K2. See :ref:`(Kumar 2008) <Kumar>` for more details.
Only a single *pair_coeff* command is used with the *e3b* style.
The first two arguments must be \* \*.
The oxygen atom type for the pair style is passed as the only argument to the *pair_style* command, not in the *pair_coeff* command.
The hydrogen atom type is inferred by the ordering of the atoms.
Only a single :doc:`pair_coeff <pair_coeff>` command is used with the
*e3b* style and the first two arguments must be \* \*. The oxygen atom
type for the pair style is passed as the only argument to the
*pair_style* command, not in the *pair_coeff* command. The hydrogen
atom type is inferred from the ordering of the atoms.
.. note::
@ -90,26 +102,41 @@ The hydrogen atom type is inferred by the ordering of the atoms.
Each water molecule must have consecutive IDs with the oxygen first.
This pair style does not test that this criteria is met.
The *pair_coeff* command must have at least one keyword/value pair, as described above.
The *preset* keyword sets the potential parameters to the values used in :ref:`(Tainter 2011) <Tainter2011>` or :ref:`(Tainter 2015) <Tainter2015>`.
To use the water models defined in those references, the *e3b* style should always be used in conjunction with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*, as demonstrated in the second example above.
The *preset 2011* option should be used with the :doc:`TIP4P water model <Howto_tip4p>`.
The *preset 2015* option should be used with the :doc:`TIP4P/2005 water model <Howto_tip4p>`.
If the *preset* keyword is used, no other keyword is needed.
Changes to the preset parameters can be made by specifying the *preset* keyword followed by the specific parameter to change, like *Ea*\ .
Note that the other keywords must come after *preset* in the pair_style command.
The *e3b* style can also be used to implement any three-body potential of the same form by specifying all the keywords except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*, *Rs*, and *bondL*\ .
The keyword *bondL* specifies the intramolecular OH bond length of the water model being used.
This is needed to include H atoms that are within the cutoff even when the attached oxygen atom is not.
The *pair_coeff* command must have at least one keyword/value pair, as
described above. The *preset* keyword sets the potential parameters to
the values used in :ref:`(Tainter 2011) <Tainter2011>` or
:ref:`(Tainter 2015) <Tainter2015>`. To use the water models defined in
those references, the *e3b* style should always be used in conjunction
with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*,
as demonstrated in the second example above. The *preset 2011* option
should be used with the :doc:`TIP4P water model <Howto_tip4p>`. The
*preset 2015* option should be used with the :doc:`TIP4P/2005 water
model <Howto_tip4p>`. If the *preset* keyword is used, no other keyword
is needed. Changes to the preset parameters can be made by specifying
the *preset* keyword followed by the specific parameter to change, like
*Ea*\ . Note that the other keywords must come after *preset* in the
pair_style command. The *e3b* style can also be used to implement any
three-body potential of the same form by specifying all the keywords
except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*,
*Rs*, and *bondL*\ . The keyword *bondL* specifies the intramolecular
OH bond length of the water model being used. This is needed to include
H atoms that are within the cutoff even when the attached oxygen atom is
not.
This pair style allocates arrays sized according to the number of pairwise interactions within Rc3.
To do this it needs an estimate for the number of water molecules within Rc3 of an oxygen atom.
This estimate defaults to 10 and can be changed using the *neigh* keyword, which takes an integer as an argument.
If the neigh setting is too small, the simulation will fail with the error "neigh is too small".
If the neigh setting is too large, the pair style will use more memory than necessary.
This pair style allocates arrays sized according to the number of
pairwise interactions within Rc3. To do this it needs an estimate for
the number of water molecules within Rc3 of an oxygen atom. This
estimate defaults to 10 and can be changed using the *neigh* keyword,
which takes an integer as an argument. If the neigh setting is too
small, the simulation will fail with the error "neigh is too small". If
the neigh setting is too large, the pair style will use more memory than
necessary.
This pair style tallies a breakdown of the total E3B potential energy into sub-categories, which can be accessed via the :doc:`compute pair <compute_pair>` command as a vector of values of length 4.
The 4 values correspond to the terms in the first equation above: the E2 term, the Ea term, the Eb term, and the Ec term.
This pair style tallies a breakdown of the total E3B potential energy
into sub-categories, which can be accessed via the :doc:`compute pair
<compute_pair>` command as a vector of values of length 4. The 4 values
correspond to the terms in the first equation above: the E2 term, the Ea
term, the Eb term, and the Ec term.
See the examples/PACKAGES/e3b directory for a complete example script.

View File

@ -144,7 +144,7 @@ two particles, and is thus a non-linear function of overlap distance.
Thus Kn has units of force per area and is thus specified in units of
(pressure). The effects of absolute particle size (monodispersity)
and relative size (polydispersity) are captured in the radii-dependent
pre-factors. When these pre-factors are carried through to the other
prefactors. When these prefactors are carried through to the other
terms in the force equation it means that the specified :math:`\gamma_n` is in
units of (1/(time\*distance)), :math:`K_t` is in units of (pressure), and
:math:`\gamma_t` is in units of (1/(time\*distance)).

View File

@ -54,7 +54,7 @@ form.
An interpolation table is used to evaluate the density-dependent energy
(:math:`\int A(\rho') d\rho'`) and force (:math:`A(\rho')`). Note that
the pre-factor to the energy is computed after the interpolation, thus
the prefactor to the energy is computed after the interpolation, thus
the :math:`\int A(\rho') d \rho'` will have units of energy / length\^4.
The interpolation table is created as a pre-computation by fitting

View File

@ -67,7 +67,7 @@ form.
An interpolation table is used to evaluate the density-dependent energy
(:math:`\int A(\rho') d \rho'`) and force (:math:`A(\rho')`). Note that
the pre-factor to the energy is computed after the interpolation, thus
the prefactor to the energy is computed after the interpolation, thus
the :math:`\int A(\rho') d\rho'` will have units of energy / length\^4.
The interpolation table is created as a pre-computation by fitting

View File

@ -20,28 +20,37 @@ Examples
Description
"""""""""""
Using a pair style of none means pair forces and energies are not
computed.
Using a pair style of *none* means that any previous pair style setting
will be deleted and pairwise forces and energies are not computed.
With this choice, the force cutoff is 0.0, which means that only atoms
within the neighbor skin distance (see the :doc:`neighbor <neighbor>`
command) are communicated between processors. You must insure the
skin distance is large enough to acquire atoms needed for computing
bonds, angles, etc.
As a consequence there will be a pairwise force cutoff of 0.0, which has
implications for the default setting of the neighbor list and the
communication cutoff. Those are the sum of the largest pairwise cutoff
and the neighbor skin distance (see the documentation of the
:doc:`neighbor <neighbor>` command and the :doc:`comm_modify
<comm_modify>` command). When you have bonds, angles, dihedrals, or
impropers defined at the same time, you must set the communication
cutoff so that communication cutoff distance is large enough to acquire
and communicate sufficient ghost atoms from neighboring sub-domains as
needed for computing bonds, angles, etc.
A pair style of *none* will also prevent pairwise neighbor lists from
being built. However if the :doc:`neighbor <neighbor>` style is *bin*,
data structures for binning are still allocated. If the neighbor skin
distance is small, then these data structures can consume a large
amount of memory. So you should either set the neighbor style to
*nsq* or set the skin distance to a larger value.
A pair style of *none* will also not request a pairwise neighbor list.
However if the :doc:`neighbor <neighbor>` style is *bin*, data
structures for binning are still allocated. If the neighbor list cutoff
is small, then these data structures can consume a large amount of
memory. So you should either set the neighbor style to *nsq* or set the
skin distance to a larger value.
See the :doc:`pair_style zero <pair_zero>` for a way to trigger the
building of a neighbor lists, but compute no pairwise interactions.
See the :doc:`pair_style zero <pair_zero>` for a way to set a pairwise
cutoff and thus trigger the building of a neighbor lists and setting
a corresponding communication cutoff, but compute no pairwise interactions.
Restrictions
""""""""""""
none
You must not use a :doc:`pair_coeff <pair_coeff>` command with this pair
style. Since there is no interaction computed, you cannot set any
coefficients for it.
Related commands
""""""""""""""""

View File

@ -41,7 +41,7 @@ Style *soft* computes pairwise interactions with the formula
\qquad r < r_c
It is useful for pushing apart overlapping atoms, since it does not
blow up as r goes to 0. A is a pre-factor that can be made to vary in
blow up as r goes to 0. A is a prefactor that can be made to vary in
time from the start to the end of the run (see discussion below),
e.g. to start with a very soft potential and slowly harden the
interactions over time. Rc is the cutoff. See the :doc:`fix nve/limit <fix_nve_limit>` command for another way to push apart

View File

@ -348,6 +348,7 @@ accelerated styles exist.
* :doc:`spin/neel <pair_spin_neel>` -
* :doc:`srp <pair_srp>` -
* :doc:`sw <pair_sw>` - Stillinger-Weber 3-body potential
* :doc:`sw/angle/table <pair_sw_angle_table>` - Stillinger-Weber potential with tabulated angular term
* :doc:`sw/mod <pair_sw>` - modified Stillinger-Weber 3-body potential
* :doc:`table <pair_table>` - tabulated pair potential
* :doc:`table/rx <pair_table_rx>` -
@ -358,6 +359,7 @@ accelerated styles exist.
* :doc:`tersoff/table <pair_tersoff>` -
* :doc:`tersoff/zbl <pair_tersoff_zbl>` - Tersoff/ZBL 3-body potential
* :doc:`thole <pair_thole>` - Coulomb interactions with thole damping
* :doc:`threebody/table <pair_threebody_table>` - generic tabulated three-body potential
* :doc:`tip4p/cut <pair_coul>` - Coulomb for TIP4P water w/out LJ
* :doc:`tip4p/long <pair_coul>` - long-range Coulomb for TIP4P water w/out LJ
* :doc:`tip4p/long/soft <pair_fep_soft>` -

View File

@ -0,0 +1,311 @@
.. index:: pair_style sw/angle/table
pair_style sw/angle/table command
=================================
Syntax
""""""
.. code-block:: LAMMPS
pair_style style
* style = *sw/angle/table*
Examples
""""""""
.. code-block:: LAMMPS
pair_style sw/angle/table
pair_coeff * * spce.sw type
Used in example input script:
.. parsed-literal::
examples/PACKAGES/manybody_table/in.spce_sw
Description
"""""""""""
The *sw/angle/table* style is a modification of the original
:doc:`pair_style sw <pair_sw>`. It has been developed for coarse-grained
simulations (of water) (:ref:`Scherer1 <Scherer1>`), but can be employed
for all kinds of systems. It computes a modified 3-body
:ref:`Stillinger-Weber <Stillinger3>` potential for the energy E of a
system of atoms as
.. math::
E & = \sum_i \sum_{j > i} \phi_2 (r_{ij}) +
\sum_i \sum_{j \neq i} \sum_{k > j}
\phi_3 (r_{ij}, r_{ik}, \theta_{ijk}) \\
\phi_2(r_{ij}) & = A_{ij} \epsilon_{ij} \left[ B_{ij} (\frac{\sigma_{ij}}{r_{ij}})^{p_{ij}} -
(\frac{\sigma_{ij}}{r_{ij}})^{q_{ij}} \right]
\exp \left( \frac{\sigma_{ij}}{r_{ij} - a_{ij} \sigma_{ij}} \right) \\
\phi_3(r_{ij},r_{ik},\theta_{ijk}) & = f^{\textrm{3b}}\left(\theta_{ijk}\right)
\exp \left( \frac{\gamma_{ij} \sigma_{ij}}{r_{ij} - a_{ij} \sigma_{ij}} \right)
\exp \left( \frac{\gamma_{ik} \sigma_{ik}}{r_{ik} - a_{ik} \sigma_{ik}} \right)
where :math:`\phi_2` is a two-body term and :math:`\phi_3` is a
three-body term. The summations in the formula are over all neighbors J
and K of atom I within a cutoff distance :math:`a \sigma`. In contrast
to the original *sw* style, *sw/angle/table* allows for a flexible
three-body term :math:`f^{\textrm{3b}}\left(\theta_{ijk}\right)` which
is read in as a tabulated interaction. It can be parameterized with the
csg_fmatch app of VOTCA as available at:
https://gitlab.mpcdf.mpg.de/votca/votca.
Only a single pair_coeff command is used with the *sw/angle/table* style
which specifies a modified Stillinger-Weber potential file with
parameters for all needed elements. These are mapped to LAMMPS atom
types by specifying N_el additional arguments after the ".sw" filename
in the pair_coeff command, where N_el is the number of LAMMPS atom
types:
* ".sw" filename
* N_el element names = mapping of SW elements to atom types
See the :doc:`pair_coeff <pair_coeff>` page for alternate ways to
specify the path for the potential file.
As an example, imagine a file SiC.sw has Stillinger-Weber values for Si
and C. If your LAMMPS simulation has 4 atoms types and you want the
first 3 to be Si, and the fourth to be C, you would use the following
pair_coeff command:
.. code-block:: LAMMPS
pair_coeff * * SiC.sw Si Si Si C
The first 2 arguments must be \* \* so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the SW file. The final C argument maps LAMMPS atom type 4 to
the C element in the SW file. If a mapping value is specified as NULL,
the mapping is not performed. This can be used when a *sw/angle/table*
potential is used as part of the *hybrid* pair style. The NULL values
are placeholders for atom types that will be used with other potentials.
The (modified) Stillinger-Weber files have a ".sw" suffix. Lines that
are not blank or comments (starting with #) define parameters for a
triplet of elements. The parameters in a single entry correspond to the
two-body and three-body coefficients in the formula above. Here, also
the suffix ".sw" is used though the original Stillinger-Weber file
format is supplemented with four additional lines per parameter block to
specify the tabulated three-body interaction. A single entry then
contains:
* element 1 (the center atom in a 3-body interaction)
* element 2
* element 3
* :math:`\epsilon` (energy units)
* :math:`\sigma` (distance units)
* a
* :math:`\lambda`
* :math:`\gamma`
* :math:`\cos\theta_0`
* A
* B
* p
* q
* tol
* filename
* keyword
* style
* N
The A, B, p, and q parameters are used only for two-body interactions.
The :math:`\lambda` and :math:`\cos\theta_0` parameters, only used for
three-body interactions in the original Stillinger-Weber style, are read
in but ignored in this modified pair style. The :math:`\epsilon`
parameter is only used for two-body interactions in this modified pair
style and not for the three-body terms. The :math:`\sigma` and *a*
parameters are used for both two-body and three-body
interactions. :math:`\gamma` is used only in the three-body
interactions, but is defined for pairs of atoms. The non-annotated
parameters are unitless.
LAMMPS introduces an additional performance-optimization parameter tol
that is used for both two-body and three-body interactions. In the
Stillinger-Weber potential, the interaction energies become negligibly
small at atomic separations substantially less than the theoretical
cutoff distances. LAMMPS therefore defines a virtual cutoff distance
based on a user defined tolerance tol. The use of the virtual cutoff
distance in constructing atom neighbor lists can significantly reduce
the neighbor list sizes and therefore the computational cost. LAMMPS
provides a *tol* value for each of the three-body entries so that they
can be separately controlled. If tol = 0.0, then the standard
Stillinger-Weber cutoff is used.
The additional parameters *filename*, *keyword*, *style*, and *N* refer
to the tabulated angular potential
:math:`f^{\textrm{3b}}\left(\theta_{ijk}\right)`. The tabulated angular
potential has to be of the format as used in the :doc:`angle_style table
<angle_table>` command:
An interpolation tables of length *N* is created. The interpolation is
done in one of 2 *styles*: *linear* or *spline*. For the *linear*
style, the angle is used to find 2 surrounding table values from which
an energy or its derivative is computed by linear interpolation. For the
*spline* style, a cubic spline coefficients are computed and stored at
each of the *N* values in the table. The angle is used to find the
appropriate set of coefficients which are used to evaluate a cubic
polynomial which computes the energy or derivative.
The *filename* specifies the file containing the tabulated energy and
derivative values of :math:`f^{\textrm{3b}}\left(\theta_{ijk}\right)`.
The *keyword* then specifies a section of the file. The format of this
file is as follows (without the parenthesized comments):
.. parsed-literal::
# Angle potential for harmonic (one or more comment or blank lines)
HAM (keyword is the first text on line)
N 181 FP 0 0 EQ 90.0 (N, FP, EQ parameters)
(blank line)
1 0.0 200.5 2.5 (index, angle, energy, derivative)
2 1.0 198.0 2.5
...
181 180.0 0.0 0.0
A section begins with a non-blank line whose first character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which identifies
the section. The next line lists (in any order) one or more parameters
for the table. Each parameter is a keyword followed by one or more
numeric values.
The parameter "N" is required and its value is the number of table
entries that follow. Note that this may be different than the *N*
specified in the Stillinger-Weber potential file. Let Nsw = *N* in the
".sw" file, and Nfile = "N" in the tabulated angular file. What LAMMPS
does is a preliminary interpolation by creating splines using the Nfile
tabulated values as nodal points. It uses these to interpolate as
needed to generate energy and derivative values at Ntable different
points. The resulting tables of length Nsw are then used as described
above, when computing energy and force for individual angles and their
atoms. This means that if you want the interpolation tables of length
Nsw to match exactly what is in the tabulated file (with effectively no
preliminary interpolation), you should set Nsw = Nfile.
The "FP" parameter is optional. If used, it is followed by two values
fplo and fphi, which are the second derivatives at the innermost and
outermost angle settings. These values are needed by the spline
construction routines. If not specified by the "FP" parameter, they are
estimated (less accurately) by the first two and last two derivative
values in the table.
The "EQ" parameter is also optional. If used, it is followed by a the
equilibrium angle value, which is used, for example, by the :doc:`fix
shake <fix_shake>` command. If not used, the equilibrium angle is set to
180.0.
Following a blank line, the next N lines of the angular table file list
the tabulated values. On each line, the first value is the index from 1
to N, the second value is the angle value (in degrees), the third value
is the energy (in energy units), and the fourth is -dE/d(theta) (also in
energy units). The third term is the energy of the 3-atom configuration
for the specified angle. The last term is the derivative of the energy
with respect to the angle (in degrees, not radians). Thus the units of
the last term are still energy, not force. The angle values must
increase from one line to the next. The angle values must also begin
with 0.0 and end with 180.0, i.e. span the full range of possible
angles.
Note that one angular potential file can contain many sections, each
with a tabulated potential. LAMMPS reads the file section by section
until it finds one that matches the specified *keyword* of appropriate
section of the ".sw" file.
The Stillinger-Weber potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain entries
for additional elements not being used in a particular simulation;
LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify SW parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
As annotated above, the first element in the entry is the center atom in
a three-body interaction. Thus an entry for SiCC means a Si atom with 2
C atoms as neighbors. The parameter values used for the two-body
interaction come from the entry where the second and third elements are
the same. Thus the two-body parameters for Si interacting with C, comes
from the SiCC entry. The three-body angular potential
:math:`f^{\textrm{3b}}\left(\theta_{ijk}\right)` can in principle be
specific to the three elements of the configuration. However, the user
must ensure that it makes physically sense. Note also that the function
:math:`\phi_3` contains two exponential screening factors with parameter
values from the ij pair and ik pairs. So :math:`\phi_3` for a C atom
bonded to a Si atom and a second C atom will depend on the three-body
parameters for the CSiC entry, and also on the two-body parameters for
the CCC and CSiSi entries. Since the order of the two neighbors is
arbitrary, the three-body parameters and the tabulated angular potential
for entries CSiC and CCSi should be the same. Similarly, the two-body
parameters for entries SiCC and CSiSi should also be the same. The
parameters used only for two-body interactions (A, B, p, and q) in
entries whose second and third element are different (e.g. SiCSi) are
not used for anything and can be set to 0.0 if desired. This is also
true for the parameters in :math:`\phi_3` that are taken from the ij and
ik pairs (:math:`\sigma`, *a*, :math:`\gamma`)
Additional input files and reference data can be found at:
https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-tutorials/spce/3body_sw
----------
Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
For atom type pairs I,J and I != J, where types I and J correspond to
two different element types, mixing is performed by LAMMPS as described
above from values in the potential file, but not for the tabulated
angular potential file.
This pair style does not support the :doc:`pair_modify <pair_modify>`
shift, table, and tail options.
This pair style does not write its information to :doc:`binary restart
files <restart>`, since it is stored in potential files. Thus, you need
to re-specify the pair_style and pair_coeff commands in an input script
that reads a restart file.
This pair style can only be used via the *pair* keyword of the
:doc:`run_style respa <run_style>` command. It does not support the
*inner*, *middle*, *outer* keywords.
----------
Restrictions
""""""""""""
This pair style is part of the MANYBODY package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
This pair style requires the :doc:`newton <newton>` setting to be "on"
for pair interactions.
Related commands
""""""""""""""""
:doc:`pair_coeff <pair_coeff>`, :doc:`pair_style sw <pair_sw>`, :doc:`pair_style threebody/table <pair_threebody_table>`
----------
.. _Stillinger3:
**(Stillinger)** Stillinger and Weber, Phys Rev B, 31, 5262 (1985).
.. _Scherer1:
**(Scherer1)** C. Scherer and D. Andrienko, Phys. Chem. Chem. Phys. 20, 22387-22394 (2018).

View File

@ -0,0 +1,281 @@
.. index:: pair_style threebody/table
pair_style threebody/table command
==================================
Syntax
""""""
.. code-block:: LAMMPS
pair_style style
* style = *threebody/table*
Examples
""""""""
.. code-block:: LAMMPS
pair_style threebody/table
pair_coeff * * spce2.3b type1 type2
pair_style hybrid/overlay table linear 1200 threebody/table
pair_coeff 1 1 table table_CG_CG.txt VOTCA
pair_coeff * * threebody/table spce.3b type
Used in example input scripts:
.. parsed-literal::
examples/PACKAGES/manybody_table/in.spce
examples/PACKAGES/manybody_table/in.spce2
Description
"""""""""""
The *threebody/table* style is a pair style for generic tabulated
three-body interactions. It has been developed for (coarse-grained)
simulations (of water) with Kernel-based machine learning (ML)
potentials (:ref:`Scherer2 <Scherer2>`). As for many other MANYBODY
package pair styles the energy of a system is computed as a sum over
three-body terms:
.. math::
E = \sum_i \sum_{j \neq i} \sum_{k > j} \phi_3 (r_{ij}, r_{ik}, \theta_{ijk})
The summations in the formula are over all neighbors J and K of atom I
within a cutoff distance :math:`cut`. In contrast to the
Stillinger-Weber potential, all forces are not calculated analytically,
but read in from a three-body force/energy table which can be generated
with the csg_ml app of VOTCA as available at:
https://gitlab.mpcdf.mpg.de/votca/votca.
Only a single pair_coeff command is used with the *threebody/table*
style which specifies a threebody potential (".3b") file with parameters
for all needed elements. These are then mapped to LAMMPS atom types by
specifying N_el additional arguments after the ".3b" filename in the
pair_coeff command, where N_el is the number of LAMMPS atom types:
* ".3b" filename
* N_el element names = mapping of threebody elements to atom types
See the :doc:`pair_coeff <pair_coeff>` page for alternate ways to
specify the path for the potential file.
As an example, imagine a file SiC.3b has three-body values for Si and C.
If your LAMMPS simulation has 4 atoms types and you want the first 3 to
be Si, and the fourth to be C, you would use the following pair_coeff
command:
.. code-block:: LAMMPS
pair_coeff * * SiC.3b Si Si Si C
The first 2 arguments must be \* \* so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the ".3b" file. The final C argument maps LAMMPS atom type 4
to the C element in the threebody file. If a mapping value is specified
as NULL, the mapping is not performed. This can be used when a
*threebody/table* potential is used as part of the *hybrid* pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
The three-body files have a ".3b" suffix. Lines that are not blank or
comments (starting with #) define parameters for a triplet of
elements. The parameters in a single entry specify to the (three-body)
cutoff distance and the tabulated three-body interaction. A single entry
then contains:
* element 1 (the center atom in a 3-body interaction)
* element 2
* element 3
* cut (distance units)
* filename
* keyword
* style
* N
The parameter :math:`cut` is the (three-body) cutoff distance. When set
to 0, no interaction is calculated for this element triplet. The
parameters *filename*, *keyword*, *style*, and *N* refer to the
tabulated three-body potential.
The tabulation is done on a three-dimensional grid of the two distances
:math:`r_{ij}` and :math:`r_{ik}` as well as the angle
:math:`\theta_{ijk}` which is constructed in the following way. There
are two different cases. If element 2 and element 3 are of the same
type (e.g. SiCC), the distance :math:`r_{ij}` is varied in "N" steps
from rmin to rmax and the distance :math:`r_{ik}` is varied from
:math:`r_{ij}` to rmax. This can be done, due to the symmetry of the
triplet. If element 2 and element 3 are not of the same type
(e.g. SiCSi), there is no additional symmetry and the distance
:math:`r_{ik}` is also varied from rmin to rmax in "N" steps. The angle
:math:`\theta_{ijk}` is always varied in "2N" steps from (0.0 +
180.0/(4N)) to (180.0 - 180.0/(4N)). Therefore, the total number of
table entries is "M = N * N * (N+1)" for the symmetric (element 2 and
element 3 are of the same type) and "M = 2 * N * N * N" for the general
case (element 2 and element 3 are not of the same type).
The forces on all three particles I, J, and K of a triplet of this type
of three-body interaction potential (:math:`\phi_3 (r_{ij}, r_{ik},
\theta_{ijk})`) lie within the plane defined by the three inter-particle
distance vectors :math:`{\mathbf r}_{ij}`, :math:`{\mathbf r}_{ik}`, and
:math:`{\mathbf r}_{jk}`. This property is used to project the forces
onto the inter-particle distance vectors as follows
.. math::
\begin{pmatrix}
{\mathbf f}_{i} \\
{\mathbf f}_{j} \\
{\mathbf f}_{k} \\
\end{pmatrix} =
\begin{pmatrix}
f_{i1} & f_{i2} & 0 \\
f_{j1} & 0 & f_{j2} \\
0 & f_{k1} & f_{k2} \\
\end{pmatrix}
\begin{pmatrix}
{\mathbf r}_{ij} \\
{\mathbf r}_{ik} \\
{\mathbf r}_{jk} \\
\end{pmatrix}
and then tabulate the 6 force constants :math:`f_{i1}`, :math:`f_{i2}`,
:math:`f_{j1}`, :math:`f_{j2}`, :math:`f_{k1}`, and :math:`f_{k2}`, as
well as the energy of a triplet e. Due to symmetry reasons, the
following relations hold: :math:`f_{i1}=-f_{j1}`,
:math:`f_{i2}=-f_{k1}`, and :math:`f_{j2}=-f_{k2}`. As in this pair
style the forces are read in directly, a correct MD simulation is also
performed in the case that the triplet energies are set to e=0.
The *filename* specifies the file containing the tabulated energy and
derivative values of :math:`\phi_3 (r_{ij}, r_{ik}, \theta_{ijk})`. The
*keyword* then specifies a section of the file. The format of this file
is as follows (without the parenthesized comments):
.. parsed-literal::
# Tabulated three-body potential for spce water (one or more comment or blank lines)
ENTRY1 (keyword is the first text on line)
N 12 rmin 2.55 rmax 3.65 (N, rmin, rmax parameters)
(blank line)
1 2.55 2.55 3.75 -867.212 -611.273 867.212 21386.8 611.273 -21386.8 0.0 (index, r_ij, r_ik, theta, f_i1, f_i2, f_j1, f_j2, f_k1, f_k2, e)
2 2.55 2.55 11.25 -621.539 -411.189 621.539 5035.95 411.189 -5035.95 0.0
...
1872 3.65 3.65 176.25 -0.00215132 -0.00412886 0.00215137 0.00111754 0.00412895 -0.00111757 0.0
A section begins with a non-blank line whose first character is not a
"#"; blank lines or lines starting with "#" can be used as comments
between sections. The first line begins with a keyword which identifies
the section. The next line lists (in any order) one or more parameters
for the table. Each parameter is a keyword followed by one or more
numeric values.
The parameter "N" is required. It should be the same than the parameter
"N" of the ".3b" file, otherwise its value is overwritten. "N"
determines the number of table entries "M" that follow: "M = N * N *
(N+1)" (symmetric triplet, e.g. SiCC) or "M = 2 * N * N * N" (asymmetric
triplet, e.g. SiCSi). Therefore "M = 12 * 12 * 13 = 1872" in the above
symmetric example. The parameters "rmin" and "rmax" are also required
and determine the minimum and maximum of the inter-particle distances
:math:`r_{ij}` and :math:`r_{ik}`.
Following a blank line, the next M lines of the angular table file list
the tabulated values. On each line, the first value is the index from 1
to M, the second value is the distance :math:`r_{ij}`, the third value
is the distance :math:`r_{ik}`, the fourth value is the angle
:math:`\theta_{ijk})`, the next six values are the force constants
:math:`f_{i1}`, :math:`f_{i2}`, :math:`f_{j1}`, :math:`f_{j2}`,
:math:`f_{k1}`, and :math:`f_{k2}`, and the last value is the energy e.
Note that one three-body potential file can contain many sections, each
with a tabulated potential. LAMMPS reads the file section by section
until it finds one that matches the specified *keyword* of appropriate
section of the ".3b" file.
At the moment, only the *style* *linear* is allowed and
implemented. After reading in the force table, it is internally stored
in LAMMPS as a lookup table. For each triplet configuration occurring in
the simulation within the cutoff distance, the next nearest tabulated
triplet configuration is looked up. No interpolation is done. This
allows for a very efficient force calculation with the stored force
constants and energies. Due to the know table structure, the lookup can
be done efficiently. It has been tested (:ref:`Scherer2 <Scherer2>`)
that with a reasonably small bin size, the accuracy and speed is
comparable to that of a Stillinger-Weber potential with tabulated
three-body interactions (:doc:`pair_style sw/angle/table
<pair_sw_angle_table>`) while the table format of this pair style allows
for more flexible three-body interactions.
As for the Stillinger-Weber potential, the three-body potential file
must contain entries for all the elements listed in the pair_coeff
command. It can also contain entries for additional elements not being
used in a particular simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify threebody parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
As annotated above, the first element in the entry is the center atom in
a three-body interaction. Thus an entry for SiCC means a Si atom with 2
C atoms as neighbors. The tabulated three-body forces can in principle
be specific to the three elements of the configuration. However, the
user must ensure that it makes physically sense. E.g., the tabulated
three-body forces for the entries CSiC and CCSi should be the same
exchanging :math:`r_{ij}` with r_{ik}, :math:`f_{j1}` with
:math:`f_{k1}`, and :math:`f_{j2}` with :math:`f_{k2}`.
Additional input files and reference data can be found at:
https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-tutorials/ml
----------
Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
As all interactions are tabulated, no mixing is performed.
This pair style does not support the :doc:`pair_modify <pair_modify>`
shift, table, and tail options.
This pair style does not write its information to :doc:`binary restart
files <restart>`, since it is stored in potential files. Thus, you need
to re-specify the pair_style and pair_coeff commands in an input script
that reads a restart file.
This pair style can only be used via the *pair* keyword of the
:doc:`run_style respa <run_style>` command. It does not support the
*inner*, *middle*, *outer* keywords.
----------
Restrictions
""""""""""""
This pair style is part of the MANYBODY package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
This pair style requires the :doc:`newton <newton>` setting to be "on"
for pair interactions.
Related commands
""""""""""""""""
:doc:`pair_coeff <pair_coeff>`, :doc:`pair sw/angle/table <pair_sw_angle_table>`
----------
.. _Scherer2:
**(Scherer2)** C. Scherer, R. Scheid, D. Andrienko, and T. Bereau, J. Chem. Theor. Comp. 16, 3194-3204 (2020).

View File

@ -56,7 +56,7 @@ Examples
read_data ../run7/data.polymer.gz
read_data data.protein fix mycmap crossterm CMAP
read_data data.water add append offset 3 1 1 1 1 shift 0.0 0.0 50.0
read_data data.water add merge 1 group solvent
read_data data.water add merge group solvent
Description
"""""""""""
@ -622,6 +622,8 @@ of analysis.
- atom-ID molecule-ID atom-type x y z
* - charge
- atom-ID atom-type q x y z
* - dielectric
- atom-ID atom-type q x y z normx normy normz area ed em epsilon curvature
* - dipole
- atom-ID atom-type q x y z mux muy muz
* - dpd

View File

@ -11,7 +11,6 @@ Syntax
read_restart file flag
* file = name of binary restart file to read in
* flag = remap (optional)
Examples
""""""""
@ -19,44 +18,40 @@ Examples
.. code-block:: LAMMPS
read_restart save.10000
read_restart save.10000 remap
read_restart restart.*
read_restart restart.*.mpiio
read_restart poly.*.% remap
Description
"""""""""""
Read in a previously saved system configuration from a restart file.
This allows continuation of a previous run. Details about what
information is stored (and not stored) in a restart file is given
below. Basically this operation will re-create the simulation box
with all its atoms and their attributes as well as some related global
settings, at the point in time it was written to the restart file by a
previous simulation. The simulation box will be partitioned into a
regular 3d grid of rectangular bricks, one per processor, based on the
number of processors in the current simulation and the settings of the
information is stored (and not stored) in a restart file is given below.
Basically this operation will re-create the simulation box with all its
atoms and their attributes as well as some related global settings, at
the point in time it was written to the restart file by a previous
simulation. The simulation box will be partitioned into a regular 3d
grid of rectangular bricks, one per processor, based on the number of
processors in the current simulation and the settings of the
:doc:`processors <processors>` command. The partitioning can later be
changed by the :doc:`balance <balance>` or :doc:`fix balance <fix_balance>` commands.
.. note::
Normally, restart files are written by the
:doc:`restart <restart>` or :doc:`write_restart <write_restart>` commands
so that all atoms in the restart file are inside the simulation box.
If this is not the case, the read_restart command will print an error
that atoms were "lost" when the file is read. This error should be
reported to the LAMMPS developers so the invalid writing of the
restart file can be fixed. If you still wish to use the restart file,
the optional *remap* flag can be appended to the read_restart command.
This should avoid the error, by explicitly remapping each atom back
into the simulation box, updating image flags for the atom
appropriately.
changed by the :doc:`balance <balance>` or :doc:`fix balance
<fix_balance>` commands.
Restart files are saved in binary format to enable exact restarts,
meaning that the trajectories of a restarted run will precisely match
those produced by the original run had it continued on.
The binary restart file format was not designed with backward, forward,
or cross-platform compatibility in mind, so the files are only expected
to be read correctly by the same LAMMPS executable on the same platform.
Changes to the architecture, compilation settings, or LAMMPS version can
render a restart file unreadable or it may read the data incorrectly.
If you want a more portable format, you can use the data file format as
created by the :doc:`write_data <write_data>` command. Binary restart
files can also be converted into a data file from the command line by
the LAMMPS executable that wrote them using the :ref:`-restart2data
<restart2data>` command line flag.
Several things can prevent exact restarts due to round-off effects, in
which case the trajectories in the 2 runs will slowly diverge. These
include running on a different number of processors or changing
@ -65,7 +60,8 @@ certain settings such as those set by the :doc:`newton <newton>` or
these cases.
Certain fixes will not restart exactly, though they should provide
statistically similar results. These include :doc:`fix shake <fix_shake>` and :doc:`fix langevin <fix_langevin>`.
statistically similar results. These include :doc:`fix shake
<fix_shake>` and :doc:`fix langevin <fix_langevin>`.
Certain pair styles will not restart exactly, though they should
provide statistically similar results. This is because the forces
@ -81,18 +77,19 @@ produced the restart file, it could be a LAMMPS bug, so consider
:doc:`reporting it <Errors_bugs>` if you think the behavior is a bug.
Because restart files are binary, they may not be portable to other
machines. In this case, you can use the :doc:`-restart command-line switch <Run_options>` to convert a restart file to a data file.
machines. In this case, you can use the :doc:`-restart command-line
switch <Run_options>` to convert a restart file to a data file.
Similar to how restart files are written (see the
:doc:`write_restart <write_restart>` and :doc:`restart <restart>`
commands), the restart filename can contain two wild-card characters.
If a "\*" appears in the filename, the directory is searched for all
filenames that match the pattern where "\*" is replaced with a timestep
value. The file with the largest timestep value is read in. Thus,
this effectively means, read the latest restart file. It's useful if
you want your script to continue a run from where it left off. See
the :doc:`run <run>` command and its "upto" option for how to specify
the run command so it does not need to be changed either.
Similar to how restart files are written (see the :doc:`write_restart
<write_restart>` and :doc:`restart <restart>` commands), the restart
filename can contain two wild-card characters. If a "\*" appears in the
filename, the directory is searched for all filenames that match the
pattern where "\*" is replaced with a timestep value. The file with the
largest timestep value is read in. Thus, this effectively means, read
the latest restart file. It's useful if you want your script to
continue a run from where it left off. See the :doc:`run <run>` command
and its "upto" option for how to specify the run command so it does not
need to be changed either.
If a "%" character appears in the restart filename, LAMMPS expects a
set of multiple files to exist. The :doc:`restart <restart>` and
@ -222,17 +219,17 @@ its calculations in a consistent manner.
.. note::
There are a handful of commands which can be used before or
between runs which may require a system initialization. Examples
include the "balance", "displace_atoms", "delete_atoms", "set" (some
options), and "velocity" (some options) commands. This is because
they can migrate atoms to new processors. Thus they will also discard
unused "state" information from fixes. You will know the discard has
There are a handful of commands which can be used before or between
runs which may require a system initialization. Examples include the
"balance", "displace_atoms", "delete_atoms", "set" (some options),
and "velocity" (some options) commands. This is because they can
migrate atoms to new processors. Thus they will also discard unused
"state" information from fixes. You will know the discard has
occurred because a list of discarded fixes will be printed to the
screen and log file, as explained above. This means that if you wish
to retain that info in a restarted run, you must re-specify the
relevant fixes and computes (which create fixes) before those commands
are used.
relevant fixes and computes (which create fixes) before those
commands are used.
Some pair styles, like the :doc:`granular pair styles <pair_gran>`, also
use a fix to store "state" information that persists from timestep to
@ -245,18 +242,19 @@ LAMMPS allows bond interactions (angle, etc) to be turned off or
deleted in various ways, which can affect how their info is stored in
a restart file.
If bonds (angles, etc) have been turned off by the :doc:`fix shake <fix_shake>` or :doc:`delete_bonds <delete_bonds>` command,
their info will be written to a restart file as if they are turned on.
This means they will need to be turned off again in a new run after
the restart file is read.
If bonds (angles, etc) have been turned off by the :doc:`fix shake
<fix_shake>` or :doc:`delete_bonds <delete_bonds>` command, their info
will be written to a restart file as if they are turned on. This means
they will need to be turned off again in a new run after the restart
file is read.
Bonds that are broken (e.g. by a bond-breaking potential) are written
to the restart file as broken bonds with a type of 0. Thus these
bonds will still be broken when the restart file is read.
Bonds that have been broken by the :doc:`fix bond/break <fix_bond_break>` command have disappeared from the
system. No information about these bonds is written to the restart
file.
Bonds that have been broken by the :doc:`fix bond/break
<fix_bond_break>` command have disappeared from the system. No
information about these bonds is written to the restart file.
----------

View File

@ -88,7 +88,7 @@ The Coulomb factors are applied to any Coulomb (charge interaction)
term that the potential calculates. The LJ factors are applied to the
remaining terms that the potential calculates, whether they represent
LJ interactions or not. The weighting factors are a scaling
pre-factor on the energy and force between the pair of atoms. A value
prefactor on the energy and force between the pair of atoms. A value
of 1.0 means include the full interaction; a value of 0.0 means
exclude it completely.

View File

@ -847,15 +847,6 @@ Special Functions
Special functions take specific kinds of arguments, meaning their
arguments cannot be formulas themselves.
The is_file(name) function is a test whether *name* is a (readable) file
and returns 1 in this case, otherwise it returns 0. For that *name*
is taken as a literal string and must not have any blanks in it.
The extract_setting(name) function allows to access some basic settings
through calling the :cpp:func:`lammps_extract_setting` library function.
For available keywords *name* and their meaning, please see the
documentation of that function.
The sum(x), min(x), max(x), ave(x), trap(x), and slope(x) functions
each take 1 argument which is of the form "c_ID" or "c_ID[N]" or
"f_ID" or "f_ID[N]" or "v_name". The first two are computes and the
@ -934,6 +925,19 @@ invoked more times than there are lines or sets of lines in the file,
the variable is deleted, similar to how the :doc:`next <next>` command
operates.
The is_file(name) function is a test whether *name* is a (readable) file
and returns 1 in this case, otherwise it returns 0. For that *name*
is taken as a literal string and must not have any blanks in it.
The extract_setting(name) function enables access to basic settings for
the LAMMPS executable and the running simulation via calling the
:cpp:func:`lammps_extract_setting` library function. For example, the
number of processors (MPI ranks) being used by the simulation or the MPI
process ID (for this processor) can be queried, or the number of atom
types, bond types and so on. For the full list of available keywords
*name* and their meaning, see the documentation for extract_setting()
via the link in this paragraph.
----------
Feature Functions

View File

@ -6,4 +6,3 @@ breathe
Pygments
six
pyyaml
wheel

View File

@ -94,6 +94,7 @@ amu
Amzallag
analytical
Anders
Andrienko
Andzelm
Ang
anglegrad
@ -119,6 +120,7 @@ Antonelli
api
Apoorva
Appl
apptainer
Apu
arallel
arccos
@ -239,6 +241,7 @@ benchmarking
Bennet
Berardi
Beraun
Bereau
berendsen
Berendsen
berger
@ -444,6 +447,7 @@ chris
Christoph
Chu
chunkID
chunksize
Ciccotti
Cieplak
Cii
@ -559,6 +563,7 @@ Crozier
Cryst
Crystallogr
Csanyi
csg
csh
cshrc
CSiC
@ -872,6 +877,7 @@ Eindhoven
Eisenforschung
Ejtehadi
El
el
elaplong
elastance
Electroneg
@ -1080,6 +1086,7 @@ fm
fmackay
fmag
fmass
fmatch
fmm
fmt
fmtlib
@ -1318,6 +1325,7 @@ hexatic
hexorder
Heyes
HfO
hftn
hgrid
hhmrr
Hibbs
@ -1562,6 +1570,7 @@ jpeglib
jpg
JPG
jpl
json
Jth
jtranch
jtype
@ -1696,6 +1705,7 @@ lamda
lammps
Lammps
LAMMPS
lammpsbin
lammpsplot
lammpsplugin
Lamoureux
@ -2229,6 +2239,7 @@ Navier
nb
Nbin
Nbins
nbodies
nbody
Nbody
nbond
@ -2268,6 +2279,7 @@ nelem
Nelement
Nelements
nelems
nellipsoids
nemd
netapp
netcdf
@ -2357,7 +2369,11 @@ nopreliminary
Nord
norder
Nordlund
noremap
normals
normx
normy
normz
Noskov
noslip
noticable
@ -2401,6 +2417,7 @@ Nstep
Nsteplast
Nstop
nsub
Nsw
Nswap
nt
Nt
@ -2410,6 +2427,7 @@ nthreads
ntimestep
Ntptask
Ntriples
ntris
Ntype
ntypes
Ntypes
@ -2793,6 +2811,7 @@ quatk
quatw
queryargs
Queteschiner
quickmin
qw
qx
qy
@ -3029,6 +3048,7 @@ scalexz
scaleyz
Scalfi
Schaik
Scheid
Schilfgarde
Schimansky
Schiotz
@ -3046,6 +3066,7 @@ screenshot
screenshots
Scripps
Scripta
sd
sdk
sdpd
SDPD
@ -3205,6 +3226,7 @@ statvolt
stdin
stdio
stdlib
stdout
steelblue
Stegailov
Steinbach
@ -3216,6 +3238,7 @@ Stesmans
stiffnesses
Stillinger
stk
stl
stochastically
stochasticity
Stockmayer

View File

@ -12,8 +12,8 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
University of Tennessee, Knoxville (USA), 2012
Contributing author: Karl D. Hammond <hammondkd@missouri.edu>
University of Missouri (USA), 2012
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself
@ -23,6 +23,7 @@
#include <mpi.h>
#include "LAMMPS-wrapper.h"
#define LAMMPS_LIB_MPI 1
#include <library.h>
#include <lammps.h>
#include <atom.h>
@ -56,181 +57,40 @@ void lammps_error_all (void *ptr, const char *file, int line, const char *str)
int lammps_extract_compute_vectorsize (void *ptr, char *id, int style)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int icompute = lmp->modify->find_compute(id);
if ( icompute < 0 ) return 0;
class Compute *compute = lmp->modify->compute[icompute];
if ( style == 0 )
{
if ( !compute->vector_flag )
return 0;
else
return compute->size_vector;
}
else if ( style == 1 )
{
return lammps_get_natoms (ptr);
}
else if ( style == 2 )
{
if ( !compute->local_flag )
return 0;
else
return compute->size_local_rows;
}
else
return 0;
int *size;
size = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_VECTOR);
if (size) return *size;
return 0;
}
void lammps_extract_compute_arraysize (void *ptr, char *id, int style,
int *nrows, int *ncols)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int icompute = lmp->modify->find_compute(id);
if ( icompute < 0 )
{
*nrows = 0;
*ncols = 0;
}
class Compute *compute = lmp->modify->compute[icompute];
if ( style == 0 )
{
if ( !compute->array_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = compute->size_array_rows;
*ncols = compute->size_array_cols;
}
}
else if ( style == 1 )
{
if ( !compute->peratom_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = lammps_get_natoms (ptr);
*ncols = compute->size_peratom_cols;
}
}
else if ( style == 2 )
{
if ( !compute->local_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = compute->size_local_rows;
*ncols = compute->size_local_cols;
}
}
else
{
*nrows = 0;
*ncols = 0;
}
int *tmp;
tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_ROWS);
if (tmp) *nrows = *tmp;
tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_COLS);
if (tmp) *ncols = *tmp;
return;
}
int lammps_extract_fix_vectorsize (void *ptr, char *id, int style)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int ifix = lmp->modify->find_fix(id);
if ( ifix < 0 ) return 0;
class Fix *fix = lmp->modify->fix[ifix];
if ( style == 0 )
{
if ( !fix->vector_flag )
return 0;
else
return fix->size_vector;
}
else if ( style == 1 )
{
return lammps_get_natoms (ptr);
}
else if ( style == 2 )
{
if ( !fix->local_flag )
return 0;
else
return fix->size_local_rows;
}
else
return 0;
int *size;
size = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_VECTOR, 0, 0);
if (size) return *size;
return 0;
}
void lammps_extract_fix_arraysize (void *ptr, char *id, int style,
int *nrows, int *ncols)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int ifix = lmp->modify->find_fix(id);
if ( ifix < 0 )
{
*nrows = 0;
*ncols = 0;
}
class Fix *fix = lmp->modify->fix[ifix];
if ( style == 0 )
{
if ( !fix->array_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = fix->size_array_rows;
*ncols = fix->size_array_cols;
}
}
else if ( style == 1 )
{
if ( !fix->peratom_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = lammps_get_natoms (ptr);
*ncols = fix->size_peratom_cols;
}
}
else if ( style == 2 )
{
if ( !fix->local_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = fix->size_local_rows;
*ncols = fix->size_local_cols;
}
}
else
{
*nrows = 0;
*ncols = 0;
}
int *tmp;
tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_ROWS, 0, 0);
if (tmp) *nrows = *tmp;
tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_COLS, 0, 0);
if (tmp) *ncols = *tmp;
return;
}
/* vim: set ts=3 sts=3 expandtab: */

View File

@ -12,8 +12,8 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
University of Tennessee, Knoxville (USA), 2012
Contributing author: Karl D. Hammond <hammondkd@missouri.edu>
University of Missouri (USA), 2012
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself

View File

@ -1292,7 +1292,7 @@ contains !! Wrapper functions local to this module {{{1
Cname = string2Cstring (name)
Ccount = size(data) / natoms
if ( Ccount /= 1 .and. Ccount /= 3 ) &
call lammps_error_all (ptr, FLERR, 'lammps_gather_atoms requires&
call lammps_error_all (ptr, FLERR, 'lammps_scatter_atoms requires&
& count to be either 1 or 3')
Fdata = data
Cdata = C_loc (Fdata(1))
@ -1355,7 +1355,7 @@ contains !! Wrapper functions local to this module {{{1
Cname = string2Cstring (name)
Ccount = size(data) / ndata
if ( Ccount /= 1 .and. Ccount /= 3 ) &
call lammps_error_all (ptr, FLERR, 'lammps_gather_atoms requires&
call lammps_error_all (ptr, FLERR, 'lammps_scatter_atoms requires&
& count to be either 1 or 3')
Fdata = data
Cdata = C_loc (Fdata(1))

View File

@ -14,7 +14,7 @@ CXXLIB = -lstdc++ # replace with your C++ runtime libs
# Flags for Fortran compiler, C++ compiler, and C preprocessor, respectively
FFLAGS = -O2 -fPIC
CXXFLAGS = -O2 -fPIC
CPPFLAGS = -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX -DLAMMPS_LIB_MPI
CPPFLAGS = -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX
all : liblammps_fortran.a liblammps_fortran.so

View File

@ -11,9 +11,8 @@ This interface was created by Karl Hammond who you can contact with
questions:
Karl D. Hammond
University of Tennessee, Knoxville
karlh at ugcs.caltech.edu
karlh at utk.edu
University of Missouri
hammondkd at missouri.edu
-------------------------------------

View File

@ -12,8 +12,8 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
University of Tennessee, Knoxville (USA), 2012
Contributing author: Karl D. Hammond <hammondkd@missouri.edu>
University of Missouri (USA), 2012
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself
@ -23,6 +23,7 @@
#include <mpi.h>
#include "LAMMPS-wrapper.h"
#define LAMMPS_LIB_MPI 1
#include <library.h>
#include <lammps.h>
#include <atom.h>
@ -56,181 +57,40 @@ void lammps_error_all (void *ptr, const char *file, int line, const char *str)
int lammps_extract_compute_vectorsize (void *ptr, char *id, int style)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int icompute = lmp->modify->find_compute(id);
if ( icompute < 0 ) return 0;
class Compute *compute = lmp->modify->compute[icompute];
if ( style == 0 )
{
if ( !compute->vector_flag )
return 0;
else
return compute->size_vector;
}
else if ( style == 1 )
{
return lammps_get_natoms (ptr);
}
else if ( style == 2 )
{
if ( !compute->local_flag )
return 0;
else
return compute->size_local_rows;
}
else
return 0;
int *size;
size = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_VECTOR);
if (size) return *size;
return 0;
}
void lammps_extract_compute_arraysize (void *ptr, char *id, int style,
int *nrows, int *ncols)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int icompute = lmp->modify->find_compute(id);
if ( icompute < 0 )
{
*nrows = 0;
*ncols = 0;
}
class Compute *compute = lmp->modify->compute[icompute];
if ( style == 0 )
{
if ( !compute->array_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = compute->size_array_rows;
*ncols = compute->size_array_cols;
}
}
else if ( style == 1 )
{
if ( !compute->peratom_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = lammps_get_natoms (ptr);
*ncols = compute->size_peratom_cols;
}
}
else if ( style == 2 )
{
if ( !compute->local_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = compute->size_local_rows;
*ncols = compute->size_local_cols;
}
}
else
{
*nrows = 0;
*ncols = 0;
}
int *tmp;
tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_ROWS);
if (tmp) *nrows = *tmp;
tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_COLS);
if (tmp) *ncols = *tmp;
return;
}
int lammps_extract_fix_vectorsize (void *ptr, char *id, int style)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int ifix = lmp->modify->find_fix(id);
if ( ifix < 0 ) return 0;
class Fix *fix = lmp->modify->fix[ifix];
if ( style == 0 )
{
if ( !fix->vector_flag )
return 0;
else
return fix->size_vector;
}
else if ( style == 1 )
{
return lammps_get_natoms (ptr);
}
else if ( style == 2 )
{
if ( !fix->local_flag )
return 0;
else
return fix->size_local_rows;
}
else
return 0;
int *size;
size = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_VECTOR, 0, 0);
if (size) return *size;
return 0;
}
void lammps_extract_fix_arraysize (void *ptr, char *id, int style,
int *nrows, int *ncols)
{
class LAMMPS *lmp = (class LAMMPS *) ptr;
int ifix = lmp->modify->find_fix(id);
if ( ifix < 0 )
{
*nrows = 0;
*ncols = 0;
}
class Fix *fix = lmp->modify->fix[ifix];
if ( style == 0 )
{
if ( !fix->array_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = fix->size_array_rows;
*ncols = fix->size_array_cols;
}
}
else if ( style == 1 )
{
if ( !fix->peratom_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = lammps_get_natoms (ptr);
*ncols = fix->size_peratom_cols;
}
}
else if ( style == 2 )
{
if ( !fix->local_flag )
{
*nrows = 0;
*ncols = 0;
}
else
{
*nrows = fix->size_local_rows;
*ncols = fix->size_local_cols;
}
}
else
{
*nrows = 0;
*ncols = 0;
}
int *tmp;
tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_ROWS, 0, 0);
if (tmp) *nrows = *tmp;
tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_COLS, 0, 0);
if (tmp) *ncols = *tmp;
return;
}
/* vim: set ts=3 sts=3 expandtab: */

View File

@ -12,8 +12,8 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
University of Tennessee, Knoxville (USA), 2012
Contributing author: Karl D. Hammond <hammondkd@missouri.edu>
University of Missouri (USA), 2012
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself

View File

@ -12,8 +12,7 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
University of Tennessee, Knoxville (USA), 2012
Contributing author: Nir Goldman, LLNL <ngoldman@llnl.gov>, 2016
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself

View File

@ -12,7 +12,7 @@
------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------
Contributing author: Nir Goldman, ngoldman@llnl.gov, Oct. 19th, 2016
Contributing author: Nir Goldman, LLNL <ngoldman@llnl.gov>, 2016
------------------------------------------------------------------------- */
/* This is set of "wrapper" functions to assist LAMMPS.F90, which itself

View File

@ -12,8 +12,8 @@
!--------------------------------------------------------------------------
!! ------------------------------------------------------------------------
! Contributing author: Karl D. Hammond <karlh@ugcs.caltech.edu>
! University of Tennessee, Knoxville (USA), 2012
! Contributing author: Karl D. Hammond <hammondkd@missouri.edu>
! University of Missouri (USA), 2012
!--------------------------------------------------------------------------
!! LAMMPS, a Fortran 2003 module containing an interface between Fortran

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import numpy as np
def reduce_Born(Cf):

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import numpy as np
def reduce_Born(Cf):

View File

@ -0,0 +1,37 @@
This directory shows how to use the `fix born` command
to calculate the full matrix of elastic constants
for cubic diamond at finite temperature
running the Stillinger-Weber potential.
The input script `in.elastic` can be run
directly from LAMMPS, or via a Python wrapper
script.
to run directly from LAMMPS, use:
mpirun -np 4 lmp.exe -in in.elastic
This simulates an orthorhombic box with the cubic crystal axes
aligned with x, y, and z.
The default settings replicate the 1477~K benchmark of
Kluge, Ray, and Rahman (1986) that is Ref.[15] in:
Y. Zhen, C. Chu, Computer Physics Communications 183(2012) 261-265
The script contains many adjustable parameters that can be used
to generate different crystal structures, supercell sizes,
and sampling rates.
to run via the Python wrapper, use:
mpirun -np 4 python elastic.py
This will first run the orthorhombic supercell as before,
follows by an equivalent simulation using a triclinic structure.
The script shows how the standard triclinic primitive cell for cubic diamond
can be rotated in to the LAMMPS upper triangular frame. The resultant
elastic constant matrix does not exhibit the standard symmetries of cubic crystals.
However, the matrix is then rotated back to the standard orientation
to recover the cubic symmetry form of the elastic matrix,
resulting in elastic constants that are the same for both
simulations, modulo statistical uncertainty.

View File

@ -0,0 +1,114 @@
#!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# elastic.py
# Purpose: demonstrate elastic constant calculation for
# two different crystal supercells, one with non-standard orientation
#
# Syntax: elastic.py
# uses in.elastic as LAMMPS input script
from __future__ import print_function
from elastic_utils import *
np.set_printoptions(precision = 3, suppress=True)
# get MPI settings from LAMMPS
lmp = lammps()
me = lmp.extract_setting("world_rank")
nprocs = lmp.extract_setting("world_size")
# cubic diamond lattice constants
alat = 5.457
# define the cubic diamond orthorhombic supercell
# with 8 atoms
basisstring = ""
origin = np.zeros(3)
bond = np.ones(3)*0.25
b = origin
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
b = bond
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
for i in range(3):
b = 2*bond
b[i] = 0
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
b += bond
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
hmat = np.eye(3)
varlist = {
"logsuffix":"ortho",
"a":alat,
"a1x":hmat[0,0],
"a2x":hmat[0,1],
"a2y":hmat[1,1],
"a3x":hmat[0,2],
"a3y":hmat[1,2],
"a3z":hmat[2,2],
"l":alat,
"basis":basisstring,
"nlat":3,
}
cmdargs = gen_varargs(varlist)
cij_ortho = calculate_cij(cmdargs)
# define the cubic diamond triclinic primitive cell
# with 2 atoms
basisstring = ""
origin = np.zeros(3)
bond = np.ones(3)*0.25
b = origin
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
b = bond
basisstring += "basis %g %g %g " % (b[0],b[1],b[2])
hmat1 = np.array([[1, 1, 0], [0, 1, 1], [1, 0, 1]]).T/np.sqrt(2)
# rotate primitive cell to LAMMPS orientation
# (upper triangular)
qmat, rmat = np.linalg.qr(hmat1)
ss = np.diagflat(np.sign(np.diag(rmat)))
rot = ss @ qmat.T
hmat2 = ss @ rmat
varlist = {
"logsuffix":"tri",
"a":alat,
"a1x":hmat2[0,0],
"a2x":hmat2[0,1],
"a2y":hmat2[1,1],
"a3x":hmat2[0,2],
"a3y":hmat2[1,2],
"a3z":hmat2[2,2],
"l":alat/2**0.5,
"basis":basisstring,
"nlat":5,
}
cmdargs = gen_varargs(varlist)
cij_tri = calculate_cij(cmdargs)
if me == 0:
print("\nPython output:")
print("C_ortho = \n",cij_ortho)
print()
print("C_tri = \n",cij_tri)
print()
cij_tri_rot = rotate_cij(cij_tri, rot.T)
print("C_tri(rotated back) = \n",cij_tri_rot)
print()
print("C_ortho-C_tri = \n", cij_ortho-cij_tri_rot)
print()

View File

@ -0,0 +1,110 @@
import numpy as np
from lammps import lammps, LMP_VAR_EQUAL
# method for rotating elastic constants
def rotate_cij(cij, r):
# K_1
# R_11^2 R_12^2 R_13^2
# R_21^2 R_22^2 R_23^2
# R_31^2 R_32^2 R_33^2
k1 = r*r
# K_2
# R_12.R_13 R_13.R_11 R_11.R_12
# R_22.R_23 R_23.R_21 R_21.R_22
# R_32.R_33 R_33.R_31 R_31.R_32
k2 = np.array([
[r[0][1]*r[0][2], r[0][2]*r[0][0], r[0][0]*r[0][1]],
[r[1][1]*r[1][2], r[1][2]*r[1][0], r[1][0]*r[1][1]],
[r[2][1]*r[2][2], r[2][2]*r[2][0], r[2][0]*r[2][1]],
])
# K_3
# R_21.R_31 R_22.R_32 R_23.R_33
# R_31.R_11 R_32.R_12 R_33.R_13
# R_11.R_21 R_12.R_22 R_13.R_23
k3 = np.array([
[r[1][0]*r[2][0], r[1][1]*r[2][1], r[1][2]*r[2][2]],
[r[2][0]*r[0][0], r[2][1]*r[0][1], r[2][2]*r[0][2]],
[r[0][0]*r[1][0], r[0][1]*r[1][1], r[0][2]*r[1][2]],
])
# K_4a
# R_22.R_33 R_23.R_31 R_21.R_32
# R_32.R_13 R_33.R_11 R_31.R_12
# R_12.R_23 R_13.R_21 R_11.R_22
k4a = np.array([
[r[1][1]*r[2][2], r[1][2]*r[2][0], r[1][0]*r[2][1]],
[r[2][1]*r[0][2], r[2][2]*r[0][0], r[2][0]*r[0][1]],
[r[0][1]*r[1][2], r[0][2]*r[1][0], r[0][0]*r[1][1]],
])
# K_4b
# R_23.R_32 R_21.R_33 R_22.R_31
# R_33.R_12 R_31.R_13 R_32.R_11
# R_13.R_22 R_11.R_23 R_12.R_21
k4b = np.array([
[r[1][2]*r[2][1], r[1][0]*r[2][2], r[1][1]*r[2][0]],
[r[2][2]*r[0][1], r[2][0]*r[0][2], r[2][1]*r[0][0]],
[r[0][2]*r[1][1], r[0][0]*r[1][2], r[0][1]*r[1][0]],
])
k = np.block([[k1, 2*k2],[k3, k4a+k4b]])
cijrot = k.dot(cij.dot(k.T))
return cijrot
def calculate_cij(cmdargs):
lmp = lammps(cmdargs=cmdargs)
lmp.file("in.elastic")
C11 = lmp.extract_variable("C11",None, LMP_VAR_EQUAL)
C22 = lmp.extract_variable("C22",None, LMP_VAR_EQUAL)
C33 = lmp.extract_variable("C33",None, LMP_VAR_EQUAL)
C44 = lmp.extract_variable("C44",None, LMP_VAR_EQUAL)
C55 = lmp.extract_variable("C55",None, LMP_VAR_EQUAL)
C66 = lmp.extract_variable("C66",None, LMP_VAR_EQUAL)
C12 = lmp.extract_variable("C12",None, LMP_VAR_EQUAL)
C13 = lmp.extract_variable("C13",None, LMP_VAR_EQUAL)
C14 = lmp.extract_variable("C14",None, LMP_VAR_EQUAL)
C15 = lmp.extract_variable("C15",None, LMP_VAR_EQUAL)
C16 = lmp.extract_variable("C16",None, LMP_VAR_EQUAL)
C23 = lmp.extract_variable("C23",None, LMP_VAR_EQUAL)
C24 = lmp.extract_variable("C24",None, LMP_VAR_EQUAL)
C25 = lmp.extract_variable("C25",None, LMP_VAR_EQUAL)
C26 = lmp.extract_variable("C26",None, LMP_VAR_EQUAL)
C34 = lmp.extract_variable("C34",None, LMP_VAR_EQUAL)
C35 = lmp.extract_variable("C35",None, LMP_VAR_EQUAL)
C36 = lmp.extract_variable("C36",None, LMP_VAR_EQUAL)
C45 = lmp.extract_variable("C45",None, LMP_VAR_EQUAL)
C46 = lmp.extract_variable("C46",None, LMP_VAR_EQUAL)
C56 = lmp.extract_variable("C56",None, LMP_VAR_EQUAL)
cij = np.array([
[C11, C12, C13, C14, C15, C16],
[ 0, C22, C23, C24, C25, C26],
[ 0, 0, C33, C34, C35, C36],
[ 0, 0, 0, C44, C45, C46],
[ 0, 0, 0, 0, C55, C56],
[ 0, 0, 0, 0, 0, C66],
])
cij = np.triu(cij) + np.tril(cij.T, -1)
return cij
def gen_varargs(varlist):
cmdargs = []
for key in varlist:
cmdargs += ["-var",key,str(varlist[key])]
return cmdargs

View File

@ -1,13 +1,17 @@
# NOTE: This script can be modified for different atomic structures,
# units, etc. See in.elastic for more info.
#
# Define MD parameters
# These can be modified by the user
# These settings replicate the 1477~K benchmark of
# Kluge, Ray, and Rahman (1986) that is Ref.[15] in:
# Y. Zhen, C. Chu, Computer Physics Communications 183(2012) 261-265
# set log file
variable logsuffix index ortho
log log.elastic.${logsuffix}
# select temperature and pressure (lattice constant)
variable temp index 1477.0 # temperature of initial sample
@ -37,19 +41,34 @@ variable nrepeatborn equal floor(${nfreq}/${neveryborn}) # number of samples
variable nequil equal 10*${nthermo} # length of equilibration run
variable nrun equal 100*${nthermo} # length of equilibrated run
# generate the box and atom positions using a diamond lattice
# this generates a general triclinic cell
# conforming to LAMMPS cell (upper triangular)
units metal
box tilt large
boundary p p p
# unit lattice vectors are
# a1 = (a1x 0 0)
# a2 = (a2x a2y 0)
# a3 = (a3x a3y a3z)
# this generates a standard 8-atom cubic cell
variable a1x index 1
variable a2x index 0
variable a2y index 1
variable a3x index 0
variable a3y index 0
variable a3z index 1
variable atmp equal $a
variable l index $a
variable basis index "basis 0 0 0 basis 0.25 0.25 0.25 basis 0 0.5 0.5 basis 0.25 0.75 0.75 basis 0.5 0 0.5 basis 0.75 0.25 0.75 basis 0.5 0.5 0 basis 0.75 0.75 0.25"
lattice custom ${l} &
a1 ${a1x} 0 0 &
a2 ${a2x} ${a2y} 0 &
a3 ${a3x} ${a3y} ${a3z} &
${basis} &
spacing 1 1 1
lattice diamond $a
region box prism 0 1 0 1 0 1 0 0 0
# this generates a 2-atom triclinic cell
#include tri.in
region box prism 0 ${a1x} 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}
create_box 1 box
create_atoms 1 box
@ -57,3 +76,4 @@ mass 1 ${mass1}
replicate ${nlat} ${nlat} ${nlat}
velocity all create ${temp} 87287

View File

@ -0,0 +1,662 @@
# select temperature and pressure (lattice constant)
variable temp index 1477.0 # temperature of initial sample
variable a index 5.457 # lattice constant
# select sampling parameters, important for speed/convergence
variable nthermo index 1500 # interval for thermo output
variable nevery index 10 # stress sampling interval
variable neveryborn index 100 # Born sampling interval
variable timestep index 0.000766 # timestep
variable nlat index 3 # number of lattice unit cells
# other settings
variable mass1 index 28.06 # mass
variable tdamp index 0.01 # time constant for thermostat
variable seed index 123457 # seed for thermostat
variable thermostat index 1 # 0 if NVE, 1 if NVT
variable delta index 1.0e-6 # Born numdiff strain magnitude
# hard-coded rules-of-thumb for run length, etc.
variable nfreq equal ${nthermo} # interval for averaging output
variable nfreq equal 1500
variable nrepeat equal floor(${nfreq}/${nevery}) # number of samples
variable nrepeat equal floor(1500/${nevery})
variable nrepeat equal floor(1500/10)
variable nrepeatborn equal floor(${nfreq}/${neveryborn}) # number of samples
variable nrepeatborn equal floor(1500/${neveryborn})
variable nrepeatborn equal floor(1500/100)
variable nequil equal 10*${nthermo} # length of equilibration run
variable nequil equal 10*1500
variable nrun equal 100*${nthermo} # length of equilibrated run
variable nrun equal 100*1500
# this generates a general triclinic cell
# conforming to LAMMPS cell (upper triangular)
units metal
box tilt large
# unit lattice vectors are
# a1 = (a1x 0 0)
# a2 = (a2x a2y 0)
# a3 = (a3x a3y a3z)
variable a1x index 1
variable a2x index 0
variable a2y index 1
variable a3x index 0
variable a3y index 0
variable a3z index 1
variable atmp equal $a
variable atmp equal 5.457
variable l index $a
variable l index 5.457
variable basis index "basis 0 0 0 basis 0.25 0.25 0.25 basis 0 0.5 0.5 basis 0.25 0.75 0.75 basis 0.5 0 0.5 basis 0.75 0.25 0.75 basis 0.5 0.5 0 basis 0.75 0.75 0.25"
lattice custom ${l} a1 ${a1x} 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 ${a1x} 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 1.0 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 1.0 0 a3 0.0 ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 1.0 0 a3 0.0 0.0 ${a3z} ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 1.0 0 a3 0.0 0.0 1.0 ${basis} spacing 1 1 1
lattice custom 5.457 a1 1.0 0 0 a2 0.0 1.0 0 a3 0.0 0.0 1.0 basis 0 0 0 basis 0.25 0.25 0.25 basis 0 0.5 0.5 basis 0.25 0.75 0.75 basis 0.5 0 0.5 basis 0.75 0.25 0.75 basis 0.5 0.5 0 basis 0.75 0.75 0.25 spacing 1 1 1
Lattice spacing in x,y,z = 5.457 5.457 5.457
region box prism 0 ${a1x} 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 1.0 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 1.0 0 1.0 ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 1.0 0 1.0 0.0 ${a3x} ${a3y}
region box prism 0 1.0 0 1.0 0 1.0 0.0 0.0 ${a3y}
region box prism 0 1.0 0 1.0 0 1.0 0.0 0.0 0.0
create_box 1 box
Created triclinic box = (0 0 0) to (5.457 5.457 5.457) with tilt (0 0 0)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 8 atoms
using lattice units in triclinic box = (0 0 0) to (5.457 5.457 5.457) with tilt (0 0 0)
create_atoms CPU = 0.000 seconds
mass 1 ${mass1}
mass 1 28.06
replicate ${nlat} ${nlat} ${nlat}
replicate 3 ${nlat} ${nlat}
replicate 3 3 ${nlat}
replicate 3 3 3
Replicating atoms ...
triclinic box = (0 0 0) to (16.371 16.371 16.371) with tilt (0 0 0)
1 by 2 by 2 MPI processor grid
216 atoms
replicate CPU = 0.001 seconds
velocity all create ${temp} 87287
velocity all create 1477.0 87287
# Compute initial state
include potential.in
# NOTE: This script can be modified for different pair styles
# See in.elastic for more info.
reset_timestep 0
# Choose potential
pair_style sw
pair_coeff * * Si.sw Si
Reading sw potential file Si.sw with DATE: 2007-06-11
# Setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# Setup MD
timestep ${timestep}
timestep 0.000766
fix 4 all nve
if "${thermostat} == 1" then "fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}"
fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 123457
thermo_style custom step temp pe press density
run ${nequil}
run 15000
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.77118
ghost atom cutoff = 4.77118
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair sw, perpetual
attributes: full, newton on
pair build: full/nsq
stencil: none
bin: none
Per MPI rank memory allocation (min/avg/max) = 3.053 | 3.053 | 3.053 Mbytes
Step Temp PotEng Press Density
0 1477 -936.42473 -4264.7155 2.2938491
15000 1409.2705 -887.74266 -595.80958 2.2938491
Loop time of 1.46866 on 4 procs for 15000 steps with 216 atoms
Performance: 675.949 ns/day, 0.036 hours/ns, 10213.420 timesteps/s
99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.1178 | 1.1422 | 1.167 | 1.8 | 77.77
Neigh | 0.015423 | 0.015665 | 0.015835 | 0.1 | 1.07
Comm | 0.24267 | 0.26778 | 0.2925 | 3.8 | 18.23
Output | 1.2863e-05 | 1.4971e-05 | 2.0888e-05 | 0.0 | 0.00
Modify | 0.019642 | 0.020192 | 0.020638 | 0.3 | 1.37
Other | | 0.02277 | | | 1.55
Nlocal: 54 ave 56 max 50 min
Histogram: 1 0 0 0 0 0 1 0 0 2
Nghost: 353 ave 357 max 351 min
Histogram: 2 0 0 1 0 0 0 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 1423.5 ave 1487 max 1324 min
Histogram: 1 0 0 0 0 1 0 0 0 2
Total # of neighbors = 5694
Ave neighs/atom = 26.361111
Neighbor list builds = 251
Dangerous builds = 0
# Run dynamics
include potential.in
# NOTE: This script can be modified for different pair styles
# See in.elastic for more info.
reset_timestep 0
# Choose potential
pair_style sw
pair_coeff * * Si.sw Si
Reading sw potential file Si.sw with DATE: 2007-06-11
# Setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# Setup MD
timestep ${timestep}
timestep 0.000766
fix 4 all nve
if "${thermostat} == 1" then "fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}"
fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 123457
include output.in
# Setup output
# Stress fluctuation term F
compute stress all pressure thermo_temp
variable s1 equal c_stress[1]
variable s2 equal c_stress[2]
variable s3 equal c_stress[3]
variable s4 equal c_stress[6]
variable s5 equal c_stress[5]
variable s6 equal c_stress[4]
variable s11 equal v_s1*v_s1
variable s22 equal v_s2*v_s2
variable s33 equal v_s3*v_s3
variable s44 equal v_s4*v_s4
variable s55 equal v_s5*v_s5
variable s66 equal v_s6*v_s6
variable s33 equal v_s3*v_s3
variable s12 equal v_s1*v_s2
variable s13 equal v_s1*v_s3
variable s14 equal v_s1*v_s4
variable s15 equal v_s1*v_s5
variable s16 equal v_s1*v_s6
variable s23 equal v_s2*v_s3
variable s24 equal v_s2*v_s4
variable s25 equal v_s2*v_s5
variable s26 equal v_s2*v_s6
variable s34 equal v_s3*v_s4
variable s35 equal v_s3*v_s5
variable s36 equal v_s3*v_s6
variable s45 equal v_s4*v_s5
variable s46 equal v_s4*v_s6
variable s56 equal v_s5*v_s6
variable mytemp equal temp
variable mypress equal press
variable mype equal pe/atoms
fix avt all ave/time ${nevery} ${nrepeat} ${nfreq} v_mytemp ave running
fix avt all ave/time 10 ${nrepeat} ${nfreq} v_mytemp ave running
fix avt all ave/time 10 150 ${nfreq} v_mytemp ave running
fix avt all ave/time 10 150 1500 v_mytemp ave running
fix avp all ave/time ${nevery} ${nrepeat} ${nfreq} v_mypress ave running
fix avp all ave/time 10 ${nrepeat} ${nfreq} v_mypress ave running
fix avp all ave/time 10 150 ${nfreq} v_mypress ave running
fix avp all ave/time 10 150 1500 v_mypress ave running
fix avpe all ave/time ${nevery} ${nrepeat} ${nfreq} v_mype ave running
fix avpe all ave/time 10 ${nrepeat} ${nfreq} v_mype ave running
fix avpe all ave/time 10 150 ${nfreq} v_mype ave running
fix avpe all ave/time 10 150 1500 v_mype ave running
fix avs all ave/time ${nevery} ${nrepeat} ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 ${nrepeat} ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 150 ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 150 1500 v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avssq all ave/time ${nevery} ${nrepeat} ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 ${nrepeat} ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 150 ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 150 1500 v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
# bar to GPa
variable pconv equal 1.0e5/1.0e9
variable cunits index GPa
# metal unit constants from LAMMPS
# force->nktv2p = 1.6021765e6;
# force->boltz = 8.617343e-5;
variable boltz equal 8.617343e-5
variable nktv2p equal 1.6021765e6
variable vkt equal vol/(${boltz}*${temp})/${nktv2p}
variable vkt equal vol/(8.617343e-05*${temp})/${nktv2p}
variable vkt equal vol/(8.617343e-05*1477.0)/${nktv2p}
variable vkt equal vol/(8.617343e-05*1477.0)/1602176.5
variable ffac equal ${pconv}*${vkt}
variable ffac equal 0.0001*${vkt}
variable ffac equal 0.0001*0.0215159929384811
variable F11 equal -(f_avssq[1]-f_avs[1]*f_avs[1])*${ffac}
variable F11 equal -(f_avssq[1]-f_avs[1]*f_avs[1])*2.15159929384811e-06
variable F22 equal -(f_avssq[2]-f_avs[2]*f_avs[2])*${ffac}
variable F22 equal -(f_avssq[2]-f_avs[2]*f_avs[2])*2.15159929384811e-06
variable F33 equal -(f_avssq[3]-f_avs[3]*f_avs[3])*${ffac}
variable F33 equal -(f_avssq[3]-f_avs[3]*f_avs[3])*2.15159929384811e-06
variable F44 equal -(f_avssq[4]-f_avs[4]*f_avs[4])*${ffac}
variable F44 equal -(f_avssq[4]-f_avs[4]*f_avs[4])*2.15159929384811e-06
variable F55 equal -(f_avssq[5]-f_avs[5]*f_avs[5])*${ffac}
variable F55 equal -(f_avssq[5]-f_avs[5]*f_avs[5])*2.15159929384811e-06
variable F66 equal -(f_avssq[6]-f_avs[6]*f_avs[6])*${ffac}
variable F66 equal -(f_avssq[6]-f_avs[6]*f_avs[6])*2.15159929384811e-06
variable F12 equal -(f_avssq[7]-f_avs[1]*f_avs[2])*${ffac}
variable F12 equal -(f_avssq[7]-f_avs[1]*f_avs[2])*2.15159929384811e-06
variable F13 equal -(f_avssq[8]-f_avs[1]*f_avs[3])*${ffac}
variable F13 equal -(f_avssq[8]-f_avs[1]*f_avs[3])*2.15159929384811e-06
variable F14 equal -(f_avssq[9]-f_avs[1]*f_avs[4])*${ffac}
variable F14 equal -(f_avssq[9]-f_avs[1]*f_avs[4])*2.15159929384811e-06
variable F15 equal -(f_avssq[10]-f_avs[1]*f_avs[5])*${ffac}
variable F15 equal -(f_avssq[10]-f_avs[1]*f_avs[5])*2.15159929384811e-06
variable F16 equal -(f_avssq[11]-f_avs[1]*f_avs[6])*${ffac}
variable F16 equal -(f_avssq[11]-f_avs[1]*f_avs[6])*2.15159929384811e-06
variable F23 equal -(f_avssq[12]-f_avs[2]*f_avs[3])*${ffac}
variable F23 equal -(f_avssq[12]-f_avs[2]*f_avs[3])*2.15159929384811e-06
variable F24 equal -(f_avssq[13]-f_avs[2]*f_avs[4])*${ffac}
variable F24 equal -(f_avssq[13]-f_avs[2]*f_avs[4])*2.15159929384811e-06
variable F25 equal -(f_avssq[14]-f_avs[2]*f_avs[5])*${ffac}
variable F25 equal -(f_avssq[14]-f_avs[2]*f_avs[5])*2.15159929384811e-06
variable F26 equal -(f_avssq[15]-f_avs[2]*f_avs[6])*${ffac}
variable F26 equal -(f_avssq[15]-f_avs[2]*f_avs[6])*2.15159929384811e-06
variable F34 equal -(f_avssq[16]-f_avs[3]*f_avs[4])*${ffac}
variable F34 equal -(f_avssq[16]-f_avs[3]*f_avs[4])*2.15159929384811e-06
variable F35 equal -(f_avssq[17]-f_avs[3]*f_avs[5])*${ffac}
variable F35 equal -(f_avssq[17]-f_avs[3]*f_avs[5])*2.15159929384811e-06
variable F36 equal -(f_avssq[18]-f_avs[3]*f_avs[6])*${ffac}
variable F36 equal -(f_avssq[18]-f_avs[3]*f_avs[6])*2.15159929384811e-06
variable F45 equal -(f_avssq[19]-f_avs[4]*f_avs[5])*${ffac}
variable F45 equal -(f_avssq[19]-f_avs[4]*f_avs[5])*2.15159929384811e-06
variable F46 equal -(f_avssq[20]-f_avs[4]*f_avs[6])*${ffac}
variable F46 equal -(f_avssq[20]-f_avs[4]*f_avs[6])*2.15159929384811e-06
variable F56 equal -(f_avssq[21]-f_avs[5]*f_avs[6])*${ffac}
variable F56 equal -(f_avssq[21]-f_avs[5]*f_avs[6])*2.15159929384811e-06
# Born term
compute virial all pressure NULL virial
compute born all born/matrix numdiff ${delta} virial
compute born all born/matrix numdiff 1.0e-6 virial
fix avborn all ave/time ${neveryborn} ${nrepeatborn} ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 ${nrepeatborn} ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 15 ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 15 1500 c_born[*] ave running
variable bfac equal ${pconv}*${nktv2p}/vol
variable bfac equal 0.0001*${nktv2p}/vol
variable bfac equal 0.0001*1602176.5/vol
variable B vector f_avborn*${bfac}
variable B vector f_avborn*0.036516128938577
# Kinetic term
variable kfac equal ${pconv}*${nktv2p}*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*${nktv2p}*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*8.617343e-05*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*8.617343e-05*1477.0/vol
variable K11 equal 4.0*${kfac}
variable K11 equal 4.0*1.00390440086865
variable K22 equal 4.0*${kfac}
variable K22 equal 4.0*1.00390440086865
variable K33 equal 4.0*${kfac}
variable K33 equal 4.0*1.00390440086865
variable K44 equal 2.0*${kfac}
variable K44 equal 2.0*1.00390440086865
variable K55 equal 2.0*${kfac}
variable K55 equal 2.0*1.00390440086865
variable K66 equal 2.0*${kfac}
variable K66 equal 2.0*1.00390440086865
# Add F, K, and B together
variable C11 equal v_F11+v_B[1]+v_K11
variable C22 equal v_F22+v_B[2]+v_K22
variable C33 equal v_F33+v_B[3]+v_K33
variable C44 equal v_F44+v_B[4]+v_K44
variable C55 equal v_F55+v_B[5]+v_K55
variable C66 equal v_F66+v_B[6]+v_K66
variable C12 equal v_F12+v_B[7]
variable C13 equal v_F13+v_B[8]
variable C14 equal v_F14+v_B[9]
variable C15 equal v_F15+v_B[10]
variable C16 equal v_F16+v_B[11]
variable C23 equal v_F23+v_B[12]
variable C24 equal v_F24+v_B[13]
variable C25 equal v_F25+v_B[14]
variable C26 equal v_F26+v_B[15]
variable C34 equal v_F34+v_B[16]
variable C35 equal v_F35+v_B[17]
variable C36 equal v_F36+v_B[18]
variable C45 equal v_F45+v_B[19]
variable C46 equal v_F46+v_B[20]
variable C56 equal v_F56+v_B[21]
thermo ${nthermo}
thermo 1500
thermo_style custom step temp pe press density f_avt f_avp f_avpe v_F11 v_F22 v_F33 v_F44 v_F55 v_F66 v_F12 v_F13 v_F23 v_B[*8] v_B[12]
thermo_modify norm no
run ${nrun}
run 150000
Per MPI rank memory allocation (min/avg/max) = 3.803 | 3.803 | 3.803 Mbytes
Step Temp PotEng Press Density f_avt f_avp f_avpe v_F11 v_F22 v_F33 v_F44 v_F55 v_F66 v_F12 v_F13 v_F23 v_B[1] v_B[2] v_B[3] v_B[4] v_B[5] v_B[6] v_B[7] v_B[8] v_B[12]
0 1409.2705 -887.74266 -595.80958 2.2938491 0 0 0 -0 -0 -0 -0 -0 -0 -0 -0 -0 0 0 0 0 0 0 0 0 0
1500 1543.955 -894.59564 829.29754 2.2938491 1479.8455 -272.48983 -4.1286994 -9.8546328 -7.6109829 -6.9399455 -42.917041 -50.311599 -54.999307 -2.1718852 -0.37897892 0.021065401 136.52661 136.57057 136.8112 99.817258 99.81304 99.70618 74.718855 74.984867 74.922489
3000 1533.4697 -891.05441 1291.5832 2.2938491 1482.4036 -135.16653 -4.130281 -8.5756153 -7.6746515 -7.0427547 -50.764257 -49.209172 -60.778328 -1.3700831 -0.4568356 0.20721573 136.58667 136.70561 136.69409 99.903478 99.76887 99.847801 74.700603 74.769035 74.913031
4500 1559.2333 -895.95898 -169.5185 2.2938491 1481.5554 110.86891 -4.1325482 -8.0338125 -7.6953586 -7.3762168 -53.430221 -48.29504 -54.657257 -1.3016296 -1.0260182 -0.045906996 136.84569 136.91821 136.90927 100.0598 99.901964 100.07314 74.813284 74.723978 74.90986
6000 1417.6434 -891.85991 84.448937 2.2938491 1480.5364 -26.042555 -4.130823 -8.2176554 -7.6691593 -7.5195046 -54.897719 -45.58593 -53.146497 -1.1159385 -0.4148108 -0.34277881 136.73272 136.74579 136.70656 99.899987 99.788575 99.91922 74.858104 74.751356 74.877807
7500 1521.8549 -890.45085 -1986.131 2.2938491 1478.7883 -63.188659 -4.131248 -7.9884217 -7.5621903 -7.6827376 -53.505647 -51.167165 -54.069643 -1.0788226 -0.72907125 -0.40595255 136.65015 136.58541 136.66316 99.849936 99.770641 99.833465 74.762105 74.749673 74.793725
9000 1481.1098 -893.58876 -302.11196 2.2938491 1480.8996 -86.706608 -4.1308352 -7.8504102 -7.4016325 -7.7875364 -52.129057 -50.748636 -55.590171 -1.0423024 -1.0411667 -0.42332136 136.61748 136.54744 136.63721 99.806859 99.750078 99.824904 74.793868 74.742871 74.75755
10500 1602.1539 -891.59953 -120.50983 2.2938491 1481.8078 -58.72234 -4.1309965 -7.979615 -7.4378227 -7.6187667 -51.499039 -50.360191 -52.483908 -0.79006562 -0.97184735 -0.42288111 136.62376 136.57134 136.65198 99.809774 99.788741 99.818781 74.780283 74.754346 74.752685
12000 1419.1584 -891.48511 -357.00507 2.2938491 1482.0565 -52.541967 -4.1307476 -7.8017302 -7.3965439 -7.5326968 -51.907957 -50.643325 -53.453282 -0.84401937 -1.0517326 -0.54021711 136.58968 136.54882 136.65563 99.810907 99.792391 99.770152 74.770444 74.788526 74.767629
13500 1349.3981 -893.65888 15.31558 2.2938491 1481.1263 -55.35676 -4.1307105 -7.5797633 -7.3093859 -7.5484467 -52.298219 -49.804373 -54.555982 -0.8242492 -1.0633311 -0.58879705 136.59553 136.58666 136.66121 99.806084 99.807326 99.79773 74.783157 74.799104 74.776677
15000 1572.7545 -888.05032 -1167.1259 2.2938491 1481.1845 -44.051939 -4.1307308 -7.4870604 -7.3959358 -7.7984973 -53.846519 -49.850023 -54.449806 -0.80437631 -0.98162577 -0.67631044 136.6089 136.60586 136.63322 99.804941 99.816756 99.807316 74.799246 74.79994 74.774964
16500 1476.3559 -894.13606 -141.71585 2.2938491 1481.9977 -57.149347 -4.1305532 -7.3563308 -7.7377027 -7.7801895 -55.418093 -50.432917 -55.092322 -0.75882435 -0.91155917 -0.8012947 136.60588 136.59648 136.64052 99.783788 99.813543 99.811844 74.796195 74.795566 74.759748
18000 1385.3464 -894.17196 -453.51135 2.2938491 1482.2841 -41.202526 -4.1305936 -7.4001985 -7.9100844 -7.7977726 -55.828868 -51.190641 -56.146338 -0.80951377 -0.88498405 -0.95870035 136.60877 136.58913 136.64391 99.807809 99.807278 99.804971 74.795414 74.787039 74.770228
19500 1459.0464 -891.56293 -583.43289 2.2938491 1481.6087 -80.19681 -4.1305727 -7.503849 -7.832224 -8.0680015 -55.621765 -52.943951 -55.834411 -0.84395931 -0.92355108 -1.0598691 136.57225 136.54527 136.59315 99.781928 99.757893 99.808931 74.802468 74.747248 74.742414
21000 1425.7724 -893.96346 -2476.1354 2.2938491 1480.7898 -80.510469 -4.1307098 -7.5517651 -7.7540688 -8.1263923 -55.676836 -51.985142 -57.190698 -0.79979707 -0.82062764 -0.96974038 136.62238 136.56316 136.58301 99.770462 99.774612 99.833221 74.817335 74.767434 74.729171
22500 1478.3908 -893.03263 356.73894 2.2938491 1481.8216 -56.608103 -4.1307548 -7.5171851 -7.7473191 -8.1531481 -55.174277 -52.991179 -56.943478 -0.83236889 -0.86233325 -0.84237825 136.63109 136.54755 136.58015 99.768999 99.789091 99.834769 74.805682 74.762367 74.709251
24000 1559.2834 -895.0061 408.35518 2.2938491 1481.7034 -50.365601 -4.1310012 -7.4371076 -7.6686437 -8.0973363 -55.391365 -53.957438 -56.758804 -0.75624259 -0.7712068 -0.79151732 136.63369 136.569 136.62933 99.801995 99.811857 99.834171 74.784642 74.764728 74.726548
25500 1418.8679 -900.05172 1038.8634 2.2938491 1481.7117 -34.795555 -4.1311417 -7.3525995 -7.6549985 -8.0932453 -55.209186 -54.850159 -56.555154 -0.76945854 -0.80520239 -0.87729866 136.65191 136.56496 136.6234 99.797985 99.83181 99.845733 74.777288 74.761405 74.70467
27000 1337.6729 -892.54371 -1223.1078 2.2938491 1481.7999 -6.868253 -4.1314105 -7.4344069 -7.670465 -8.0748588 -55.642919 -54.694351 -56.043818 -0.84229089 -0.85050448 -0.8848331 136.69353 136.58737 136.65353 99.816588 99.854571 99.87065 74.779124 74.767968 74.713918
28500 1428.3391 -890.39992 1637.2396 2.2938491 1481.456 -5.7648513 -4.1315226 -7.401319 -7.6104928 -8.0522046 -55.924803 -54.963031 -55.354755 -0.80198132 -0.78513105 -0.89948604 136.66669 136.57056 136.6591 99.824707 99.851902 99.853954 74.769147 74.764532 74.720065
30000 1610.749 -892.10736 579.88182 2.2938491 1480.9008 6.256216 -4.1316122 -7.4537451 -7.5486694 -7.9515037 -56.204342 -55.065875 -55.139775 -0.83945753 -0.80897524 -0.84944598 136.67155 136.59361 136.64942 99.830699 99.848762 99.869963 74.777778 74.755753 74.718528
31500 1424.0387 -892.82589 -1088.8668 2.2938491 1480.8612 27.560648 -4.1318123 -7.4239872 -7.5434979 -7.8962752 -56.813306 -55.891849 -55.592699 -0.90786211 -0.78634826 -0.89364109 136.67764 136.59992 136.66244 99.844569 99.867062 99.872844 74.758315 74.7448 74.710189
33000 1608.6242 -892.4438 2546.9882 2.2938491 1481.6562 47.051547 -4.1316992 -7.4646486 -7.5038235 -7.8961468 -57.865394 -55.375621 -56.027867 -0.8910679 -0.84053561 -0.89582173 136.68768 136.59732 136.67152 99.846034 99.880097 99.867468 74.752249 74.751739 74.710642
34500 1459.0403 -892.25499 551.36057 2.2938491 1482.1308 44.660322 -4.1317055 -7.4352078 -7.5237108 -7.8649773 -58.468947 -55.357512 -55.779494 -0.84115908 -0.77476537 -0.87458546 136.66595 136.59551 136.65084 99.839323 99.866733 99.8611 74.741493 74.738738 74.709871
36000 1421.5526 -896.28506 -29.316911 2.2938491 1481.789 47.541032 -4.1318408 -7.3733107 -7.5190295 -7.8143454 -57.929804 -55.418333 -55.785571 -0.83611043 -0.73869976 -0.86057781 136.67194 136.61145 136.66484 99.85524 99.874475 99.868689 74.735031 74.73536 74.716839
37500 1420.8916 -891.82782 -124.77618 2.2938491 1481.4989 50.677557 -4.1319034 -7.351484 -7.4418106 -7.8130188 -57.428955 -55.290755 -55.728856 -0.79501628 -0.76420281 -0.87517695 136.6581 136.61188 136.65931 99.8659 99.870608 99.861288 74.723088 74.734658 74.717
39000 1419.8533 -891.85187 775.65186 2.2938491 1481.3759 61.485208 -4.1320474 -7.3143703 -7.3968445 -7.781877 -57.264431 -55.699481 -55.805103 -0.76748846 -0.78919404 -0.83311458 136.66482 136.61272 136.64292 99.859449 99.871369 99.879933 74.724309 74.716924 74.690243
40500 1618.5121 -891.22453 478.34407 2.2938491 1481.7031 51.968148 -4.1319722 -7.2819086 -7.5511556 -7.7257743 -57.306557 -55.743925 -56.312823 -0.83338334 -0.78815013 -0.80988519 136.65567 136.58905 136.64007 99.843268 99.870939 99.865104 74.716829 74.725634 74.69278
42000 1532.044 -890.39164 1505.0844 2.2938491 1482.0334 59.439461 -4.1318795 -7.2758088 -7.601243 -7.6989373 -57.29647 -55.736173 -55.983442 -0.84537078 -0.77684239 -0.7910269 136.65858 136.5908 136.64401 99.845607 99.869513 99.867281 74.724164 74.732279 74.699567
43500 1390.2967 -890.21856 1078.0917 2.2938491 1482.3754 56.694555 -4.1317225 -7.2485872 -7.568553 -7.7195095 -57.819566 -55.528042 -55.848214 -0.82149712 -0.82258095 -0.75292757 136.66772 136.57379 136.65372 99.83762 99.882723 99.854263 74.72191 74.747558 74.704137
45000 1427.5782 -892.18995 -564.57357 2.2938491 1482.0054 64.751105 -4.1319259 -7.2234655 -7.5860705 -7.6146702 -57.745852 -56.095471 -55.618665 -0.77244466 -0.77811125 -0.75729958 136.66838 136.59611 136.6615 99.853922 99.886483 99.864469 74.715773 74.736269 74.702744
46500 1457.907 -890.87371 1296.2125 2.2938491 1481.9658 74.963993 -4.1319725 -7.2288448 -7.5807903 -7.6640053 -57.821382 -55.848166 -55.521503 -0.80230061 -0.78832769 -0.77589289 136.69039 136.61343 136.68259 99.862454 99.896917 99.881487 74.726406 74.741295 74.710053
48000 1526.0771 -895.53336 951.53234 2.2938491 1481.7295 84.065637 -4.1320813 -7.2137393 -7.545201 -7.6839878 -57.914627 -55.591336 -55.900718 -0.79496608 -0.78179316 -0.79496022 136.6987 136.62461 136.70778 99.879775 99.908913 99.883958 74.71782 74.746229 74.714358
49500 1657.943 -890.09268 424.53616 2.2938491 1481.5972 95.06808 -4.1322261 -7.2312162 -7.5609924 -7.6933969 -58.460164 -55.614895 -55.68435 -0.7539777 -0.78036417 -0.84398343 136.70672 136.6326 136.70523 99.887231 99.910615 99.890981 74.711921 74.735306 74.70572
51000 1517.8791 -894.6926 1412.5634 2.2938491 1481.8411 91.241557 -4.1321301 -7.2856849 -7.554417 -7.6852066 -58.824904 -55.906732 -55.722124 -0.72652169 -0.74459334 -0.824857 136.70149 136.63447 136.70155 99.892122 99.901377 99.890263 74.713234 74.73149 74.710717
52500 1546.6245 -895.29958 181.50897 2.2938491 1482.1091 82.209025 -4.132121 -7.2711566 -7.5656939 -7.6600316 -58.75721 -55.971266 -55.724274 -0.72068642 -0.74174146 -0.81673789 136.68292 136.62513 136.69226 99.883717 99.900635 99.877994 74.704983 74.724386 74.708085
54000 1432.5143 -892.33522 -1007.7153 2.2938491 1481.7799 82.064986 -4.1320527 -7.2297435 -7.5532463 -7.5873553 -58.769531 -56.753962 -55.320358 -0.69093494 -0.71376103 -0.8266532 136.66681 136.62772 136.68861 99.880916 99.890283 99.87535 74.709314 74.72301 74.713722
55500 1525.2554 -890.36734 1294.5154 2.2938491 1481.5565 85.222591 -4.1321435 -7.2322453 -7.5028572 -7.5979369 -58.470473 -56.91003 -54.983461 -0.67325171 -0.68237059 -0.82452296 136.68218 136.64126 136.71384 99.888262 99.903988 99.885655 74.709774 74.736014 74.716975
57000 1480.851 -891.41709 -148.33291 2.2938491 1481.401 80.316901 -4.1321436 -7.262647 -7.5256821 -7.6034232 -58.185727 -56.55166 -54.966948 -0.69905198 -0.64380996 -0.84814546 136.677 136.64844 136.7165 99.891933 99.904202 99.884534 74.70914 74.736681 74.716403
58500 1546.9102 -892.66057 1089.3405 2.2938491 1481.4299 78.801721 -4.1321113 -7.276498 -7.5191946 -7.617463 -58.32857 -56.257777 -54.959089 -0.67949464 -0.65491266 -0.85310199 136.67479 136.64503 136.70605 99.885427 99.899987 99.884663 74.714168 74.737379 74.714314
60000 1485.6648 -893.08278 -428.03608 2.2938491 1481.7631 79.689946 -4.1321441 -7.2552452 -7.5131486 -7.57811 -58.354213 -56.020669 -55.063017 -0.69757949 -0.6589713 -0.84658488 136.67189 136.63503 136.69828 99.877882 99.900844 99.87896 74.707924 74.735972 74.703597
61500 1495.0662 -890.78023 1028.7889 2.2938491 1481.9678 75.884372 -4.1320422 -7.2080989 -7.5371914 -7.5381901 -58.053737 -56.190462 -55.148238 -0.69885347 -0.63670212 -0.87555185 136.65839 136.62158 136.68603 99.869396 99.894708 99.868716 74.704861 74.735992 74.700569
63000 1409.6818 -887.95961 -1304.652 2.2938491 1482.3126 76.410022 -4.1319825 -7.2523905 -7.5152373 -7.5536513 -58.73159 -56.137578 -54.799791 -0.73461753 -0.67809249 -0.88492027 136.65593 136.62329 136.67831 99.868652 99.888176 99.869266 74.703693 74.730048 74.701284
64500 1582.31 -895.49087 1119.2594 2.2938491 1482.1186 66.626242 -4.1320087 -7.2521942 -7.5234826 -7.5594736 -58.305867 -56.601233 -54.537783 -0.7563263 -0.68942681 -0.89444015 136.64507 136.61842 136.66703 99.860683 99.882098 99.86589 74.702368 74.723763 74.693042
66000 1468.6429 -891.90582 -773.99786 2.2938491 1482.414 56.160228 -4.1318961 -7.2436172 -7.5080588 -7.5819411 -57.982694 -56.370777 -54.739699 -0.75092608 -0.69652428 -0.90242579 136.62154 136.60352 136.65359 99.85017 99.872559 99.849715 74.698926 74.716783 74.691294
67500 1592.9841 -894.17166 -373.28608 2.2938491 1482.4608 66.22665 -4.1319088 -7.2020048 -7.5343208 -7.6502267 -57.737091 -56.058804 -54.410576 -0.74973866 -0.71379313 -0.92874192 136.61811 136.60579 136.64811 99.851858 99.868577 99.85379 74.695471 74.703568 74.688361
69000 1451.6708 -892.24332 -42.454938 2.2938491 1482.3952 64.462379 -4.1318409 -7.2084429 -7.5095889 -7.6621307 -58.007656 -55.977537 -54.39909 -0.74311576 -0.67139652 -0.91195038 136.63393 136.60861 136.63564 99.845601 99.865271 99.865085 74.704656 74.707684 74.682318
70500 1541.8751 -890.84273 603.87446 2.2938491 1482.1352 69.651346 -4.1319184 -7.1867148 -7.4795063 -7.6774435 -57.597661 -55.972955 -54.365809 -0.72507444 -0.63500349 -0.909513 136.63512 136.60177 136.63362 99.845987 99.867527 99.865623 74.698143 74.701585 74.674848
72000 1469.8975 -890.17779 -712.95338 2.2938491 1482.2905 73.091503 -4.1319489 -7.1766057 -7.4591194 -7.660856 -57.657616 -55.981892 -54.095734 -0.71782602 -0.61875736 -0.91469335 136.63573 136.60382 136.63383 99.845901 99.869082 99.866108 74.699376 74.701787 74.672946
73500 1571.7762 -894.46891 1835.3759 2.2938491 1482.42 84.062922 -4.1319557 -7.2310516 -7.4816168 -7.6691216 -57.820079 -55.90879 -54.134789 -0.73871067 -0.64971193 -0.93750027 136.63865 136.60893 136.64184 99.848872 99.876734 99.869374 74.696526 74.703769 74.671271
75000 1668.0665 -889.10379 319.58734 2.2938491 1482.5795 91.590228 -4.1319353 -7.2136142 -7.4546526 -7.6863632 -57.99287 -55.973671 -54.462176 -0.7272861 -0.64541622 -0.9505418 136.64301 136.61457 136.65062 99.855439 99.877747 99.869599 74.701819 74.706548 74.682155
76500 1660.1105 -891.61038 2128.1078 2.2938491 1482.4578 91.208675 -4.1318581 -7.2797412 -7.5002006 -7.6971338 -58.256724 -55.882133 -54.72244 -0.74105804 -0.65844257 -0.98078027 136.64403 136.6142 136.65487 99.855009 99.878188 99.868938 74.703354 74.70937 74.68632
78000 1551.7441 -890.77214 -121.70935 2.2938491 1482.3519 85.597023 -4.1317377 -7.2689985 -7.4957494 -7.7185745 -58.313372 -56.092493 -54.841116 -0.75183521 -0.65377647 -0.97014055 136.62932 136.61045 136.63974 99.849688 99.867005 99.861641 74.698504 74.705574 74.688265
79500 1451.11 -892.82037 -632.95505 2.2938491 1482.3476 87.575027 -4.1317651 -7.2403953 -7.4775336 -7.6689122 -58.32666 -56.035227 -54.817357 -0.72487208 -0.63508667 -0.96802939 136.62952 136.60836 136.63433 99.846727 99.865255 99.865022 74.698105 74.698515 74.685562
81000 1497.4722 -891.00907 -173.43837 2.2938491 1482.3832 86.788447 -4.1317009 -7.270206 -7.4485143 -7.6702474 -58.081079 -55.896158 -54.762508 -0.72740498 -0.65433219 -0.95969011 136.62378 136.60331 136.63421 99.844906 99.86253 99.858317 74.695022 74.698559 74.689157
82500 1555.7129 -892.58366 1904.2361 2.2938491 1482.3558 93.090261 -4.1317057 -7.2690799 -7.4631718 -7.7113864 -58.043005 -56.089191 -54.702244 -0.74777178 -0.68581389 -1.0039008 136.62292 136.59848 136.6349 99.844402 99.867354 99.856268 74.688752 74.699686 74.686532
84000 1567.5762 -893.4426 1395.2965 2.2938491 1482.5162 94.678844 -4.1316985 -7.2414617 -7.4514971 -7.7059415 -57.823672 -56.159106 -54.697355 -0.73591992 -0.67263169 -0.99293636 136.62485 136.60365 136.63538 99.84546 99.868588 99.859502 74.694287 74.699557 74.688432
85500 1432.2278 -889.0106 -1377.5411 2.2938491 1482.3155 93.438709 -4.1317406 -7.2231164 -7.4908049 -7.7049396 -57.502557 -56.145262 -54.63067 -0.75954036 -0.65582508 -1.0183515 136.6309 136.61047 136.64107 99.849588 99.871028 99.864254 74.699439 74.70335 74.691002
87000 1460.2447 -891.89246 -0.80016568 2.2938491 1482.3382 88.386804 -4.1316936 -7.2264011 -7.5056543 -7.709398 -57.406671 -55.971898 -54.886302 -0.74942793 -0.65651161 -1.0146109 136.6237 136.59887 136.63315 99.842443 99.867697 99.856739 74.697165 74.70443 74.683402
88500 1440.2891 -893.33008 524.68194 2.2938491 1482.3143 88.757788 -4.1317107 -7.2539574 -7.5019633 -7.6970553 -57.100672 -56.001078 -54.967854 -0.72231568 -0.67329128 -1.0062405 136.62754 136.60076 136.63746 99.841603 99.871714 99.857299 74.700219 74.708928 74.688224
90000 1516.1386 -896.83736 514.25183 2.2938491 1482.4324 93.624187 -4.1316721 -7.2661783 -7.4872817 -7.6621711 -57.153939 -55.675044 -55.038702 -0.71162973 -0.65640585 -0.9901763 136.62634 136.5973 136.63636 99.840724 99.872434 99.853565 74.696616 74.71085 74.68682
91500 1607.5754 -891.45362 -335.12175 2.2938491 1482.3634 96.295552 -4.1317168 -7.2512482 -7.4855921 -7.6563828 -57.333312 -55.871451 -54.885579 -0.71855253 -0.66451595 -0.9784755 136.62406 136.60485 136.63801 99.845387 99.869057 99.856498 74.69518 74.707799 74.689867
93000 1460.9577 -891.0447 1910.5719 2.2938491 1482.5495 95.612581 -4.1316835 -7.2345819 -7.4872574 -7.6900538 -57.577838 -55.778305 -55.190243 -0.72452799 -0.67622846 -0.95134216 136.6155 136.58928 136.6336 99.838615 99.867719 99.849452 74.687208 74.706541 74.685971
94500 1470.6227 -892.26051 270.39634 2.2938491 1482.5672 94.112066 -4.1317045 -7.2341279 -7.4928727 -7.6545536 -57.426957 -56.064962 -55.047123 -0.70451968 -0.67591615 -0.92282964 136.61646 136.59089 136.64185 99.840845 99.870383 99.849979 74.688749 74.709584 74.686957
96000 1761.7597 -889.19794 2653.3494 2.2938491 1482.3672 85.211301 -4.1316762 -7.2539691 -7.4631657 -7.6913375 -57.327731 -55.963801 -55.013515 -0.71090453 -0.69574107 -0.92155635 136.60972 136.58428 136.62883 99.832904 99.864366 99.847749 74.688857 74.708236 74.682281
97500 1481.5876 -894.20788 -389.53494 2.2938491 1482.2533 89.07951 -4.1317073 -7.25095 -7.4753287 -7.6606804 -57.47475 -56.096252 -55.158143 -0.71560129 -0.68873446 -0.93406162 136.61564 136.58736 136.63462 99.838049 99.868876 99.848771 74.686838 74.711562 74.683471
99000 1495.5155 -891.01063 1680.8863 2.2938491 1482.2267 97.208165 -4.1317016 -7.277595 -7.5192558 -7.6344538 -57.476542 -56.383856 -54.882305 -0.74400485 -0.68726404 -0.94799728 136.61907 136.59346 136.63796 99.842727 99.870409 99.853088 74.685523 74.708843 74.684813
100500 1467.1581 -889.95317 242.60103 2.2938491 1481.9829 97.224982 -4.1317571 -7.252584 -7.5076801 -7.6611416 -57.552637 -56.14004 -55.018801 -0.75385025 -0.69209438 -0.94398412 136.6207 136.60141 136.63777 99.846229 99.86929 99.857689 74.69078 74.705759 74.687925
102000 1613.876 -891.23745 1375.2231 2.2938491 1481.8918 94.379877 -4.1317123 -7.2522696 -7.490171 -7.6514314 -57.635642 -55.888914 -54.994388 -0.75241502 -0.68960669 -0.91645246 136.62344 136.60488 136.63347 99.847338 99.865247 99.856123 74.695679 74.707583 74.693448
103500 1366.8885 -892.68641 -434.73129 2.2938491 1481.866 97.233875 -4.1317222 -7.2341862 -7.4693846 -7.6427203 -57.848484 -55.98048 -55.261348 -0.74622204 -0.68309934 -0.92443719 136.62181 136.61267 136.63941 99.856541 99.863371 99.859527 74.696212 74.702525 74.694062
105000 1566.8173 -889.64302 52.134848 2.2938491 1481.9555 94.617908 -4.131708 -7.2078092 -7.490984 -7.6511905 -57.877166 -55.970863 -55.392031 -0.74617361 -0.69517832 -0.94219586 136.62317 136.61282 136.63557 99.853702 99.862156 99.858588 74.697837 74.703415 74.693222
106500 1510.7795 -891.83105 912.04973 2.2938491 1481.9273 94.050693 -4.1317245 -7.2274362 -7.4958029 -7.6473799 -57.9481 -55.855934 -55.405593 -0.7612426 -0.70193323 -0.94170435 136.61865 136.60991 136.63015 99.851136 99.858763 99.857942 74.697833 74.700173 74.690954
108000 1455.2205 -886.40658 557.80643 2.2938491 1481.8672 90.932719 -4.131639 -7.2156616 -7.5140992 -7.6592343 -57.875096 -56.121921 -55.441901 -0.77520355 -0.7082224 -0.95332709 136.61521 136.60854 136.62307 99.844819 99.853589 99.857619 74.706032 74.702008 74.690719
109500 1591.694 -890.12115 2111.7582 2.2938491 1481.9081 90.818335 -4.1316826 -7.2099875 -7.5036851 -7.6146732 -57.901962 -56.080481 -55.335907 -0.77541222 -0.70215363 -0.94640585 136.62449 136.62284 136.63316 99.852345 99.858242 99.864241 74.712062 74.706711 74.695773
111000 1401.5464 -889.70209 -1162.998 2.2938491 1481.8995 90.785361 -4.1317103 -7.2232569 -7.4975842 -7.6122167 -57.814589 -56.145176 -55.237091 -0.77101386 -0.71297505 -0.93787376 136.62319 136.62624 136.63278 99.855678 99.855147 99.865946 74.710261 74.703628 74.698218
112500 1661.4542 -893.40947 3577.1279 2.2938491 1482.0712 91.936529 -4.1316922 -7.2363752 -7.490673 -7.6041227 -57.793279 -56.031961 -55.425678 -0.76646862 -0.71410904 -0.9310629 136.61332 136.62225 136.62704 99.856804 99.84979 99.862862 74.707371 74.696176 74.697236
114000 1547.0639 -887.44417 1477.9344 2.2938491 1482.0257 92.747503 -4.131727 -7.2300662 -7.4797162 -7.5970492 -57.853023 -55.961882 -55.370161 -0.75229192 -0.6895434 -0.93030859 136.61656 136.62515 136.62686 99.855862 99.853722 99.86337 74.71008 74.698813 74.695278
115500 1439.5189 -890.25524 1449.2504 2.2938491 1482.1027 93.092922 -4.1317311 -7.2248464 -7.4844791 -7.577668 -57.724672 -55.908203 -55.477058 -0.75703148 -0.69213445 -0.93063769 136.61287 136.62652 136.63064 99.861066 99.855191 99.860674 74.707263 74.699878 74.698782
117000 1484.5557 -888.52105 62.875599 2.2938491 1481.939 88.920925 -4.1316902 -7.2401277 -7.4688263 -7.5738313 -57.623793 -55.827804 -55.470646 -0.7670686 -0.70720567 -0.94065827 136.61043 136.62028 136.62637 99.856362 99.852679 99.856577 74.7054 74.702523 74.700062
118500 1544.5557 -897.27305 290.28551 2.2938491 1482.0321 82.378509 -4.1316258 -7.2550568 -7.4962409 -7.6069951 -57.791253 -55.82989 -55.246167 -0.7749151 -0.72530054 -0.96204389 136.60394 136.61474 136.6218 99.851596 99.848741 99.849294 74.707077 74.705425 74.700726
120000 1478.3947 -892.7268 -577.38167 2.2938491 1481.8729 84.389547 -4.1316655 -7.2406756 -7.4760807 -7.571379 -57.99213 -55.95264 -55.45397 -0.77057679 -0.71238268 -0.94097166 136.60946 136.62355 136.62508 99.855739 99.849821 99.856483 74.708864 74.703347 74.704105
121500 1529.2571 -890.35258 214.27253 2.2938491 1481.8862 79.172239 -4.131618 -7.2321448 -7.4640098 -7.5859318 -57.999026 -55.743602 -55.374383 -0.76556556 -0.72763717 -0.94266473 136.60096 136.62176 136.61876 99.853547 99.843769 99.850416 74.711419 74.702896 74.703593
123000 1592.6338 -895.89179 1618.5405 2.2938491 1481.8996 82.460382 -4.1316142 -7.2304535 -7.4384951 -7.5700086 -57.853634 -55.668494 -55.236154 -0.75305506 -0.73385059 -0.93874018 136.59877 136.61927 136.61316 99.852817 99.840785 99.851696 74.710721 74.698867 74.700648
124500 1481.1564 -896.96342 324.3934 2.2938491 1481.8895 85.319881 -4.1316244 -7.2264693 -7.4227219 -7.5551714 -57.777484 -55.785962 -55.26024 -0.75234123 -0.73009637 -0.93269204 136.59932 136.61758 136.61173 99.852222 99.841031 99.851213 74.709885 74.698336 74.698938
126000 1366.1089 -891.93997 -658.32428 2.2938491 1481.7226 78.355779 -4.1316207 -7.2488328 -7.4329154 -7.5647275 -57.916784 -55.857672 -55.218103 -0.76146388 -0.73488986 -0.92639796 136.5948 136.61742 136.60582 99.851304 99.835211 99.848225 74.709524 74.694785 74.702522
127500 1505.7295 -893.82427 1963.9643 2.2938491 1481.8782 87.640052 -4.1316687 -7.277167 -7.4400402 -7.5639761 -57.931692 -55.857053 -55.327085 -0.77752365 -0.7559997 -0.93064472 136.60295 136.6295 136.61443 99.859242 99.841072 99.856065 74.711211 74.693396 74.703574
129000 1544.571 -892.03159 -527.07176 2.2938491 1482.0193 87.794364 -4.1316821 -7.2698344 -7.4346091 -7.5684319 -57.869829 -55.877329 -55.269055 -0.77585053 -0.73210247 -0.92680166 136.60317 136.63098 136.61634 99.86071 99.839607 99.856208 74.712198 74.695158 74.705047
130500 1563.3858 -889.50411 -87.198132 2.2938491 1482.0526 81.485975 -4.1316493 -7.2663101 -7.4269998 -7.5691984 -57.836151 -55.897446 -55.110745 -0.7681867 -0.72744291 -0.91874044 136.59693 136.63004 136.61117 99.858337 99.836672 99.849979 74.711563 74.695134 74.708137
132000 1553.6055 -896.15176 740.11093 2.2938491 1481.9674 80.783301 -4.1316735 -7.2824836 -7.4350446 -7.5489937 -57.950565 -55.829897 -55.147418 -0.79446196 -0.73309725 -0.92126843 136.59425 136.62943 136.61481 99.860995 99.838059 99.848436 74.708412 74.695423 74.708926
133500 1385.0177 -892.27993 -907.20247 2.2938491 1481.8295 79.187393 -4.1316431 -7.2781202 -7.4600968 -7.5283409 -58.068566 -55.837667 -54.995174 -0.79075959 -0.72422066 -0.92463565 136.58806 136.62239 136.6053 99.858416 99.830029 99.847215 74.70793 74.690917 74.708181
135000 1483.9097 -893.96772 -2166.9672 2.2938491 1481.8458 79.724142 -4.1316572 -7.2532514 -7.4529684 -7.5151627 -58.117754 -55.762813 -55.044672 -0.78734824 -0.71937479 -0.9191986 136.5908 136.62612 136.60205 99.856567 99.829771 99.850178 74.711435 74.688994 74.708456
136500 1600.2522 -890.70516 609.13895 2.2938491 1481.92 83.006512 -4.1316674 -7.258606 -7.4315875 -7.5020899 -58.1938 -55.794999 -54.94864 -0.77941653 -0.72340994 -0.90867059 136.5924 136.62407 136.6027 99.858372 99.830876 99.850851 74.70873 74.687502 74.705977
138000 1502.6753 -890.61112 391.94407 2.2938491 1482.0167 76.016016 -4.1316051 -7.2681189 -7.4332901 -7.5246594 -58.549025 -55.68375 -55.083251 -0.7721303 -0.73534454 -0.91398112 136.5902 136.61295 136.59058 99.848968 99.826477 99.845811 74.7088 74.685769 74.700689
139500 1356.6079 -892.88412 443.66566 2.2938491 1482.1012 75.175931 -4.1315823 -7.272648 -7.4202164 -7.5435138 -58.430256 -55.645142 -55.177498 -0.77281637 -0.74277362 -0.90655462 136.58594 136.60941 136.58868 99.8471 99.825215 99.844524 74.704379 74.684246 74.698048
141000 1536.8299 -891.3964 1488.9232 2.2938491 1482.1777 70.161617 -4.1315549 -7.2870883 -7.4331937 -7.5306099 -58.52421 -55.722214 -55.042544 -0.74933771 -0.74261337 -0.87760623 136.58324 136.61276 136.58989 99.849169 99.823054 99.843296 74.706773 74.681129 74.703048
142500 1436.4404 -893.92271 574.36968 2.2938491 1482.0701 72.237377 -4.1316031 -7.2838066 -7.4093453 -7.5146661 -58.526669 -55.658527 -54.961371 -0.75069722 -0.74058553 -0.87613316 136.58937 136.61441 136.59146 99.848728 99.827923 99.846928 74.706061 74.681733 74.697755
144000 1489.9179 -891.89057 874.84954 2.2938491 1482.1193 76.069588 -4.1316094 -7.2964678 -7.3973197 -7.5029947 -58.56494 -55.90659 -54.948484 -0.74022244 -0.75134582 -0.87359031 136.59283 136.61825 136.59298 99.85297 99.828592 99.848855 74.708201 74.681372 74.698936
145500 1498.8873 -892.88995 -375.19001 2.2938491 1482.1293 78.637484 -4.1316333 -7.28757 -7.3758785 -7.5097553 -58.819672 -55.915661 -54.947745 -0.73771147 -0.76005783 -0.87268243 136.59805 136.62289 136.59468 99.853239 99.831254 99.853326 74.712898 74.684719 74.697923
147000 1522.292 -888.44727 1193.3345 2.2938491 1482.274 82.096416 -4.1316355 -7.2628288 -7.3837513 -7.5079984 -58.864236 -55.949971 -55.052575 -0.72231418 -0.74804745 -0.87292368 136.60062 136.62844 136.59425 99.855419 99.831528 99.855082 74.715145 74.682637 74.701191
148500 1570.9693 -893.72505 672.43585 2.2938491 1482.3953 88.359724 -4.1316418 -7.2884009 -7.3644359 -7.5112899 -58.807712 -55.988036 -55.099847 -0.72835513 -0.74530355 -0.87637008 136.60096 136.6326 136.59779 99.857791 99.834031 99.857841 74.715094 74.683359 74.70131
150000 1449.0081 -891.81638 -714.54867 2.2938491 1482.3667 90.591195 -4.1316589 -7.3037214 -7.3497793 -7.5219215 -58.757005 -56.00609 -55.081797 -0.72611841 -0.75187625 -0.87207291 136.60564 136.63782 136.59487 99.857615 99.835445 99.86176 74.718484 74.683132 74.699142
Loop time of 18.3423 on 4 procs for 150000 steps with 216 atoms
Performance: 541.227 ns/day, 0.044 hours/ns, 8177.811 timesteps/s
99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 12.192 | 12.302 | 12.366 | 2.0 | 67.07
Neigh | 0.16441 | 0.16492 | 0.16576 | 0.1 | 0.90
Comm | 2.4159 | 2.4795 | 2.5866 | 4.3 | 13.52
Output | 0.0030494 | 0.0033533 | 0.0042086 | 0.9 | 0.02
Modify | 3.1243 | 3.1322 | 3.1398 | 0.3 | 17.08
Other | | 0.2608 | | | 1.42
Nlocal: 54 ave 54 max 54 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost: 334.75 ave 338 max 331 min
Histogram: 1 0 1 0 0 0 0 0 1 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 1426.5 ave 1439 max 1408 min
Histogram: 1 0 0 0 0 1 0 0 1 1
Total # of neighbors = 5706
Ave neighs/atom = 26.416667
Neighbor list builds = 2567
Dangerous builds = 0
# Output final values
include final_output.in
# Average moduli for cubic crystals
variable C11cubic equal (${C11}+${C22}+${C33})/3.0
variable C11cubic equal (133.317541070292+${C22}+${C33})/3.0
variable C11cubic equal (133.317541070292+133.303658933287+${C33})/3.0
variable C11cubic equal (133.317541070292+133.303658933287+133.088561493082)/3.0
variable C12cubic equal (${C12}+${C13}+${C23})/3.0
variable C12cubic equal (73.9923654361203+${C13}+${C23})/3.0
variable C12cubic equal (73.9923654361203+73.9312552589804+${C23})/3.0
variable C12cubic equal (73.9923654361203+73.9312552589804+73.8270687089798)/3.0
variable C44cubic equal (${C44}+${C55}+${C66})/3.0
variable C44cubic equal (43.1084188147025+${C55}+${C66})/3.0
variable C44cubic equal (43.1084188147025+45.8371646999798+${C66})/3.0
variable C44cubic equal (43.1084188147025+45.8371646999798+46.7877718062386)/3.0
variable bulkmodulus equal (${C11cubic}+2*${C12cubic})/3.0
variable bulkmodulus equal (133.236587165554+2*${C12cubic})/3.0
variable bulkmodulus equal (133.236587165554+2*73.9168964680268)/3.0
variable shearmodulus1 equal ${C44cubic}
variable shearmodulus1 equal 45.2444517736403
variable shearmodulus2 equal (${C11cubic}-${C12cubic})/2.0
variable shearmodulus2 equal (133.236587165554-${C12cubic})/2.0
variable shearmodulus2 equal (133.236587165554-73.9168964680268)/2.0
variable poissonratio equal 1.0/(1.0+${C11cubic}/${C12cubic})
variable poissonratio equal 1.0/(1.0+133.236587165554/${C12cubic})
variable poissonratio equal 1.0/(1.0+133.236587165554/73.9168964680268)
# For Stillinger-Weber silicon, the analytical results
# are known to be (E. R. Cowley, 1988):
# C11 = 151.4 GPa
# C12 = 76.4 GPa
# C44 = 56.4 GPa
#print "========================================="
#print "Components of the Elastic Constant Tensor"
#print "========================================="
print "Elastic Constant C11 = ${C11} ${cunits}"
Elastic Constant C11 = 133.317541070292 GPa
print "Elastic Constant C22 = ${C22} ${cunits}"
Elastic Constant C22 = 133.303658933287 GPa
print "Elastic Constant C33 = ${C33} ${cunits}"
Elastic Constant C33 = 133.088561493082 GPa
print "Elastic Constant C12 = ${C12} ${cunits}"
Elastic Constant C12 = 73.9923654361203 GPa
print "Elastic Constant C13 = ${C13} ${cunits}"
Elastic Constant C13 = 73.9312552589804 GPa
print "Elastic Constant C23 = ${C23} ${cunits}"
Elastic Constant C23 = 73.8270687089798 GPa
print "Elastic Constant C44 = ${C44} ${cunits}"
Elastic Constant C44 = 43.1084188147025 GPa
print "Elastic Constant C55 = ${C55} ${cunits}"
Elastic Constant C55 = 45.8371646999798 GPa
print "Elastic Constant C66 = ${C66} ${cunits}"
Elastic Constant C66 = 46.7877718062386 GPa
print "Elastic Constant C14 = ${C14} ${cunits}"
Elastic Constant C14 = 0.0767019895461112 GPa
print "Elastic Constant C15 = ${C15} ${cunits}"
Elastic Constant C15 = 0.160081312432549 GPa
print "Elastic Constant C16 = ${C16} ${cunits}"
Elastic Constant C16 = -0.0672322473606912 GPa
print "Elastic Constant C24 = ${C24} ${cunits}"
Elastic Constant C24 = -0.0980703737031021 GPa
print "Elastic Constant C25 = ${C25} ${cunits}"
Elastic Constant C25 = 0.425094496914652 GPa
print "Elastic Constant C26 = ${C26} ${cunits}"
Elastic Constant C26 = -0.061665192022258 GPa
print "Elastic Constant C34 = ${C34} ${cunits}"
Elastic Constant C34 = -0.0939770954478323 GPa
print "Elastic Constant C35 = ${C35} ${cunits}"
Elastic Constant C35 = 0.10019558502976 GPa
print "Elastic Constant C36 = ${C36} ${cunits}"
Elastic Constant C36 = 0.246165012383149 GPa
print "Elastic Constant C45 = ${C45} ${cunits}"
Elastic Constant C45 = 0.451034755300606 GPa
print "Elastic Constant C46 = ${C46} ${cunits}"
Elastic Constant C46 = 0.53971304682664 GPa
print "Elastic Constant C56 = ${C56} ${cunits}"
Elastic Constant C56 = -0.243078648160722 GPa
print "========================================="
=========================================
print "Average properties for a cubic crystal"
Average properties for a cubic crystal
print "========================================="
=========================================
print "Bulk Modulus = ${bulkmodulus} ${cunits}"
Bulk Modulus = 93.6901267005359 GPa
print "Shear Modulus 1 = ${shearmodulus1} ${cunits}"
Shear Modulus 1 = 45.2444517736403 GPa
print "Shear Modulus 2 = ${shearmodulus2} ${cunits}"
Shear Modulus 2 = 29.6598453487636 GPa
print "Poisson Ratio = ${poissonratio}"
Poisson Ratio = 0.356821884775895
# summarize sampling protocol
variable tmp equal atoms
print "Number of atoms = ${tmp}"
Number of atoms = 216
print "Stress sampling interval = ${nevery}"
Stress sampling interval = 10
variable tmp equal ${nrun}/${nevery}
variable tmp equal 150000/${nevery}
variable tmp equal 150000/10
print "Stress sample count = ${tmp}"
Stress sample count = 15000
print "Born sampling interval = ${neveryborn}"
Born sampling interval = 100
variable tmp equal ${nrun}/${neveryborn}
variable tmp equal 150000/${neveryborn}
variable tmp equal 150000/100
print "Born sample count = ${tmp}"
Born sample count = 1500
Total wall time: 0:00:19

View File

@ -0,0 +1,662 @@
# select temperature and pressure (lattice constant)
variable temp index 1477.0 # temperature of initial sample
variable a index 5.457 # lattice constant
# select sampling parameters, important for speed/convergence
variable nthermo index 1500 # interval for thermo output
variable nevery index 10 # stress sampling interval
variable neveryborn index 100 # Born sampling interval
variable timestep index 0.000766 # timestep
variable nlat index 3 # number of lattice unit cells
# other settings
variable mass1 index 28.06 # mass
variable tdamp index 0.01 # time constant for thermostat
variable seed index 123457 # seed for thermostat
variable thermostat index 1 # 0 if NVE, 1 if NVT
variable delta index 1.0e-6 # Born numdiff strain magnitude
# hard-coded rules-of-thumb for run length, etc.
variable nfreq equal ${nthermo} # interval for averaging output
variable nfreq equal 1500
variable nrepeat equal floor(${nfreq}/${nevery}) # number of samples
variable nrepeat equal floor(1500/${nevery})
variable nrepeat equal floor(1500/10)
variable nrepeatborn equal floor(${nfreq}/${neveryborn}) # number of samples
variable nrepeatborn equal floor(1500/${neveryborn})
variable nrepeatborn equal floor(1500/100)
variable nequil equal 10*${nthermo} # length of equilibration run
variable nequil equal 10*1500
variable nrun equal 100*${nthermo} # length of equilibrated run
variable nrun equal 100*1500
# this generates a general triclinic cell
# conforming to LAMMPS cell (upper triangular)
units metal
box tilt large
# unit lattice vectors are
# a1 = (a1x 0 0)
# a2 = (a2x a2y 0)
# a3 = (a3x a3y a3z)
variable a1x index 1
variable a2x index 0
variable a2y index 1
variable a3x index 0
variable a3y index 0
variable a3z index 1
variable atmp equal $a
variable atmp equal 5.457
variable l index $a
variable l index 5.457
variable basis index "basis 0 0 0 basis 0.25 0.25 0.25 basis 0 0.5 0.5 basis 0.25 0.75 0.75 basis 0.5 0 0.5 basis 0.75 0.25 0.75 basis 0.5 0.5 0 basis 0.75 0.75 0.25"
lattice custom ${l} a1 ${a1x} 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 ${a1x} 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 ${a2x} ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 ${a2y} 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 0.8660254037844385 0 a3 ${a3x} ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 0.8660254037844385 0 a3 0.5 ${a3y} ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 0.8660254037844385 0 a3 0.5 0.2886751345948129 ${a3z} ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 0.8660254037844385 0 a3 0.5 0.2886751345948129 0.8164965809277259 ${basis} spacing 1 1 1
lattice custom 3.8586817049349893 a1 1.0 0 0 a2 0.4999999999999999 0.8660254037844385 0 a3 0.5 0.2886751345948129 0.8164965809277259 basis 0 0 0 basis 0.25 0.25 0.25 spacing 1 1 1
Lattice spacing in x,y,z = 3.8586817 3.8586817 3.8586817
region box prism 0 ${a1x} 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 0.8660254037844385 0 ${a3z} ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 0.8660254037844385 0 0.8164965809277259 ${a2x} ${a3x} ${a3y}
region box prism 0 1.0 0 0.8660254037844385 0 0.8164965809277259 0.4999999999999999 ${a3x} ${a3y}
region box prism 0 1.0 0 0.8660254037844385 0 0.8164965809277259 0.4999999999999999 0.5 ${a3y}
region box prism 0 1.0 0 0.8660254037844385 0 0.8164965809277259 0.4999999999999999 0.5 0.2886751345948129
create_box 1 box
Created triclinic box = (0 0 0) to (3.8586817 3.3417164 3.1506004) with tilt (1.9293409 1.9293409 1.1139055)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 2 atoms
using lattice units in triclinic box = (0 0 0) to (3.8586817 3.3417164 3.1506004) with tilt (1.9293409 1.9293409 1.1139055)
create_atoms CPU = 0.000 seconds
mass 1 ${mass1}
mass 1 28.06
replicate ${nlat} ${nlat} ${nlat}
replicate 5 ${nlat} ${nlat}
replicate 5 5 ${nlat}
replicate 5 5 5
Replicating atoms ...
triclinic box = (0 0 0) to (19.293409 16.708582 15.753002) with tilt (9.6467043 9.6467043 5.5695273)
2 by 1 by 2 MPI processor grid
250 atoms
replicate CPU = 0.000 seconds
velocity all create ${temp} 87287
velocity all create 1477.0 87287
# Compute initial state
include potential.in
# NOTE: This script can be modified for different pair styles
# See in.elastic for more info.
reset_timestep 0
# Choose potential
pair_style sw
pair_coeff * * Si.sw Si
Reading sw potential file Si.sw with DATE: 2007-06-11
# Setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# Setup MD
timestep ${timestep}
timestep 0.000766
fix 4 all nve
if "${thermostat} == 1" then "fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}"
fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 123457
thermo_style custom step temp pe press density
run ${nequil}
run 15000
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.77118
ghost atom cutoff = 4.77118
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair sw, perpetual
attributes: full, newton on
pair build: full/nsq
stencil: none
bin: none
Per MPI rank memory allocation (min/avg/max) = 3.058 | 3.058 | 3.059 Mbytes
Step Temp PotEng Press Density
0 1477 -1083.8249 -4258.3947 2.2938491
15000 1496.4515 -1030.8279 1702.5821 2.2938491
Loop time of 1.93162 on 4 procs for 15000 steps with 250 atoms
Performance: 513.941 ns/day, 0.047 hours/ns, 7765.521 timesteps/s
99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.233 | 1.4215 | 1.6958 | 14.2 | 73.59
Neigh | 0.020173 | 0.022348 | 0.025604 | 1.3 | 1.16
Comm | 0.15771 | 0.43281 | 0.62056 | 25.8 | 22.41
Output | 1.2841e-05 | 1.4604e-05 | 1.9543e-05 | 0.0 | 0.00
Modify | 0.021536 | 0.025134 | 0.030087 | 2.0 | 1.30
Other | | 0.02978 | | | 1.54
Nlocal: 62.5 ave 74 max 58 min
Histogram: 3 0 0 0 0 0 0 0 0 1
Nghost: 429.5 ave 465 max 391 min
Histogram: 1 0 0 1 0 0 0 1 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 1649.5 ave 1943 max 1526 min
Histogram: 2 1 0 0 0 0 0 0 0 1
Total # of neighbors = 6598
Ave neighs/atom = 26.392
Neighbor list builds = 261
Dangerous builds = 0
# Run dynamics
include potential.in
# NOTE: This script can be modified for different pair styles
# See in.elastic for more info.
reset_timestep 0
# Choose potential
pair_style sw
pair_coeff * * Si.sw Si
Reading sw potential file Si.sw with DATE: 2007-06-11
# Setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# Setup MD
timestep ${timestep}
timestep 0.000766
fix 4 all nve
if "${thermostat} == 1" then "fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}"
fix 5 all langevin ${temp} ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 ${temp} ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 ${tdamp} ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 ${seed}
fix 5 all langevin 1477.0 1477.0 0.01 123457
include output.in
# Setup output
# Stress fluctuation term F
compute stress all pressure thermo_temp
variable s1 equal c_stress[1]
variable s2 equal c_stress[2]
variable s3 equal c_stress[3]
variable s4 equal c_stress[6]
variable s5 equal c_stress[5]
variable s6 equal c_stress[4]
variable s11 equal v_s1*v_s1
variable s22 equal v_s2*v_s2
variable s33 equal v_s3*v_s3
variable s44 equal v_s4*v_s4
variable s55 equal v_s5*v_s5
variable s66 equal v_s6*v_s6
variable s33 equal v_s3*v_s3
variable s12 equal v_s1*v_s2
variable s13 equal v_s1*v_s3
variable s14 equal v_s1*v_s4
variable s15 equal v_s1*v_s5
variable s16 equal v_s1*v_s6
variable s23 equal v_s2*v_s3
variable s24 equal v_s2*v_s4
variable s25 equal v_s2*v_s5
variable s26 equal v_s2*v_s6
variable s34 equal v_s3*v_s4
variable s35 equal v_s3*v_s5
variable s36 equal v_s3*v_s6
variable s45 equal v_s4*v_s5
variable s46 equal v_s4*v_s6
variable s56 equal v_s5*v_s6
variable mytemp equal temp
variable mypress equal press
variable mype equal pe/atoms
fix avt all ave/time ${nevery} ${nrepeat} ${nfreq} v_mytemp ave running
fix avt all ave/time 10 ${nrepeat} ${nfreq} v_mytemp ave running
fix avt all ave/time 10 150 ${nfreq} v_mytemp ave running
fix avt all ave/time 10 150 1500 v_mytemp ave running
fix avp all ave/time ${nevery} ${nrepeat} ${nfreq} v_mypress ave running
fix avp all ave/time 10 ${nrepeat} ${nfreq} v_mypress ave running
fix avp all ave/time 10 150 ${nfreq} v_mypress ave running
fix avp all ave/time 10 150 1500 v_mypress ave running
fix avpe all ave/time ${nevery} ${nrepeat} ${nfreq} v_mype ave running
fix avpe all ave/time 10 ${nrepeat} ${nfreq} v_mype ave running
fix avpe all ave/time 10 150 ${nfreq} v_mype ave running
fix avpe all ave/time 10 150 1500 v_mype ave running
fix avs all ave/time ${nevery} ${nrepeat} ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 ${nrepeat} ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 150 ${nfreq} v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avs all ave/time 10 150 1500 v_s1 v_s2 v_s3 v_s4 v_s5 v_s6 ave running
fix avssq all ave/time ${nevery} ${nrepeat} ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 ${nrepeat} ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 150 ${nfreq} v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
fix avssq all ave/time 10 150 1500 v_s11 v_s22 v_s33 v_s44 v_s55 v_s66 v_s12 v_s13 v_s14 v_s15 v_s16 v_s23 v_s24 v_s25 v_s26 v_s34 v_s35 v_s36 v_s45 v_s46 v_s56 ave running
# bar to GPa
variable pconv equal 1.0e5/1.0e9
variable cunits index GPa
# metal unit constants from LAMMPS
# force->nktv2p = 1.6021765e6;
# force->boltz = 8.617343e-5;
variable boltz equal 8.617343e-5
variable nktv2p equal 1.6021765e6
variable vkt equal vol/(${boltz}*${temp})/${nktv2p}
variable vkt equal vol/(8.617343e-05*${temp})/${nktv2p}
variable vkt equal vol/(8.617343e-05*1477.0)/${nktv2p}
variable vkt equal vol/(8.617343e-05*1477.0)/1602176.5
variable ffac equal ${pconv}*${vkt}
variable ffac equal 0.0001*${vkt}
variable ffac equal 0.0001*0.0249027696047235
variable F11 equal -(f_avssq[1]-f_avs[1]*f_avs[1])*${ffac}
variable F11 equal -(f_avssq[1]-f_avs[1]*f_avs[1])*2.49027696047235e-06
variable F22 equal -(f_avssq[2]-f_avs[2]*f_avs[2])*${ffac}
variable F22 equal -(f_avssq[2]-f_avs[2]*f_avs[2])*2.49027696047235e-06
variable F33 equal -(f_avssq[3]-f_avs[3]*f_avs[3])*${ffac}
variable F33 equal -(f_avssq[3]-f_avs[3]*f_avs[3])*2.49027696047235e-06
variable F44 equal -(f_avssq[4]-f_avs[4]*f_avs[4])*${ffac}
variable F44 equal -(f_avssq[4]-f_avs[4]*f_avs[4])*2.49027696047235e-06
variable F55 equal -(f_avssq[5]-f_avs[5]*f_avs[5])*${ffac}
variable F55 equal -(f_avssq[5]-f_avs[5]*f_avs[5])*2.49027696047235e-06
variable F66 equal -(f_avssq[6]-f_avs[6]*f_avs[6])*${ffac}
variable F66 equal -(f_avssq[6]-f_avs[6]*f_avs[6])*2.49027696047235e-06
variable F12 equal -(f_avssq[7]-f_avs[1]*f_avs[2])*${ffac}
variable F12 equal -(f_avssq[7]-f_avs[1]*f_avs[2])*2.49027696047235e-06
variable F13 equal -(f_avssq[8]-f_avs[1]*f_avs[3])*${ffac}
variable F13 equal -(f_avssq[8]-f_avs[1]*f_avs[3])*2.49027696047235e-06
variable F14 equal -(f_avssq[9]-f_avs[1]*f_avs[4])*${ffac}
variable F14 equal -(f_avssq[9]-f_avs[1]*f_avs[4])*2.49027696047235e-06
variable F15 equal -(f_avssq[10]-f_avs[1]*f_avs[5])*${ffac}
variable F15 equal -(f_avssq[10]-f_avs[1]*f_avs[5])*2.49027696047235e-06
variable F16 equal -(f_avssq[11]-f_avs[1]*f_avs[6])*${ffac}
variable F16 equal -(f_avssq[11]-f_avs[1]*f_avs[6])*2.49027696047235e-06
variable F23 equal -(f_avssq[12]-f_avs[2]*f_avs[3])*${ffac}
variable F23 equal -(f_avssq[12]-f_avs[2]*f_avs[3])*2.49027696047235e-06
variable F24 equal -(f_avssq[13]-f_avs[2]*f_avs[4])*${ffac}
variable F24 equal -(f_avssq[13]-f_avs[2]*f_avs[4])*2.49027696047235e-06
variable F25 equal -(f_avssq[14]-f_avs[2]*f_avs[5])*${ffac}
variable F25 equal -(f_avssq[14]-f_avs[2]*f_avs[5])*2.49027696047235e-06
variable F26 equal -(f_avssq[15]-f_avs[2]*f_avs[6])*${ffac}
variable F26 equal -(f_avssq[15]-f_avs[2]*f_avs[6])*2.49027696047235e-06
variable F34 equal -(f_avssq[16]-f_avs[3]*f_avs[4])*${ffac}
variable F34 equal -(f_avssq[16]-f_avs[3]*f_avs[4])*2.49027696047235e-06
variable F35 equal -(f_avssq[17]-f_avs[3]*f_avs[5])*${ffac}
variable F35 equal -(f_avssq[17]-f_avs[3]*f_avs[5])*2.49027696047235e-06
variable F36 equal -(f_avssq[18]-f_avs[3]*f_avs[6])*${ffac}
variable F36 equal -(f_avssq[18]-f_avs[3]*f_avs[6])*2.49027696047235e-06
variable F45 equal -(f_avssq[19]-f_avs[4]*f_avs[5])*${ffac}
variable F45 equal -(f_avssq[19]-f_avs[4]*f_avs[5])*2.49027696047235e-06
variable F46 equal -(f_avssq[20]-f_avs[4]*f_avs[6])*${ffac}
variable F46 equal -(f_avssq[20]-f_avs[4]*f_avs[6])*2.49027696047235e-06
variable F56 equal -(f_avssq[21]-f_avs[5]*f_avs[6])*${ffac}
variable F56 equal -(f_avssq[21]-f_avs[5]*f_avs[6])*2.49027696047235e-06
# Born term
compute virial all pressure NULL virial
compute born all born/matrix numdiff ${delta} virial
compute born all born/matrix numdiff 1.0e-6 virial
fix avborn all ave/time ${neveryborn} ${nrepeatborn} ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 ${nrepeatborn} ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 15 ${nfreq} c_born[*] ave running
fix avborn all ave/time 100 15 1500 c_born[*] ave running
variable bfac equal ${pconv}*${nktv2p}/vol
variable bfac equal 0.0001*${nktv2p}/vol
variable bfac equal 0.0001*1602176.5/vol
variable B vector f_avborn*${bfac}
variable B vector f_avborn*0.0315499354029305
# Kinetic term
variable kfac equal ${pconv}*${nktv2p}*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*${nktv2p}*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*${boltz}*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*8.617343e-05*${temp}/vol
variable kfac equal 0.0001*1602176.5*atoms*8.617343e-05*1477.0/vol
variable K11 equal 4.0*${kfac}
variable K11 equal 4.0*1.00390440086865
variable K22 equal 4.0*${kfac}
variable K22 equal 4.0*1.00390440086865
variable K33 equal 4.0*${kfac}
variable K33 equal 4.0*1.00390440086865
variable K44 equal 2.0*${kfac}
variable K44 equal 2.0*1.00390440086865
variable K55 equal 2.0*${kfac}
variable K55 equal 2.0*1.00390440086865
variable K66 equal 2.0*${kfac}
variable K66 equal 2.0*1.00390440086865
# Add F, K, and B together
variable C11 equal v_F11+v_B[1]+v_K11
variable C22 equal v_F22+v_B[2]+v_K22
variable C33 equal v_F33+v_B[3]+v_K33
variable C44 equal v_F44+v_B[4]+v_K44
variable C55 equal v_F55+v_B[5]+v_K55
variable C66 equal v_F66+v_B[6]+v_K66
variable C12 equal v_F12+v_B[7]
variable C13 equal v_F13+v_B[8]
variable C14 equal v_F14+v_B[9]
variable C15 equal v_F15+v_B[10]
variable C16 equal v_F16+v_B[11]
variable C23 equal v_F23+v_B[12]
variable C24 equal v_F24+v_B[13]
variable C25 equal v_F25+v_B[14]
variable C26 equal v_F26+v_B[15]
variable C34 equal v_F34+v_B[16]
variable C35 equal v_F35+v_B[17]
variable C36 equal v_F36+v_B[18]
variable C45 equal v_F45+v_B[19]
variable C46 equal v_F46+v_B[20]
variable C56 equal v_F56+v_B[21]
thermo ${nthermo}
thermo 1500
thermo_style custom step temp pe press density f_avt f_avp f_avpe v_F11 v_F22 v_F33 v_F44 v_F55 v_F66 v_F12 v_F13 v_F23 v_B[*8] v_B[12]
thermo_modify norm no
run ${nrun}
run 150000
Per MPI rank memory allocation (min/avg/max) = 3.808 | 3.808 | 3.809 Mbytes
Step Temp PotEng Press Density f_avt f_avp f_avpe v_F11 v_F22 v_F33 v_F44 v_F55 v_F66 v_F12 v_F13 v_F23 v_B[1] v_B[2] v_B[3] v_B[4] v_B[5] v_B[6] v_B[7] v_B[8] v_B[12]
0 1496.4515 -1030.8279 1702.5821 2.2938491 0 0 0 -0 -0 -0 -0 -0 -0 -0 -0 -0 0 0 0 0 0 0 0 0 0
1500 1488.0457 -1029.7336 235.49231 2.2938491 1491.6476 -209.95869 -4.1259067 -63.72574 -52.347237 -72.863469 -20.2529 -21.202225 -36.80768 15.820914 36.256996 27.837899 205.06161 205.28482 228.74061 53.516205 53.666764 76.479575 51.898427 28.841484 28.947835
3000 1375.6945 -1032.3272 -1432.388 2.2938491 1483.7188 -14.944433 -4.1309886 -67.857182 -50.461537 -79.041956 -20.359329 -18.394118 -30.634049 16.973116 39.991949 29.200709 205.96072 205.57169 228.76797 53.760188 53.974806 76.829718 51.809223 28.715153 28.726595
4500 1526.5784 -1034.4597 1558.1337 2.2938491 1482.7867 -70.886348 -4.1310256 -67.022382 -54.684704 -77.069485 -22.576461 -17.672784 -32.228898 21.458044 38.393569 27.72595 204.72251 205.88009 229.07903 53.899658 53.829006 76.717342 51.727843 28.636004 28.863718
6000 1491.1951 -1030.0995 562.54917 2.2938491 1482.4806 -60.021349 -4.1307545 -66.909586 -58.886858 -80.148099 -22.601629 -19.09635 -33.473899 22.377747 38.855891 30.853996 204.70732 205.70649 229.01661 53.84119 53.800462 76.711553 51.690081 28.694904 28.797116
7500 1330.8214 -1035.6828 -1407.4142 2.2938491 1480.7544 -63.898974 -4.1310393 -62.886575 -58.471219 -80.882593 -20.651266 -18.941729 -34.494541 18.287621 38.644547 32.466665 204.67832 205.92138 228.89129 53.887237 53.779706 76.803588 51.754653 28.661714 28.868533
9000 1377.3139 -1030.6102 -814.50808 2.2938491 1480.0394 -57.969892 -4.1308955 -62.399927 -57.505746 -80.761377 -20.199819 -21.000829 -36.738929 17.319159 39.700869 31.315234 204.64296 206.17515 228.48224 53.911268 53.704831 76.8708 51.796155 28.641886 28.861077
10500 1419.4538 -1032.4784 -554.39941 2.2938491 1481.1811 -7.9992199 -4.1309985 -59.045791 -61.164487 -82.861664 -19.890936 -21.168588 -35.873778 16.458244 37.100379 35.570692 204.9188 205.93531 228.57289 53.947197 53.739418 76.918077 51.784088 28.653206 28.87283
12000 1442.3335 -1030.2902 -131.99922 2.2938491 1482.4991 25.724832 -4.1307257 -58.119089 -60.519191 -82.155615 -20.069823 -21.727839 -36.795312 16.944019 35.542297 35.788632 205.06536 205.89715 228.49105 53.949154 53.764738 76.945863 51.812548 28.698335 28.903557
13500 1618.255 -1034.0691 448.39746 2.2938491 1482.9429 33.42958 -4.1306128 -59.840288 -61.599932 -82.215965 -20.598551 -21.492035 -36.443374 17.607876 36.241716 35.998172 205.07866 205.84943 228.61637 53.944979 53.774191 76.903895 51.792701 28.74114 28.89238
15000 1364.3796 -1029.6878 -966.13025 2.2938491 1483.2726 65.784103 -4.1306007 -58.826126 -60.177687 -80.570212 -20.026628 -22.061421 -37.332987 16.618347 35.824117 34.991167 205.15731 205.79483 228.63407 53.929721 53.813353 76.896163 51.776923 28.752029 28.878669
16500 1669.1757 -1031.0699 43.341777 2.2938491 1483.2491 18.99268 -4.1304591 -59.962016 -59.15211 -80.102432 -20.399129 -22.025441 -37.82746 17.082159 36.290705 33.775651 205.14266 205.7193 228.63038 53.925355 53.785453 76.855119 51.737872 28.759369 28.898142
18000 1550.5382 -1027.3945 -1246.0289 2.2938491 1483.6491 5.7408759 -4.1303353 -59.35016 -58.728701 -78.818663 -20.150701 -21.942883 -37.891844 17.203814 35.337637 33.285126 205.13384 205.6063 228.57531 53.891378 53.769275 76.832714 51.74568 28.791121 28.877624
19500 1629.5036 -1036.9849 -451.26178 2.2938491 1484.1226 27.288331 -4.1304459 -58.665989 -60.109261 -78.714857 -20.404554 -21.983442 -37.992827 17.117122 34.608111 34.643094 205.23998 205.53366 228.59186 53.890849 53.787956 76.856299 51.736162 28.786354 28.85888
21000 1472.5544 -1032.859 -20.186692 2.2938491 1483.3486 19.365496 -4.130639 -59.030496 -61.687931 -79.499878 -21.045487 -21.978669 -37.750071 17.282482 34.752705 35.830146 205.166 205.4977 228.68839 53.897034 53.798516 76.833481 51.716388 28.777538 28.853221
22500 1538.3331 -1029.4222 -1516.1779 2.2938491 1483.9369 9.3663668 -4.1304658 -59.601342 -61.528294 -79.886775 -21.058116 -21.744815 -37.415441 17.458006 35.03524 35.490302 205.15957 205.3737 228.66857 53.875938 53.82329 76.813455 51.710539 28.807394 28.846491
24000 1640.6306 -1032.8747 1820.5076 2.2938491 1484.3582 -2.9605818 -4.1303985 -60.752912 -62.308755 -80.507722 -21.295171 -21.728498 -37.85529 17.636088 35.38702 36.141494 205.19032 205.28915 228.69633 53.859405 53.858117 76.802512 51.728172 28.822365 28.83436
25500 1432.5405 -1036.4177 165.16737 2.2938491 1483.2229 8.3729002 -4.1307362 -60.653401 -61.891943 -80.020623 -21.215377 -21.694568 -37.770769 17.468376 35.128883 36.013452 205.2687 205.29914 228.65445 53.868129 53.866433 76.831986 51.734064 28.809762 28.823143
27000 1459.7165 -1032.2704 555.49626 2.2938491 1483.5999 29.734336 -4.1307773 -60.348436 -62.451484 -79.397912 -21.536942 -21.312644 -37.473352 18.07619 34.322981 36.063688 205.28479 205.36871 228.6014 53.882785 53.860318 76.843783 51.736186 28.791218 28.824958
28500 1398.7866 -1032.325 -228.86327 2.2938491 1482.9241 10.135953 -4.1308163 -60.923204 -62.1935 -80.289996 -21.326799 -21.465421 -37.781979 17.525986 35.112803 36.122375 205.33196 205.38849 228.51467 53.877397 53.85885 76.855869 51.748421 28.791318 28.810646
30000 1609.4626 -1026.1198 2151.4352 2.2938491 1482.737 -6.9747499 -4.130764 -62.14162 -62.578377 -79.864982 -21.683154 -21.501264 -37.647952 18.064145 35.592848 35.670682 205.30816 205.42759 228.45924 53.874997 53.845931 76.855299 51.757648 28.798886 28.822951
31500 1535.1988 -1030.7627 1962.4562 2.2938491 1482.9354 -2.7241836 -4.1306143 -61.870375 -62.851578 -80.524128 -21.560593 -21.908782 -38.604429 18.110966 35.564598 36.054336 205.32395 205.40536 228.48839 53.874999 53.854825 76.856925 51.764937 28.810228 28.831593
33000 1570.1208 -1026.2494 351.76291 2.2938491 1482.996 -7.4807931 -4.130577 -62.238722 -63.288756 -80.80606 -21.615247 -21.67204 -38.37626 18.053097 35.862534 36.372658 205.33168 205.41606 228.43691 53.871561 53.849411 76.854679 51.770903 28.813329 28.832923
34500 1432.3272 -1031.7548 419.21972 2.2938491 1482.7892 -28.425324 -4.1304667 -61.926882 -63.333125 -80.201249 -21.557493 -21.477997 -38.188053 17.990156 35.484765 36.40502 205.32852 205.36594 228.42193 53.858032 53.85339 76.845155 51.776258 28.810311 28.83193
36000 1461.1221 -1031.0936 -732.09091 2.2938491 1482.7576 -17.70291 -4.1306165 -62.179266 -62.986391 -81.351014 -21.399698 -21.423609 -38.39933 17.389924 36.483096 36.528136 205.36025 205.37113 228.45226 53.869219 53.85851 76.853637 51.780873 28.812037 28.835983
37500 1504.8525 -1035.0799 1917.6077 2.2938491 1482.2878 -23.877209 -4.1306315 -62.332808 -63.43488 -81.773513 -21.40584 -21.375369 -38.287661 17.372388 36.472678 37.074729 205.36817 205.37669 228.40654 53.854172 53.855291 76.849674 51.775051 28.80071 28.818624
39000 1467.8385 -1033.4844 685.3059 2.2938491 1481.8721 -31.824125 -4.1307881 -63.029639 -63.482571 -82.632663 -21.710699 -21.140028 -38.056647 17.507416 37.185033 37.136598 205.33141 205.38158 228.41356 53.864319 53.853944 76.842991 51.764685 28.788943 28.816327
40500 1471.3714 -1035.0313 -661.11589 2.2938491 1482.1911 -28.660441 -4.1307331 -63.073554 -63.301254 -81.939449 -21.849646 -21.333366 -38.459438 17.701055 36.929221 36.777905 205.3174 205.38828 228.42064 53.864766 53.857226 76.830391 51.764266 28.789323 28.813992
42000 1524.1294 -1035.634 2140.1687 2.2938491 1481.9241 -26.308067 -4.1307414 -63.243189 -62.730676 -81.627378 -21.801779 -21.351359 -38.561895 17.541375 37.122985 36.480135 205.34025 205.40651 228.42086 53.866239 53.864292 76.836071 51.765489 28.788169 28.810743
43500 1432.3705 -1034.551 526.49996 2.2938491 1482.1016 -20.246935 -4.1307637 -62.7724 -62.037498 -80.906378 -21.565193 -21.248644 -38.30893 17.35505 36.763529 35.974546 205.35875 205.40419 228.41899 53.869164 53.863535 76.833317 51.761902 28.785203 28.815597
45000 1490.388 -1032.0658 956.44619 2.2938491 1482.0953 -16.260449 -4.1307284 -62.718709 -61.819139 -80.292247 -21.55464 -21.249523 -38.355562 17.650135 36.482629 35.521216 205.36793 205.41743 228.39993 53.868999 53.866369 76.841723 51.766771 28.793869 28.808214
46500 1356.2575 -1032.0811 -502.03492 2.2938491 1482.1181 -12.636107 -4.13075 -62.68624 -61.442684 -80.301091 -21.478828 -21.171205 -38.25252 17.41833 36.696398 35.405695 205.36772 205.38631 228.3701 53.859688 53.869887 76.850495 51.770439 28.794225 28.795947
48000 1462.4861 -1032.4019 657.08276 2.2938491 1482.05 -21.340898 -4.1306466 -62.635163 -61.415766 -79.917249 -21.386814 -21.256478 -38.35836 17.260015 36.61439 35.397473 205.30205 205.37133 228.40523 53.861273 53.865346 76.83163 51.771796 28.797153 28.801011
49500 1403.792 -1033.3865 -106.37364 2.2938491 1481.9419 -13.709551 -4.1307951 -62.875109 -61.637029 -79.597373 -21.505971 -21.141812 -38.230756 17.55599 36.546467 35.220436 205.29491 205.41266 228.39157 53.866215 53.872264 76.830304 51.758539 28.787714 28.79857
51000 1438.1787 -1032.0109 -1059.9064 2.2938491 1481.6449 -15.09976 -4.1309897 -62.670557 -61.561705 -79.379648 -21.567968 -21.055659 -38.015182 17.671904 36.332941 35.014233 205.32924 205.40088 228.39835 53.868539 53.885315 76.822335 51.745659 28.789851 28.792545
52500 1382.2099 -1033.058 -1259.1214 2.2938491 1481.5946 -20.300497 -4.13093 -63.232758 -62.310412 -79.804684 -21.802267 -21.260561 -38.419579 18.056561 36.720771 34.972269 205.34284 205.35156 228.41342 53.864857 53.891003 76.81602 51.732483 28.791137 28.791887
54000 1533.7764 -1028.7613 1714.1927 2.2938491 1481.7208 -28.620488 -4.1308301 -63.113526 -61.903055 -79.382866 -21.730147 -21.21458 -38.316562 18.001225 36.474036 34.681959 205.34377 205.31381 228.39872 53.84474 53.889496 76.812664 51.743856 28.802121 28.781409
55500 1523.4727 -1033.3641 -612.71038 2.2938491 1481.8812 -36.263593 -4.1307128 -63.926005 -61.676301 -79.572696 -21.935651 -21.124984 -38.120805 18.30654 36.789152 34.374772 205.31795 205.35529 228.36668 53.847443 53.882195 76.806901 51.74734 28.814592 28.796537
57000 1491.3678 -1026.9983 -1119.4609 2.2938491 1481.9455 -36.326068 -4.1306892 -63.595683 -61.564985 -79.974258 -21.822985 -21.136666 -38.16275 18.083171 36.766293 34.707154 205.29618 205.33458 228.38626 53.852279 53.878924 76.797511 51.735536 28.815462 28.802463
58500 1438.7756 -1027.9678 -1657.13 2.2938491 1481.9051 -46.49998 -4.1306702 -63.970101 -61.372119 -79.511332 -21.995264 -21.032781 -38.038112 18.401226 36.639522 34.227378 205.29966 205.32376 228.38361 53.852024 53.875838 76.788068 51.734772 28.81576 28.803892
60000 1325.4993 -1034.1913 -2362.9866 2.2938491 1481.5012 -44.903145 -4.1307851 -63.963407 -61.431254 -79.683191 -22.024759 -21.138562 -38.223052 18.153279 36.826694 34.405325 205.27702 205.36875 228.40644 53.856994 53.875391 76.799152 51.731492 28.811173 28.797945
61500 1505.9305 -1036.2556 132.06247 2.2938491 1481.6293 -37.731588 -4.1308223 -64.381464 -61.674639 -80.188334 -22.158723 -21.108889 -38.248855 18.390358 37.059536 34.455424 205.23517 205.35912 228.41484 53.864166 53.876015 76.794352 51.722323 28.804043 28.801179
63000 1534.39 -1039.4484 1046.653 2.2938491 1481.7949 -33.380601 -4.1308464 -64.068931 -61.368649 -79.704263 -22.130922 -21.067286 -38.215994 18.495768 36.761782 34.189797 205.22412 205.35391 228.43945 53.869115 53.87449 76.793337 51.712686 28.794684 28.800456
64500 1361.7518 -1030.5694 790.72852 2.2938491 1481.8251 -28.691877 -4.1308571 -64.06363 -61.273278 -79.676705 -22.16565 -21.02496 -38.172259 18.638855 36.719131 34.006715 205.20559 205.35747 228.42261 53.874341 53.871631 76.797534 51.715519 28.789202 28.800286
66000 1493.9592 -1034.8315 -83.381519 2.2938491 1481.8804 -28.444673 -4.130839 -63.871998 -60.922315 -79.543208 -22.084939 -21.051796 -38.178075 18.469097 36.653501 33.983218 205.17353 205.37012 228.4333 53.873209 53.87128 76.793735 51.715772 28.787185 28.799271
67500 1421.276 -1033.8109 -435.15037 2.2938491 1482.0268 -15.717566 -4.1308595 -63.961701 -61.265171 -79.32614 -22.181352 -20.923325 -37.927752 18.58702 36.575619 34.041641 205.20462 205.4057 228.41483 53.873248 53.867409 76.806453 51.725025 28.781635 28.790933
69000 1462.71 -1031.786 2044.924 2.2938491 1482.0808 -12.41913 -4.1308487 -63.537939 -61.572781 -79.813735 -22.037844 -20.940539 -37.978104 18.246032 36.52598 34.631512 205.21991 205.43641 228.3772 53.872474 53.864337 76.817521 51.736948 28.777643 28.790877
70500 1460.7684 -1032.5687 -950.70337 2.2938491 1482.2232 -6.1090924 -4.1308194 -62.959394 -61.457796 -79.687401 -21.885475 -20.919469 -37.921646 18.034683 36.313758 34.737829 205.22464 205.41986 228.36249 53.872577 53.869324 76.818318 51.735068 28.780852 28.790481
72000 1421.4484 -1031.353 1648.2423 2.2938491 1482.362 -8.171728 -4.1308339 -62.919483 -61.526828 -79.571975 -21.913281 -20.822948 -37.684888 18.014821 36.170823 34.809531 205.23354 205.40265 228.37137 53.876829 53.868192 76.821146 51.735902 28.781575 28.799457
73500 1752.498 -1034.2169 1469.9503 2.2938491 1482.5906 -3.8737403 -4.130845 -62.630533 -61.309844 -79.729568 -21.758626 -20.825548 -37.860657 17.748076 36.259904 34.845837 205.22997 205.41547 228.3844 53.883713 53.868296 76.824464 51.735899 28.783023 28.803298
75000 1520.6212 -1036.5004 837.2324 2.2938491 1482.4238 -0.1913038 -4.1308831 -62.821147 -61.828489 -79.567323 -21.889326 -20.789721 -37.714104 17.879632 36.22222 34.919953 205.2442 205.41386 228.37542 53.88291 53.867274 76.830786 51.73158 28.778935 28.794923
76500 1439.6706 -1034.3536 3.867216 2.2938491 1482.3799 2.9201733 -4.1309078 -63.110409 -61.628579 -79.646303 -21.943803 -20.784043 -37.709136 18.090962 36.339502 34.640705 205.22882 205.4377 228.37991 53.889722 53.867867 76.832127 51.730291 28.776106 28.800613
78000 1472.2878 -1032.0488 606.92009 2.2938491 1482.4315 4.0162921 -4.1308864 -63.18742 -61.476216 -79.518345 -21.915006 -20.795344 -37.685095 18.160875 36.317768 34.562962 205.21304 205.4681 228.35132 53.888419 53.860959 76.832795 51.726368 28.769804 28.803835
79500 1512.5998 -1031.4782 -608.33112 2.2938491 1482.4683 -4.9946179 -4.1308672 -63.136709 -61.38976 -79.342774 -21.877029 -20.790716 -37.765995 18.082202 36.307384 34.529887 205.20173 205.45621 228.33612 53.884127 53.85096 76.827797 51.725854 28.764443 28.800151
81000 1517.4109 -1028.3826 -2043.4874 2.2938491 1482.2404 -19.291403 -4.130792 -62.826972 -61.57491 -78.919307 -21.815485 -20.773717 -37.72361 18.034102 35.870919 34.590596 205.18765 205.42705 228.3524 53.878666 53.848387 76.814541 51.723458 28.771787 28.801959
82500 1495.0416 -1034.9971 -919.28281 2.2938491 1482.5918 -7.0685741 -4.1308239 -62.741622 -61.394991 -78.779816 -21.795693 -20.713253 -37.628978 18.028438 35.854382 34.286915 205.18358 205.42059 228.39152 53.88507 53.855289 76.812978 51.718793 28.771939 28.803997
84000 1491.0232 -1032.0478 1693.2093 2.2938491 1482.6179 -13.503477 -4.1306843 -62.623399 -61.545116 -78.875891 -21.831602 -20.760705 -37.783204 18.049826 35.698982 34.461373 205.18823 205.41432 228.37952 53.880292 53.848427 76.812319 51.723745 28.776002 28.809842
85500 1432.7633 -1032.698 -881.37505 2.2938491 1482.5743 -10.555756 -4.1306695 -62.232152 -61.412377 -78.830213 -21.727847 -20.801103 -37.812275 17.923531 35.499394 34.546639 205.19889 205.41789 228.36824 53.880011 53.849407 76.819282 51.727384 28.780783 28.812392
87000 1485.3288 -1032.6691 158.89155 2.2938491 1482.5535 -6.3950299 -4.1307187 -62.169286 -61.063223 -78.970108 -21.61197 -20.763121 -37.82023 17.757088 35.636063 34.438868 205.1894 205.43526 228.38369 53.883498 53.850233 76.819949 51.726626 28.776566 28.814967
88500 1504.1685 -1034.896 -576.81489 2.2938491 1482.5577 -4.2302198 -4.1307273 -62.060242 -60.91541 -79.120582 -21.5292 -20.789763 -37.890171 17.627385 35.769308 34.444455 205.17713 205.41733 228.41274 53.884038 53.851418 76.815226 51.720575 28.778578 28.81437
90000 1449.8972 -1033.1249 16.828339 2.2938491 1482.5956 -3.7681039 -4.1306958 -62.088756 -60.725318 -79.170616 -21.492856 -20.734831 -37.741223 17.584396 35.868249 34.318289 205.18548 205.4084 228.40148 53.880047 53.853611 76.816207 51.723692 28.779781 28.809322
91500 1416.2681 -1033.1616 -16.270943 2.2938491 1482.4743 -10.282897 -4.1306355 -62.133545 -60.706158 -79.069992 -21.526357 -20.751961 -37.744268 17.678691 35.77502 34.270056 205.20409 205.40965 228.38688 53.875395 53.853283 76.818389 51.731399 28.784679 28.812085
93000 1641.0262 -1032.9652 1541.4778 2.2938491 1482.7239 -0.21530915 -4.1306987 -62.103472 -60.524542 -78.94244 -21.416169 -20.762777 -37.724968 17.503079 35.79639 34.254575 205.21819 205.4208 228.38518 53.874775 53.859201 76.82538 51.73286 28.787014 28.806284
94500 1446.894 -1033.0546 -1172.8149 2.2938491 1482.6464 3.4467336 -4.1307822 -62.347354 -60.242764 -79.472893 -21.34953 -20.717759 -37.687715 17.289476 36.186844 34.277361 205.23165 205.43019 228.39821 53.884069 53.865596 76.827934 51.732077 28.786882 28.805655
96000 1542.079 -1029.6926 322.45446 2.2938491 1482.5441 4.6485293 -4.1308136 -62.206988 -59.973518 -79.080994 -21.288972 -20.760823 -37.729071 17.259751 36.128248 33.998066 205.24388 205.42381 228.41608 53.886007 53.867776 76.82741 51.731615 28.791259 28.805397
97500 1487.9454 -1034.7172 820.51649 2.2938491 1482.5632 8.5386652 -4.1308234 -62.143296 -60.101635 -78.931963 -21.290736 -20.716267 -37.692871 17.462016 36.002029 33.918161 205.26305 205.43429 228.40827 53.888433 53.870451 76.826913 51.728767 28.791481 28.804241
99000 1368.2594 -1031.2037 593.35668 2.2938491 1482.6064 5.0925632 -4.1307682 -61.963501 -60.016279 -78.857674 -21.245113 -20.75973 -37.759628 17.293147 36.020666 33.897023 205.26324 205.41903 228.40538 53.882522 53.868615 76.826529 51.734223 28.797165 28.804278
100500 1442.5153 -1033.8773 -538.06378 2.2938491 1482.5806 8.0051295 -4.1307853 -61.807415 -59.816464 -78.885211 -21.182274 -20.821701 -37.887086 17.136467 36.03321 33.886956 205.29244 205.41979 228.40702 53.882321 53.875874 76.834725 51.739661 28.801012 28.804575
102000 1523.8256 -1030.5549 1412.4566 2.2938491 1482.5866 4.0411856 -4.1307569 -61.444398 -59.781654 -78.484191 -21.18101 -20.822776 -37.865635 17.152952 35.720218 33.798513 205.2959 205.39482 228.41979 53.878609 53.877207 76.830098 51.741804 28.807055 28.805499
103500 1577.9333 -1030.2793 16.968578 2.2938491 1482.4554 1.2961629 -4.1307672 -61.397825 -59.829587 -78.4479 -21.161504 -20.867524 -37.888147 17.149447 35.662363 33.851317 205.28757 205.3981 228.43413 53.882435 53.873014 76.827589 51.735462 28.805202 28.810239
105000 1337.0075 -1031.8541 -2721.9544 2.2938491 1482.4268 -4.353932 -4.1307412 -61.705223 -59.747259 -78.609622 -21.165441 -20.851207 -37.876114 17.14923 35.951734 33.665587 205.27089 205.39074 228.43789 53.879034 53.870275 76.822978 51.73248 28.802281 28.81082
106500 1422.8946 -1030.8343 -800.38058 2.2938491 1482.5115 -4.0049886 -4.1307542 -61.643384 -59.644844 -78.475169 -21.104781 -20.828498 -37.805234 16.983794 35.924403 33.682427 205.27511 205.39208 228.44888 53.881421 53.873402 76.821913 51.730452 28.801513 28.816076
108000 1576.0145 -1032.7976 973.46949 2.2938491 1482.6158 3.0627527 -4.1307693 -61.632096 -59.704639 -78.39173 -21.106554 -20.866293 -37.84322 16.999887 35.7367 33.736853 205.27847 205.39567 228.46373 53.883841 53.8794 76.823598 51.724192 28.797812 28.814282
109500 1469.798 -1035.4088 -1513.3569 2.2938491 1482.5815 -2.3554776 -4.1307587 -61.409226 -59.368417 -78.056976 -20.987396 -20.922787 -37.905832 16.80989 35.603164 33.571735 205.29739 205.39186 228.45528 53.881647 53.883201 76.826509 51.727265 28.803221 28.816387
111000 1450.1364 -1034.8692 535.01425 2.2938491 1482.5086 -4.9493018 -4.1307925 -61.853187 -59.298301 -78.058449 -21.0476 -20.870886 -37.809302 16.931849 35.815648 33.395258 205.30581 205.38706 228.47139 53.885853 53.883453 76.822939 51.72578 28.798242 28.817665
112500 1449.2612 -1032.1626 -707.9713 2.2938491 1482.6231 -5.6051571 -4.1307318 -61.617376 -59.400658 -77.86748 -21.058008 -20.900491 -37.885275 16.941367 35.595081 33.457412 205.31006 205.37483 228.46421 53.884923 53.884787 76.818386 51.725453 28.799728 28.818511
114000 1472.8275 -1037.0664 -442.38894 2.2938491 1482.8034 -1.1760851 -4.13075 -61.604652 -59.42193 -77.729625 -21.108945 -20.839988 -37.816934 17.027186 35.528809 33.333712 205.2996 205.40083 228.47441 53.889449 53.885434 76.822691 51.72532 28.799205 28.817456
115500 1412.2073 -1033.3813 -859.54093 2.2938491 1482.7115 -6.3971107 -4.1307164 -61.582698 -59.540524 -77.958489 -21.065292 -20.841779 -37.81416 17.014851 35.663213 33.266402 205.30868 205.39757 228.44955 53.887583 53.882631 76.821441 51.730925 28.798319 28.820824
117000 1460.2307 -1028.9074 -1164.6613 2.2938491 1482.657 -7.8697826 -4.1307244 -61.82235 -59.692597 -77.850871 -21.124418 -20.764516 -37.690786 17.155656 35.649724 33.269516 205.30451 205.41455 228.45187 53.893125 53.885988 76.81911 51.730761 28.798798 28.824658
118500 1493.0731 -1028.7066 -260.29362 2.2938491 1482.7469 -1.8511441 -4.1307413 -61.826554 -59.86035 -77.828964 -21.126638 -20.753378 -37.660607 17.198524 35.664955 33.285591 205.31841 205.42978 228.43324 53.895373 53.888281 76.82351 51.731769 28.799645 28.824431
120000 1345.6123 -1029.9346 -1895.5256 2.2938491 1482.7843 -4.5972195 -4.1307269 -61.669058 -59.838425 -77.745234 -21.161305 -20.848334 -37.830906 17.174454 35.604439 33.297851 205.32668 205.43762 228.42017 53.889381 53.883438 76.823854 51.733939 28.794303 28.822327
121500 1407.0748 -1031.8136 426.75808 2.2938491 1482.8284 -1.6468876 -4.1307603 -61.64701 -59.903233 -77.693914 -21.163628 -20.835781 -37.828167 17.171387 35.563809 33.348664 205.34563 205.44066 228.4023 53.88813 53.886137 76.827345 51.735371 28.794168 28.819736
123000 1526.2861 -1032.537 852.79109 2.2938491 1482.9332 5.0560365 -4.1307796 -61.724187 -59.904131 -77.473899 -21.179869 -20.815648 -37.857571 17.267887 35.516275 33.238968 205.36759 205.43856 228.38631 53.885394 53.886842 76.832314 51.732243 28.791888 28.813868
124500 1529.8037 -1031.1582 -92.453284 2.2938491 1483.0597 8.0257434 -4.130767 -61.73912 -59.872674 -77.532647 -21.149928 -20.801849 -37.741413 17.188 35.59366 33.235229 205.37362 205.43069 228.39692 53.88626 53.886586 76.834567 51.73587 28.793201 28.81626
126000 1496.3891 -1033.1452 -367.03965 2.2938491 1483.0771 4.6045133 -4.1307269 -61.729431 -59.954414 -77.338248 -21.179207 -20.784619 -37.762061 17.353033 35.439541 33.189469 205.36796 205.44072 228.37772 53.885265 53.881811 76.830859 51.738138 28.792247 28.818739
127500 1466.1306 -1030.612 -926.29759 2.2938491 1483.133 11.366773 -4.1307722 -61.602447 -59.920526 -77.282372 -21.159672 -20.75159 -37.719968 17.307656 35.296921 33.236486 205.37779 205.44691 228.38745 53.887086 53.885763 76.836326 51.737488 28.792599 28.815257
129000 1569.3651 -1032.9186 -442.35004 2.2938491 1483.1369 10.328658 -4.1307387 -61.543466 -59.942662 -77.483904 -21.119911 -20.722378 -37.671723 17.281249 35.232627 33.459675 205.36599 205.43931 228.40108 53.884216 53.882413 76.831442 51.737409 28.790919 28.811477
130500 1421.911 -1031.8139 -758.70123 2.2938491 1483.0449 11.4085 -4.1307613 -61.333773 -59.934246 -77.426746 -21.113826 -20.713965 -37.674443 17.157344 35.141168 33.569733 205.36146 205.44547 228.4022 53.886232 53.879268 76.832738 51.73627 28.786769 28.811493
132000 1524.2191 -1037.407 -480.85722 2.2938491 1482.8528 8.9287162 -4.1308006 -61.561432 -60.092757 -77.742507 -21.167795 -20.674863 -37.639706 17.29371 35.275171 33.678108 205.36428 205.45116 228.4058 53.889052 53.879475 76.834536 51.73562 28.786514 28.811264
133500 1494.6866 -1034.7465 416.3259 2.2938491 1482.8997 8.7918538 -4.1307995 -61.539391 -60.210309 -78.095947 -21.12506 -20.675829 -37.641619 17.068859 35.348266 34.049804 205.37443 205.45053 228.39031 53.888328 53.87864 76.837876 51.741192 28.786138 28.811558
135000 1569.7047 -1036.5833 1648.5811 2.2938491 1482.8373 16.413757 -4.1308862 -61.379715 -60.19875 -77.885213 -21.077149 -20.659689 -37.571815 17.039133 35.160383 34.027006 205.38045 205.47385 228.40044 53.89379 53.883916 76.84446 51.74077 28.782168 28.811503
136500 1434.076 -1032.3999 1440.6873 2.2938491 1482.8065 20.877471 -4.130942 -61.250129 -60.36518 -77.797762 -21.173422 -20.644652 -37.555746 17.168354 34.98673 34.050232 205.39567 205.46987 228.41208 53.893145 53.888561 76.850201 51.742217 28.782951 28.809364
138000 1435.6229 -1027.2932 -1994.0334 2.2938491 1482.9676 28.338068 -4.1309771 -61.286555 -60.502324 -77.929763 -21.144817 -20.627874 -37.5188 16.99209 35.098588 34.233379 205.38967 205.48076 228.41949 53.897481 53.889052 76.852273 51.743864 28.782553 28.811336
139500 1351.2102 -1032.4433 -239.90235 2.2938491 1482.9605 27.292315 -4.1309341 -61.209087 -60.465858 -77.765563 -21.106356 -20.671478 -37.691344 16.943971 35.047976 34.174565 205.38424 205.48042 228.42161 53.896767 53.885832 76.847548 51.746591 28.779555 28.812114
141000 1467.5087 -1031.9354 -532.99883 2.2938491 1482.8932 24.307649 -4.1309051 -61.070518 -60.441795 -77.624715 -21.086802 -20.640868 -37.683803 17.017529 34.883575 34.096205 205.37075 205.48554 228.42021 53.896931 53.882672 76.844472 51.745488 28.777347 28.815227
142500 1426.8036 -1029.0269 475.29365 2.2938491 1482.9486 28.873848 -4.1309222 -61.253743 -60.394307 -77.623948 -21.117683 -20.666512 -37.724806 17.009433 34.985626 34.037536 205.38057 205.50055 228.40554 53.898614 53.880885 76.846518 51.744358 28.772507 28.8159
144000 1442.207 -1031.8281 666.41114 2.2938491 1482.9324 27.849865 -4.1309475 -61.168217 -60.212673 -77.584118 -21.079119 -20.692903 -37.826824 16.878262 35.048543 34.002324 205.37899 205.51754 228.39212 53.90079 53.88167 76.847699 51.746645 28.771418 28.817434
145500 1513.7861 -1032.8894 103.68291 2.2938491 1483.1433 26.889484 -4.1309369 -61.076852 -60.104649 -77.709917 -21.033322 -20.670939 -37.779427 16.717574 35.122343 34.057639 205.3625 205.52972 228.37916 53.90269 53.879604 76.847902 51.74393 28.76916 28.820449
147000 1403.8295 -1038.4747 125.48856 2.2938491 1483.0944 25.436764 -4.1309291 -61.058221 -60.015165 -77.827606 -21.025708 -20.75728 -37.905513 16.756237 35.091941 34.043829 205.36839 205.52553 228.38543 53.902592 53.879578 76.848283 51.744624 28.771608 28.822339
148500 1570.4334 -1030.4725 1176.9001 2.2938491 1482.9036 26.018243 -4.1309919 -60.988967 -59.970975 -77.596029 -21.062881 -20.789165 -38.050798 16.784906 34.917316 34.005084 205.36511 205.5204 228.39472 53.905268 53.883557 76.849572 51.742284 28.771597 28.820426
150000 1637.0679 -1032.2165 1094.5581 2.2938491 1482.9569 27.608241 -4.1310012 -61.014673 -59.868323 -77.559954 -21.028486 -20.762668 -37.995752 16.75055 34.948738 33.9703 205.36993 205.53181 228.3843 53.905331 53.882296 76.852069 51.742975 28.773161 28.820754
Loop time of 23.1063 on 4 procs for 150000 steps with 250 atoms
Performance: 429.638 ns/day, 0.056 hours/ns, 6491.724 timesteps/s
99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 13.514 | 15.049 | 16.345 | 27.6 | 65.13
Neigh | 0.22265 | 0.23987 | 0.26064 | 2.8 | 1.04
Comm | 2.4163 | 3.7264 | 5.2764 | 56.0 | 16.13
Output | 0.0032872 | 0.0035512 | 0.0043178 | 0.7 | 0.02
Modify | 3.7671 | 3.7877 | 3.8007 | 0.7 | 16.39
Other | | 0.2998 | | | 1.30
Nlocal: 62.5 ave 88 max 40 min
Histogram: 1 0 0 0 2 0 0 0 0 1
Nghost: 432.75 ave 543 max 326 min
Histogram: 1 0 0 0 1 1 0 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 1650.5 ave 2334 max 1048 min
Histogram: 1 0 0 0 2 0 0 0 0 1
Total # of neighbors = 6602
Ave neighs/atom = 26.408
Neighbor list builds = 2667
Dangerous builds = 0
# Output final values
include final_output.in
# Average moduli for cubic crystals
variable C11cubic equal (${C11}+${C22}+${C33})/3.0
variable C11cubic equal (148.370873646034+${C22}+${C33})/3.0
variable C11cubic equal (148.370873646034+149.679104177467+${C33})/3.0
variable C11cubic equal (148.370873646034+149.679104177467+154.839963498785)/3.0
variable C12cubic equal (${C12}+${C13}+${C23})/3.0
variable C12cubic equal (68.4935246016777+${C13}+${C23})/3.0
variable C12cubic equal (68.4935246016777+63.7218992685599+${C23})/3.0
variable C12cubic equal (68.4935246016777+63.7218992685599+62.7910539636263)/3.0
variable C44cubic equal (${C44}+${C55}+${C66})/3.0
variable C44cubic equal (34.8846541689484+${C55}+${C66})/3.0
variable C44cubic equal (34.8846541689484+35.1274361331555+${C66})/3.0
variable C44cubic equal (34.8846541689484+35.1274361331555+40.8641262264389)/3.0
variable bulkmodulus equal (${C11cubic}+2*${C12cubic})/3.0
variable bulkmodulus equal (150.963313774095+2*${C12cubic})/3.0
variable bulkmodulus equal (150.963313774095+2*65.0021592779546)/3.0
variable shearmodulus1 equal ${C44cubic}
variable shearmodulus1 equal 36.9587388428476
variable shearmodulus2 equal (${C11cubic}-${C12cubic})/2.0
variable shearmodulus2 equal (150.963313774095-${C12cubic})/2.0
variable shearmodulus2 equal (150.963313774095-65.0021592779546)/2.0
variable poissonratio equal 1.0/(1.0+${C11cubic}/${C12cubic})
variable poissonratio equal 1.0/(1.0+150.963313774095/${C12cubic})
variable poissonratio equal 1.0/(1.0+150.963313774095/65.0021592779546)
# For Stillinger-Weber silicon, the analytical results
# are known to be (E. R. Cowley, 1988):
# C11 = 151.4 GPa
# C12 = 76.4 GPa
# C44 = 56.4 GPa
#print "========================================="
#print "Components of the Elastic Constant Tensor"
#print "========================================="
print "Elastic Constant C11 = ${C11} ${cunits}"
Elastic Constant C11 = 148.370873646034 GPa
print "Elastic Constant C22 = ${C22} ${cunits}"
Elastic Constant C22 = 149.679104177467 GPa
print "Elastic Constant C33 = ${C33} ${cunits}"
Elastic Constant C33 = 154.839963498785 GPa
print "Elastic Constant C12 = ${C12} ${cunits}"
Elastic Constant C12 = 68.4935246016777 GPa
print "Elastic Constant C13 = ${C13} ${cunits}"
Elastic Constant C13 = 63.7218992685599 GPa
print "Elastic Constant C23 = ${C23} ${cunits}"
Elastic Constant C23 = 62.7910539636263 GPa
print "Elastic Constant C44 = ${C44} ${cunits}"
Elastic Constant C44 = 34.8846541689484 GPa
print "Elastic Constant C55 = ${C55} ${cunits}"
Elastic Constant C55 = 35.1274361331555 GPa
print "Elastic Constant C66 = ${C66} ${cunits}"
Elastic Constant C66 = 40.8641262264389 GPa
print "Elastic Constant C14 = ${C14} ${cunits}"
Elastic Constant C14 = 6.92404731313863 GPa
print "Elastic Constant C15 = ${C15} ${cunits}"
Elastic Constant C15 = -0.241854528091832 GPa
print "Elastic Constant C16 = ${C16} ${cunits}"
Elastic Constant C16 = -0.348583506816062 GPa
print "Elastic Constant C24 = ${C24} ${cunits}"
Elastic Constant C24 = -8.12880441353851 GPa
print "Elastic Constant C25 = ${C25} ${cunits}"
Elastic Constant C25 = 0.489292435379784 GPa
print "Elastic Constant C26 = ${C26} ${cunits}"
Elastic Constant C26 = 0.823159952503936 GPa
print "Elastic Constant C34 = ${C34} ${cunits}"
Elastic Constant C34 = 0.696244884461012 GPa
print "Elastic Constant C35 = ${C35} ${cunits}"
Elastic Constant C35 = 0.0721961245198595 GPa
print "Elastic Constant C36 = ${C36} ${cunits}"
Elastic Constant C36 = -0.201416093587799 GPa
print "Elastic Constant C45 = ${C45} ${cunits}"
Elastic Constant C45 = -0.310665193707046 GPa
print "Elastic Constant C46 = ${C46} ${cunits}"
Elastic Constant C46 = -0.491041219509184 GPa
print "Elastic Constant C56 = ${C56} ${cunits}"
Elastic Constant C56 = 7.93280717781775 GPa
print "========================================="
=========================================
print "Average properties for a cubic crystal"
Average properties for a cubic crystal
print "========================================="
=========================================
print "Bulk Modulus = ${bulkmodulus} ${cunits}"
Bulk Modulus = 93.6558774433347 GPa
print "Shear Modulus 1 = ${shearmodulus1} ${cunits}"
Shear Modulus 1 = 36.9587388428476 GPa
print "Shear Modulus 2 = ${shearmodulus2} ${cunits}"
Shear Modulus 2 = 42.9805772480702 GPa
print "Poisson Ratio = ${poissonratio}"
Poisson Ratio = 0.300984033972359
# summarize sampling protocol
variable tmp equal atoms
print "Number of atoms = ${tmp}"
Number of atoms = 250
print "Stress sampling interval = ${nevery}"
Stress sampling interval = 10
variable tmp equal ${nrun}/${nevery}
variable tmp equal 150000/${nevery}
variable tmp equal 150000/10
print "Stress sample count = ${tmp}"
Stress sample count = 15000
print "Born sampling interval = ${neveryborn}"
Born sampling interval = 100
variable tmp equal ${nrun}/${neveryborn}
variable tmp equal 150000/${neveryborn}
variable tmp equal 150000/100
print "Born sample count = ${tmp}"
Born sample count = 1500
Total wall time: 0:00:25

View File

@ -1,26 +0,0 @@
# this generates a 2-atom triclinic cell
# due to rotation on to x-axis,
# elastic constant analysis is not working yet
# unit lattice vectors are
# a1 = (1 0 0)
# a2 = (1/2 sqrt3/2 0)
# a3 = (1/2 1/(2sqrt3) sqrt2/sqrt3)
variable a1x equal 1
variable a2x equal 1/2
variable a2y equal sqrt(3)/2
variable a3x equal 1/2
variable a3y equal 1/(2*sqrt(3))
variable a3z equal sqrt(2/3)
variable l equal $a/sqrt(2)
lattice custom ${l} &
a1 ${a1x} 0 0 &
a2 ${a2x} ${a2y} 0.0 &
a3 ${a3x} ${a3y} ${a3z} &
basis 0 0 0 &
basis 0.25 0.25 0.25 &
spacing 1 1 1
region box prism 0 ${a1x} 0 ${a2y} 0 ${a3z} ${a2x} ${a3x} ${a3y}

View File

@ -46,17 +46,17 @@ energy flux, and dTemp/dZ = temperature gradient.
(1) in.langevin
dQ = 8000 * 0.5*(0.905+0.947) / 100 / 18.82^2 / 2
dQ = 8000 * 0.5*(0.890+0.883) / 100 / 18.82^2 / 2
8000 atoms
0.5*(0.905+0.947) = from log file =
0.5*(0.890+0.883) = from log file =
ave of total in/out energy for 2 regions normalized by # of atoms
100 = 20,000 steps at 0.005 tau timestep = run time in tau
xy box area = 18.82^2
divide by 2 since energy flux goes in 2 directions due to periodic z
dTemp = 0.578 from log file for average Temp difference between 2 regions
dTemp = 0.574 from log file for average Temp difference between 2 regions
dZ = 18.82
Kappa = 3.41
Kappa = 3.29
(2) in.heat
@ -82,17 +82,17 @@ dZ = 18.82
Kappa = 3.45
(4) in.mp
(4) in.mp
dQ = 15087 / 100 / 18.82^2 / 2
15087 = cumulative delta energy, tallied by fix thermal/conductivity
dQ = 15068 / 100 / 18.82^2 / 2
15068 = cumulative delta energy, tallied by fix thermal/conductivity
100 = 20,000 steps at 0.005 tau timestep = run time in tau
xy box area = 18.82^2
divide by 2 since energy flux goes in 2 directions due to periodic z
dTemp = 1.16 from log file for average Temp difference between 2 regions
dTemp = 1.175 from log file for average Temp difference between 2 regions
dZ = 18.82
Kappa = 3.45
Kappa = 3.41
(5) in.heatflux
@ -101,4 +101,4 @@ integration of the formulas discussed on the compute heat/flux doc
page - the resulting value prints at the end of the run and is in the
log file
Kappa = 3.78
Kappa = 3.88

View File

@ -3,36 +3,36 @@
# settings
variable x equal 10
variable y equal 10
variable z equal 20
variable x equal 10
variable y equal 10
variable z equal 20
variable rho equal 0.6
variable rho equal 0.6
variable t equal 1.35
variable rc equal 2.5
variable rc equal 2.5
#variable rho equal 0.85
#variable rho equal 0.85
#variable t equal 0.7
#variable rc equal 3.0
#variable rc equal 3.0
# setup problem
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create $t 87287
velocity all create $t 87287
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
neighbor 0.3 bin
neigh_modify delay 0 every 1
neighbor 0.3 bin
neigh_modify delay 0 every 1
# heat layers
@ -44,33 +44,40 @@ compute Tcold all temp/region cold
# 1st equilibration run
fix 1 all nvt temp $t $t 0.5
thermo 100
thermo 100
run 1000
velocity all scale $t
velocity all scale $t
unfix 1
unfix 1
# 2nd equilibration run
fix 1 all nve
fix 1 all nve
fix hot all ehex 1 100.0 region hot
fix cold all ehex 1 -100.0 region cold
thermo_style custom step temp c_Thot c_Tcold
thermo 1000
run 10000
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold
thermo 1000
run 10000
# thermal conductivity calculation
compute ke all ke/atom
variable temp atom c_ke/1.5
compute ke all ke/atom
variable temp atom c_ke/1.5
compute layers all chunk/atom bin/1d z lower 0.05 units reduced
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.ehex
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.ehex
variable tdiff equal f_2[11][3]-f_2[1][3]
variable tdiff equal f_2[1][3]-f_2[11][3]
fix ave all ave/time 1 1 1000 v_tdiff ave running start 13000
variable kappa equal (100/(lx*ly)/2.0)*(lz/2.0)/f_ave
thermo_style custom step temp c_Thot c_Tcold v_tdiff f_ave
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold &
colname v_tdiff dTemp_step colname f_ave dTemp
run 20000
print "Running average thermal conductivity: $(v_kappa:%.2f)"

View File

@ -3,36 +3,36 @@
# settings
variable x equal 10
variable y equal 10
variable z equal 20
variable x equal 10
variable y equal 10
variable z equal 20
variable rho equal 0.6
variable rho equal 0.6
variable t equal 1.35
variable rc equal 2.5
variable rc equal 2.5
#variable rho equal 0.85
#variable rho equal 0.85
#variable t equal 0.7
#variable rc equal 3.0
#variable rc equal 3.0
# setup problem
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create $t 87287
velocity all create $t 87287
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
neighbor 0.3 bin
neigh_modify delay 0 every 1
neighbor 0.3 bin
neigh_modify delay 0 every 1
# heat layers
@ -44,33 +44,39 @@ compute Tcold all temp/region cold
# 1st equilibration run
fix 1 all nvt temp $t $t 0.5
thermo 100
thermo 100
run 1000
velocity all scale $t
velocity all scale $t
unfix 1
unfix 1
# 2nd equilibration run
fix 1 all nve
fix 1 all nve
fix hot all heat 1 100.0 region hot
fix cold all heat 1 -100.0 region cold
thermo_style custom step temp c_Thot c_Tcold
thermo 1000
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold
thermo 1000
run 10000
# thermal conductivity calculation
compute ke all ke/atom
variable temp atom c_ke/1.5
compute ke all ke/atom
variable temp atom c_ke/1.5
compute layers all chunk/atom bin/1d z lower 0.05 units reduced
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.heat
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.heat
variable tdiff equal f_2[11][3]-f_2[1][3]
variable tdiff equal f_2[1][3]-f_2[11][3]
fix ave all ave/time 1 1 1000 v_tdiff ave running start 13000
variable kappa equal (100/(lx*ly)/2.0)*(lz/2.0)/f_ave
thermo_style custom step temp c_Thot c_Tcold v_tdiff f_ave
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold &
colname v_tdiff dTemp_step colname f_ave dTemp
run 20000
print "Running average thermal conductivity: $(v_kappa:%.2f)"

View File

@ -3,17 +3,17 @@
# settings
variable x equal 10
variable y equal 10
variable z equal 10
variable x equal 10
variable y equal 10
variable z equal 10
variable rho equal 0.6
variable rho equal 0.6
variable t equal 1.35
variable rc equal 2.5
variable rc equal 2.5
#variable rho equal 0.85
#variable rho equal 0.85
#variable t equal 0.7
#variable rc equal 3.0
#variable rc equal 3.0
variable p equal 200 # correlation length
variable s equal 10 # sample interval
@ -21,32 +21,32 @@ variable d equal $p*$s # dump interval
# setup problem
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create $t 87287
velocity all create $t 87287
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
neighbor 0.3 bin
neigh_modify delay 0 every 1
neighbor 0.3 bin
neigh_modify delay 0 every 1
# 1st equilibration run
fix 1 all nvt temp $t $t 0.5
thermo 100
run 1000
fix 1 all nvt temp $t $t 0.5
thermo 100
run 1000
velocity all scale $t
velocity all scale $t
unfix 1
unfix 1
# thermal conductivity calculation
@ -60,20 +60,23 @@ variable Jx equal c_flux[1]/vol
variable Jy equal c_flux[2]/vol
variable Jz equal c_flux[3]/vol
fix 1 all nve
fix 1 all nve
fix JJ all ave/correlate $s $p $d &
c_flux[1] c_flux[2] c_flux[3] type auto &
file profile.heatflux ave running
file profile.heatflux ave running
variable scale equal $s*dt/$t/$t/vol
variable k11 equal trap(f_JJ[3])*${scale}
variable k22 equal trap(f_JJ[4])*${scale}
variable k33 equal trap(f_JJ[5])*${scale}
variable kappa equal (v_k11+v_k22+v_k33)/3.0
thermo $d
thermo_style custom step temp v_Jx v_Jy v_Jz v_k11 v_k22 v_k33
thermo $d
thermo_style custom step temp v_Jx v_Jy v_Jz v_k11 v_k22 v_k33 v_kappa
thermo_modify colname v_Jx Jx colname v_Jy Jy colname v_Jz Jz &
colname v_k11 kappa_11 colname v_k22 kappa_22 &
colname v_k33 kappa_33 colname v_kappa kappa
run 100000
variable kappa equal (v_k11+v_k22+v_k33)/3.0
print "running average conductivity: ${kappa}"
print "Running average thermal conductivity: $(v_kappa:%.2f)"

View File

@ -3,40 +3,40 @@
# settings
variable x equal 10
variable y equal 10
variable z equal 20
variable x equal 10
variable y equal 10
variable z equal 20
variable rho equal 0.6
variable rho equal 0.6
variable t equal 1.35
variable rc equal 2.5
variable rc equal 2.5
variable tlo equal 1.0
variable thi equal 1.70
#variable rho equal 0.85
#variable rho equal 0.85
#variable t equal 0.7
#variable rc equal 3.0
#variable rc equal 3.0
#variable tlo equal 0.3
#variable thi equal 1.0
# setup problem
units lj
atom_style atomic
units lj
atom_style atomic
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
lattice fcc ${rho}
region box block 0 $x 0 $y 0 $z
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create $t 87287
velocity all create $t 87287
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
pair_style lj/cut ${rc}
pair_coeff 1 1 1.0 1.0
neighbor 0.3 bin
neigh_modify delay 0 every 1
neighbor 0.3 bin
neigh_modify delay 0 every 1
# heat layers
@ -48,16 +48,16 @@ compute Tcold all temp/region cold
# 1st equilibration run
fix 1 all nvt temp $t $t 0.5
thermo 100
thermo 100
run 1000
velocity all scale $t
velocity all scale $t
unfix 1
unfix 1
# 2nd equilibration run
fix 1 all nve
fix 1 all nve
fix hot all langevin ${thi} ${thi} 1.0 59804 tally yes
fix cold all langevin ${tlo} ${tlo} 1.0 287859 tally yes
fix_modify hot temp Thot
@ -65,14 +65,17 @@ fix_modify cold temp Tcold
variable tdiff equal c_Thot-c_Tcold
thermo_style custom step temp c_Thot c_Tcold f_hot f_cold v_tdiff
thermo 1000
run 10000
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold &
colname f_hot E_hot colname f_cold E_cold &
colname v_tdiff dTemp_step
thermo 1000
run 10000
# thermal conductivity calculation
# reset langevin thermostats to zero energy accumulation
compute ke all ke/atom
variable temp atom c_ke/1.5
compute ke all ke/atom
variable temp atom c_ke/1.5
fix hot all langevin ${thi} ${thi} 1.0 59804 tally yes
fix cold all langevin ${tlo} ${tlo} 1.0 287859 tally yes
@ -81,8 +84,15 @@ fix_modify cold temp Tcold
fix ave all ave/time 10 100 1000 v_tdiff ave running
thermo_style custom step temp c_Thot c_Tcold f_hot f_cold v_tdiff f_ave
thermo_modify colname c_Thot Temp_hot colname c_Tcold Temp_cold &
colname f_hot E_hot colname f_cold E_cold &
colname v_tdiff dTemp_step colname f_ave dTemp
compute layers all chunk/atom bin/1d z lower 0.05 units reduced
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.langevin
fix 2 all ave/chunk 10 100 1000 layers v_temp file profile.langevin
variable start_time equal time
variable kappa equal (0.5*(abs(f_hot)+abs(f_cold))/(time-${start_time})/(lx*ly)/2.0)*(lz/2.0)/f_ave
run 20000
print "Running average thermal conductivity: $(v_kappa:%.2f)"

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