Merge branch 'develop' into amoeba-ak

This commit is contained in:
Axel Kohlmeyer
2022-05-28 05:24:02 -04:00
1087 changed files with 121298 additions and 27084 deletions

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()
@ -161,10 +161,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)
@ -210,6 +212,7 @@ set(STANDARD_PACKAGES
DPD-SMOOTH
DRUDE
EFF
ELECTRODE
EXTRA-COMPUTE
EXTRA-DUMP
EXTRA-FIX
@ -328,7 +331,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")
@ -354,6 +359,7 @@ pkg_depends(DIELECTRIC KSPACE)
pkg_depends(DIELECTRIC EXTRA-PAIR)
pkg_depends(CG-DNA MOLECULE)
pkg_depends(CG-DNA ASPHERE)
pkg_depends(ELECTRODE KSPACE)
# detect if we may enable OpenMP support by default
set(BUILD_OMP_DEFAULT OFF)
@ -391,7 +397,7 @@ if(BUILD_OMP)
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
endif()
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE OR PKG_ELECTRODE)
enable_language(C)
find_package(LAPACK)
find_package(BLAS)
@ -414,9 +420,23 @@ endif()
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
set(JPEG_NAMES libjpeg libjpeg-62)
find_package(JPEG QUIET)
if((NOT JPEG_FOUND) AND (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16))
set(LIBJPEG_URL https://sourceforge.net/projects/libjpeg-turbo/files/2.1.3/libjpeg-turbo-2.1.3.tar.gz)
set(LIBJPEG_MD5 85244dedeaf06f636a9e7ddea6d236d8)
mark_as_advanced(LIBJPEG_URL)
mark_as_advanced(LIBJPEG_MD5)
include(ExternalCMakeProject)
ExternalCmakeProject(libjpeg ${LIBJPEG_URL} ${LIBJPEG_MD5} libjpeg-turbo . CMakeLists.jpeg)
add_library(JPEG::JPEG ALIAS jpeg-static)
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libjpeg-src")
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libjpeg-build")
set(JPEG_FOUND TRUE)
endif()
option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND})
if(WITH_JPEG)
find_package(JPEG REQUIRED)
if(NOT JPEG_FOUND)
find_package(JPEG REQUIRED)
endif()
target_compile_definitions(lammps PRIVATE -DLAMMPS_JPEG)
if(CMAKE_VERSION VERSION_LESS 3.12)
target_include_directories(lammps PRIVATE ${JPEG_INCLUDE_DIRS})
@ -428,14 +448,43 @@ endif()
find_package(PNG QUIET)
find_package(ZLIB QUIET)
if((NOT ZLIB_FOUND) AND (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16))
set(LIBZ_URL http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz)
set(LIBZ_MD5 1c9f62f0778697a09d36121ead88e08e)
mark_as_advanced(LIBZ_URL)
mark_as_advanced(LIBZ_MD5)
include(ExternalCMakeProject)
ExternalCmakeProject(libz ${LIBZ_URL} ${LIBZ_MD5} zlib . CMakeLists.zlib)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libz-src")
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libz-build")
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/libz-src;${CMAKE_BINARY_DIR}/_deps/libz-build")
endif()
if((NOT PNG_FOUND) AND (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16))
set(LIBPNG_URL http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.gz)
set(LIBPNG_MD5 6c7519f6c75939efa0ed3053197abd54)
mark_as_advanced(LIBPNG_URL)
mark_as_advanced(LIBPNG_MD5)
include(ExternalCMakeProject)
ExternalCmakeProject(libpng ${LIBPNG_URL} ${LIBPNG_MD5} libpng . CMakeLists.png)
add_library(PNG::PNG ALIAS png_static)
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libpng-src")
target_include_directories(lammps PRIVATE "${CMAKE_BINARY_DIR}/_deps/libpng-build")
set(PNG_FOUND TRUE)
endif()
if(PNG_FOUND AND ZLIB_FOUND)
option(WITH_PNG "Enable PNG support" ON)
else()
option(WITH_PNG "Enable PNG support" OFF)
endif()
if(WITH_PNG)
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
if(NOT PNG_FOUND)
find_package(PNG REQUIRED)
endif()
if(NOT ZLIB_FOUND)
find_package(ZLIB REQUIRED)
endif()
target_link_libraries(lammps PRIVATE PNG::PNG ZLIB::ZLIB)
target_compile_definitions(lammps PRIVATE -DLAMMPS_PNG)
endif()
@ -595,6 +644,10 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
endif()
endforeach()
if(PKG_ELECTRODE)
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
endif()
if(PKG_AWPMD)
target_link_libraries(awpmd PRIVATE ${LAPACK_LIBRARIES})
endif()
@ -943,6 +996,12 @@ if(PKG_KSPACE)
else()
message(STATUS "Kokkos FFT: cuFFT")
endif()
elseif(Kokkos_ENABLE_HIP)
if(FFT STREQUAL "KISS")
message(STATUS "Kokkos FFT: KISS")
else()
message(STATUS "Kokkos FFT: hipFFT")
endif()
else()
message(STATUS "Kokkos FFT: ${FFT}")
endif()

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

@ -1,4 +1,6 @@
find_package(ZLIB REQUIRED)
if(NOT ZLIB_FOUND)
find_package(ZLIB REQUIRED)
endif()
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
find_package(PkgConfig QUIET)

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()
@ -112,5 +112,9 @@ if(PKG_KSPACE)
RegisterIntegrateStyle(${INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
endif()
if(PKG_ELECTRODE)
list(APPEND INTEL_SOURCES ${INTEL_SOURCES_DIR}/electrode_accel_intel.cpp)
endif()
target_sources(lammps PRIVATE ${INTEL_SOURCES})
target_include_directories(lammps PRIVATE ${INTEL_SOURCES_DIR})

View File

@ -47,8 +47,8 @@ if(DOWNLOAD_KOKKOS)
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
include(ExternalProject)
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.5.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "079323d973ae0e1c38c0a54a150c674e" CACHE STRING "MD5 checksum of KOKKOS tarball")
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.6.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "b5c44ea961031795f434002cd7b31c20" CACHE STRING "MD5 checksum of KOKKOS tarball")
mark_as_advanced(KOKKOS_URL)
mark_as_advanced(KOKKOS_MD5)
ExternalProject_Add(kokkos_build
@ -72,7 +72,7 @@ if(DOWNLOAD_KOKKOS)
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 3.5.00 REQUIRED CONFIG)
find_package(Kokkos 3.6.00 REQUIRED CONFIG)
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
else()
@ -130,6 +130,11 @@ if(PKG_KSPACE)
target_compile_definitions(lammps PRIVATE -DFFT_CUFFT)
target_link_libraries(lammps PRIVATE cufft)
endif()
elseif(Kokkos_ENABLE_HIP)
if(NOT (FFT STREQUAL "KISS"))
target_compile_definitions(lammps PRIVATE -DFFT_HIPFFT)
target_link_libraries(lammps PRIVATE hipfft)
endif()
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.fix.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 "e0572de57039d4afedefb25707b6ceae" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
mark_as_advanced(PACELIB_URL)
mark_as_advanced(PACELIB_MD5)
@ -15,6 +15,10 @@ execute_process(
)
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)

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

@ -26,6 +26,7 @@ set(ALL_PACKAGES
DPD-REACT
DPD-SMOOTH
DRUDE
ELECTRODE
EFF
EXTRA-COMPUTE
EXTRA-DUMP

View File

@ -28,6 +28,7 @@ set(ALL_PACKAGES
DPD-REACT
DPD-SMOOTH
DRUDE
ELECTRODE
EFF
EXTRA-COMPUTE
EXTRA-DUMP

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

@ -0,0 +1,20 @@
# preset that enables KOKKOS and selects HIP compilation with OpenMP
# enabled as well. Also sets some performance related compiler flags.
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 OFF CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_HIP ON CACHE BOOL "" FORCE)
set(Kokkos_ARCH_VEGA90A on CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS ON CACHE BOOL "" FORCE)
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

@ -22,6 +22,7 @@ set(WIN_PACKAGES
DPD-REACT
DPD-SMOOTH
DRUDE
ELECTRODE
EFF
EXTRA-COMPUTE
EXTRA-DUMP

View File

@ -24,6 +24,7 @@ set(ALL_PACKAGES
DPD-REACT
DPD-SMOOTH
DRUDE
ELECTRODE
EFF
EXTRA-COMPUTE
EXTRA-DUMP

View File

@ -6,6 +6,7 @@ set(PACKAGES_WITH_LIB
ATC
AWPMD
COMPRESS
ELECTRODE
GPU
H5MD
KIM

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

@ -10,6 +10,7 @@ set(WIN_PACKAGES
CLASS2
COLLOID
COLVARS
COMPRESS
CORESHELL
DIELECTRIC
DIFFRACTION
@ -44,6 +45,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.1
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

@ -2,7 +2,7 @@
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "LAMMPS Programmer's Guide"
PROJECT_NUMBER = "24 August 2020"
PROJECT_NUMBER = "4 May 2022"
PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper"
PROJECT_LOGO = lammps-logo.png
CREATE_SUBDIRS = NO
@ -437,6 +437,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
@LAMMPS_SOURCE_DIR@/math_eigen.h \
@LAMMPS_SOURCE_DIR@/platform.h \
@LAMMPS_SOURCE_DIR@/platform.cpp \
@LAMMPS_SOURCE_DIR@/math_special.h \
@LAMMPS_SOURCE_DIR@/math_special.cpp \
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -1,4 +1,4 @@
.TH LAMMPS "1" "24 March 2022" "2022-3-24"
.TH LAMMPS "1" "4 May 2022" "2022-5-4"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator. Version 24 March 2022

View File

@ -641,14 +641,27 @@ This list was last updated for version 3.5.0 of the Kokkos library.
-D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper
To simplify compilation, four preset files are included in the
For AMD or NVIDIA GPUs using HIP, set these variables:
.. code-block:: bash
-D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above
-D Kokkos_ARCH_GPUARCH=yes # GPUARCH = GPU from list above
-D Kokkos_ENABLE_HIP=yes
-D Kokkos_ENABLE_OPENMP=yes
This will enable FFTs on the GPU, either by the internal KISSFFT library
or with the hipFFT wrapper library, which will call out to the
platform-appropriate vendor library: rocFFT on AMD GPUs or cuFFT on
NVIDIA GPUs.
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
@ -707,6 +720,15 @@ This list was last updated for version 3.5.0 of the Kokkos library.
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
For AMD or NVIDIA GPUs using HIP:
.. code-block:: make
KOKKOS_DEVICES = HIP
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU
# GPUARCH = GPU from list above
FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional)
FFT_LIB = -lhipfft # link to hipFFT library
Advanced KOKKOS compilation settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -1252,6 +1274,41 @@ be built for the most part with all major versions of the C++ language.
----------
.. _electrode:
ELECTRODE package
-----------------
This package depends on the KSPACE package.
.. tabs::
.. tab:: CMake build
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and ``-D
PKG_ELECTRODE=yes``.
.. tab:: Traditional make
The package is activated with ``make yes-KSPACE`` and ``make
yes-ELECTRODE``
Note that the ``Makefile.lammps`` file has settings for the BLAS and
LAPACK linear algebra libraries. As explained in ``lib/awpmd/README``
these can either exist on your system, or you can use the files provided
in ``lib/linalg``. In the latter case you also need to build the library
in ``lib/linalg`` with a command like these:
.. code-block:: bash
$ make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
----------
.. _ml-pace:
ML-PACE package

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
@ -220,7 +225,8 @@ These commands install/un-install sets of packages:
.. code-block:: bash
make yes-all # install all packages
make no-all # uninstall all packages
make no-all # check for changes and uninstall all packages
make no-installed # only check and uninstall installed packages
make yes-basic # install a few commonly used packages'
make no-basic # remove a few commonly used packages'
make yes-most # install most packages w/o libs'

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::
@ -297,15 +297,15 @@ following settings:
.. code-block:: bash
-D WITH_JPEG=value # yes or no
# default = yes if CMake finds JPEG files, else no
# default = yes
-D WITH_PNG=value # yes or no
# default = yes if CMake finds PNG and ZLIB files, else no
# default = yes
-D WITH_FFMPEG=value # yes or no
# default = yes if CMake can find ffmpeg, else no
Usually these settings are all that is needed. If CMake cannot
find the graphics header, library, executable files, you can set
these variables:
Usually these settings are all that is needed. If those libraries
or executables are installed but CMake cannot find the graphics header,
library, or executable files, you can set these variables accordingly:
.. code-block:: bash
@ -317,6 +317,9 @@ following settings:
-D ZLIB_LIBRARY=path # path to libz.a (.so) file
-D FFMPEG_EXECUTABLE=path # path to ffmpeg executable
Otherwise, CMake will attempt to download, build, and link with
jpeg, png, and zlib libraries statically from source code.
.. tab:: Traditional make
.. code-block:: make
@ -328,11 +331,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>`_
@ -99,6 +102,10 @@ It is possible to use both the integrated CMake support of the Visual
Studio IDE or use an external CMake installation (e.g. downloaded from
cmake.org) to create build files and compile LAMMPS from the command line.
Compilation via command line and unit tests are checked automatically
for the LAMMPS development branch through
`GitHub Actions <https://github.com/lammps/lammps/actions/workflows/compile-msvc.yml>`_.
.. note::
Versions of Visual Studio before version 17.1 may scan the entire
@ -111,6 +118,10 @@ Please note, that for either approach CMake will create a so-called
the command lines for building and testing LAMMPS must be adjusted
accordingly.
The LAMMPS cmake folder contains a ``CMakeSettings.json`` file with
build configurations for MSVC compilers and the MS provided Clang
compiler package in Debug and Release mode.
To support running in parallel you can compile with OpenMP enabled using
the OPENMP package or install Microsoft MPI (including the SDK) and compile
LAMMPS with MPI enabled.
@ -121,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
@ -145,14 +203,3 @@ LAMMPS developers. We instead rely on the feedback of the users
of these pre-compiled LAMMPS packages for Windows. We will try to resolve
issues to the best of our abilities if we become aware of them. However
this is subject to time constraints and focus on HPC platforms.
.. _native:
Native Visual C++ support
^^^^^^^^^^^^^^^^^^^^^^^^^
Support for the Visual C++ compilers is currently not available. The
CMake build system is capable of creating suitable a Visual Studio
style build environment, but the LAMMPS source code itself is not
ported to fully support Visual C++. Volunteers to take on this task
are welcome.

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

@ -89,7 +89,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

@ -68,6 +68,9 @@ OPT.
* :doc:`edpd/source <fix_dpd_source>`
* :doc:`efield <fix_efield>`
* :doc:`ehex <fix_ehex>`
* :doc:`electrode/conp (i) <fix_electrode_conp>`
* :doc:`electrode/conq (i) <fix_electrode_conp>`
* :doc:`electrode/thermo (i) <fix_electrode_conp>`
* :doc:`electron/stopping <fix_electron_stopping>`
* :doc:`electron/stopping/fit <fix_electron_stopping>`
* :doc:`enforce2d (k) <fix_enforce2d>`

View File

@ -27,6 +27,7 @@ OPT.
* :doc:`ewald/disp/dipole <kspace_style>`
* :doc:`ewald/dipole <kspace_style>`
* :doc:`ewald/dipole/spin <kspace_style>`
* :doc:`ewald/electrode <kspace_style>`
* :doc:`msm (o) <kspace_style>`
* :doc:`msm/cg (o) <kspace_style>`
* :doc:`msm/dielectric <kspace_style>`
@ -41,4 +42,5 @@ OPT.
* :doc:`pppm/stagger <kspace_style>`
* :doc:`pppm/tip4p (o) <kspace_style>`
* :doc:`pppm/dielectric <kspace_style>`
* :doc:`pppm/electrode (i) <kspace_style>`
* :doc:`scafacos <kspace_style>`

View File

@ -34,7 +34,7 @@ OPT.
*
*
*
* :doc:`adp (o) <pair_adp>`
* :doc:`adp (ko) <pair_adp>`
* :doc:`agni (o) <pair_agni>`
* :doc:`airebo (io) <pair_airebo>`
* :doc:`airebo/morse (io) <pair_airebo>`
@ -127,7 +127,7 @@ OPT.
* :doc:`hdnnp <pair_hdnnp>`
* :doc:`hippo <pair_amoeba>`
* :doc:`ilp/graphene/hbn (t) <pair_ilp_graphene_hbn>`
* :doc:`ilp/tmd <pair_ilp_tmd>`
* :doc:`ilp/tmd (t) <pair_ilp_tmd>`
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
* :doc:`lcbop <pair_lcbop>`
@ -233,7 +233,7 @@ OPT.
* :doc:`oxrna2/stk <pair_oxrna2>`
* :doc:`oxrna2/xstk <pair_oxrna2>`
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
* :doc:`pace <pair_pace>`
* :doc:`pace (k) <pair_pace>`
* :doc:`peri/eps <pair_peri>`
* :doc:`peri/lps (o) <pair_peri>`
* :doc:`peri/pmb (o) <pair_peri>`
@ -245,8 +245,10 @@ OPT.
* :doc:`reaxff (ko) <pair_reaxff>`
* :doc:`rebo (io) <pair_airebo>`
* :doc:`resquared (go) <pair_resquared>`
* :doc:`saip/metal <pair_saip_metal>`
* :doc:`saip/metal (t) <pair_saip_metal>`
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
* :doc:`smatb <pair_smatb>`
* :doc:`smatb/single <pair_smatb>`
* :doc:`smd/hertz <pair_smd_hertz>`
* :doc:`smd/tlsph <pair_smd_tlsph>`
* :doc:`smd/tri_surface <pair_smd_triangulated_surface>`

View File

@ -77,18 +77,19 @@ LAMMPS:
so that you do not have to define (or discard) a temporary variable,
"X" in this case.
Additionally, the "immediate" variable expression may be followed by
a colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
The format string must be appropriate for a double-precision
floating-point value. The format string is used to output the result
of the variable expression evaluation. If a format string is not
specified a high-precision "%.20g" is used as the default.
Additionally, the entire "immediate" variable expression may be
followed by a colon, followed by a C-style format string,
e.g. ":%f" or ":%.10g". The format string must be appropriate for
a double-precision floating-point value. The format string is used
to output the result of the variable expression evaluation. If a
format string is not specified, a high-precision "%.20g" is used as
the default format.
This can be useful for formatting print output to a desired precision:
.. code-block:: LAMMPS
print "Final energy per atom: $(pe/atoms:%10.3f) eV/atom"
print "Final energy per atom: $(v_ke_per_atom+v_pe_per_atom:%10.3f) eV/atom"
Note that neither the curly-bracket or immediate form of variables
can contain nested $ characters for other variables to substitute

View File

@ -246,6 +246,44 @@ Customized standard functions
---------------------------
Special Math functions
----------------------
The ``MathSpecial`` namespace implements a selection of custom and optimized
mathematical functions for a variety of applications.
.. doxygenfunction:: factorial
:project: progguide
.. doxygenfunction:: exp2_x86
:project: progguide
.. doxygenfunction:: fm_exp
:project: progguide
.. doxygenfunction:: my_erfcx
:project: progguide
.. doxygenfunction:: expmsq
:project: progguide
.. doxygenfunction:: square
:project: progguide
.. doxygenfunction:: cube
:project: progguide
.. doxygenfunction:: powsign
:project: progguide
.. doxygenfunction:: powint
:project: progguide
.. doxygenfunction:: powsinxx
:project: progguide
---------------------------
Tokenizer classes
-----------------

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

@ -55,6 +55,9 @@ JSON
YAML format thermo_style output
===============================
Extracting data from log file
-----------------------------
.. versionadded:: 24Mar2022
LAMMPS supports the thermo style "yaml" and for "custom" style
@ -66,7 +69,7 @@ the following style:
.. code-block:: yaml
---
keywords: [Step, Temp, E_pair, E_mol, TotEng, Press, ]
keywords: ['Step', 'Temp', 'E_pair', 'E_mol', 'TotEng', 'Press', ]
data:
- [100, 0.757453103239935, -5.7585054860159, 0, -4.62236133677021, 0.207261053624721, ]
- [110, 0.759322359337036, -5.7614668389562, 0, -4.62251889318624, 0.194314975399602, ]
@ -80,9 +83,9 @@ This data can be extracted and parsed from a log file using python with:
import re, yaml
try:
from yaml import CSafeLoader as Loader, CSafeDumper as Dumper
from yaml import CSafeLoader as Loader
except ImportError:
from yaml import SafeLoader as Loader, SafeDumper as Dumper
from yaml import SafeLoader as Loader
docs = ""
with open("log.lammps") as f:
@ -109,6 +112,135 @@ of that run:
Number of runs: 2
TotEng = -4.62140097780047
.. versionadded:: 4May2022
YAML format output has been added to multiple commands in LAMMPS,
for example :doc:`dump yaml <dump>` or :doc:`fix ave/time <fix_ave_time>`
Depending on the kind of data being written, organization of the data
or the specific syntax used may change, but the principles are very
similar and all files should be readable with a suitable YAML parser.
Processing scalar data with Python
----------------------------------
.. figure:: JPG/thermo_bondeng.png
:figwidth: 33%
:align: right
After reading and parsing the YAML format data, it can be easily
imported for further processing and visualization with the `pandas
<https://pandas.pydata.org/>`_ and `matplotlib
<https://matplotlib.org/>`_ Python modules. Because of the organization
of the data in the YAML format thermo output, it needs to be told to
process only the 'data' part of the imported data to create a pandas
data frame, and one needs to set the column names from the 'keywords'
entry. The following Python script code example demonstrates this, and
creates the image shown on the right of a simple plot of various bonded
energy contributions versus the timestep from a run of the 'peptide'
example input after changing the :doc:`thermo style <thermo_style>` to
'yaml'. The properties to be used for x and y values can be
conveniently selected through the keywords. Please note that those
keywords can be changed to custom strings with the :doc:`thermo_modify
colname <thermo_modify>` command.
.. code-block:: python
import re, yaml
import pandas as pd
import matplotlib.pyplot as plt
try:
from yaml import CSafeLoader as Loader
except ImportError:
from yaml import SafeLoader as Loader
docs = ""
with open("log.lammps") as f:
for line in f:
m = re.search(r"^(keywords:.*$|data:$|---$|\.\.\.$| - \[.*\]$)", line)
if m: docs += m.group(0) + '\n'
thermo = list(yaml.load_all(docs, Loader=Loader))
df = pd.DataFrame(data=thermo[0]['data'], columns=thermo[0]['keywords'])
fig = df.plot(x='Step', y=['E_bond', 'E_angle', 'E_dihed', 'E_impro'], ylabel='Energy in kcal/mol')
plt.savefig('thermo_bondeng.png')
Processing vector data with Python
----------------------------------
Global *vector* data as produced by :doc:`fix ave/time <fix_ave_time>`
uses a slightly different organization of the data. You still have the
dictionary keys 'keywords' and 'data' for the column headers and the
data. But the data is a dictionary indexed by the time step and for
each step there are multiple rows of values each with a list of the
averaged properties. This requires a slightly different processing,
since the entire data cannot be directly imported into a single pandas
DataFrame class instance. The following Python script example
demonstrates how to read such data. The result will combine the data
for the different steps into one large "multi-index" table. The pandas
IndexSlice class can then be used to select data from this combined data
frame.
.. code-block:: python
import re, yaml
import pandas as pd
try:
from yaml import CSafeLoader as Loader
except ImportError:
from yaml import SafeLoader as Loader
with open("ave.yaml") as f:
ave = yaml.load(docs, Loader=Loader)
keys = ave['keywords']
df = {}
for k in ave['data'].keys():
df[k] = pd.DataFrame(data=ave['data'][k], columns=keys)
# create multi-index data frame
df = pd.concat(df)
# output only the first 3 value for steps 200 to 300 of the column Pressure
idx = pd.IndexSlice
print(df['Pressure'].loc[idx[200:300, 0:2]])
Processing scalar data with Perl
--------------------------------
The ease of processing YAML data is not limited to Python. Here is an
example for extracting and processing a LAMMPS log file with Perl instead.
.. code-block:: perl
use YAML::XS;
open(LOG, "log.lammps") or die("could not open log.lammps: $!");
my $file = "";
while(my $line = <LOG>) {
if ($line =~ /^(keywords:.*$|data:$|---$|\.\.\.$| - \[.*\]$)/) {
$file .= $line;
}
}
close(LOG);
# convert YAML to perl as nested hash and array references
my $thermo = Load $file;
# convert references to real arrays
my @keywords = @{$thermo->{'keywords'}};
my @data = @{$thermo->{'data'}};
# print first two columns
print("$keywords[0] $keywords[1]\n");
foreach (@data) {
print("${$_}[0] ${$_}[1]\n");
}
Writing continuous data during a simulation
===========================================

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -250,9 +250,9 @@ on` comments around that block.
Error or warning messages and explanations (preferred)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionchanged:: 27Apr2022
.. versionchanged:: 4May2022
Starting with LAMMPS version 27 April 2022 the LAMMPS developers have
Starting with LAMMPS version 4 May 2022 the LAMMPS developers have
agreed on a new policy for error and warning messages.
Previously, all error and warning strings were supposed to be listed in

View File

@ -51,6 +51,7 @@ page gives those details.
* :ref:`DPD-SMOOTH <PKG-DPD-SMOOTH>`
* :ref:`DRUDE <PKG-DRUDE>`
* :ref:`EFF <PKG-EFF>`
* :ref:`ELECTRODE <PKG-ELECTRODE>`
* :ref:`EXTRA-COMPUTE <PKG-EXTRA-COMPUTE>`
* :ref:`EXTRA-DUMP <PKG-EXTRA-DUMP>`
* :ref:`EXTRA-FIX <PKG-EXTRA-FIX>`
@ -828,6 +829,31 @@ tools/eff; see its README file.
-------------------
.. _PKG-ELECTRODE:
ELECTRODE package
-----------------
**Contents:**
The ELECTRODE package allows the user to enforce a constant potential method for
groups of atoms that interact with the remaining atoms as electrolyte.
**Authors:** The ELECTRODE library is written and maintained by Ludwig
Ahrens-Iwers (TUHH, Hamburg, Germany), Shern Tee (UQ, Brisbane, Australia) and
Robert Meissner (TUHH, Hamburg, Germany).
**Install:**
This package has :ref:`specific installation instructions <electrode>` on the
:doc:`Build extras <Build_extras>` page.
**Supporting info:**
* :doc:`fix electrode/conp <fix_electrode_conp>`
----------
.. _PKG-EXTRA-COMPUTE:
EXTRA-COMPUTE package
@ -2597,18 +2623,20 @@ SMTBQ package
**Contents:**
A pair style which implements a Second Moment Tight Binding model with
QEq charge equilibration (SMTBQ) potential for the description of
ionocovalent bonds in oxides.
Pair styles which implement Second Moment Tight Binding models.
One with QEq charge equilibration (SMTBQ) for the description of
ionocovalent bonds in oxides, and two more as plain SMATB models.
**Authors:** Nicolas Salles, Emile Maras, Olivier Politano, and Robert
Tetot (LAAS-CNRS, France).
**Authors:** SMTBQ: Nicolas Salles, Emile Maras, Olivier Politano, and Robert
Tetot (LAAS-CNRS, France);
SMATB: Daniele Rapetti (Politecnico di Torino)
**Supporting info:**
* src/SMTBQ: filenames -> commands
* src/SMTBQ/README
* :doc:`pair_style smtbq <pair_smtbq>`
* :doc:`pair_style smatb <pair_smatb>`, :doc:`pair_style smatb/single <pair_smatb>`
* examples/PACKAGES/smtbq
----------

View File

@ -153,6 +153,11 @@ whether an extra library is needed to build and use the package:
- :doc:`pair_style eff/cut <pair_eff>`
- PACKAGES/eff
- no
* - :ref:`ELECTRODE <PKG-ELECTRODE>`
- electrode charges to match potential
- :doc:`fix electrode/conp <fix_electrode_conp>`
- PACKAGES/electrode
- no
* - :ref:`EXTRA-COMPUTE <PKG-EXTRA-COMPUTE>`
- additional compute styles
- :doc:`compute <compute>`
@ -434,8 +439,8 @@ whether an extra library is needed to build and use the package:
- n/a
- no
* - :ref:`SMTBQ <PKG-SMTBQ>`
- second moment tight binding potential
- :doc:`pair_style smtbq <pair_smtbq>`
- second moment tight binding potentials
- :doc:`pair_style smtbq <pair_smtbq>` :doc:`pair_style smatb <pair_smatb>`
- PACKAGES/smtbq
- no
* - :ref:`SPH <PKG-SPH>`

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
@ -1017,6 +1018,28 @@ 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).
----------
.. _swig:
SWIG interface

View File

@ -88,7 +88,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

@ -23,7 +23,7 @@ Syntax
*reduce/region* arg = region-ID
region-ID = ID of region to use for choosing atoms
* mode = *sum* or *min* or *max* or *ave* or *sumsq* or *avesq*
* mode = *sum* or *min* or *max* or *ave* or *sumsq* or *avesq* or *sumabs* or *aveabs*
* one or more inputs can be listed
* input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name
@ -77,7 +77,10 @@ option sums the square of the values in the vector into a global
total. The *avesq* setting does the same as *sumsq*, then divides the
sum of squares by the number of values. The last two options can be
useful for calculating the variance of some quantity, e.g. variance =
sumsq - ave\^2.
sumsq - ave\^2. The *sumabs* option sums the absolute values in the
vector into a global total. The *aveabs* setting does the same as
*sumabs*, then divides the sum of absolute values by the number of
values.
Each listed input is operated on independently. For per-atom inputs,
the group specified with this command means only atoms within the
@ -189,7 +192,7 @@ value. If multiple inputs are specified, this compute produces a
global vector of values, the length of which is equal to the number of
inputs specified.
As discussed below, for the *sum* and *sumsq* modes, the value(s)
As discussed below, for the *sum*, *sumabs* and *sumsq* modes, the value(s)
produced by this compute are all "extensive", meaning their value
scales linearly with the number of atoms involved. If normalized
values are desired, this compute can be accessed by the :doc:`thermo_style custom <thermo_style>` command with :doc:`thermo_modify norm yes <thermo_modify>` set as an option. Or it can be accessed by a
@ -208,7 +211,7 @@ compute as input. See the :doc:`Howto output <Howto_output>` doc page
for an overview of LAMMPS output options.
All the scalar or vector values calculated by this compute are
"intensive", except when the *sum* or *sumsq* modes are used on
"intensive", except when the *sum*, *sumabs* or *sumsq* modes are used on
per-atom or local vectors, in which case the calculated values are
"extensive".

View File

@ -33,7 +33,7 @@ Syntax
* R_1, R_2,... = list of cutoff radii, one for each type (distance units)
* w_1, w_2,... = list of neighbor weights, one for each type
* zero or more keyword/value pairs may be appended
* keyword = *rmin0* or *switchflag* or *bzeroflag* or *quadraticflag* or *chem* or *bnormflag* or *wselfallflag* or *bikflag* or *switchinnerflag*
* keyword = *rmin0* or *switchflag* or *bzeroflag* or *quadraticflag* or *chem* or *bnormflag* or *wselfallflag* or *bikflag* or *switchinnerflag* or *sinner* or *dinner*
.. parsed-literal::
@ -59,9 +59,13 @@ Syntax
*bikflag* value = *0* or *1* (only implemented for compute snap)
*0* = per-atom bispectrum descriptors are summed over atoms
*1* = per-atom bispectrum descriptors are not summed over atoms
*switchinnerflag* values = *rinnerlist* *drinnerlist*
*rinnerlist* = *ntypes* values of rinner (distance units)
*drinnerlist* = *ntypes* values of drinner (distance units)
*switchinnerflag* value = *0* or *1*
*0* = do not use inner switching function
*1* = use inner switching function
*sinner* values = *sinnerlist*
*sinnerlist* = *ntypes* values of *Sinner* (distance units)
*dinner* values = *dinnerlist*
*dinnerlist* = *ntypes* values of *Dinner* (distance units)
Examples
""""""""
@ -73,7 +77,7 @@ Examples
compute vb all sna/atom 1.4 0.95 6 2.0 1.0
compute snap all snap 1.4 0.95 6 2.0 1.0
compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 chem 2 0 1
compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 switchinnerflag 1.1 1.3 0.5 0.6
compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 switchinnerflag 1 sinner 1.35 1.6 dinner 0.25 0.3
Description
"""""""""""
@ -312,25 +316,29 @@ the resulting bispectrum rows are :math:`B_{i,k}` instead of just
:math:`B_k`. In this case, the entries in the final column for these rows
are set to zero.
The keyword *switchinnerflag* activates an additional radial switching
The keyword *switchinnerflag* with value 1
activates an additional radial switching
function similar to :math:`f_c(r)` above, but acting to switch off
smoothly contributions from neighbor atoms at short separation distances.
This is useful when SNAP is used in combination with a simple
repulsive potential. The keyword is followed by the *ntypes*
values for :math:`r_{inner}` and the *ntypes*
values for :math:`\Delta r_{inner}`. For a neighbor atom at
repulsive potential. For a neighbor atom at
distance :math:`r`, its contribution is scaled by a multiplicative
factor :math:`f_{inner}(r)` defined as follows:
.. math::
= & 0, r \leq r_{inner} \\
f_{inner}(r) = & \frac{1}{2}(1 - \cos(\pi \frac{r-r_{inner}}{\Delta r_{inner}})), r_{inner} < r \leq r_{inner} + \Delta r_{inner} \\
= & 1, r > r_{inner} + \Delta r_{inner}
= & 0, r \leq S_{inner} - D_{inner} \\
f_{inner}(r) = & \frac{1}{2}(1 - \cos(\frac{\pi}{2} (1 + \frac{r-S_{inner}}{D_{inner}})), S_{inner} - D_{inner} < r \leq S_{inner} + D_{inner} \\
= & 1, r > S_{inner} + D_{inner}
The values of :math:`r_{inner}` and :math:`\Delta r_{inner}` are
the arithmetic means of the values for the central atom of type I
and the neighbor atom of type J.
where the switching region is centered at :math:`S_{inner}` and it extends a distance :math:`D_{inner}`
to the left and to the right of this.
With this option, additional keywords *sinner* and *dinner* must be used,
each followed by *ntypes*
values for :math:`S_{inner}` and :math:`D_{inner}`, respectively.
When the central atom and the neighbor atom have different types,
the values of :math:`S_{inner}` and :math:`D_{inner}` are
the arithmetic means of the values for both types.
.. note::
@ -450,7 +458,7 @@ Default
The optional keyword defaults are *rmin0* = 0,
*switchflag* = 1, *bzeroflag* = 1, *quadraticflag* = 0,
*bnormflag* = 0, *wselfallflag* = 0
*bnormflag* = 0, *wselfallflag* = 0, *switchinnerflag* = 0,
----------

View File

@ -198,7 +198,9 @@ potentials only include the pair potential portion of the EAM
interaction when used by this compute, not the embedding term. Also
bonded or Kspace interactions do not contribute to this compute.
The computes in this package are not compatible with dynamic groups.
When used with dynamic groups, a :doc:`run 0 <run>` command needs to
be inserted in order to initialize the dynamic groups before accessing
the computes.
Related commands
""""""""""""""""

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,17 +20,19 @@ 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)
region-ID = create atoms within this region, use NULL for entire simulation box
* zero or more keyword/value pairs may be appended
* keyword = *mol* or *basis* or *ratio* or *subset* or *remap* or *var* or *set* or *rotate* or *units*
* keyword = *mol* or *basis* or *ratio* or *subset* or *remap* or *var* or *set* or *rotate* or *overlap* or *maxtry* or *units*
.. parsed-literal::
*mol* value = template-ID seed
*mol* values = template-ID seed
template-ID = ID of molecule template specified in a separate :doc:`molecule <molecule>` command
seed = random # seed (positive integer)
*basis* values = M itype
@ -47,9 +49,21 @@ 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
*overlap* value = Doverlap
Doverlap = only insert if at least this distance from all existing atoms
*maxtry* value = Ntry
Ntry = number of attempts to insert a particle before failure
*units* value = *lattice* or *box*
*lattice* = the geometry is defined in lattice units
*box* = the geometry is defined in simulation box units
@ -64,17 +78,21 @@ Examples
create_atoms 3 region regsphere basis 2 3 ratio 0.5 74637
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) on a lattice, or a single
atom (or molecule), or a random collection of atoms (or molecules), as
an alternative to reading in their 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
This command creates atoms (or molecules) within the simulation box,
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".
@ -97,58 +115,126 @@ particular dimension, LAMMPS is careful to put exactly one particle at
the boundary (on either side of the box), not zero or two.
For the *region* style, a geometric volume is filled with particles on
the lattice. This volume what is inside the simulation box and is
also consistent with the region volume. See the :doc:`region <region>`
command for details. Note that a region can be specified so that its
"volume" is either inside or outside a geometric boundary. Also note
that if your region is the same size as a periodic simulation box (in
some dimension), LAMMPS does not implement the same logic described
above as for the *box* style, to insure exactly one particle at
periodic boundaries. if this is what you desire, you should either
use the *box* style, or tweak the region size to get precisely the
particles you want.
the lattice. This volume is what is both inside the simulation box
and also consistent with the region volume. See the :doc:`region
<region>` command for details. Note that a region can be specified so
that its "volume" is either inside or outside its geometric boundary.
Also note that if a region is the same size as a periodic simulation
box (in some dimension), LAMMPS does NOT implement the same logic
described above for the *box* style, to insure exactly one particle at
periodic boundaries. If this is desired, you should either use the
*box* style, or tweak the region size to get precisely the particles
you want.
For the *single* style, a single particle is added to the system at
the specified coordinates. This can be useful for debugging purposes
or to create a tiny system with a handful of particles at specified
positions.
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
specified random number *seed*, resulting in the same set of particles
coordinates, independent of how many processors are being used in the
simulation. If the *region-ID* argument is specified as NULL, then
the created particles will be anywhere in the simulation box. If a
*region-ID* is specified, a geometric volume is filled which is both
inside the simulation box and is also consistent with the region
volume. See the :doc:`region <region>` command for details. Note that
a region can be specified so that its "volume" is either inside or
outside a geometric boundary.
.. 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::
Particles generated by the *random* style will typically be
highly overlapped which will cause many interatomic potentials to
compute large energies and forces. Thus you should either perform an
:doc:`energy minimization <minimize>` or run dynamics with :doc:`fix nve/limit <fix_nve_limit>` to equilibrate such a system, before
running normal dynamics.
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 that this command adds particles to those that already exist.
This means it can be used to add particles to a system previously read
in from a data or restart file. Or the create_atoms command can be
used multiple times, to add multiple sets of particles to the
simulation. For example, grain boundaries can be created, by
interleaving create_atoms with :doc:`lattice <lattice>` commands
specifying different orientations. By using the create_atoms command
in conjunction with the :doc:`delete_atoms <delete_atoms>` command,
reasonably complex geometries can be created, or a protein can be
solvated with a surrounding box of water molecules.
.. note::
In all these cases, care should be taken to insure that new atoms do
not overlap existing atoms inappropriately, especially if molecules
are being added. The :doc:`delete_atoms <delete_atoms>` command can be
used to remove overlapping atoms or molecules.
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
specified random number *seed*, resulting in the same set of particle
coordinates, independent of how many processors are being used in the
simulation. Unless the *overlap* keyword is specified, particles
created by the *random* style will typically be highly overlapped.
Various additional criteria can be used to accept or reject a random
particle insertion; see the keyword discussion below. Multiple
attempts per particle are made (see the *maxtry* keyword) until the
insertion is either successful or fails. If this command fails to add
all requested *N* particles, a warning will be output.
If the *region-ID* argument is specified as NULL, then the randomly
created particles will be anywhere in the simulation box. If a
*region-ID* is specified, a geometric volume is filled which is both
inside the simulation box and is also consistent with the region
volume. See the :doc:`region <region>` command for details. Note
that a region can be specified so that its "volume" is either inside
or outside its geometric boundary.
Note that the create_atoms command adds particles to those that
already exist. This means it can be used to add particles to a system
previously read in from a data or restart file. Or the create_atoms
command can be used multiple times, to add multiple sets of particles
to the simulation. For example, grain boundaries can be created, by
interleaving the create_atoms command with :doc:`lattice <lattice>`
commands specifying different orientations.
When this command is used, care should be taken to insure the
resulting system does not contain particles which are highly
overlapped. Such overlaps will cause many interatomic potentials to
compute huge energies and forces, leading to bad dynamics. There are
several strategies to avoid this problem:
* Use the :doc:`delete_atoms overlap <delete_atoms>` command after
create_atoms. For example, this strategy can be used to overlay and
surround a large protein molecule with a volume of water molecules,
then delete water molecules that overlap with the protein atoms.
* For the *random* style, use the optional *overlap* keyword to avoid
overlaps when each new particle is created.
* Before running dynamics on an overlapped system, perform an
:doc:`energy minimization <minimize>`. Or run initial dynamics with
:doc:`pair_style soft <pair_soft>` or with :doc:`fix nve/limit
<fix_nve_limit>` to un-overlap the particles, before running normal
dynamics.
.. note::
@ -156,12 +242,13 @@ used to remove overlapping atoms or molecules.
that are outside the simulation box; they will just be ignored by
LAMMPS. This is true even if you are using shrink-wrapped box
boundaries, as specified by the :doc:`boundary <boundary>` command.
However, you can first use the :doc:`change_box <change_box>` command to
temporarily expand the box, then add atoms via create_atoms, then
finally use change_box command again if needed to re-shrink-wrap the
new atoms. See the :doc:`change_box <change_box>` page for an
example of how to do this, using the create_atoms *single* style to
insert a new atom outside the current simulation box.
However, you can first use the :doc:`change_box <change_box>`
command to temporarily expand the box, then add atoms via
create_atoms, then finally use change_box command again if needed
to re-shrink-wrap the new atoms. See the :doc:`change_box
<change_box>` doc page for an example of how to do this, using the
create_atoms *single* style to insert a new atom outside the
current simulation box.
----------
@ -180,17 +267,19 @@ Using a lattice to add molecules, e.g. via the *box* or *region* or
points, except that entire molecules are added at each point, i.e. on
the point defined by each basis atom in the unit cell as it tiles the
simulation box or region. This is done by placing the geometric
center of the molecule at the lattice point, and giving the molecule a
random orientation about the point. The random *seed* specified with
the *mol* keyword is used for this operation, and the random numbers
generated by each processor are different. This means the coordinates
of individual atoms (in the molecules) will be different when running
on different numbers of processors, unlike when atoms are being
created in parallel.
center of the molecule at the lattice point, and (by default) giving
the molecule a random orientation about the point. The random *seed*
specified with the *mol* keyword is used for this operation, and the
random numbers generated by each processor are different. This means
the coordinates of individual atoms (in the molecules) will be
different when running on different numbers of processors, unlike when
atoms are being created in parallel.
Also note that because of the random rotations, it may be important to
use a lattice with a large enough spacing that adjacent molecules will
not overlap, regardless of their relative orientations.
Note that with random rotations, it may be important to use a lattice
with a large enough spacing that adjacent molecules will not overlap,
regardless of their relative orientations. See the description of the
*rotate* keyword below, which overrides the default random orientation
and inserts all molecules at a specified orientation.
.. note::
@ -204,7 +293,7 @@ not overlap, regardless of their relative orientations.
----------
This is the meaning of the other allowed keywords.
This is the meaning of the other optional keywords.
The *basis* keyword is only used when atoms (not molecules) are being
created. It specifies an atom type that will be assigned to specific
@ -234,18 +323,24 @@ and no particle is created if its position is outside the box.
The *var* and *set* keywords can be used together to provide a
criterion for accepting or rejecting the addition of an individual
atom, based on its coordinates. The *name* specified for the *var*
keyword is the name of an :doc:`equal-style variable <variable>` which
should evaluate to a zero or non-zero value based on one or two or
three variables which will store the x, y, or z coordinates of an atom
(one variable per coordinate). If used, these other variables must be
:doc:`internal-style variables <variable>` defined in the input script;
their initial numeric value can be anything. They must be
atom, based on its coordinates. They apply to all styles except
*single*. The *name* specified for the *var* keyword is the name of
an :doc:`equal-style variable <variable>` which should evaluate to a
zero or non-zero value based on one or two or three variables which
will store the x, y, or z coordinates of an atom (one variable per
coordinate). If used, these other variables must be
:doc:`internal-style variables <variable>` defined in the input
script; their initial numeric value can be anything. They must be
internal-style variables, because this command resets their values
directly. The *set* keyword is used to identify the names of these
other variables, one variable for the x-coordinate of a created atom,
one for y, and one for z.
.. figure:: img/sinusoid.jpg
:figwidth: 50%
:align: right
:target: _images/sinusoid.jpg
When an atom is created, its x,y,z coordinates become the values for
any *set* variable that is defined. The *var* variable is then
evaluated. If the returned value is 0.0, the atom is not created. If
@ -259,28 +354,26 @@ the sinusoid would appear to be "smoother". Also note the use of the
"xlat" and "ylat" :doc:`thermo_style <thermo_style>` keywords which
converts lattice spacings to distance.
.. only:: html
(Click on the image for a larger version)
.. code-block:: LAMMPS
dimension 2
variable x equal 100
variable y equal 25
lattice hex 0.8442
region box block 0 $x 0 $y -0.5 0.5
create_box 1 box
dimension 2
variable x equal 100
variable y equal 25
lattice hex 0.8442
region box block 0 $x 0 $y -0.5 0.5
create_box 1 box
variable xx internal 0.0
variable yy internal 0.0
variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0"
create_atoms 1 box var v set x xx set y yy
write_dump all atom sinusoid.lammpstrj
variable xx internal 0.0
variable yy internal 0.0
variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0"
create_atoms 1 box var v set x xx set y yy
write_dump all atom sinusoid.lammpstrj
.. image:: img/sinusoid.jpg
:scale: 50%
:align: center
.. raw:: html
Click on the image for a larger version.
-----
The *rotate* keyword allows specification of the orientation
at which molecules are inserted. The axis of rotation is
@ -291,10 +384,79 @@ 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
created are molecules, the radius of the molecule (from its geometric
center) is added to *Doverlap*. If particles have finite size (see
:doc:`atom_style sphere <atom_style>` for example) *Doverlap* should
be specified large enough to include the particle size in the
non-overlapping criterion.
.. note::
Checking for overlaps is a costly O(N(N+M)) operation for inserting
*N* new particles into a system with *M* existing particles. This
is because distances to all *M* existing particles are computed for
each new particle that is added. Thus the intended use of this
keyword is to add relatively small numbers of particles to systems
which remain at a relatively low density even after the new
particles are created. Careful use of the *maxtry* keyword in
combination with *overlap* is recommended. See the discussion
above about systems with overlapped particles for alternate
strategies that allow for overlapped insertions.
The *maxtry* keyword only applies to the *random* style. It limits
the number of attempts to generate valid coordinates for a single new
particle that satisfy all requirements imposed by the *region*, *var*,
and *overlap* keywords. The default is 10 attempts per particle
before the loop over the requested *N* particles advances to the next
particle. Note that if insertion success is unlikely (e.g. inserting
new particles into a dense system using the *overlap* keyword),
setting the *maxtry* keyword to a large value may result in this
command running for a long time.
.. figure:: img/overlap.png
:figwidth: 30%
:align: right
:target: _images/overlap.png
Here is an example for the *random* style using these commands
.. code-block:: LAMMPS
units lj
dimension 2
region box block 0 50 0 50 -0.5 0.5
create_box 1 box
create_atoms 1 random 2000 13487 NULL overlap 1.0 maxtry 50
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
to produce a system as shown in the image with 1520 particles (out of
2000 requested) that are moderately dense and which have no overlaps
sufficient to prevent the LJ pair_style from running properly (because
the overlap criterion = 1.0). The create_atoms command ran for 0.3 s
on a single CPU core.
.. only:: html
(Click on the image for a larger version)
-----
The *units* keyword determines the meaning of the distance units used
to specify the coordinates of the one particle created by the *single*
style. A *box* value selects standard distance units as defined by
the :doc:`units <units>` command, e.g. Angstroms for units = real or
style, or the overlap distance *Doverlap* by the *overlap* keyword. A
*box* value selects standard distance units as defined by the
:doc:`units <units>` command, e.g. Angstroms for units = real or
metal. A *lattice* value means the distance units are in lattice
spacings.
@ -315,9 +477,10 @@ assigned to created molecules in a similar fashion.
Aside from their ID, atom type, and xyz position, other properties of
created atoms are set to default values, depending on which quantities
are defined by the chosen :doc:`atom style <atom_style>`. See the :doc:`atom style <atom_style>` command for more details. See the
:doc:`set <set>` and :doc:`velocity <velocity>` commands for info on how
to change these values.
are defined by the chosen :doc:`atom style <atom_style>`. See the
:doc:`atom style <atom_style>` command for more details. See the
:doc:`set <set>` and :doc:`velocity <velocity>` commands for info on
how to change these values.
* charge = 0.0
* dipole moment magnitude = 0.0
@ -336,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
@ -372,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, 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*
* style = *group* or *region* or *overlap* or *random* or *variable*
.. parsed-literal::
@ -20,12 +20,19 @@ 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
* zero or more keyword/value pairs may be appended
* keyword = *compress* or *bond* or *mol*
@ -45,15 +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.
@ -79,17 +88,44 @@ 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
can be deleted if they are in a molecule for which one or more atoms
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

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

@ -211,6 +211,9 @@ accelerated styles exist.
* :doc:`edpd/source <fix_dpd_source>` - add heat source to eDPD simulations
* :doc:`efield <fix_efield>` - impose electric field on system
* :doc:`ehex <fix_ehex>` - enhanced heat exchange algorithm
* :doc:`electrode/conp <fix_electrode_conp>` - impose electric potential
* :doc:`electrode/conq <fix_electrode_conp>` - impose total electric charge
* :doc:`electrode/thermo <fix_electrode_conp>` - apply thermo-potentiostat
* :doc:`electron/stopping <fix_electron_stopping>` - electronic stopping power as a friction force
* :doc:`electron/stopping/fit <fix_electron_stopping>` - electronic stopping power as a friction force
* :doc:`enforce2d <fix_enforce2d>` - zero out z-dimension velocity and force

View File

@ -272,10 +272,18 @@ each input value specified in the fix ave/time command. For *mode* =
scalar, this means a single line is written each time output is
performed. Thus the file ends up to be a series of lines, i.e. one
column of numbers for each input value. For *mode* = vector, an array
of numbers is written each time output is performed. The number of
rows is the length of the input vectors, and the number of columns is
the number of values. Thus the file ends up to be a series of these
array sections.
of numbers is written each time output is performed. The number of rows
is the length of the input vectors, and the number of columns is the
number of values. Thus the file ends up to be a series of these array
sections.
If the filename ends in '.yaml' or '.yml' then the output format
conforms to the `YAML standard <https://yaml.org/>`_ which allows
easy import that data into tools and scripts that support reading YAML
files. The :doc:`structured data Howto <Howto_structured_data>` contains
examples for parsing and plotting such data with very little programming
effort in Python using the *pyyaml*, *pandas*, and *matplotlib*
packages.
The *overwrite* keyword will continuously overwrite the output file
with the latest output, so that it only contains one timestep worth of
@ -321,8 +329,10 @@ appropriate fields from the fix ave/time command.
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
are relevant to this fix.
No information about this fix is written to :doc:`binary restart files
<restart>`. The :doc:`fix_modify colname <fix_modify>` option can be
used to change the name of the column in the output file. When writing
a YAML format file this name will be in the list of keywords.
This fix produces a global scalar or global vector or global array
which can be accessed by various :doc:`output commands <Howto_output>`.

View File

@ -0,0 +1,221 @@
.. index:: fix electrode/conp
.. index:: fix electrode/conq
.. index:: fix electrode/thermo
.. index:: fix electrode/conp/intel
.. index:: fix electrode/conq/intel
.. index:: fix electrode/thermo/intel
fix electrode/conp command
==========================
Accelerator Variant: *electrode/conp/intel*
fix electrode/conq command
==========================
Accelerator Variant: *electrode/conq/intel*
fix electrode/thermo command
============================
Accelerator Variant: *electrode/thermo/intel*
Syntax
""""""
.. parsed-literal::
fix ID group-ID electrode/conp potential eta keyword values ...
fix ID group-ID electrode/conq charge eta keyword values ...
fix ID group-ID electrode/thermo potential eta temp T_v tau_v rng_v keyword values ...
* ID, group-ID are documented in fix command
* mode = electrode/conp or electrode/conq or electrode/thermo
* potential = electrode potential
* charge = electrode charge
* eta = reciprocal width of electrode charge smearing
* T_v = temperature of thermo-potentiostat
* tau_v = time constant of thermo-potentiostat
* rng_v = integer used to initialize random number generator
.. parsed-literal::
*symm(etry) on/off*
turn on/off charge neutrality constraint for the electrodes
*couple group-ID value*
group-ID = group of atoms treated as additional electrode
value = electric potential or charge on this electrode
*etypes values = atom types*
specify atom types exclusive to the electrode for optimized neighbor lists
*ffield on/off*
turn on/off finite-field implementation
*write_mat filename*
write elastance matrix to file
*write_inv filename*
write inverted matrix to file
*read_mat filename*
read elastance matrix from file
*read_inv filename*
read inverted matrix from file
Examples
""""""""
.. code-block:: LAMMPS
fix fxconp bot electrode/conp -1.0 1.805 couple top 1.0 couple ref 0.0 write_inv inv.csv symm on
fix fxconp electrodes electrode/conq 0.0 1.805
fix fxconp bot electrode/thermo -1.0 1.805 temp 298 100 couple top 1.0
Description
"""""""""""
fix electrode/conp mode implements a constant potential method (CPM)
(:ref:`Siepmann <Siepmann>`, :ref:`Reed <Reed3>`). Charges of groups specified
via group-ID and optionally with the `couple` keyword are adapted to meet their respective
potential at every time step. An arbitrary number of electrodes can be set but
the respective groups may not overlap. Electrode charges have a Gaussian charge
distribution with reciprocal width eta. The energy minimization is achieved via
matrix inversion :ref:`(Wang) <Wang5>`.
fix electrode/conq enforces a total charge specified in the input on each electrode. The energy is
minimized w.r.t. the charge distribution within the electrode.
fix electrode/thermo implements a thermo-potentiostat :ref:`(Deissenbeck)
<Deissenbeck>`. Temperature and time constant of the thermo-potentiostat need
to be specified using the temp keyword. Currently, only two electrodes are possible with
this style.
This fix necessitates the use of a long range solver that calculates and provides the matrix
of electrode-electrode interactions and a vector of electrode-electrolyte
interactions. The Kspace styles *ewald/electrode*, *pppm/electrode* and
*pppm/electrode/intel* are created specifically for this task
:ref:`(Ahrens-Iwers) <Ahrens-Iwers>`.
For systems with non-periodic boundaries in one or two directions dipole
corrections are available with the :doc:`kspace_modify <kspace_modify>`. For
ewald/electrode a two-dimensional Ewald summation :ref:`(Hu) <Hu>` can be used
by setting "slab ew2d":
.. code-block:: LAMMPS
kspace_modify slab <slab_factor>
kspace_modify wire <wire_factor>
kspace_modify slab ew2d
Two implementations for the calculation of the elastance matrix are available
with pppm and can be selected using the *amat onestep/twostep* keyword.
*onestep* is the default; *twostep* can be faster for large electrodes and a
moderate mesh size but requires more memory.
.. code-block:: LAMMPS
kspace_modify amat onestep/twostep
The *fix_modify tf* option enables the Thomas-Fermi metallicity model
(:ref:`Scalfi <Scalfi>`) and allows parameters to be set for each atom type.
.. code-block:: LAMMPS
fix_modify ID tf type length voronoi
If this option is used parameters must be set for all atom types of the electrode.
The *fix_modify timer* option turns on (off) additional timer outputs in the log
file, for code developers to track optimization.
.. code-block:: LAMMPS
fix_modify ID timer on/off
The *fix_modify set* options allow calculated quantities to be accessed via
internal variables. Currently four types of quantities can be accessed:
.. code-block:: LAMMPS
fix-modify ID set v group-ID variablename
fix-modify ID set qsb group-ID variablename
fix-modify ID set mc group-ID1 group-ID2 variablename
fix-modify ID set me group-ID1 group-ID2 variablename
One use case is to output the potential that is internally calculated and
applied to each electrode group by *fix electrode/conq* or *fix electrode/thermo*.
For that case the *v* option makes *fix electrode* update the variable
*variablename* with the potential applied to group *group-ID*, where *group-ID*
must be a group whose charges are updated by *fix electrode* and *variablename*
must be an internal-style variable:
.. code-block:: LAMMPS
fix conq bot electrode/conq -1.0 1.979 couple top 1.0
variable vbot internal 0.0
fix_modify conq set v bot vbot
The *qsb* option similarly outputs the total updated charge of the group if its
potential were 0.0V. The *mc* option requires two *group-IDs*, and outputs the
entry \{*group-ID1*, *group-ID2*\} of the (symmetric) *macro-capacitance* matrix
(MC) which relates the electrodes' applied potentials (V), total charges (Q), and
total charges at 0.0 V (Qsb):
.. math::
\mathbf{Q} = \mathbf{Q}_{SB} + \mathbf{MC} \cdot \mathbf{V}
Lastly, the *me* option also requires two *group-IDs* and outputs the entry
\{*group-ID1*, *group-ID2*\} of the *macro-elastance* matrix, which is the
inverse of the macro-capacitance matrix. (As the names denote, the
macro-capacitance matrix gives electrode charges from potentials, and the
macro-elastance matrix gives electrode potentials from charges).
.. warning::
Positions of electrode particles have to be immobilized at all times.
The parallelization for the fix works best if electrode atoms are evenly
distributed across processors. For a system with two electrodes at the bottom
and top of the cell this can be achieved with *processors * * 2*, or with the
line
.. code-block:: LAMMPS
if "$(extract_setting(world_size) % 2) == 0" then "processors * * 2"
which avoids an error if the script is run on an odd number of processors (such
as on just one processor for testing).
----------
.. include:: accel_styles.rst
----------
.. _Siepmann:
**(Siepmann)** Siepmann and Sprik, J. Chem. Phys. 102, 511 (1995).
.. _Reed3:
**(Reed)** Reed *et al.*, J. Chem. Phys. 126, 084704 (2007).
.. _Wang5:
**(Wang)** Wang *et al.*, J. Chem. Phys. 141, 184102 (2014).
.. _Deissenbeck:
**(Deissenbeck)** Deissenbeck *et al.*, Phys. Rev. Letters 126, 136803 (2021).
.. _Ahrens-Iwers:
**(Ahrens-Iwers)** Ahrens-Iwers and Meissner, J. Chem. Phys. 155, 104104 (2021).
.. _Hu:
**(Hu)** Hu, J. Chem. Theory Comput. 10, 5254 (2014).
.. _Scalfi:
**(Scalfi)** Scalfi *et al.*, J. Chem. Phys., 153, 174704 (2020).

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,19 +12,23 @@ Syntax
* fix-ID = ID of the fix to modify
* one or more keyword/value pairs may be appended
* keyword = *temp* or *press* or *energy* or *virial* or *respa* or *dynamic/dof* or *bodyforces*
* keyword = *bodyforces* or *colname* or *dynamic/dof* or *energy* or *press* or *respa* or *temp* or *virial*
.. parsed-literal::
*temp* value = compute ID that calculates a temperature
*press* value = compute ID that calculates a pressure
*energy* value = *yes* or *no*
*virial* value = *yes* or *no*
*respa* value = *1* to *max respa level* or *0* (for outermost level)
*dynamic/dof* value = *yes* or *no*
yes/no = do or do not re-compute the number of degrees of freedom (DOF) contributing to the temperature
*bodyforces* value = *early* or *late*
early/late = compute rigid-body forces/torques early or late in the timestep
*colname* values = ID string
string = new column header name
ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output
*or* a fix output property keyword or reference to compute, fix, property or variable.
*dynamic/dof* value = *yes* or *no*
yes/no = do or do not re-compute the number of degrees of freedom (DOF) contributing to the temperature
*energy* value = *yes* or *no*
*press* value = compute ID that calculates a pressure
*respa* value = *1* to *max respa level* or *0* (for outermost level)
*temp* value = compute ID that calculates a temperature
*virial* value = *yes* or *no*
Examples
""""""""
@ -34,6 +38,7 @@ Examples
fix_modify 3 temp myTemp press myPress
fix_modify 1 energy yes
fix_modify tether respa 2
fix_modify ave colname c_thermo_press Pressure colname 1 Temperature
Description
"""""""""""
@ -165,6 +170,20 @@ will have no effect on the motion of the rigid bodies if they are
specified in the input script after the fix rigid command. LAMMPS
will give a warning if that is the case.
The *colname* keyword can be used to change the default header keywords
in output files of fix styles that support it: currently only :doc:`fix
ave/time <fix_ave_time>` is supported. The setting for *ID string*
replaces the default text with the provided string. *ID* can be a
positive integer when it represents the column number counting from the
left, a negative integer when it represents the column number from the
right (i.e. -1 is the last column/keyword), or a custom fix output
keyword (or compute, fix, property, or variable reference) and then it
replaces the string for that specific keyword. The *colname* keyword can
be used multiple times. If multiple *colname* settings refer to the same
keyword, the last setting has precedence.
Restrictions
""""""""""""
none
@ -172,7 +191,8 @@ none
Related commands
""""""""""""""""
:doc:`fix <fix>`, :doc:`compute temp <compute_temp>`, :doc:`compute pressure <compute_pressure>`, :doc:`thermo_style <thermo_style>`
:doc:`fix <fix>`, :doc:`compute temp <compute_temp>`,
:doc:`compute pressure <compute_pressure>`, :doc:`thermo_style <thermo_style>`
Default
"""""""

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

@ -39,19 +39,35 @@ Description
Print a text string every N steps during a simulation run. This can
be used for diagnostic purposes or as a debugging tool to monitor some
quantity during a run. The text string must be a single argument, so
it should be enclosed in double quotes if it is more than one word.
If it contains variables it must be enclosed in double quotes to
insure they are not evaluated when the input script line is read, but
will instead be evaluated each time the string is printed.
it should be enclosed in single or double quotes if it is more than
one word. If it contains variables it must be enclosed in double
quotes to insure they are not evaluated when the input script line is
read, but will instead be evaluated each time the string is printed.
Instead of a numeric value, N can be specified as an :doc:`equal-style variable <variable>`, which should be specified as v_name, where
name is the variable name. In this case, the variable is evaluated at
the beginning of a run to determine the **next** timestep at which the
.. note::
As discussed on the :doc:`Commands parse <Commands_parse>` doc
page, the text string can use "immediate" variables, specified as
$(formula) with parenthesis, where the numeric formula has the same
syntax as equal-style variables described on the :doc:`variable
<variable>` doc page. This is a convenient way to evaluate a
formula immediately without using the variable command to define a
named variable and then use that variable in the text string. The
formula can include a trailing colon and format string which
determines the precision with which the numeric value is output.
This is also explained on the :doc:`Commands parse
<Commands_parse>` doc page.
Instead of a numeric value, N can be specified as an :doc:`equal-style
variable <variable>`, which should be specified as v_name, where name
is the variable name. In this case, the variable is evaluated at the
beginning of a run to determine the **next** timestep at which the
string will be written out. On that timestep, the variable will be
evaluated again to determine the next timestep, etc.
Thus the variable should return timestep values. See the stagger()
and logfreq() and stride() math functions for :doc:`equal-style variables <variable>`, as examples of useful functions to use in
this context. For example, the following commands will print output at
evaluated again to determine the next timestep, etc. Thus the
variable should return timestep values. See the stagger() and
logfreq() and stride() math functions for :doc:`equal-style variables
<variable>`, as examples of useful functions to use in this
context. For example, the following commands will print output at
timesteps 10,20,30,100,200,300,1000,2000,etc:
.. code-block:: LAMMPS
@ -61,12 +77,12 @@ timesteps 10,20,30,100,200,300,1000,2000,etc:
The specified group-ID is ignored by this fix.
See the :doc:`variable <variable>` command for a description of *equal*
style variables which are the most useful ones to use with the fix
print command, since they are evaluated afresh each timestep that the
fix print line is output. Equal-style variables calculate formulas
involving mathematical operations, atom properties, group properties,
thermodynamic properties, global values calculated by a
See the :doc:`variable <variable>` command for a description of
*equal* style variables which are the most useful ones to use with the
fix print command, since they are evaluated afresh each timestep that
the fix print line is output. Equal-style variables calculate
formulas involving mathematical operations, atom properties, group
properties, thermodynamic properties, global values calculated by a
:doc:`compute <compute>` or :doc:`fix <fix>`, or references to other
:doc:`variables <variable>`.
@ -92,11 +108,13 @@ where ID is replaced with the fix-ID.
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various :doc:`output commands <Howto_output>`.
No information about this fix is written to :doc:`binary restart files
<restart>`. None of the :doc:`fix_modify <fix_modify>` options are
relevant to this fix. No global or per-atom quantities are stored by
this fix for access by various :doc:`output commands <Howto_output>`.
No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
the :doc:`run <run>` command. This fix is not invoked during
:doc:`energy minimization <minimize>`.
Restrictions
""""""""""""

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

BIN
doc/src/img/overlap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

View File

@ -51,9 +51,13 @@ Syntax
*slab* value = volfactor or *nozforce*
volfactor = ratio of the total extended volume used in the
2d approximation compared with the volume of the simulation domain
*ew2d* EW2D correction (available with ELECTRODE package)
*nozforce* turns off kspace forces in the z direction
*splittol* value = tol
tol = relative size of two eigenvalues (see discussion below)
*wire* value = volfactor (available with ELECTRODE package)
volfactor = ratio of the total extended dimension used in the 1d
approximation compared with the dimension of the simulation domain
Examples
""""""""

View File

@ -4,6 +4,7 @@
.. index:: kspace_style ewald/disp
.. index:: kspace_style ewald/disp/dipole
.. index:: kspace_style ewald/omp
.. index:: kspace_style ewald/electrode
.. index:: kspace_style pppm
.. index:: kspace_style pppm/kk
.. index:: kspace_style pppm/omp
@ -23,6 +24,8 @@
.. index:: kspace_style pppm/stagger
.. index:: kspace_style pppm/tip4p
.. index:: kspace_style pppm/tip4p/omp
.. index:: kspace_style pppm/electrode
.. index:: kspace_style pppm/electrode/intel
.. index:: kspace_style msm
.. index:: kspace_style msm/omp
.. index:: kspace_style msm/cg
@ -40,7 +43,7 @@ Syntax
kspace_style style value
* style = *none* or *ewald* or *ewald/dipole* or *ewald/dipole/spin* or *ewald/disp* or *ewald/disp/dipole* or *ewald/omp* or *pppm* or *pppm/cg* or *pppm/disp* or *pppm/tip4p* or *pppm/stagger* or *pppm/disp/tip4p* or *pppm/gpu* or *pppm/intel* or *pppm/disp/intel* or *pppm/kk* or *pppm/omp* or *pppm/cg/omp* or *pppm/disp/tip4p/omp* or *pppm/tip4p/omp* or *pppm/dielectic* or *pppm/disp/dielectric* or *msm* or *msm/cg* or *msm/omp* or *msm/cg/omp* or *msm/dielectric* or *scafacos*
* style = *none* or *ewald* or *ewald/dipole* or *ewald/dipole/spin* or *ewald/disp* or *ewald/disp/dipole* or *ewald/omp* or *ewald/electrode* or *pppm* or *pppm/cg* or *pppm/disp* or *pppm/tip4p* or *pppm/stagger* or *pppm/disp/tip4p* or *pppm/gpu* or *pppm/intel* or *pppm/disp/intel* or *pppm/kk* or *pppm/omp* or *pppm/cg/omp* or *pppm/disp/tip4p/omp* or *pppm/tip4p/omp* or *pppm/dielectic* or *pppm/disp/dielectric* or *pppm/electrode* or *pppm/electrode/intel* or *msm* or *msm/cg* or *msm/omp* or *msm/cg/omp* or *msm/dielectric* or *scafacos*
.. parsed-literal::
@ -57,6 +60,8 @@ Syntax
accuracy = desired relative error in forces
*ewald/omp* value = accuracy
accuracy = desired relative error in forces
*ewald/electrode* value = accuracy
accuracy = desired relative error in forces
*pppm* value = accuracy
accuracy = desired relative error in forces
*pppm/cg* values = accuracy (smallq)
@ -97,6 +102,10 @@ Syntax
accuracy = desired relative error in forces
*pppm/disp/dielectric* value = accuracy
accuracy = desired relative error in forces
*pppm/electrode* value = accuracy
accuracy = desired relative error in forces
*pppm/electrode/intel* value = accuracy
accuracy = desired relative error in forces
*msm* value = accuracy
accuracy = desired relative error in forces
*msm/cg* value = accuracy (smallq)
@ -273,6 +282,13 @@ parameters and how to choose them is described in
----------
The *electrode* styles add methods that are required for the constant potential
method implemented in :doc:`fix electrode/* <fix_electrode_conp>`. The styles
*ewald/electrode*, *pppm/electrode* and *pppm/electrode/intel* are available.
These styles do not support the `kspace_modify slab nozforce` command.
----------
The *msm* style invokes a multi-level summation method MSM solver,
:ref:`(Hardy) <Hardy2006>` or :ref:`(Hardy2) <Hardy2009>`, which maps atom charge
to a 3d mesh, and uses a multi-level hierarchy of coarser and coarser
@ -459,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

@ -1,10 +1,11 @@
.. index:: pair_style adp
.. index:: pair_style adp/kk
.. index:: pair_style adp/omp
pair_style adp command
======================
Accelerator Variants: *adp/omp*
Accelerator Variants: *adp/kk*, *adp/omp*
Syntax
""""""

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

@ -1,8 +1,11 @@
.. index:: pair_style ilp/tmd
.. index:: pair_style ilp/tmd/opt
pair_style ilp/tmd command
===================================
Accelerator Variant: *ilp/tmd/opt*
Syntax
""""""
@ -103,6 +106,10 @@ headings) the following commands could be included in an input script:
----------
.. include:: accel_styles.rst
----------
Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

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

@ -1,7 +1,10 @@
.. index:: pair_style pace
.. index:: pair_style pace/kk
pair_style pace command
========================
=======================
Accelerator Variants: *pace/kk*
Syntax
""""""
@ -10,13 +13,14 @@ Syntax
pair_style pace ... keyword values ...
* an optional keyword may be appended
* keyword = *product* or *recursive*
* one or more keyword/value pairs may be appended
.. parsed-literal::
keyword = *product* or *recursive* or *chunksize*
*product* = use product algorithm for basis functions
*recursive* = use recursive algorithm for basis functions
*chunksize* value = number of atoms in each pass
Examples
""""""""
@ -24,7 +28,7 @@ Examples
.. code-block:: LAMMPS
pair_style pace
pair_style pace product
pair_style pace product chunksize 2048
pair_coeff * * Cu-PBE-core-rep.ace Cu
Description
@ -59,11 +63,19 @@ Note that unlike for other potentials, cutoffs are
not set in the pair_style or pair_coeff command; they are specified in
the ACE file.
The pair_style *pace* command may be followed by an optional keyword
The pair_style *pace* command may be followed by the optional keyword
*product* or *recursive*, which determines which of two algorithms
is used for the calculation of basis functions and derivatives.
The default is *recursive*.
The keyword *chunksize* is only applicable when
using the pair style *pace* with the KOKKOS package on GPUs and is
ignored otherwise. This keyword controls the number of atoms
in each pass used to compute the atomic cluster expansion and is used to
avoid running out of memory. For example if there are 8192 atoms in the
simulation and the *chunksize* is set to 4096, the ACE
calculation will be broken up into two passes (running on a single GPU).
See the :doc:`pair_coeff <pair_coeff>` page for alternate ways
to specify the path for the ACE coefficient file.
@ -88,6 +100,10 @@ This pair style can only be used via the *pair* keyword of the
----------
.. include:: accel_styles.rst
----------
Restrictions
""""""""""""
@ -103,7 +119,7 @@ Related commands
Default
"""""""
recursive
recursive, chunksize = 4096
.. _Drautz20191:

View File

@ -1,8 +1,11 @@
.. index:: pair_style saip/metal
.. index:: pair_style saip/metal/opt
pair_style saip/metal command
===================================
Accelerator Variant: *saip/metal/opt*
Syntax
""""""
@ -102,6 +105,10 @@ headings) the following commands could be included in an input script:
----------
.. include:: accel_styles.rst
----------
Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

131
doc/src/pair_smatb.rst Normal file
View File

@ -0,0 +1,131 @@
.. index:: pair_style smatb
.. index:: pair_style smatb/single
pair_style smatb command
=========================
pair_style smatb/single command
===============================
Syntax
""""""
.. code-block:: LAMMPS
pair_style style args
* style = *smatb*
* args = none
.. parsed-literal::
*smatb*
Examples
""""""""
.. code-block:: LAMMPS
pair_style smatb
pair_coeff 1 1 2.88 10.35 4.178 0.210 1.818 4.07293506 4.9883063257983666
Description
"""""""""""
The *smatb* styles compute the Second Moment Approximation to the Tight Binding
:ref:`(Cyrot) <Cyrot>`, :ref:`(Gupta) <Gupta>`, :ref:`(Rosato) <Rosato>`,
given by
.. math::
E_{i} = \sum_{j,R_{ij}\leq R_{c}} \alpha(R_{ij}) - \sqrt{\sum_{j,R_{ij}\leq R_{c}}\Xi^2(R_{ij})}
:math:`R_{ij}` is the distance between the atom :math:`i` and :math:`j`.
And the two functions :math:`\alpha\left(r\right)` and :math:`\Xi\left(r\right)` are:
.. math::
\alpha\left(r\right)=\left\lbrace\begin{array}{ll}
A e^{-p \left(\frac{r}{R_{0}}-1\right)} & r < R_{sc}\\
a_3\left(r-R_{c}\right)^3+a_4\left(r-R_{c}\right)^4
+a_5\left(r-R_{c}\right)^5& R_{sc} < r < R_{c}
\end{array}
\right.
.. math::
\Xi\left(r\right)=\left\lbrace\begin{array}{ll}
\xi e^{-q \left(\frac{r}{R_{0}}-1\right)} & r < R_{sc}\\
x_3\left(r-R_{c}\right)^3+x_4\left(r-R_{c}\right)^4
+x_5\left(r-R_{c}\right)^5& R_{sc} < r < R_{c}
\end{array}
\right.
The polynomial coefficients :math:`a_3`, :math:`a_4`, :math:`a_5`,
:math:`x_3`, :math:`x_4`, :math:`x_5` are computed by LAMMPS: the two
exponential terms and their first and second derivatives are smoothly
reduced to zero, from the inner cutoff :math:`R_{sc}` to the outer
cutoff :math:`R_{c}`.
Coefficients
""""""""""""
The following coefficients must be defined for each pair of atoms types via the
:doc:`pair_coeff <pair_coeff>` command as in the examples above, or in the data
file or restart files read by the :doc:`read_data <read_data>` or
:doc:`read_restart <read_restart>` commands, or by mixing as described below:
* :math:`R_{0}` (distance units)
* :math:`p` (dimensionless)
* :math:`q` (dimensionless)
* :math:`A` (energy units)
* :math:`\xi` (energy units)
* :math:`R_{cs}` (distance units)
* :math:`R_{c}` (distance units)
Note that: :math:`R_{0}` is the nearest neighbor distance, usually coincides
with the diameter of the atoms
See the :doc:`run_style <run_style>` command for details.
----------
Mixing info
"""""""""""
For atom type pairs I,J and I != J the coefficients are not automatically mixed.
----------
Restrictions
""""""""""""
This pair style is part of the SMTBQ package and is only enabled
if LAMMPS is built with that package. See the :doc:`Build package <Build_package>` page for more info.
These pair potentials require the :doc:`newton <newton>` setting to be "on" for pair interactions.
Related commands
""""""""""""""""
* :doc:`pair_coeff <pair_coeff>`
Default
"""""""
none
----------
.. _Cyrot:
**(Cyrot)** Cyrot-Lackmann and Ducastelle, Phys Rev. B, 4, 2406-2412 (1971).
.. _Gupta:
**(Gupta)** Gupta ,Phys Rev. B, 23, 6265-6270 (1981).
.. _Rosato:
**(Rosato)** Rosato and Guillope and Legrand, Philosophical Magazine A, 59.2, 321-336 (1989).

View File

@ -136,7 +136,7 @@ keyword/value pair. The required keywords are *rcutfac* and
*twojmax*\ . Optional keywords are *rfac0*, *rmin0*,
*switchflag*, *bzeroflag*, *quadraticflag*, *chemflag*,
*bnormflag*, *wselfallflag*, *switchinnerflag*,
*rinner*, *drinner*, *chunksize*, and *parallelthresh*\ .
*sinner*, *dinner*, *chunksize*, and *parallelthresh*\ .
The default values for these keywords are
@ -152,6 +152,9 @@ The default values for these keywords are
* *chunksize* = 32768
* *parallelthresh* = 8192
For detailed definitions of all of these keywords,
see the :doc:`compute sna/atom <compute_sna_atom>` doc page.
If *quadraticflag* is set to 1, then the SNAP energy expression includes
additional quadratic terms that have been shown to increase the overall
accuracy of the potential without much increase in computational cost
@ -194,7 +197,7 @@ pair_coeff command, to avoid ambiguity in the number of coefficients.
The keyword *switchinnerflag* activates an additional switching function
that smoothly turns off contributions to the SNAP potential from neighbor
atoms at short separations. If *switchinnerflag* is set to 1 then
the additional keywords *rinner* and *drinner* must also be provided.
the additional keywords *sinner* and *dinner* must also be provided.
Each of these is followed by *nelements* values, where *nelements*
is the number of unique elements appearing in appearing in the LAMMPS
pair_coeff command. The element order should correspond to the order
@ -217,9 +220,6 @@ already large enough to saturate the GPU threads. Extra parallelism
will be performed if the *chunksize* (or total number of atoms per GPU)
is smaller than *parallelthresh*.
Detailed definitions for all the other keywords
are given on the :doc:`compute sna/atom <compute_sna_atom>` doc page.
.. note::
The previously used *diagonalstyle* keyword was removed in 2019,

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

@ -325,6 +325,8 @@ accelerated styles exist.
* :doc:`resquared <pair_resquared>` - Everaers RE-Squared ellipsoidal potential
* :doc:`saip/metal <pair_saip_metal>` - interlayer potential for hetero-junctions formed with hexagonal 2D materials and metal surfaces
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>` - smoothed dissipative particle dynamics for water at isothermal conditions
* :doc:`smatb <pair_smatb>` - Second Moment Approximation to the Tight Binding
* :doc:`smatb/single <pair_smatb>` - Second Moment Approximation to the Tight Binding for single-element systems
* :doc:`smd/hertz <pair_smd_hertz>` -
* :doc:`smd/tlsph <pair_smd_tlsph>` -
* :doc:`smd/tri_surface <pair_smd_triangulated_surface>` -

View File

@ -46,6 +46,20 @@ lines of output, the string can be enclosed in triple quotes, as in
the last example above. If the text string contains variables, they
will be evaluated and their current values printed.
.. note::
As discussed on the :doc:`Commands parse <Commands_parse>` doc
page, the text string can use "immediate" variables, specified as
$(formula) with parenthesis, where the numeric formula has the same
syntax as equal-style variables described on the :doc:`variable
<variable>` doc page. This is a convenient way to evaluate a
formula immediately without using the variable command to define a
named variable and then use that variable in the text string. The
formula can include a trailing colon and format string which
determines the precision with which the numeric value is output.
This is also explained on the :doc:`Commands parse
<Commands_parse>` doc page.
If the *file* or *append* keyword is used, a filename is specified to
which the output will be written. If *file* is used, then the
filename is overwritten if it already exists. If *append* is used,

View File

@ -11,7 +11,7 @@ Syntax
region ID style args keyword arg ...
* ID = user-assigned name for the region
* style = *delete* or *block* or *cone* or *cylinder* or *plane* or *prism* or *sphere* or *union* or *intersect*
* style = *delete* or *block* or *cone* or *cylinder* or *ellipsoid* or *plane* or *prism* or *sphere* or *union* or *intersect*
.. parsed-literal::
@ -29,6 +29,10 @@ Syntax
radius = cylinder radius (distance units)
c1,c2, and radius can be a variable (see below)
lo,hi = bounds of cylinder in dim (distance units)
*ellipsoid* args = x y z a b c
x,y,z = center of ellipsoid (distance units)
a,b,c = half the length of the principal axes of the ellipsoid (distance units)
x,y,z,a,b and c can be a variable (see below)
*plane* args = px py pz nx ny nz
px,py,pz = point on the plane (distance units)
nx,ny,nz = direction normal to plane (distance units)
@ -60,7 +64,7 @@ Syntax
*lattice* = the geometry is defined in lattice units
*box* = the geometry is defined in simulation box units
*move* args = v_x v_y v_z
v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time
v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time (distance units)
*rotate* args = v_theta Px Py Pz Rx Ry Rz
v_theta = equal-style variable for rotaton of region over time (in radians)
Px,Py,Pz = origin for axis of rotation (distance units)
@ -158,6 +162,12 @@ Thus the third example above specifies a cylinder with its axis in the
y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and
extending in the y-direction from -5.0 to the upper box boundary.
For style *ellipsoid*, an axis-aligned ellipsoid is defined. The
ellipsoid has its center at (x,y,z) and is defined by 3 axis-aligned
vectors given by A = (a,0,0); B = (0,b,0); C = (0,0,c). Note that
although the ellipsoid is specified as axis-aligned it can be rotated
via the optional *rotate* keyword.
For style *plane*, a plane is defined which contain the point
(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does
not have to be of unit length. The "inside" of the plane is the
@ -184,15 +194,21 @@ since if the maximum tilt factor is 5 (as in this example), then
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
geometrically equivalent.
The *radius* value for style *sphere* and *cylinder* can be specified
as an equal-style :doc:`variable <variable>`. If the value is a
variable, it should be specified as v_name, where name is the variable
name. In this case, the variable will be evaluated each timestep, and
its value used to determine the radius of the region. For style *sphere*
also the x-, y-, and z- coordinate of the center of the sphere and for
style *cylinder* the two center positions c1 and c2 for the location of
the cylinder axes can be a variable with the same kind of effect and
requirements than for the radius.
For style *sphere*, a sphere is defined with its center at (x,y,z)
and with radius as its radius.
The *radius* value for styles *sphere* and *cylinder*, and the
parameters a,b,c for style *ellipsoid*, can each be specified as an
equal-style :doc:`variable <variable>`. Likewise, for style *sphere*
and *ellipsoid* the x-, y-, and z- coordinates of the center of the
sphere/ellipsoid can be specified as an equal-style variable. And for
style *cylinder* the two center positions c1 and c2 for the location
of the cylinder axes can be specified as a equal-style variable.
If the value is a variable, it should be specified as v_name, where
name is the variable name. In this case, the variable will be
evaluated each timestep, and its value used to determine the radius of
the region.
Equal-style variables can specify formulas with various mathematical
functions, and include :doc:`thermo_style <thermo_style>` command
@ -250,6 +266,9 @@ define the lattice spacings which are used as follows:
to lo and hi. The spacings in the two radial dimensions are applied
to c1 and c2. The cylinder radius is scaled by the lattice
spacing in the dimension corresponding to c1.
* For style *ellipsoid*, the lattice spacing in dimensions x,y,z are
applied to the ellipsoid center x,y,z. The spacing in dimensions
x,y,z are applied to the ellipsoid radii a,b,c respectively.
* For style *plane*, the lattice spacing in dimension x is applied to
px and nx, similarly the spacings in dimensions y,z are applied to
py/ny and pz/nz.

View File

@ -8,9 +8,16 @@ Syntax
.. code-block:: LAMMPS
reset_timestep N
reset_timestep N keyword values ...
* N = timestep number
* zero or more keyword/value pairs may be appended
* keyword = *time*
.. parsed-literal::
*time* value = atime
atime = accumulated simulation time
Examples
""""""""
@ -19,48 +26,56 @@ Examples
reset_timestep 0
reset_timestep 4000000
reset_timestep 1000 time 100.0
Description
"""""""""""
Set the timestep counter to the specified value. This command
normally comes after the timestep has been set by reading a restart
usually comes after the timestep has been set by reading a restart
file via the :doc:`read_restart <read_restart>` command, or a previous
simulation advanced the timestep.
simulation run or minimization advanced the timestep.
The optional *time* keyword allows to also set the accumulated
simulation time. This is usually the number of timesteps times
the size of the timestep, but when using variable size timesteps
with :doc:`fix dt/reset <fix_dt_reset>` it can differ.
The :doc:`read_data <read_data>` and :doc:`create_box <create_box>`
commands set the timestep to 0; the :doc:`read_restart <read_restart>`
command sets the timestep to the value it had when the restart file
was written.
was written. The same applies to the accumulated simulation time.
Restrictions
""""""""""""
none
This command cannot be used when any fixes are defined that keep track
of elapsed time to perform certain kinds of time-dependent operations.
Examples are the :doc:`fix deposit <fix_deposit>` and :doc:`fix dt/reset <fix_dt_reset>` commands. The former adds atoms on
specific timesteps. The latter keeps track of accumulated time.
Examples are the :doc:`fix deposit <fix_deposit>` and :doc:`fix dt/reset
<fix_dt_reset>` commands. The former adds atoms on specific timesteps.
The latter keeps track of accumulated time.
Various fixes use the current timestep to calculate related
quantities. If the timestep is reset, this may produce unexpected
behavior, but LAMMPS allows the fixes to be defined even if the
timestep is reset. For example, commands which thermostat the system,
e.g. :doc:`fix nvt <fix_nh>`, allow you to specify a target temperature
which ramps from Tstart to Tstop which may persist over several runs.
If you change the timestep, you may induce an instantaneous change in
the target temperature.
Various fixes use the current timestep to calculate related quantities.
If the timestep is reset, this may produce unexpected behavior, but
LAMMPS allows the fixes to be defined even if the timestep is reset.
For example, commands which thermostat the system, e.g. :doc:`fix nvt
<fix_nh>`, allow you to specify a target temperature which ramps from
Tstart to Tstop which may persist over several runs. If you change the
timestep, you may induce an instantaneous change in the target
temperature.
Resetting the timestep clears flags for :doc:`computes <compute>` that
may have calculated some quantity from a previous run. This means
these quantity cannot be accessed by a variable in between runs until
a new run is performed. See the :doc:`variable <variable>` command for
more details.
may have calculated some quantity from a previous run. This means these
quantity cannot be accessed by a variable in between runs until a new
run is performed. See the :doc:`variable <variable>` command for more
details.
Related commands
""""""""""""""""
:doc:`rerun <rerun>`
:doc:`rerun <rerun>`, :doc:`timestep <timestep>`,
:doc:`fix dt/reset <fix_dt_reset>`
Default
"""""""

View File

@ -92,7 +92,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

@ -39,8 +39,9 @@ Description
Calculate the third order force constant tensor by finite difference of the selected group,
.. image:: JPG/third_order_force_constant.png
:align: center
.. math::
\Phi^{\alpha\beta\gamma}_{ijk} = \frac{\partial^3 U}{\partial x_{i,\alpha} \partial x_{j,\beta} \partial x_{k, \gamma}}
where Phi is the third order force constant tensor.

View File

@ -11,7 +11,7 @@ Syntax
variable name style args ...
* name = name of variable to define
* style = *delete* or *index* or *loop* or *world* or *universe* or *uloop* or *string* or *format* or *getenv* or *file* or *atomfile* or *python* or *internal* or *equal* or *vector* or *atom*
* style = *delete* or *index* or *loop* or *world* or *universe* or *uloop* or *string* or *format* or *getenv* or *file* or *atomfile* or *python* or *timer* or *internal* or *equal* or *vector* or *atom*
.. parsed-literal::
@ -42,6 +42,7 @@ Syntax
*file* arg = filename
*atomfile* arg = filename
*python* arg = function
*timer* arg = no arguments
*internal* arg = numeric value
*equal* or *vector* or *atom* args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references
numbers = 0.0, 100, -5.4, 2.8e-4, etc
@ -96,6 +97,13 @@ Examples
variable str format x %.6g
variable x delete
.. code-block:: LAMMPS
variable start timer
other commands
variable stop timer
print "Elapsed time: $(v_stop-v_start:%.6f)"
Description
"""""""""""
@ -108,32 +116,38 @@ part of a new input command. For variable styles that store multiple
strings, the :doc:`next <next>` command can be used to increment which
string is assigned to the variable. Variables of style *equal* store
a formula which when evaluated produces a single numeric value which
can be output either directly (see the :doc:`print <print>`, :doc:`fix print <fix_print>`, and :doc:`run every <run>` commands) or as part
of thermodynamic output (see the :doc:`thermo_style <thermo_style>`
command), or used as input to an averaging fix (see the :doc:`fix ave/time <fix_ave_time>` command). Variables of style *vector*
store a formula which produces a vector of such values which can be
used as input to various averaging fixes, or elements of which can be
part of thermodynamic output. Variables of style *atom* store a
formula which when evaluated produces one numeric value per atom which
can be output to a dump file (see the :doc:`dump custom <dump>` command)
or used as input to an averaging fix (see the :doc:`fix ave/chunk <fix_ave_chunk>` and :doc:`fix ave/atom <fix_ave_atom>`
commands). Variables of style *atomfile* can be used anywhere in an
input script that atom-style variables are used; they get their
per-atom values from a file rather than from a formula. Variables of
style *python* can be hooked to Python functions using code you
provide, so that the variable gets its value from the evaluation of
the Python code. Variables of style *internal* are used by a few
commands which set their value directly.
can be output either directly (see the :doc:`print <print>`, :doc:`fix
print <fix_print>`, and :doc:`run every <run>` commands) or as part of
thermodynamic output (see the :doc:`thermo_style <thermo_style>`
command), or used as input to an averaging fix (see the :doc:`fix
ave/time <fix_ave_time>` command). Variables of style *vector* store
a formula which produces a vector of such values which can be used as
input to various averaging fixes, or elements of which can be part of
thermodynamic output. Variables of style *atom* store a formula which
when evaluated produces one numeric value per atom which can be output
to a dump file (see the :doc:`dump custom <dump>` command) or used as
input to an averaging fix (see the :doc:`fix ave/chunk
<fix_ave_chunk>` and :doc:`fix ave/atom <fix_ave_atom>` commands).
Variables of style *atomfile* can be used anywhere in an input script
that atom-style variables are used; they get their per-atom values
from a file rather than from a formula. Variables of style *python*
can be hooked to Python functions using code you provide, so that the
variable gets its value from the evaluation of the Python code.
Variables of style *internal* are used by a few commands which set
their value directly.
.. note::
As discussed on the :doc:`Commands parse <Commands_parse>` doc
page, an input script can use "immediate" variables, specified as
$(formula) with parenthesis, where the formula has the same syntax as
equal-style variables described on this page. This is a convenient
way to evaluate a formula immediately without using the variable
command to define a named variable and then evaluate that
variable. See below for a more detailed discussion of this feature.
$(formula) with parenthesis, where the numeric formula has the same
syntax as equal-style variables described on this page. This is a
convenient way to evaluate a formula immediately without using the
variable command to define a named variable and then evaluate that
variable. The formula can include a trailing colon and format
string which determines the precision with which the numeric value
is generated. This is also explained on the :doc:`Commands parse
<Commands_parse>` doc page.
In the discussion that follows, the "name" of the variable is the
arbitrary string that is the first argument in the variable command.
@ -160,22 +174,19 @@ simulation.
Variables of style *equal* and *vector* and *atom* can be used as
inputs to various other commands which evaluate their formulas as
needed, e.g. at different timesteps during a :doc:`run <run>`.
needed, e.g. at different timesteps during a :doc:`run <run>`. In
this context, variables of style *timer* or *internal* or *python* can
be used in place of an equal-style variable, with the following two
caveats.
Variables of style *internal* can be used in place of an equal-style
variable, except by commands that set the value stored by the
internal-style variable. Thus any command that states it can use an
equal-style variable as an argument, can also use an internal-style
variable. This means that when the command evaluates the variable, it
will use the value set (internally) by another command.
Variables of style *python* can be used in place of an equal-style
variable so long as the associated Python function, as defined by the
:doc:`python <python>` command, returns a numeric value. Thus any
command that states it can use an equal-style variable as an argument,
can also use such a python-style variable. This means that when the
LAMMPS command evaluates the variable, the Python function will be
executed.
First, internal-style variables can be used except by commands that
set the value stored by the internal variable. When the LAMMPS
command evaluates the internal-style variable, it will use the value
set (internally) by another command. Second, python-style variables
can be used so long as the associated Python function, as defined by
the :doc:`python <python>` command, returns a numeric value. When the
LAMMPS command evaluates the python-style variable, the Python
function will be executed.
.. note::
@ -271,14 +282,15 @@ N1 <= N2 and N2 >= 0 is required.
For the *world* style, one or more strings are specified. There must
be one string for each processor partition or "world". LAMMPS can be
run with multiple partitions via the :doc:`-partition command-line switch <Run_options>`. This variable command assigns one string to
run with multiple partitions via the :doc:`-partition command-line
switch <Run_options>`. This variable command assigns one string to
each world. All processors in the world are assigned the same string.
The next command cannot be used with *equal* style variables, since
there is only one value per world. This style of variable is useful
when you wish to run different simulations on different partitions, or
when performing a parallel tempering simulation (see the
:doc:`temper <temper>` command), to assign different temperatures to
different partitions.
when performing a parallel tempering simulation (see the :doc:`temper
<temper>` command), to assign different temperatures to different
partitions.
For the *universe* style, one or more strings are specified. There
must be at least as many strings as there are processor partitions or
@ -313,11 +325,12 @@ appropriate for formatting a double-precision floating-point value.
The default format is "%.15g". This variable style allows an
equal-style variable to be formatted precisely when it is evaluated.
If you simply wish to print a variable value with desired precision to
the screen or logfile via the :doc:`print <print>` or :doc:`fix print <fix_print>` commands, you can also do this by specifying an
"immediate" variable with a trailing colon and format string, as part
of the string argument of those commands. This is explained on the
:doc:`Commands parse <Commands_parse>` doc page.
Note that if you simply wish to print a variable value with desired
precision to the screen or logfile via the :doc:`print <print>` or
:doc:`fix print <fix_print>` commands, you can also do this by
specifying an "immediate" variable with a trailing colon and format
string, as part of the string argument of those commands. This is
explained on the :doc:`Commands parse <Commands_parse>` doc page.
For the *getenv* style, a single string is assigned to the variable
which should be the name of an environment variable. When the
@ -412,14 +425,25 @@ python-style variable can be used in place of an equal-style variable
anywhere in an input script, e.g. as an argument to another command
that allows for equal-style variables.
For the *timer* style no additional argument is specified. The value of
the variable is set by querying the current elapsed wall time of the
simulation. This is done at the point in time when the variable is
defined in the input script. If a second timer-style variable is also
defined, then a simple formula can be used to calculate the elapsed time
between the two timers, as in the example at the top of this manual
entry. As mentioned above, timer-style variables can be redefined
elsewhere in the input script, so the same pair of variables can be used
in a loop or to time a series of operations.
For the *internal* style a numeric value is provided. This value will
be assigned to the variable until a LAMMPS command sets it to a new
value. There are currently only two LAMMPS commands that require
*internal* variables as inputs, because they reset them:
:doc:`create_atoms <create_atoms>` and :doc:`fix controller <fix_controller>`. As mentioned above, an
internal-style variable can be used in place of an equal-style
variable anywhere else in an input script, e.g. as an argument to
another command that allows for equal-style variables.
:doc:`create_atoms <create_atoms>` and :doc:`fix controller
<fix_controller>`. As mentioned above, an internal-style variable can
be used in place of an equal-style variable anywhere else in an input
script, e.g. as an argument to another command that allows for
equal-style variables.
----------
@ -823,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
@ -910,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
@ -1383,14 +1411,15 @@ commands:
The first run is performed using one setting for the pairwise
potential defined by the :doc:`pair_style <pair_style>` and
:doc:`pair_coeff <pair_coeff>` commands. The potential energy is
evaluated on the final timestep and stored by the :doc:`compute pe <compute_pe>` compute (this is done by the
:doc:`thermo_style <thermo_style>` command). Then a pair coefficient is
changed, altering the potential energy of the system. When the
potential energy is printed via the "e" variable, LAMMPS will use the
potential energy value stored by the :doc:`compute pe <compute_pe>`
compute, thinking it is current. There are many other commands which
could alter the state of the system between runs, causing a variable
to evaluate incorrectly.
evaluated on the final timestep and stored by the :doc:`compute pe
<compute_pe>` compute (this is done by the :doc:`thermo_style
<thermo_style>` command). Then a pair coefficient is changed,
altering the potential energy of the system. When the potential
energy is printed via the "e" variable, LAMMPS will use the potential
energy value stored by the :doc:`compute pe <compute_pe>` compute,
thinking it is current. There are many other commands which could
alter the state of the system between runs, causing a variable to
evaluate incorrectly.
The solution to this issue is the same as for case (2) above, namely
perform a 0-timestep run before the variable is evaluated to insure

View File

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

View File

@ -48,6 +48,7 @@ agilio
Agilio
agni
Agnolin
Ahrens
Ai
Aidan
aij
@ -443,6 +444,7 @@ chris
Christoph
Chu
chunkID
chunksize
Ciccotti
Cieplak
Cii
@ -512,6 +514,8 @@ configfile
configurational
conformational
Connor
conp
conq
ConstMatrix
Contrib
cooperativity
@ -650,6 +654,7 @@ deepskyblue
defgrad
defn
deformable
Deissenbeck
del
delaystep
deleteIDs
@ -693,6 +698,7 @@ DFT
dftb
dh
dhex
di
dia
diag
diagonalization
@ -784,6 +790,7 @@ dtheta
dtshrink
du
dU
Ducastelle
Dudarev
Duin
Dullweber
@ -867,6 +874,7 @@ Eisenforschung
Ejtehadi
El
elaplong
elastance
Electroneg
electronegative
electronegativity
@ -890,6 +898,7 @@ Embt
emi
emol
eN
endian
energetics
energyCorr
eng
@ -979,6 +988,7 @@ evector
Everaers
Evgeny
evirials
ew
ewald
Ewald
excitations
@ -1067,6 +1077,7 @@ fld
floralwhite
Florez
flv
fm
fmackay
fmag
fmass
@ -1246,6 +1257,7 @@ Gubbins
Guenole
Guericke
gui
Guillope
Gumbsch
Gunsteren
Gunzenmuller
@ -1307,6 +1319,7 @@ hexatic
hexorder
Heyes
HfO
hftn
hgrid
hhmrr
Hibbs
@ -1315,6 +1328,7 @@ hiID
Hijazi
Hilger
Hinestrosa
hipFFT
histo
histogrammed
histogramming
@ -1489,6 +1503,7 @@ iva
Ivanov
Ivector
Iw
Iwers
iwyu
ixcm
ixx
@ -1683,6 +1698,7 @@ lamda
lammps
Lammps
LAMMPS
lammpsbin
lammpsplot
lammpsplugin
Lamoureux
@ -1722,6 +1738,7 @@ lebedeva
Lebedeva
Lebold
Lechman
Legrand
Lehoucq
Leimkuhler
Leite
@ -1938,6 +1955,7 @@ maxsize
maxspecial
maxSteps
maxstrain
maxtry
maxwell
Maxwellian
maxX
@ -1973,6 +1991,7 @@ mediumvioletred
Mees
Mehl
Mei
Meissner
Melchor
Meloni
Melrose
@ -2001,6 +2020,7 @@ mesoscopic
metadata
metadynamics
Metadynamics
metallicity
Methfessel
methine
Metin
@ -2212,6 +2232,7 @@ Navier
nb
Nbin
Nbins
nbodies
nbody
Nbody
nbond
@ -2251,6 +2272,7 @@ nelem
Nelement
Nelements
nelems
nellipsoids
nemd
netapp
netcdf
@ -2393,6 +2415,7 @@ nthreads
ntimestep
Ntptask
Ntriples
ntris
Ntype
ntypes
Ntypes
@ -2636,6 +2659,7 @@ Polarizable
polarizables
polarizer
Politano
Politecnico
polyA
polybond
polydisperse
@ -2656,6 +2680,7 @@ postfixed
postfixes
Postma
Potapkin
potentiostat
potin
Pourtois
powderblue
@ -2759,6 +2784,7 @@ qopenmp
qoverride
qqr
qqrd
Qsb
qtb
quadratically
quadrupolar
@ -2773,6 +2799,7 @@ quatk
quatw
queryargs
Queteschiner
quickmin
qw
qx
qy
@ -2794,6 +2821,7 @@ Randisi
randomizations
rann
RANN
Rapetti
Raphson
Rappe
Ravelo
@ -2929,8 +2957,10 @@ Rmin
RMS
rmsd
rnage
rng
rNEMD
ro
rocFFT
Rochus
Rockett
rocksalt
@ -2939,6 +2969,7 @@ Rohart
Ronchetti
Ronevich
Rosati
Rosato
Rosenberger
Rossky
rosybrown
@ -3003,6 +3034,7 @@ Scalable
scalexy
scalexz
scaleyz
Scalfi
Schaik
Schilfgarde
Schimansky
@ -3021,6 +3053,7 @@ screenshot
screenshots
Scripps
Scripta
sd
sdk
sdpd
SDPD
@ -3115,6 +3148,7 @@ smallbig
smallint
Smallint
smallsmall
smatb
smd
SMD
smi
@ -3150,6 +3184,7 @@ SPH
Spickermann
splined
spparks
Sprik
Springer
springgreen
spx
@ -3189,6 +3224,7 @@ Stesmans
stiffnesses
Stillinger
stk
stl
stochastically
stochasticity
Stockmayer
@ -3383,6 +3419,7 @@ toolchain
topologies
Toporov
Torder
Torino
torsions
Tosi
Toukmaji
@ -3754,6 +3791,7 @@ ylat
ylo
ymax
ymin
yml
Yoshida
ys
ysu

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, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_VAR_EQUAL, LMP_VAR_ATOM
# 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}

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