diff --git a/.github/ISSUE_TEMPLATE/generic.md b/.github/ISSUE_TEMPLATE/generic.md new file mode 100644 index 0000000000..15d2763919 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/generic.md @@ -0,0 +1,21 @@ +--- +name: Generic Issue +about: For issues that do not fit any of the other categories +title: "_Replace With a Descriptive Title_" +labels: +assignees: '' + +--- + +**Summary** + +_Please provide a clear and concise description of what this issue report is about._ + +**LAMMPS Version and Platform** + +_Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version_ + +**Details** + +_Please explain the issue in detail here_ + diff --git a/.github/ISSUE_TEMPLATE/help_request.md b/.github/ISSUE_TEMPLATE/help_request.md new file mode 100644 index 0000000000..5e5b3ebffd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/help_request.md @@ -0,0 +1,15 @@ +--- +name: Request for Help +about: "Don't post help requests here, email the lammps-users mailing list" +title: "" +labels: invalid +assignees: '' + +--- + +Please **do not** post requests for help (e.g. with installing or using LAMMPS) here. +Instead send an e-mail to the lammps-users mailing list. + +This issue tracker is for tracking LAMMPS development related issues only. + +Thanks for your cooperation. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 32b76a079c..9e43aa0244 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,22 +4,19 @@ _Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in **Related Issues** -__If this addresses an open GitHub Issue, mention the issue number here. Use the phrases `fixes #221` or `closes #135`, when you want those issues to be automatically closed when the pull request is merged_ +_If this addresses an open GitHub issue for this project, please mention the issue number here, and describe the relation. Use the phrases `fixes #221` or `closes #135`, when you want an issue to be automatically closed when the pull request is merged_ **Author(s)** -_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (e.g. from gmail, yahoo, outlook, etc.) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this code. now and in the future_ +_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (ideally something that can outlive your institution's e-mail, in case you change jobs) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this contributed code._ **Licensing** -By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under the GNU General Public License version 2. - -_Please complete the following statement by adding "yes" or "no":_ -My contribution may be re-licensed as LGPL (for use of LAMMPS as a library linked to proprietary software): +By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1). **Backward Compatibility** -_Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why_ +_Please state whether any changes in the pull request will break backward compatibility for inputs, and - if yes - explain what has been changed and why_ **Implementation Notes** @@ -27,7 +24,7 @@ _Provide any relevant details about how the changes are implemented, how correct **Post Submission Checklist** -_Please check the fields below as they are completed **after** the pull request has been submitted_ +_Please check the fields below as they are completed **after** the pull request has been submitted. Delete lines that don't apply_ - [ ] The feature or features in this pull request is complete - [ ] Licensing information is complete diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 9ad64a59ed..f6f822676e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -11,6 +11,8 @@ get_filename_component(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE) get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUTE) +find_package(Git) + # by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE ) @@ -85,7 +87,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) # this is fast, so check for it all the time message(STATUS "Running check for auto-generated files from make-based build system") file(GLOB SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/style_*.h) -list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h) +list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h ${LAMMPS_SOURCE_DIR}/lmpgitversion.h) foreach(_SRC ${SRC_AUTOGEN_FILES}) get_filename_component(FILENAME "${_SRC}" NAME) if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME}) @@ -178,7 +180,7 @@ set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK - USER-QUIP USER-QMMM USER-YAFF) + USER-QUIP USER-QMMM USER-YAFF USER-ADIOS) set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU) set(OTHER_PACKAGES CORESHELL QEQ) foreach(PKG ${DEFAULT_PACKAGES}) @@ -201,6 +203,17 @@ endif() include_directories(${LAMMPS_SOURCE_DIR}) + +if(PKG_USER-ADIOS) + # The search for ADIOS2 must come before MPI because + # it includes its own MPI search with the latest FindMPI.cmake + # script that defines the MPI::MPI_C target + enable_language(C) + find_package(ADIOS2 REQUIRED) + list(APPEND LAMMPS_LINK_LIBS adios2::adios2) +endif() + + # do MPI detection after language activation, if MPI for these language is required find_package(MPI QUIET) option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) @@ -613,6 +626,7 @@ if(PKG_USER-NETCDF) add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020) endif() + if(PKG_USER-SMD) option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF) if(DOWNLOAD_EIGEN3) @@ -656,28 +670,34 @@ if(PKG_USER-VTK) endif() if(PKG_KIM) - option(DOWNLOAD_KIM "Download KIM-API v1 from OpenKIM instead of using an already installed one)" OFF) + option(DOWNLOAD_KIM "Download KIM-API v2 from OpenKIM instead of using an already installed one" OFF) if(DOWNLOAD_KIM) - message(STATUS "KIM-API v1 download requested - we will build our own") + message(STATUS "KIM-API v2 download requested - we will build our own") + enable_language(C) + enable_language(Fortran) include(ExternalProject) ExternalProject_Add(kim_build - URL https://github.com/openkim/kim-api/archive/v1.9.5.tar.gz - URL_MD5 9f66efc128da33039e30659f36fc6d00 - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND /configure --prefix= + URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.1.txz + URL_MD5 289c57f0c3bc2a549662283cac1c4ef1 + BINARY_DIR build + CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ) ExternalProject_get_property(kim_build INSTALL_DIR) - set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v1) - set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v1.so) + set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) + set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api-v2${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() - find_package(KIM) - if(NOT KIM_FOUND) - message(FATAL_ERROR "KIM-API v1 not found, help CMake to find it by setting KIM_LIBRARY and KIM_INCLUDE_DIR, or set DOWNLOAD_KIM=ON to download it") + find_package(KIM-API-V2) + if(NOT KIM-API-V2_FOUND) + message(FATAL_ERROR "KIM-API v2 not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") endif() endif() - list(APPEND LAMMPS_LINK_LIBS ${KIM_LIBRARIES}) - include_directories(${KIM_INCLUDE_DIRS}) + list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}") + include_directories(${KIM-API-V2_INCLUDE_DIRS}) endif() if(PKG_MESSAGE) @@ -1308,6 +1328,40 @@ message(STATUS "Generating lmpinstalledpkgs.h...") file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${temp}" ) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h") +###################################### +# Generate lmpgitversion.h +###################################### +set(temp "#ifndef LMP_GIT_VERSION_H\n#define LMP_GIT_VERSION_H\n") +set(temp_git_commit "(unknown)") +set(temp_git_branch "(unknown)") +set(temp_git_describe "(unknown)") +set(temp_git_info "false") +if(GIT_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git) + set(temp_git_info "true") + execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git rev-parse HEAD + OUTPUT_VARIABLE temp_git_commit + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git rev-parse --abbrev-ref HEAD + OUTPUT_VARIABLE temp_git_branch + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git describe --dirty=-modified + OUTPUT_VARIABLE temp_git_describe + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n") +set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n") +set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n") +set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n") +set(temp "${temp}#endif\n\n") + +message(STATUS "Generating lmpgitversion.h...") +file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" ) +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h") + ########################################### # Actually add executable and lib to build ############################################ @@ -1354,6 +1408,7 @@ if(BUILD_EXE) endif() endif() + ############################################################################### # Build documentation ############################################################################### diff --git a/cmake/Modules/FindKIM-API-V2.cmake b/cmake/Modules/FindKIM-API-V2.cmake new file mode 100644 index 0000000000..6ca6e068df --- /dev/null +++ b/cmake/Modules/FindKIM-API-V2.cmake @@ -0,0 +1,50 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the Common Development +# and Distribution License Version 1.0 (the "License"). +# +# You can obtain a copy of the license at +# http://www.opensource.org/licenses/CDDL-1.0. See the License for the +# specific language governing permissions and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each file and +# include the License file in a prominent location with the name LICENSE.CDDL. +# If applicable, add the following below this CDDL HEADER, with the fields +# enclosed by brackets "[]" replaced with your own identifying information: +# +# Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2013--2018, Regents of the University of Minnesota. +# All rights reserved. +# +# Contributors: +# Richard Berger +# Christoph Junghans +# Ryan S. Elliott +# + +# - Find KIM-API-V2 +# +# sets standard pkg_check_modules variables plus: +# +# KIM-API-V2-CMAKE_C_COMPILER +# KIM-API-V2-CMAKE_CXX_COMPILER +# KIM-API-V2-CMAKE_Fortran_COMPILER +# +find_package(PkgConfig REQUIRED) +include(FindPackageHandleStandardArgs) + +pkg_check_modules(KIM-API-V2 REQUIRED libkim-api-v2>=2.0) + +pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api-v2 CMAKE_C_COMPILER) +pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api-v2 CMAKE_CXX_COMPILER) +pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api-v2 CMAKE_Fortran_COMPILER) + +# handle the QUIETLY and REQUIRED arguments and set KIM-API-V2_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(KIM-API-V2 REQUIRED_VARS KIM-API-V2_LIBRARIES) diff --git a/cmake/Modules/FindKIM.cmake b/cmake/Modules/FindKIM.cmake deleted file mode 100644 index a01f817cf6..0000000000 --- a/cmake/Modules/FindKIM.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# - Find kim -# Find the native KIM headers and libraries. -# -# KIM_INCLUDE_DIRS - where to find kim.h, etc. -# KIM_LIBRARIES - List of libraries when using kim. -# KIM_FOUND - True if kim found. -# - -find_path(KIM_INCLUDE_DIR KIM_API.h PATH_SUFFIXES kim-api-v1) - -find_library(KIM_LIBRARY NAMES kim-api-v1) - -set(KIM_LIBRARIES ${KIM_LIBRARY}) -set(KIM_INCLUDE_DIRS ${KIM_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set KIM_FOUND to TRUE -# if all listed variables are TRUE - -find_package_handle_standard_args(KIM DEFAULT_MSG KIM_LIBRARY KIM_INCLUDE_DIR) - -mark_as_advanced(KIM_INCLUDE_DIR KIM_LIBRARY ) diff --git a/doc/.gitignore b/doc/.gitignore index b20157057c..88679898a8 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,3 +1,4 @@ +/old /html /latex /spelling diff --git a/doc/Makefile b/doc/Makefile index d117c2d98c..044e358bd5 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -39,7 +39,7 @@ help: @echo "Please use \`make ' where is one of" @echo " html create HTML doc pages in html dir" @echo " pdf create Developer.pdf and Manual.pdf in this dir" - @echo " old create old-style HTML doc pages in old dir" + @echo " old create old-style HTML doc pages and Manual.pdf in old dir" @echo " fetch fetch HTML and PDF files from LAMMPS web site" @echo " epub create ePUB format manual for e-book readers" @echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)" @@ -56,7 +56,7 @@ clean-all: clean rm -rf $(BUILDDIR)/* utils/txt2html/txt2html.exe clean: - rm -rf $(RSTDIR) html old epub + rm -rf $(RSTDIR) html old epub latex rm -rf spelling clean-spelling: @@ -115,21 +115,44 @@ mobi: epub @ebook-convert LAMMPS.epub LAMMPS.mobi @echo "Conversion finished. The MOBI manual file is created." -pdf: utils/txt2html/txt2html.exe +pdf: $(OBJECTS) $(ANCHORCHECK) + @(\ + . $(VENV)/bin/activate ;\ + cp -r src/* $(RSTDIR)/ ;\ + sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\ + echo "############################################" ;\ + doc_anchor_check src/*.txt ;\ + echo "############################################" ;\ + deactivate ;\ + ) + @cd latex && \ + sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \ + mv temp Makefile && \ + sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \ + mv tmp.tex LAMMPS.tex && \ + sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \ + mv tmp.tex LAMMPS.tex && \ + make && \ + make && \ + mv LAMMPS.pdf ../Manual.pdf && \ + cd ../; @(\ - set -e; \ cd src/Developer; \ pdflatex developer; \ pdflatex developer; \ mv developer.pdf ../../Developer.pdf; \ - cd ..; \ - ../utils/txt2html/txt2html.exe -b *.txt; \ - htmldoc --batch lammps.book; \ - for s in `echo *.txt | sed -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \ - do grep -q ^$$s lammps.book || \ - echo WARNING: doc file $$s missing in src/lammps.book; done; \ - rm *.html; \ + cd ../../; \ ) + @rm -rf latex/_sources + @rm -rf latex/PDF + @rm -rf latex/USER + @cp -r src/PDF latex/PDF + @cp -r src/USER latex/USER + @rm -rf latex/PDF/.[sg]* + @rm -rf latex/USER/.[sg]* + @rm -rf latex/USER/*/.[sg]* + @rm -rf latex/USER/*/*.[sg]* + @echo "Build finished. Manual.pdf and Developer.pdf are in this directory." old: utils/txt2html/txt2html.exe @rm -rf old @@ -139,6 +162,18 @@ old: utils/txt2html/txt2html.exe cp Eqs/*.jpg ../old/Eqs; \ cp JPG/* ../old/JPG; \ cp PDF/* ../old/PDF; + @( set -e;\ + cd src/Developer; \ + pdflatex developer; \ + pdflatex developer; \ + mv developer.pdf ../../old/Developer.pdf; \ + cd ../../old; \ + for s in `echo ../src/*.txt | sed -e 's,\.\./src/,,g' -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \ + do grep -q ^$$s ../src/lammps.book || \ + echo WARNING: doc file $$s missing in src/lammps.book; done; \ + htmldoc --batch ../src/lammps.book; \ + ) + fetch: @rm -rf html_www Manual_www.pdf Developer_www.pdf diff --git a/doc/src/Build_extras.txt b/doc/src/Build_extras.txt index 09841bd9d4..cbbd9db2f3 100644 --- a/doc/src/Build_extras.txt +++ b/doc/src/Build_extras.txt @@ -37,6 +37,7 @@ This is the list of packages that may require additional steps. "POEMS"_#poems, "PYTHON"_#python, "VORONOI"_#voronoi, +"USER-ADIOS"_#user-adios, "USER-ATC"_#user-atc, "USER-AWPMD"_#user-awpmd, "USER-COLVARS"_#user-colvars, @@ -180,27 +181,19 @@ library with all its models, may take around 30 min to build. Of course you only need to do that once. See the list of KIM model drivers here: -https://openkim.org/kim-items/model-drivers/alphabetical +https://openkim.org/browse/model-drivers/alphabetical See the list of all KIM models here: -https://openkim.org/kim-items/models/by-model-drivers - -See the list of example KIM models included by default here: -https://openkim.org/kim-api on the "What is in the KIM API source -package?" page. +https://openkim.org/browse/models/by-model-drivers [CMake build]: --D DOWNLOAD_KIM=value # download OpenKIM API v1 for build, value = no (default) or yes --D KIM_LIBRARY=path # KIM library file (only needed if a custom location) --D KIM_INCLUDE_DIR=path # KIM include directory (only needed if a custom location) :pre +-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes :pre If DOWNLOAD_KIM is set, the KIM library will be downloaded and built inside the CMake build directory. If the KIM library is already on -your system (in a location CMake cannot find it), KIM_LIBRARY is the -filename (plus path) of the KIM library file, not the directory the -library file is in. KIM_INCLUDE_DIR is the directory the KIM include -file is in. +your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH +environment variable so that libkim-api-v2 can be found. [Traditional make]: @@ -214,8 +207,8 @@ make lib-kim args="-b " # (re-)install KIM API lib with only example models make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver -make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location -make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre +make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location +make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre :line @@ -576,6 +569,32 @@ the lib/voronoi/Makefile.lammps file. :line +USER-ADIOS package :h4,link(user-adios) + +The USER-ADIOS package requires the "ADIOS I/O library"_https://github.com/ornladios/ADIOS2, +version 2.3.1 or newer. Make sure that you have ADIOS built either with or +without MPI to match if you build LAMMPS with or without MPI. +ADIOS compilation settings for LAMMPS are automatically detected, if the PATH +and LD_LIBRARY_PATH environment variables have been updated for the local ADIOS +installation and the instructions below are followed for the respective build systems. + +[CMake build]: + +-D ADIOS2_DIR=path # path is where ADIOS 2.x is installed +-D PKG_USER-ADIOS=yes :pre + +[Traditional make]: + +Turn on the USER-ADIOS package before building LAMMPS. If the ADIOS 2.x software is installed in PATH, there is nothing else to do: + +make yes-user-adios :pre + +otherwise, set ADIOS2_DIR environment variable when turning on the package: + +ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed :pre + +:line + USER-ATC package :h4,link(user-atc) The USER-ATC package requires the MANYBODY package also be installed. diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index 01c82d724e..c5eca96edb 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -48,6 +48,7 @@ packages: "POEMS"_Build_extras.html#poems, "PYTHON"_Build_extras.html#python, "VORONOI"_Build_extras.html#voronoi, +"USER-ADIOS"_Build_extras.html#user-adios, "USER-ATC"_Build_extras.html#user-atc, "USER-AWPMD"_Build_extras.html#user-awpmd, "USER-COLVARS"_Build_extras.html#user-colvars, diff --git a/doc/src/Commands_all.txt b/doc/src/Commands_all.txt index f137ccffd9..155b56ace8 100644 --- a/doc/src/Commands_all.txt +++ b/doc/src/Commands_all.txt @@ -48,12 +48,14 @@ An alphabetic list of all general LAMMPS commands. "dimension"_dimension.html, "displace_atoms"_displace_atoms.html, "dump"_dump.html, +"dump adios"_dump_adios.html, "dump image"_dump_image.html, "dump_modify"_dump_modify.html, "dump movie"_dump_image.html, "dump netcdf"_dump_netcdf.html, "dump netcdf/mpiio"_dump_netcdf.html, "dump vtk"_dump_vtk.html, +"dynamical_matrix"_dynamical_matrix.html, "echo"_echo.html, "fix"_fix.html, "fix_modify"_fix_modify.html, diff --git a/doc/src/Errors_messages.txt b/doc/src/Errors_messages.txt index 23a7405f87..fb5003e602 100644 --- a/doc/src/Errors_messages.txt +++ b/doc/src/Errors_messages.txt @@ -6988,12 +6988,6 @@ The atom style defined does not have this attribute. :dd The atom style defined does not have these attributes. :dd -{KIM neighbor iterator exceeded range} :dt - -This should not happen. It likely indicates a bug -in the KIM implementation of the interatomic potential -where it is requesting neighbors incorrectly. :dd - {KOKKOS package does not yet support comm_style tiled} :dt Self-explanatory. :dd @@ -10185,10 +10179,6 @@ valid. :dd Self-explanatory. :dd -{Unrecognized virial argument in pair_style command} :dt - -Only two options are supported: LAMMPSvirial and KIMvirial :dd - {Unsupported mixing rule in kspace_style ewald/disp} :dt Only geometric mixing is supported. :dd diff --git a/doc/src/Errors_warnings.txt b/doc/src/Errors_warnings.txt index 079688c639..47dd597af8 100644 --- a/doc/src/Errors_warnings.txt +++ b/doc/src/Errors_warnings.txt @@ -178,12 +178,6 @@ When using fixes like box/relax, the potential energy used by the minimizer is augmented by an additional energy provided by the fix. Thus the printed converged energy may be different from the total potential energy. :dd -{Energy tally does not account for 'zero yes'} :dt - -The energy removed by using the 'zero yes' flag is not accounted -for in the energy tally and thus energy conservation cannot be -monitored in this case. :dd - {Estimated error in splitting of dispersion coeffs is %g} :dt Error is greater than 0.0001 percent. :dd diff --git a/doc/src/JPG/coul_soft.jpg b/doc/src/JPG/coul_soft.jpg index d2cc4c0c9a..618d23b306 100644 Binary files a/doc/src/JPG/coul_soft.jpg and b/doc/src/JPG/coul_soft.jpg differ diff --git a/doc/src/JPG/lj_soft.jpg b/doc/src/JPG/lj_soft.jpg index 47c6a04b91..98404f857d 100644 Binary files a/doc/src/JPG/lj_soft.jpg and b/doc/src/JPG/lj_soft.jpg differ diff --git a/doc/src/JPG/uef_frames.jpg b/doc/src/JPG/uef_frames.jpg index 3b3bfc3a24..933c3e2925 100644 Binary files a/doc/src/JPG/uef_frames.jpg and b/doc/src/JPG/uef_frames.jpg differ diff --git a/doc/src/Manual.txt b/doc/src/Manual.txt index 3b3d31d4c4..af0a2681ab 100644 --- a/doc/src/Manual.txt +++ b/doc/src/Manual.txt @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -21,7 +21,7 @@ :line LAMMPS Documentation :c,h1 -8 Feb 2019 version :c,h2 +28 Feb 2019 version :c,h2 "What is a LAMMPS version?"_Manual_version.html diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt index 7d3d6d13e2..3a362a23d0 100644 --- a/doc/src/Packages_details.txt +++ b/doc/src/Packages_details.txt @@ -63,6 +63,7 @@ as contained in the file name. "SRD"_#PKG-SRD, "VORONOI"_#PKG-VORONOI :tb(c=6,ea=c) +"USER-ADIOS"_#PKG-USER-ADIOS, "USER-ATC"_#PKG-USER-ATC, "USER-AWPMD"_#PKG-USER-AWPMD, "USER-BOCS"_#PKG-USER-BOCS, @@ -346,12 +347,11 @@ system. Information about the KIM project can be found at its website: https://openkim.org. The KIM project is led by Ellad Tadmor and Ryan -Elliott (U Minnesota) and James Sethna (Cornell U). +Elliott (U Minnesota). [Authors:] Ryan Elliott (U Minnesota) is the main developer for the KIM API which the "pair_style kim"_pair_kim.html command uses. He -developed the pair style in collaboration with Valeriu Smirichinski (U -Minnesota). +developed the pair style. [Install:] @@ -975,6 +975,31 @@ examples/voronoi :ul :line +USER-ADIOS package :link(PKG-USER-ADIOS),h4 + +[Contents:] + +ADIOS is a high-performance I/O library. This package implements the +dump "atom/adios" and dump "custom/adios" commands to write data using +the ADIOS library. + +[Authors:] Norbert Podhorszki (ORNL) from the ADIOS developer team. + +[Install:] + +This package has "specific installation +instructions"_Build_extras.html#user-adios on the "Build +extras"_Build_extras.html doc page. + +[Supporting info:] + +src/USER-ADIOS: filenames -> commands +src/USER-ADIOS/README +examples/USER/adios +https://github.com/ornladios/ADIOS2 :ul + +:line + USER-ATC package :link(PKG-USER-ATC),h4 [Contents:] @@ -1700,14 +1725,19 @@ USER-PHONON package :link(PKG-USER-PHONON),h4 A "fix phonon"_fix_phonon.html command that calculates dynamical matrices, which can then be used to compute phonon dispersion relations, directly from molecular dynamics simulations. +And a "dynamical_matrix" command to compute the dynamical matrix +from finite differences. + +[Authors:] Ling-Ti Kong (Shanghai Jiao Tong University) for "fix phonon" +and Charlie Sievers (UC Davis) for "dynamical_matrix" -[Author:] Ling-Ti Kong (Shanghai Jiao Tong University). [Supporting info:] src/USER-PHONON: filenames -> commands src/USER-PHONON/README "fix phonon"_fix_phonon.html +"dynamical_matrix"_dynamical_matrix.html examples/USER/phonon :ul :line @@ -2102,5 +2132,3 @@ src/USER-YAFF/README "pair_style mm3/switch3/coulgauss/long"_pair_mm3_switch3_coulgauss.html "pair_style lj/switch3/coulgauss/long"_pair_lj_switch3_coulgauss.html examples/USER/yaff :ul - - diff --git a/doc/src/Packages_user.txt b/doc/src/Packages_user.txt index 4a702e971f..4210f617ef 100644 --- a/doc/src/Packages_user.txt +++ b/doc/src/Packages_user.txt @@ -38,6 +38,7 @@ int = internal library: provided with LAMMPS, but you may need to build it ext = external library: you will need to download and install it on your machine :ul Package, Description, Doc page, Example, Library +"USER-ADIOS"_Packages_details.html#PKG-USER-ADIOS, dump output via ADIOS, "dump adios"_dump_adios.html, USER/adios, ext "USER-ATC"_Packages_details.html#PKG-USER-ATC, Atom-to-Continuum coupling, "fix atc"_fix_atc.html, USER/atc, int "USER-AWPMD"_Packages_details.html#PKG-USER-AWPMD, wave packet MD, "pair_style awpmd/cut"_pair_awpmd.html, USER/awpmd, int "USER-BOCS"_Packages_details.html#PKG-USER-BOCS, BOCS bottom up coarse graining, "fix bocs"_fix_bocs.html, USER/bocs, no diff --git a/doc/src/commands_list.txt b/doc/src/commands_list.txt index 78fa9fbf87..27e0906b5f 100644 --- a/doc/src/commands_list.txt +++ b/doc/src/commands_list.txt @@ -32,6 +32,7 @@ Commands :h1 dimension displace_atoms dump + dump_adios dump_cfg_uef dump_h5md dump_image @@ -39,6 +40,7 @@ Commands :h1 dump_molfile dump_netcdf dump_vtk + dynamical_matrix echo fix fix_modify diff --git a/doc/src/compute_group_group.txt b/doc/src/compute_group_group.txt index cff3687354..5dfd8cf60b 100644 --- a/doc/src/compute_group_group.txt +++ b/doc/src/compute_group_group.txt @@ -137,11 +137,12 @@ Not all pair styles can be evaluated in a pairwise mode as required by this compute. For example, 3-body and other many-body potentials, such as "Tersoff"_pair_tersoff.html and "Stillinger-Weber"_pair_sw.html cannot be used. "EAM"_pair_eam.html -potentials only include the pair potential portion of the EAM -interaction when used by this compute, not the embedding term. +potentials will re-use previously computed embedding term contributions, +so the computed pairwise forces and energies are based on the whole +system and not valid if particles have been moved since. -Not all Kspace styles support calculation of group/group interactions. -The {ewald} and {pppm} styles do. +Not all "Kspace styles"_kspace_style.html support the calculation of +group/group interactions. The regular {ewald} and {pppm} styles do. [Related commands:] none diff --git a/doc/src/dump.txt b/doc/src/dump.txt index 9999f5bbff..a776ff70fc 100644 --- a/doc/src/dump.txt +++ b/doc/src/dump.txt @@ -13,6 +13,7 @@ dump command :h3 "dump netcdf"_dump_netcdf.html command :h3 "dump image"_dump_image.html command :h3 "dump movie"_dump_image.html command :h3 +"dump adios"_dump_adios.html command :h3 [Syntax:] @@ -27,10 +28,12 @@ args = list of arguments for a particular style :l {atom} args = none {atom/gz} args = none {atom/mpiio} args = none + {atom/adios} args = none, discussed on "dump adios"_dump_adios.html doc page {cfg} args = same as {custom} args, see below {cfg/gz} args = same as {custom} args, see below {cfg/mpiio} args = same as {custom} args, see below {custom}, {custom/gz}, {custom/mpiio} args = see below + {custom/adios} args = same as {custom} args, discussed on "dump adios"_dump_adios.html doc page {dcd} args = none {h5md} args = discussed on "dump h5md"_dump_h5md.html doc page {image} args = discussed on "dump image"_dump_image.html doc page @@ -653,7 +656,7 @@ package"_Build_package.html doc page for more info. [Related commands:] -"dump h5md"_dump_h5md.html, "dump image"_dump_image.html, +"dump adios"_dump_adios.html "dump h5md"_dump_h5md.html, "dump image"_dump_image.html, "dump molfile"_dump_molfile.html, "dump_modify"_dump_modify.html, "undump"_undump.html diff --git a/doc/src/dump_adios.txt b/doc/src/dump_adios.txt new file mode 100644 index 0000000000..e3c919db5a --- /dev/null +++ b/doc/src/dump_adios.txt @@ -0,0 +1,73 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Commands_all.html) + +:line + +dump atoms/adios command :h3 +dump custom/adios command :h3 + +[Syntax:] + +dump ID group-ID atoms/adios N file.bp :pre +dump ID group-ID custom/adios N file.bp args :pre + +ID = user-assigned name for the dump :ulb,l +group-ID = ID of the group of atoms to be imaged :l +adios = style of dump command (other styles {atom} or {cfg} or {dcd} or {xtc} or {xyz} or {local} or {custom} are discussed on the "dump"_dump.html doc page) :l +N = dump every this many timesteps :l +file.bp = name of file/stream to write to :l +args = same options as in "{dump custom}"_dump.html command :l +:ule + + +[Examples:] + +dump adios1 all atom/adios 100 atoms.bp +dump 4a all custom/adios 100 dump_adios.bp id v_p x y z +dump 2 subgroup custom/adios 100 dump_adios.bp mass type xs ys zs vx vy vz :pre + +[Description:] + +Dump a snapshot of atom coordinates every N timesteps in the +"ADIOS"_adios based "BP" file format, or using different I/O solutions in ADIOS, +to a stream that can be read on-line by another program. +ADIOS-BP files are binary, portable and self-describing. + +:link(adios,https://github.com/ornladios/ADIOS2) + + +[Use from write_dump:] + +It is possible to use these dump styles with the +"write_dump"_write_dump.html command. In this case, the sub-intervals +must not be set at all. The write_dump command can be used to +create a new file at each individual dump. + +dump 4 all atom/adios 100 dump.bp +write_dump all atom/adios singledump.bp :pre + +:line + +[Restrictions:] + +The number of atoms per snapshot CAN change with the adios style. +When using the ADIOS tool 'bpls' to list the content of a .bp file, +bpls will print {__} for the size of the output table indicating that +its size is changing every step. + +The {atom/adios} and {custom/adios} dump styles are part of the USER-ADIOS +package. They are only enabled if LAMMPS was built with that package. +See the "Build package"_Build_package.html doc page for more info. + + +:line + +[Related commands:] + +"dump"_dump.html, "dump_modify"_dump_modify.html, "undump"_undump.html + +:line + diff --git a/doc/src/dynamical_matrix.txt b/doc/src/dynamical_matrix.txt new file mode 100644 index 0000000000..a7dc4e442e --- /dev/null +++ b/doc/src/dynamical_matrix.txt @@ -0,0 +1,52 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Commands_all.html) + +:line + +dynamical_matrix command :h3 + +[Syntax:] + +dynamical_matrix group-ID style gamma args keyword value ... :pre + +group-ID = ID of group of atoms to displace :ulb,l +style = {regular} or {eskm} :l +gamma = finite different displacement length (distance units) :l +one or more keyword/arg pairs may be appended :l + keyword = {file} or {binary} + {file} name = name of output file for the dynamical matrix + {binary} arg = {yes} or {no} or {gzip} :pre +:ule + +[Examples:] + +dynamical_matrix 1 regular 0.000001 +dynamical_matrix 1 eskm 0.000001 +dynamical_matrix 3 regular 0.00004 file dynmat.dat +dynamical_matrix 5 eskm 0.00000001 file dynamical.dat binary yes :pre + +[Description:] + +Calculate the dynamical matrix of the selected group. + +[Restrictions:] + +The command collects the entire dynamical matrix a single MPI rank, +so the memory requirements can be very significant for large systems. + +This command assumes a periodic system. + +This command is part of the USER-PHONON package. It is only enabled if +LAMMPS was built with that package. See the "Build +package"_Build_package.html doc page for more info. + +[Related commands:] + +"fix phonon"_fix_phonon.html + +[Default:] + +The default settings are file = "dynmat.dyn", binary = no diff --git a/doc/src/fix_adapt.txt b/doc/src/fix_adapt.txt index fe86f49b25..0d862a890d 100644 --- a/doc/src/fix_adapt.txt +++ b/doc/src/fix_adapt.txt @@ -158,12 +158,6 @@ the pair_*.cpp file associated with the potential. Some parameters are global settings for the pair style, e.g. the viscosity setting "mu" for "pair_style lubricate"_pair_lubricate.html. -For "pair_kim"_pair_kim.html, all free parameters supported by the -KIM Model are available (e.g., PARAM_FREE_sigmas provided by the -LennardJones612_Universal__MO_826355984548_001 Model). If the free -parameter corresponds to an array, then the particular array element -to be adapted must be specified (e.g., "PARAM_FREE_sigmas:10", to -adapt the tenth entry of the sigmas array). Other parameters apply to atom type pairs within the pair style, e.g. the prefactor "a" for "pair_style soft"_pair_soft.html. diff --git a/doc/src/fix_langevin.txt b/doc/src/fix_langevin.txt index 85c97a3436..861eed4a6f 100644 --- a/doc/src/fix_langevin.txt +++ b/doc/src/fix_langevin.txt @@ -217,10 +217,6 @@ the particles. As described below, this energy can then be printed out or added to the potential energy of the system to monitor energy conservation. -NOTE: this accumulated energy does NOT include kinetic energy removed -by the {zero} flag. LAMMPS will print a warning when both options are -active. - The keyword {zero} can be used to eliminate drift due to the thermostat. Because the random forces on different atoms are independent, they do not sum exactly to zero. As a result, this fix diff --git a/doc/src/fix_phonon.txt b/doc/src/fix_phonon.txt index 23d4d09552..73f2f4600b 100644 --- a/doc/src/fix_phonon.txt +++ b/doc/src/fix_phonon.txt @@ -179,7 +179,8 @@ settings"_Build_settings.html doc page for details. [Related commands:] -"compute msd"_compute_msd.html +"compute msd"_compute_msd.html, +"dynamical_matrix"_dynamical_matrix.html [Default:] diff --git a/doc/src/lammps.book b/doc/src/lammps.book index 02a55e3810..198e234f0c 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -1,5 +1,5 @@ #HTMLDOC 1.8.28 --t pdf14 -f "../Manual.pdf" --book --toclevels 4 --no-numbered --toctitle "Table of Contents" --title --textcolor #000000 --linkcolor #0000ff --linkstyle plain --bodycolor #ffffff --size Universal --left 1.00in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --header1 ... --footer ..1 --nup 1 --tocheader .t. --tocfooter ..i --portrait --color --no-pscommands --no-xrxcomments --compression=9 --jpeg=0 --fontsize 11.0 --fontspacing 1.2 --headingfont Sans --bodyfont Serif --headfootsize 11.0 --headfootfont Sans-Bold --charset iso-8859-15 --links --embedfonts --pagemode document --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 --no-strict --no-overflow +-t pdf14 -f "Manual.pdf" --book --toclevels 4 --no-numbered --toctitle "Table of Contents" --title --textcolor #000000 --linkcolor #0000ff --linkstyle plain --bodycolor #ffffff --size Universal --left 1.00in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --header1 ... --footer ..1 --nup 1 --tocheader .t. --tocfooter ..i --portrait --color --no-pscommands --no-xrxcomments --compression=9 --jpeg=0 --fontsize 11.0 --fontspacing 1.2 --headingfont Sans --bodyfont Serif --headfootsize 11.0 --headfootfont Sans-Bold --charset iso-8859-15 --links --embedfonts --pagemode document --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 --no-strict --no-overflow Manual.html Intro.html Intro_overview.html @@ -150,6 +150,7 @@ dielectric.html dimension.html displace_atoms.html dump.html +dump_adios.html dump_h5md.html dump_image.html dump_modify.html @@ -157,6 +158,7 @@ dump_molfile.html dump_netcdf.html dump_vtk.html dump_cfg_uef.html +dynamical_matrix.html echo.html group.html group2ndx.html diff --git a/doc/src/pair_kim.txt b/doc/src/pair_kim.txt index e1bde4f10e..c5d42403e3 100644 --- a/doc/src/pair_kim.txt +++ b/doc/src/pair_kim.txt @@ -10,18 +10,13 @@ pair_style kim command :h3 [Syntax:] -pair_style kim virialmode model printflag :pre +pair_style kim model :pre -virialmode = KIMvirial or LAMMPSvirial model = name of KIM model (potential) -printflag = 1/0 do or do not print KIM descriptor file, optional :ul [Examples:] -pair_style kim KIMvirial model_Ar_P_Morse -pair_coeff * * Ar Ar :pre - -pair_style kim KIMvirial model_Ar_P_Morse 1 +pair_style kim ex_model_Ar_P_LJ pair_coeff * * Ar Ar :pre [Description:] @@ -36,14 +31,10 @@ element or alloy and set of parameters, e.g. EAM for Cu with a specific EAM potential file. See the current list of "KIM model -drivers"_https://openkim.org/kim-items/model-drivers/alphabetical. +drivers"_https://openkim.org/browse/model-drivers/alphabetical. See the current list of all "KIM -models"_https://openkim.org/kim-items/models/by-model-drivers - -See the list of "example KIM models"_https://openkim.org/kim-api which -are included in the KIM library by default, in the "What is in the KIM -API source package?" section. +models"_https://openkim.org/browse/models/by-model-drivers To use this pair style, you must first download and install the KIM API library from the "OpenKIM website"_https://openkim.org. The KIM @@ -51,25 +42,19 @@ section of the "Packages details"_Packages_details.html doc page has instructions on how to do this with a simple make command, when building LAMMPS. -See the examples/kim dir for an input script that uses a KIM model -(potential) for Lennard-Jones. +See the examples/kim dir for an input script that uses a KIM model (potential) +for Lennard-Jones. Note, for this example input script, the example models +shipped with with kim-api package must be installed. See the "Build +package"_Build_package.html section and the ./lib/kim/README for details +on how to build LAMMSPS with the kim-api and how to install the example models. :line -The argument {virialmode} determines how the global virial is -calculated. If {KIMvirial} is specified, the KIM model performs the -global virial calculation (if it knows how). If {LAMMPSvirial} is -specified, LAMMPS computes the global virial using its fdotr mechanism. - The argument {model} is the name of the KIM model for a specific potential as KIM defines it. In principle, LAMMPS can invoke any KIM model. You should get an error or warning message from either LAMMPS or KIM if there is an incompatibility. -The argument {printflag} is optional. If it is set to a non-zero -value then a KIM descriptor file is printed when KIM is invoked. This -can be useful for debugging. The default is to not print this file. - Only a single pair_coeff command is used with the {kim} style which specifies the mapping of LAMMPS atom types to KIM elements. This is done by specifying N additional arguments after the * * in the @@ -86,18 +71,14 @@ pair_coeff * * Si Si Si C :pre The 1st 2 arguments must be * * so as to span all LAMMPS atom types. The first three Si arguments map LAMMPS atom types 1,2,3 to Si as defined within KIM. The final C argument maps LAMMPS atom type 4 to C -as defined within KIM. If a mapping value is specified as NULL, the -mapping is not performed. This can only be used when a {kim} -potential is used as part of the {hybrid} pair style. The NULL values -are placeholders for atom types that will be used with other -potentials. +as defined within KIM. :line In addition to the usual LAMMPS error messages, the KIM library itself may generate errors, which should be printed to the screen. In this case it is also useful to check the kim.log file for additional error -information. This file kim.log should be generated in the same +information. The file kim.log should be generated in the same directory where LAMMPS is running. To download, build, and install the KIM library on your system, see @@ -130,7 +111,7 @@ LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. This current version of pair_style kim is compatible with the -kim-api package version 1.6.0 and higher. +kim-api package version 2.0.0 and higher. [Related commands:] diff --git a/doc/utils/sphinx-config/conf.py b/doc/utils/sphinx-config/conf.py index 8a8b887a5e..29de3af156 100644 --- a/doc/utils/sphinx-config/conf.py +++ b/doc/utils/sphinx-config/conf.py @@ -211,7 +211,9 @@ latex_elements = { #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. -#'preamble': '', +'preamble': r''' +\setcounter{tocdepth}{2} +''' } # Grouping the document tree into LaTeX files. List of tuples @@ -229,7 +231,7 @@ latex_documents = [ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False - +latex_toplevel_sectioning = 'part' # If true, show page references after internal links. #latex_show_pagerefs = False diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 5844dd3454..5366a31d5d 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -251,6 +251,8 @@ Botero Botu Bouguet boxcolor +bp +bpls bpclermont br Branduardi @@ -625,8 +627,10 @@ dVx dW dx dy +dyn dyne dynes +dynmat Dyre Dzyaloshinskii Eaa @@ -1384,6 +1388,7 @@ libfftw libgcc libgpu libjpeg +libkim liblammps Liblammps liblink @@ -2083,6 +2088,7 @@ Pmolrotate Pmoltrans pN png +Podhorszki Poiseuille Polak polarizabilities @@ -2435,6 +2441,7 @@ shockvel si SiC Siepmann +Sievers Sij Sikandar Silbert diff --git a/examples/USER/adios/adios2_config.xml b/examples/USER/adios/adios2_config.xml new file mode 100644 index 0000000000..4b9cd9b9b5 --- /dev/null +++ b/examples/USER/adios/adios2_config.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/USER/adios/in.adios_balance b/examples/USER/adios/in.adios_balance new file mode 100644 index 0000000000..d89ae52b41 --- /dev/null +++ b/examples/USER/adios/in.adios_balance @@ -0,0 +1,57 @@ +# 2d circle of particles inside a box with LJ walls + +variable b index 0 + +variable x index 50 +variable y index 20 +variable d index 20 +variable v index 5 +variable w index 2 + +units lj +dimension 2 +atom_style atomic +boundary f f p + +lattice hex 0.85 +region box block 0 $x 0 $y -0.5 0.5 +create_box 1 box +region circle sphere $(v_d/2+1) $(v_d/2/sqrt(3.0)+1) 0.0 $(v_d/2) +create_atoms 1 region circle +mass 1 1.0 + +velocity all create 0.5 87287 loop geom +velocity all set $v $w 0 sum yes + +pair_style lj/cut 2.5 +pair_coeff 1 1 10.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +fix 2 all wall/lj93 xlo 0.0 1 1 2.5 xhi $x 1 1 2.5 +fix 3 all wall/lj93 ylo 0.0 1 1 2.5 yhi $y 1 1 2.5 + +comm_style tiled +fix 10 all balance 50 0.9 rcb + +compute 1 all property/atom proc +variable p atom c_1%10 +dump 2 all custom 50 balance.dump id v_p x y z +dump 3 all custom/adios 50 balance_custom.bp id v_p x y z +dump 4 all atom/adios 50 balance_atom.bp + +#dump 3 all image 50 image.*.jpg v_p type & +# adiam 1.0 view 0 0 zoom 1.8 subbox yes 0.02 +#variable colors string & +# "red green blue yellow white & +# purple pink orange lime gray" +#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} + +thermo_style custom step temp epair press f_10[3] f_10 +thermo 100 + +run 200 +write_dump all atom/adios balance_atom_final.bp diff --git a/examples/USER/adios/log.balance b/examples/USER/adios/log.balance new file mode 100644 index 0000000000..162ecf7741 --- /dev/null +++ b/examples/USER/adios/log.balance @@ -0,0 +1,114 @@ +LAMMPS (4 Jan 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +# 2d circle of particles inside a box with LJ walls + +variable b index 0 + +variable x index 50 +variable y index 20 +variable d index 20 +variable v index 5 +variable w index 2 + +units lj +dimension 2 +atom_style atomic +boundary f f p + +lattice hex 0.85 +Lattice spacing in x,y,z = 1.16553 2.01877 1.16553 +region box block 0 $x 0 $y -0.5 0.5 +region box block 0 50 0 $y -0.5 0.5 +region box block 0 50 0 20 -0.5 0.5 +create_box 1 box +Created orthogonal box = (0 0 -0.582767) to (58.2767 40.3753 0.582767) + 2 by 2 by 1 MPI processor grid +region circle sphere $(v_d/2+1) $(v_d/2/sqrt(3.0)+1) 0.0 $(v_d/2) +region circle sphere 11 $(v_d/2/sqrt(3.0)+1) 0.0 $(v_d/2) +region circle sphere 11 6.7735026918962581988 0.0 $(v_d/2) +region circle sphere 11 6.7735026918962581988 0.0 10 +create_atoms 1 region circle +Created 361 atoms + Time spent = 0.00171804 secs +mass 1 1.0 + +velocity all create 0.5 87287 loop geom +velocity all set $v $w 0 sum yes +velocity all set 5 $w 0 sum yes +velocity all set 5 2 0 sum yes + +pair_style lj/cut 2.5 +pair_coeff 1 1 10.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +fix 2 all wall/lj93 xlo 0.0 1 1 2.5 xhi $x 1 1 2.5 +fix 2 all wall/lj93 xlo 0.0 1 1 2.5 xhi 50 1 1 2.5 +fix 3 all wall/lj93 ylo 0.0 1 1 2.5 yhi $y 1 1 2.5 +fix 3 all wall/lj93 ylo 0.0 1 1 2.5 yhi 20 1 1 2.5 + +comm_style tiled +fix 10 all balance 50 0.9 rcb + +compute 1 all property/atom proc +variable p atom c_1%10 +dump 2 all custom 50 balance.dump id v_p x y z +dump 3 all custom/adios 50 balance_custom.bp id v_p x y z +dump 4 all atom/adios 50 balance_atom.bp + +#dump 3 all image 50 image.*.jpg v_p type # adiam 1.0 view 0 0 zoom 1.8 subbox yes 0.02 +#variable colors string # "red green blue yellow white # purple pink orange lime gray" +#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} + +thermo_style custom step temp epair press f_10[3] f_10 +thermo 100 + +run 200 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 42 29 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/2d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.926 | 4.933 | 4.944 Mbytes +Step Temp E_pair Press f_10[3] f_10 + 0 25.701528 -29.143179 -1.2407285 3.2354571 1.0526316 + 100 26.269576 -29.713313 7.9052334 1.2742382 1.0304709 + 200 26.368336 -29.809962 1.6412462 1.2520776 1.0083102 +Loop time of 0.0992351 on 4 procs for 200 steps with 361 atoms + +Performance: 870660.046 tau/day, 2015.417 timesteps/s +32.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0078368 | 0.0081607 | 0.0085468 | 0.3 | 8.22 +Neigh | 0.002804 | 0.0045915 | 0.0092173 | 3.9 | 4.63 +Comm | 0.044407 | 0.05352 | 0.062051 | 3.0 | 53.93 +Output | 0.011406 | 0.012025 | 0.01342 | 0.7 | 12.12 +Modify | 0.006305 | 0.0064294 | 0.0066617 | 0.2 | 6.48 +Other | | 0.01451 | | | 14.62 + +Nlocal: 90.25 ave 91 max 90 min +Histogram: 3 0 0 0 0 0 0 0 0 1 +Nghost: 58.25 ave 64 max 51 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 730.75 ave 801 max 671 min +Histogram: 1 0 1 0 0 1 0 0 0 1 + +Total # of neighbors = 2923 +Ave neighs/atom = 8.09695 +Neighbor list builds = 60 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/README.md b/examples/USER/phonon/dynamical_matrix_command/Silicon/README.md new file mode 100755 index 0000000000..15ae158c62 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/README.md @@ -0,0 +1,21 @@ +# LAMMPS LATTICE DYNAMICS COMMANDS + +## DYNAMICAL MATRIX CALCULATOR + +This directory contains the ingredients to calculate a dynamical matrix. + +Example: +``` +NP=4 #number of processors +mpirun -np $NP lmp_mpi -in in.silicon -out out.silicon +``` + +To test out a different silicon example: +``` +LMP_FILE=amorphous_silicon.lmp +cp lmp_bank/$LMP_FILE ./silicon_input_file.lmp +NP=4 #number of processors +mpirun -np $NP lmp_mpi -in in.silicon -out out.silicon +``` + +## Requires: MANYBODY and MOLECULE packages diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/Si.opt.tersoff b/examples/USER/phonon/dynamical_matrix_command/Silicon/Si.opt.tersoff new file mode 100755 index 0000000000..3bc19f0581 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/Si.opt.tersoff @@ -0,0 +1,66 @@ +# Tersoff parameters for various elements and mixtures +# multiple entries can be added to this file, LAMMPS reads the ones it needs +# these entries are in LAMMPS "metal" units: +# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms +# other quantities are unitless + +# Aidan Thompson (athomps at sandia.gov) takes full blame for this +# file. It specifies various potentials published by J. Tersoff for +# silicon, carbon and germanium. Since Tersoff published several +# different silicon potentials, I refer to them using atom types +# Si(B), Si(C) and Si(D). The last two are almost almost identical but +# refer to two different publications. These names should be used in +# the LAMMPS command when the file is invoked. For example: +# pair_coeff * * SiCGe.tersoff Si(B). The Si(D), C and Ge potentials +# can be used pure silicon, pure carbon, pure germanium, binary SiC, +# and binary SiGe, but not binary GeC or ternary SiGeC. LAMMPS will +# generate an error if this file is used with any combination +# involving C and Ge, since there are no entries for the GeC +# interactions (Tersoff did not publish parameters for this +# cross-interaction.) + +# format of a single entry (one or more lines): +# element 1, element 2, element 3, +# m, gamma, lambda3, c, d, costheta0, n, beta, lambda2, B, R, D, lambda1, A + +# The original Tersoff potential for Silicon, Si(B) +# J. Tersoff, PRB, 37, 6991 (1988) + +Si(B) Si(B) Si(B) 3.0 1.0 1.3258 4.8381 2.0417 0.0000 22.956 + 0.33675 1.3258 95.373 3.0 0.2 3.2394 3264.7 + +# The later Tersoff potential for Silicon, Si(C) +# J. Tersoff, PRB, 38, 9902 (1988) + +Si(C) Si(C) Si(C) 3.0 1.0 1.7322 1.0039e5 16.218 -0.59826 0.78734 + 1.0999e-6 1.7322 471.18 2.85 0.15 2.4799 1830.8 + +# The later Tersoff potential for Carbon, Silicon, and Germanium +# J. Tersoff, PRB, 39, 5566 (1989) + errata (PRB 41, 3248) +# The Si and C parameters are very close to those in SiC.tersoff + +C C C 3.0 1.0 0.0 3.8049e4 4.3484 -0.57058 0.72751 1.5724e-7 2.2119 346.74 1.95 0.15 3.4879 1393.6 +Si(D) Si(D) Si(D) 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 1.1000e-6 1.7322 471.18 2.85 0.15 2.4799 1830.8 +Ge Ge Ge 3.0 1.0 0.0 1.0643e5 15.652 -0.43884 0.75627 9.0166e-7 1.7047 419.23 2.95 0.15 2.4451 1769.0 + +C Si(D) Si(D) 3.0 1.0 0.0 3.8049e4 4.3484 -0.57058 0.72751 1.5724e-7 1.97205 395.1451 2.3573 0.1527 2.9839 1597.3111 +C Si(D) C 3.0 1.0 0.0 3.8049e4 4.3484 -0.57058 0.72751 0.0 0.0 0.0 1.95 0.15 0.0 0.0 +C C Si(D) 3.0 1.0 0.0 3.8049e4 4.3484 -0.57058 0.72751 0.0 0.0 0.0 2.3573 0.1527 0.0 0.0 + +Si(D) C C 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 1.1000e-6 1.97205 395.1451 2.3573 0.1527 2.9839 1597.3111 +Si(D) Si(D) C 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 0.0 0.0 0.0 2.3573 0.1527 0.0 0.0 +Si(D) C Si(D) 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 0.0 0.0 0.0 2.85 0.15 0.0 0.0 + +Si(D) Ge Ge 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 1.1000e-6 1.71845 444.7177 2.8996 0.1500 2.4625 1799.6347 +Si(D) Si(D) Ge 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 0.0 0.0 0.0 2.8996 0.1500 0.0 0.0 +Si(D) Ge Si(D) 3.0 1.0 0.0 1.0039e5 16.217 -0.59825 0.78734 0.0 0.0 0.0 2.85 0.15 0.0 0.0 + +Ge Si(D) Si(D) 3.0 1.0 0.0 1.0643e5 15.652 -0.43884 0.75627 9.0166e-7 1.71845 444.7177 2.8996 0.1500 2.4625 1799.6347 +Ge Si(D) Ge 3.0 1.0 0.0 1.0643e5 15.652 -0.43884 0.75627 0.0 0.0 0.0 2.95 0.15 0.0 0.0 +Ge Ge Si(D) 3.0 1.0 0.0 1.0643e5 15.652 -0.43884 0.75627 0.0 0.0 0.0 2.8996 0.1500 0.0 0.0 + +# Optimized Tersoff for Carbon: Lindsay and Broido PRB 81, 205441 (2010) +# element 1, element 2, element 3, +# m, gamma, lambda3, c, d, costheta0, n, beta, lambda2, B, R, D, lambda1, A +C(O) C(O) C(O) 3.0 1.0 0.0 3.8049e4 4.3484 -0.930 0.72751 1.5724e-7 2.2119 430.0 1.95 0.15 3.4879 1393.6 + diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp new file mode 100755 index 0000000000..f3b895f168 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/ff-silicon.lmp @@ -0,0 +1,19 @@ +############################# +#Atoms types - mass - charge# +############################# +#@ 1 atom types #!THIS LINE IS NECESSARY DON'T SPEND HOURS FINDING THAT OUT!# + +variable Si equal 1 + +############# +#Atom Masses# +############# + +mass ${Si} 28.08550 + +########################### +#Pair Potentials - Tersoff# +########################### + +pair_style tersoff +pair_coeff * * Si.opt.tersoff Si(D) diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/in.silicon b/examples/USER/phonon/dynamical_matrix_command/Silicon/in.silicon new file mode 100755 index 0000000000..cda0ee8c58 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/in.silicon @@ -0,0 +1,89 @@ +###############################mm +# Atom style - charge/vdw/bonded# +################################# +atom_style full + +############################################## +#Units Metal : eV - ps - angstrom - bar# +# Real : kcal/mol - fs - angstrom - atm# +############################################## +units metal + +############ +#Run number# +############ +variable run_no equal 0 # is it a restart? +variable res_no equal ${run_no}-1 # restart file number + +####################################### +#Random Seeds and Domain Decomposition# +####################################### +variable iseed0 equal 2357 +variable iseed1 equal 26488 +variable iseed2 equal 10669 +processors * * * + +########### +#Data File# +########### +variable inpfile string silicon_input_file.lmp +variable resfile string final_restart.${res_no} +variable ff_file string ff-silicon.lmp + +########## +#Run Type# +########## +variable minimise equal 0 #Energy Minimization + +############################### +#Molecular Dynamics Parameters# +############################### +neighbor 1 bin + +################################ +#Energy Minimization Parameters# +################################ +variable mtraj equal 1 # trajectory output frequency - all system +variable etol equal 1e-5 # % change in energy +variable ftol equal 1e-5 # max force threshold (force units) +variable maxiter equal 10000 # max # of iterations + +######################## +#3D Periodic Simulation# +######################## +boundary p p p + +############################# +#Reading the input structure# +############################# +if "${run_no} == 0" then "read_data ${inpfile}" else "read_restart ${resfile}" + +############# +#Force Field# +############# +include ${ff_file} + +###################### +#Thermodynamic Output# +###################### +variable str_basic string 'step time pe temp press' + +##################### +#Energy Minimization# +##################### +if "${minimise} <= 0 || ${run_no} > 0" then "jump SELF end_minimise" + print "Doing CG minimisation" + dump mdcd all dcd ${mtraj} min.dcd + dump_modify mdcd unwrap yes + min_style cg + min_modify line quadratic + minimize ${etol} ${ftol} ${maxiter} ${maxiter} + reset_timestep 0 + undump mdcd +label end_minimise + +################## +#Dynamical Matrix# +################## +dynamical_matrix all eskm 0.000001 file dynmat.dat binary no + diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp new file mode 100755 index 0000000000..036ece0279 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/amorphous_silicon.lmp @@ -0,0 +1,534 @@ +LAMMPS description + + 512 atoms + 0 bonds + 0 angles + 0 dihedrals + 0 impropers + + 1 atom types + 0 bond types + 0 angle types + 0 dihedral types + 0 improper types + + + 0.0000000 21.848000 xlo xhi + 0.0000000 21.848000 ylo yhi + 0.0000000 21.848000 zlo zhi + + Atoms + + 1 1 1 0.0000000 6.2030000 5.5980000 12.9980000 + 2 2 1 0.0000000 21.3100000 5.6310000 21.1380000 + 3 3 1 0.0000000 19.5320000 6.1170000 3.6940000 + 4 4 1 0.0000000 4.3700000 14.0260000 0.0900000 + 5 5 1 0.0000000 10.1930000 7.4590000 2.3530000 + 6 6 1 0.0000000 17.5070000 14.1860000 3.6790000 + 7 7 1 0.0000000 11.2050000 15.9160000 15.0480000 + 8 8 1 0.0000000 8.6050000 19.8970000 21.0040000 + 9 9 1 0.0000000 15.0360000 17.5650000 1.3640000 + 10 10 1 0.0000000 12.0450000 3.3600000 7.2720000 + 11 11 1 0.0000000 7.1330000 17.4130000 18.0480000 + 12 12 1 0.0000000 8.7340000 6.3830000 3.8480000 + 13 13 1 0.0000000 13.0940000 3.2490000 3.5840000 + 14 14 1 0.0000000 11.3200000 7.2770000 20.4120000 + 15 15 1 0.0000000 19.7770000 8.9110000 0.3000000 + 16 16 1 0.0000000 11.9710000 20.8500000 1.5140000 + 17 17 1 0.0000000 10.4480000 10.3650000 15.4040000 + 18 18 1 0.0000000 9.2060000 9.4670000 10.2240000 + 19 19 1 0.0000000 8.4360000 13.6240000 17.6570000 + 20 20 1 0.0000000 18.2020000 21.1230000 0.1380000 + 21 21 1 0.0000000 3.2970000 19.5740000 14.7410000 + 22 22 1 0.0000000 12.5330000 17.3580000 7.5960000 + 23 23 1 0.0000000 1.4040000 18.1060000 3.1510000 + 24 24 1 0.0000000 17.7440000 13.1530000 16.7940000 + 25 25 1 0.0000000 12.1070000 12.6630000 18.0340000 + 26 26 1 0.0000000 8.7270000 17.1140000 10.4200000 + 27 27 1 0.0000000 13.2330000 16.0380000 13.9210000 + 28 28 1 0.0000000 15.2360000 14.8650000 7.0150000 + 29 29 1 0.0000000 5.5190000 20.8660000 19.9260000 + 30 30 1 0.0000000 16.5810000 9.7460000 15.1710000 + 31 31 1 0.0000000 2.0500000 13.8550000 21.8010000 + 32 32 1 0.0000000 21.2670000 20.8970000 13.6740000 + 33 33 1 0.0000000 9.6900000 6.7650000 0.1950000 + 34 34 1 0.0000000 11.2570000 13.2440000 2.8190000 + 35 35 1 0.0000000 10.7810000 12.7310000 12.1920000 + 36 36 1 0.0000000 16.2630000 7.4100000 1.5360000 + 37 37 1 0.0000000 19.6100000 18.1440000 19.6830000 + 38 38 1 0.0000000 8.1790000 0.1200000 10.1620000 + 39 39 1 0.0000000 17.0520000 20.4210000 15.0450000 + 40 40 1 0.0000000 12.3690000 12.6710000 4.8320000 + 41 41 1 0.0000000 7.8300000 16.6790000 14.2470000 + 42 42 1 0.0000000 1.6790000 9.9500000 1.2660000 + 43 43 1 0.0000000 16.6160000 14.6580000 13.2790000 + 44 44 1 0.0000000 13.7430000 11.9730000 21.5360000 + 45 45 1 0.0000000 5.2590000 15.1850000 9.5720000 + 46 46 1 0.0000000 20.5980000 14.7930000 20.4140000 + 47 47 1 0.0000000 1.5640000 16.8080000 13.0450000 + 48 48 1 0.0000000 21.3670000 11.4610000 20.6420000 + 49 49 1 0.0000000 14.5890000 5.9510000 7.1950000 + 50 50 1 0.0000000 1.0870000 13.5410000 11.3300000 + 51 51 1 0.0000000 6.2040000 4.8970000 16.9420000 + 52 52 1 0.0000000 0.4800000 4.1450000 0.8710000 + 53 53 1 0.0000000 2.0120000 5.7530000 1.8950000 + 54 54 1 0.0000000 9.8460000 19.1320000 7.3060000 + 55 55 1 0.0000000 18.3760000 21.3430000 4.0940000 + 56 56 1 0.0000000 5.2900000 6.5400000 5.3620000 + 57 57 1 0.0000000 1.4110000 6.5750000 4.0580000 + 58 58 1 0.0000000 16.1600000 15.1390000 11.0380000 + 59 59 1 0.0000000 21.0670000 18.3830000 8.6900000 + 60 60 1 0.0000000 18.0250000 17.7750000 1.4340000 + 61 61 1 0.0000000 19.0570000 16.2190000 6.6410000 + 62 62 1 0.0000000 5.1170000 16.5510000 11.5540000 + 63 63 1 0.0000000 14.4810000 7.8720000 12.6320000 + 64 64 1 0.0000000 11.7990000 10.9690000 13.5430000 + 65 65 1 0.0000000 11.2980000 18.5410000 1.5740000 + 66 66 1 0.0000000 16.1280000 19.0390000 19.6440000 + 67 67 1 0.0000000 6.0950000 7.0580000 9.6530000 + 68 68 1 0.0000000 5.3890000 20.2540000 10.7060000 + 69 69 1 0.0000000 17.9160000 18.9070000 21.1540000 + 70 70 1 0.0000000 13.0780000 2.1790000 17.4030000 + 71 71 1 0.0000000 8.0450000 14.3440000 14.0640000 + 72 72 1 0.0000000 14.4380000 6.8780000 14.6950000 + 73 73 1 0.0000000 0.4570000 21.6180000 8.3670000 + 74 74 1 0.0000000 6.4350000 16.9720000 21.7330000 + 75 75 1 0.0000000 8.0530000 4.0310000 20.1860000 + 76 76 1 0.0000000 6.8130000 19.7870000 12.5790000 + 77 77 1 0.0000000 19.0490000 10.8480000 6.0760000 + 78 78 1 0.0000000 2.2540000 7.7370000 0.5320000 + 79 79 1 0.0000000 16.3920000 9.0880000 3.1430000 + 80 80 1 0.0000000 2.3620000 2.5500000 7.5690000 + 81 81 1 0.0000000 16.4560000 18.5670000 3.1120000 + 82 82 1 0.0000000 8.9560000 21.0830000 12.3020000 + 83 83 1 0.0000000 20.5540000 8.9280000 5.9480000 + 84 84 1 0.0000000 13.5930000 8.4890000 16.2370000 + 85 85 1 0.0000000 9.5270000 18.0720000 3.0190000 + 86 86 1 0.0000000 11.3690000 15.3870000 7.1310000 + 87 87 1 0.0000000 8.3670000 13.3960000 11.8610000 + 88 88 1 0.0000000 14.6370000 11.4110000 11.4870000 + 89 89 1 0.0000000 8.4720000 16.0650000 2.4300000 + 90 90 1 0.0000000 8.2360000 5.2200000 18.1710000 + 91 91 1 0.0000000 11.0620000 2.8760000 0.4170000 + 92 92 1 0.0000000 14.0830000 1.3550000 14.0190000 + 93 93 1 0.0000000 20.5600000 4.1900000 19.4660000 + 94 94 1 0.0000000 4.6340000 13.0980000 10.3670000 + 95 95 1 0.0000000 19.9860000 15.5670000 11.7860000 + 96 96 1 0.0000000 21.5070000 4.1860000 14.8350000 + 97 97 1 0.0000000 3.3000000 11.2060000 2.5350000 + 98 98 1 0.0000000 19.2680000 21.0240000 10.9110000 + 99 99 1 0.0000000 12.2370000 19.4650000 19.9000000 + 100 100 1 0.0000000 8.3790000 9.6670000 14.5440000 + 101 101 1 0.0000000 5.4520000 19.1660000 5.6940000 + 102 102 1 0.0000000 15.8720000 15.4140000 0.3070000 + 103 103 1 0.0000000 6.9830000 19.1480000 0.5830000 + 104 104 1 0.0000000 7.9760000 18.3420000 8.5250000 + 105 105 1 0.0000000 13.9710000 6.7570000 1.1860000 + 106 106 1 0.0000000 18.7050000 7.2110000 9.2350000 + 107 107 1 0.0000000 3.2430000 13.6330000 12.1990000 + 108 108 1 0.0000000 1.9830000 10.8340000 5.4640000 + 109 109 1 0.0000000 16.5770000 5.0400000 11.4490000 + 110 110 1 0.0000000 9.5130000 6.2390000 14.3030000 + 111 111 1 0.0000000 14.1990000 4.0910000 16.7750000 + 112 112 1 0.0000000 8.0160000 3.5600000 2.0280000 + 113 113 1 0.0000000 7.9650000 12.1700000 7.8050000 + 114 114 1 0.0000000 0.3770000 0.0320000 15.5780000 + 115 115 1 0.0000000 19.0860000 17.5690000 12.6230000 + 116 116 1 0.0000000 17.2970000 16.8030000 13.9660000 + 117 117 1 0.0000000 6.7180000 10.5880000 19.5790000 + 118 118 1 0.0000000 21.3930000 21.2940000 6.2410000 + 119 119 1 0.0000000 16.0260000 18.7640000 13.6100000 + 120 120 1 0.0000000 3.1880000 2.1990000 18.5690000 + 121 121 1 0.0000000 20.7860000 13.7840000 4.4870000 + 122 122 1 0.0000000 18.3540000 11.7960000 11.0710000 + 123 123 1 0.0000000 19.3210000 0.4960000 5.9630000 + 124 124 1 0.0000000 3.7260000 13.4120000 18.4840000 + 125 125 1 0.0000000 4.4280000 4.9270000 18.4730000 + 126 126 1 0.0000000 2.7040000 21.7660000 15.2940000 + 127 127 1 0.0000000 9.3640000 14.3230000 3.7130000 + 128 128 1 0.0000000 20.5800000 3.3360000 7.9310000 + 129 129 1 0.0000000 2.4060000 4.1320000 17.3120000 + 130 130 1 0.0000000 0.9210000 2.6080000 11.0930000 + 131 131 1 0.0000000 13.7900000 9.5610000 8.2490000 + 132 132 1 0.0000000 5.5210000 8.6760000 2.5590000 + 133 133 1 0.0000000 11.1320000 11.1160000 6.1310000 + 134 134 1 0.0000000 1.6180000 6.5650000 10.7690000 + 135 135 1 0.0000000 21.0480000 17.3880000 3.1250000 + 136 136 1 0.0000000 2.5950000 13.3430000 3.3870000 + 137 137 1 0.0000000 1.8600000 4.7830000 14.1190000 + 138 138 1 0.0000000 1.2420000 12.9340000 9.0760000 + 139 139 1 0.0000000 2.2650000 8.2300000 7.4350000 + 140 140 1 0.0000000 10.9360000 17.8140000 10.9520000 + 141 141 1 0.0000000 10.3160000 13.8030000 14.5060000 + 142 142 1 0.0000000 11.0500000 2.5760000 12.8090000 + 143 143 1 0.0000000 18.3430000 15.3950000 10.0190000 + 144 144 1 0.0000000 8.2990000 0.3320000 5.4980000 + 145 145 1 0.0000000 17.9730000 3.4330000 17.4260000 + 146 146 1 0.0000000 0.8080000 7.5530000 20.4740000 + 147 147 1 0.0000000 20.6320000 14.4730000 6.7080000 + 148 148 1 0.0000000 19.3400000 2.8450000 5.9340000 + 149 149 1 0.0000000 5.2100000 0.9290000 6.2580000 + 150 150 1 0.0000000 8.6370000 4.0920000 9.2870000 + 151 151 1 0.0000000 16.5730000 2.0050000 1.7720000 + 152 152 1 0.0000000 14.6570000 14.1440000 14.4910000 + 153 153 1 0.0000000 11.1610000 6.0610000 15.8870000 + 154 154 1 0.0000000 3.8100000 4.2040000 2.1350000 + 155 155 1 0.0000000 18.6920000 11.8180000 18.5170000 + 156 156 1 0.0000000 20.4240000 10.6340000 10.7960000 + 157 157 1 0.0000000 8.9050000 9.9220000 20.2310000 + 158 158 1 0.0000000 7.7940000 19.5410000 2.7410000 + 159 159 1 0.0000000 2.7600000 18.2100000 9.0140000 + 160 160 1 0.0000000 11.7480000 5.0280000 4.3170000 + 161 161 1 0.0000000 20.6470000 3.0010000 2.1470000 + 162 162 1 0.0000000 6.5680000 11.9510000 11.1410000 + 163 163 1 0.0000000 18.0300000 5.6700000 13.1650000 + 164 164 1 0.0000000 15.8950000 17.4810000 17.7940000 + 165 165 1 0.0000000 0.6840000 12.2180000 4.0930000 + 166 166 1 0.0000000 0.9170000 0.0080000 0.9710000 + 167 167 1 0.0000000 1.5850000 18.4470000 16.1470000 + 168 168 1 0.0000000 13.1970000 2.0830000 5.6040000 + 169 169 1 0.0000000 13.4220000 1.6690000 19.6280000 + 170 170 1 0.0000000 7.2980000 15.5410000 6.4330000 + 171 171 1 0.0000000 11.8930000 0.1240000 5.2450000 + 172 172 1 0.0000000 21.5410000 5.4260000 7.3690000 + 173 173 1 0.0000000 6.2310000 17.4900000 7.1340000 + 174 174 1 0.0000000 20.3880000 18.7320000 14.2000000 + 175 175 1 0.0000000 15.0410000 20.5060000 3.2370000 + 176 176 1 0.0000000 19.8180000 7.0070000 7.1800000 + 177 177 1 0.0000000 8.4660000 2.7180000 5.7470000 + 178 178 1 0.0000000 5.4480000 10.4180000 6.1220000 + 179 179 1 0.0000000 10.8570000 0.2910000 3.1650000 + 180 180 1 0.0000000 7.1820000 12.9370000 19.5560000 + 181 181 1 0.0000000 21.6620000 11.8360000 12.5450000 + 182 182 1 0.0000000 10.9080000 11.2050000 1.6360000 + 183 183 1 0.0000000 11.2840000 8.4420000 16.6070000 + 184 184 1 0.0000000 8.0040000 7.5690000 15.4890000 + 185 185 1 0.0000000 8.0790000 6.2840000 8.6400000 + 186 186 1 0.0000000 18.9520000 12.1530000 4.0530000 + 187 187 1 0.0000000 10.3010000 12.0820000 8.1320000 + 188 188 1 0.0000000 14.4560000 11.6780000 4.7170000 + 189 189 1 0.0000000 7.1020000 21.2750000 15.8180000 + 190 190 1 0.0000000 13.1170000 20.7170000 9.0870000 + 191 191 1 0.0000000 5.3560000 2.2610000 12.5060000 + 192 192 1 0.0000000 17.3690000 11.1000000 2.4870000 + 193 193 1 0.0000000 15.9510000 5.0030000 20.2280000 + 194 194 1 0.0000000 3.3320000 11.8950000 8.8170000 + 195 195 1 0.0000000 8.2450000 1.7100000 19.8310000 + 196 196 1 0.0000000 9.0600000 15.9380000 18.2990000 + 197 197 1 0.0000000 10.3120000 12.4780000 16.5400000 + 198 198 1 0.0000000 21.2690000 2.1440000 16.1630000 + 199 199 1 0.0000000 20.7920000 11.3890000 2.6870000 + 200 200 1 0.0000000 5.5190000 10.8650000 12.9180000 + 201 201 1 0.0000000 13.1600000 14.6530000 5.7980000 + 202 202 1 0.0000000 9.4110000 4.0280000 3.9640000 + 203 203 1 0.0000000 10.1160000 21.3800000 6.7070000 + 204 204 1 0.0000000 18.8050000 17.5440000 8.7540000 + 205 205 1 0.0000000 0.2690000 20.1700000 17.2400000 + 206 206 1 0.0000000 14.6190000 13.4340000 10.3480000 + 207 207 1 0.0000000 14.9800000 3.6520000 2.2770000 + 208 208 1 0.0000000 10.4210000 1.4390000 14.8540000 + 209 209 1 0.0000000 2.8950000 8.5990000 11.0640000 + 210 210 1 0.0000000 8.3350000 0.6070000 14.2020000 + 211 211 1 0.0000000 5.6790000 2.9730000 15.7800000 + 212 212 1 0.0000000 7.9000000 8.2920000 21.6460000 + 213 213 1 0.0000000 1.7820000 17.8720000 5.4810000 + 214 214 1 0.0000000 7.1130000 2.5790000 13.9770000 + 215 215 1 0.0000000 14.4580000 4.6660000 0.2210000 + 216 216 1 0.0000000 2.6400000 9.9660000 17.7570000 + 217 217 1 0.0000000 12.9280000 10.2110000 10.3600000 + 218 218 1 0.0000000 0.5090000 2.0800000 8.8230000 + 219 219 1 0.0000000 0.9650000 20.6540000 11.9240000 + 220 220 1 0.0000000 19.5740000 21.0310000 2.1230000 + 221 221 1 0.0000000 18.6770000 7.8820000 12.9890000 + 222 222 1 0.0000000 17.1700000 3.9160000 5.7110000 + 223 223 1 0.0000000 7.0920000 12.0700000 1.6960000 + 224 224 1 0.0000000 2.6840000 17.0880000 1.3490000 + 225 225 1 0.0000000 5.4860000 16.7240000 19.5970000 + 226 226 1 0.0000000 16.3220000 3.8420000 15.8790000 + 227 227 1 0.0000000 3.8940000 2.4920000 0.4900000 + 228 228 1 0.0000000 13.2430000 3.5150000 13.0570000 + 229 229 1 0.0000000 13.3010000 21.5940000 12.5150000 + 230 230 1 0.0000000 4.9010000 11.9630000 0.9870000 + 231 231 1 0.0000000 12.6700000 14.8980000 18.4670000 + 232 232 1 0.0000000 6.4220000 6.6170000 3.2980000 + 233 233 1 0.0000000 16.6360000 5.9910000 15.0630000 + 234 234 1 0.0000000 17.9000000 15.3980000 1.6090000 + 235 235 1 0.0000000 18.1580000 0.8480000 9.7210000 + 236 236 1 0.0000000 20.2850000 4.8230000 12.9090000 + 237 237 1 0.0000000 1.6610000 2.7360000 5.3350000 + 238 238 1 0.0000000 5.8340000 0.9980000 16.9740000 + 239 239 1 0.0000000 9.0090000 7.7870000 5.7310000 + 240 240 1 0.0000000 16.1890000 4.3150000 7.8490000 + 241 241 1 0.0000000 16.5840000 8.9600000 12.9530000 + 242 242 1 0.0000000 4.8520000 10.4780000 21.0310000 + 243 243 1 0.0000000 2.7810000 16.7740000 17.2520000 + 244 244 1 0.0000000 19.7990000 10.0200000 15.9170000 + 245 245 1 0.0000000 3.1690000 7.6710000 5.2800000 + 246 246 1 0.0000000 15.1980000 2.3520000 8.6870000 + 247 247 1 0.0000000 16.3130000 2.2040000 14.2110000 + 248 248 1 0.0000000 6.3140000 2.9350000 6.7010000 + 249 249 1 0.0000000 8.2590000 4.5060000 13.2730000 + 250 250 1 0.0000000 13.9300000 18.2210000 14.4470000 + 251 251 1 0.0000000 20.2210000 7.9620000 14.8160000 + 252 252 1 0.0000000 1.6700000 11.5910000 21.3490000 + 253 253 1 0.0000000 11.2380000 16.3450000 17.3670000 + 254 254 1 0.0000000 2.0800000 20.2850000 2.3410000 + 255 255 1 0.0000000 13.5570000 16.5190000 4.3840000 + 256 256 1 0.0000000 7.4220000 19.6120000 18.9900000 + 257 257 1 0.0000000 12.9300000 16.8740000 2.1540000 + 258 258 1 0.0000000 14.8300000 17.0150000 10.5830000 + 259 259 1 0.0000000 9.9680000 16.3050000 20.5360000 + 260 260 1 0.0000000 20.9510000 14.9180000 15.5360000 + 261 261 1 0.0000000 21.2710000 0.7830000 2.5700000 + 262 262 1 0.0000000 7.5010000 11.4110000 5.6070000 + 263 263 1 0.0000000 15.1820000 11.1410000 6.9920000 + 264 264 1 0.0000000 12.3430000 6.8350000 2.9520000 + 265 265 1 0.0000000 15.6910000 17.3040000 4.9430000 + 266 266 1 0.0000000 6.2450000 1.4930000 10.4630000 + 267 267 1 0.0000000 15.3140000 20.7570000 16.6390000 + 268 268 1 0.0000000 18.2310000 18.8700000 10.8220000 + 269 269 1 0.0000000 19.9080000 8.2790000 11.0020000 + 270 270 1 0.0000000 16.2580000 5.0600000 3.6820000 + 271 271 1 0.0000000 3.6660000 15.6980000 13.3000000 + 272 272 1 0.0000000 21.3440000 9.2620000 2.0490000 + 273 273 1 0.0000000 21.6340000 20.9700000 20.9670000 + 274 274 1 0.0000000 20.4570000 2.7200000 11.7840000 + 275 275 1 0.0000000 4.3450000 15.9260000 15.6130000 + 276 276 1 0.0000000 18.5090000 3.3140000 1.1410000 + 277 277 1 0.0000000 0.4070000 15.7920000 11.2970000 + 278 278 1 0.0000000 13.3440000 8.1980000 4.5520000 + 279 279 1 0.0000000 8.5380000 21.6840000 3.2560000 + 280 280 1 0.0000000 2.2890000 0.7680000 11.6890000 + 281 281 1 0.0000000 21.5990000 18.8900000 6.4050000 + 282 282 1 0.0000000 14.9140000 7.5570000 8.8670000 + 283 283 1 0.0000000 21.3690000 18.6450000 21.2590000 + 284 284 1 0.0000000 10.9470000 5.8950000 10.8840000 + 285 285 1 0.0000000 2.6280000 15.7990000 6.4350000 + 286 286 1 0.0000000 11.9940000 15.1200000 20.8540000 + 287 287 1 0.0000000 16.6450000 10.2270000 10.9850000 + 288 288 1 0.0000000 13.0310000 2.8900000 9.3200000 + 289 289 1 0.0000000 12.4260000 19.8280000 13.6940000 + 290 290 1 0.0000000 19.8890000 19.6500000 17.8410000 + 291 291 1 0.0000000 4.0230000 9.6810000 4.2830000 + 292 292 1 0.0000000 2.6590000 21.3600000 4.2810000 + 293 293 1 0.0000000 6.4930000 3.2770000 9.0110000 + 294 294 1 0.0000000 21.3560000 20.3330000 10.0560000 + 295 295 1 0.0000000 14.3030000 20.6610000 0.9740000 + 296 296 1 0.0000000 4.4890000 8.4620000 0.4180000 + 297 297 1 0.0000000 6.5630000 7.5730000 11.8490000 + 298 298 1 0.0000000 3.4090000 1.4420000 13.6640000 + 299 299 1 0.0000000 15.6340000 1.9640000 5.3770000 + 300 300 1 0.0000000 11.9210000 0.8170000 9.6710000 + 301 301 1 0.0000000 20.9660000 9.2330000 20.1270000 + 302 302 1 0.0000000 1.6280000 6.2090000 8.4340000 + 303 303 1 0.0000000 0.5530000 9.8060000 7.0560000 + 304 304 1 0.0000000 11.5710000 18.9280000 8.9830000 + 305 305 1 0.0000000 4.2490000 7.9910000 14.8160000 + 306 306 1 0.0000000 19.7300000 12.4900000 7.6500000 + 307 307 1 0.0000000 10.8450000 14.1880000 9.0020000 + 308 308 1 0.0000000 10.8070000 11.1620000 10.2560000 + 309 309 1 0.0000000 4.7040000 8.6980000 12.6030000 + 310 310 1 0.0000000 3.7570000 12.0590000 6.5220000 + 311 311 1 0.0000000 9.7910000 2.9010000 7.6620000 + 312 312 1 0.0000000 3.7810000 14.0810000 5.2770000 + 313 313 1 0.0000000 4.0640000 19.1000000 1.8260000 + 314 314 1 0.0000000 21.7520000 10.6160000 14.7710000 + 315 315 1 0.0000000 1.3090000 11.5200000 16.3780000 + 316 316 1 0.0000000 5.1840000 20.6560000 0.4260000 + 317 317 1 0.0000000 10.7630000 2.3920000 17.0100000 + 318 318 1 0.0000000 4.7970000 15.9920000 1.2450000 + 319 319 1 0.0000000 11.1370000 0.4590000 11.8330000 + 320 320 1 0.0000000 14.5870000 13.6170000 1.1610000 + 321 321 1 0.0000000 9.8660000 0.7940000 8.6450000 + 322 322 1 0.0000000 17.7650000 19.2430000 7.2990000 + 323 323 1 0.0000000 6.0610000 1.2430000 19.3000000 + 324 324 1 0.0000000 18.2200000 12.8760000 13.2170000 + 325 325 1 0.0000000 18.0460000 13.1700000 9.1450000 + 326 326 1 0.0000000 3.3530000 3.3130000 15.2040000 + 327 327 1 0.0000000 10.4090000 19.4890000 16.3660000 + 328 328 1 0.0000000 15.6710000 1.1260000 19.9260000 + 329 329 1 0.0000000 10.8900000 7.3650000 7.1060000 + 330 330 1 0.0000000 13.4480000 20.2870000 5.0130000 + 331 331 1 0.0000000 16.0530000 0.3050000 0.2340000 + 332 332 1 0.0000000 9.8430000 17.8410000 14.6670000 + 333 333 1 0.0000000 13.0150000 10.2370000 1.1400000 + 334 334 1 0.0000000 4.2090000 16.6330000 8.0040000 + 335 335 1 0.0000000 4.5530000 4.3630000 11.8090000 + 336 336 1 0.0000000 12.4370000 18.2310000 5.4180000 + 337 337 1 0.0000000 4.6660000 4.4220000 5.9770000 + 338 338 1 0.0000000 9.5670000 9.6790000 2.7600000 + 339 339 1 0.0000000 17.6640000 17.0250000 16.2770000 + 340 340 1 0.0000000 20.3640000 13.8280000 13.4210000 + 341 341 1 0.0000000 10.0140000 7.4130000 9.2700000 + 342 342 1 0.0000000 2.1350000 7.0370000 14.8450000 + 343 343 1 0.0000000 10.1280000 17.9060000 5.2690000 + 344 344 1 0.0000000 9.9640000 11.7180000 21.3790000 + 345 345 1 0.0000000 3.9300000 18.4910000 10.9740000 + 346 346 1 0.0000000 4.4370000 0.9780000 3.9700000 + 347 347 1 0.0000000 3.3540000 11.6180000 13.2880000 + 348 348 1 0.0000000 10.1490000 8.5100000 18.7440000 + 349 349 1 0.0000000 20.0030000 12.0850000 0.6000000 + 350 350 1 0.0000000 8.1370000 7.5880000 17.8300000 + 351 351 1 0.0000000 4.9940000 4.9580000 9.5900000 + 352 352 1 0.0000000 5.3170000 14.3610000 19.8350000 + 353 353 1 0.0000000 9.3030000 10.0320000 5.0540000 + 354 354 1 0.0000000 15.9060000 19.0210000 11.2850000 + 355 355 1 0.0000000 4.7750000 3.1100000 20.1740000 + 356 356 1 0.0000000 12.3120000 9.1080000 6.4970000 + 357 357 1 0.0000000 10.4810000 4.6620000 17.6350000 + 358 358 1 0.0000000 4.7080000 13.6970000 16.3300000 + 359 359 1 0.0000000 12.2970000 5.5490000 6.5760000 + 360 360 1 0.0000000 17.9900000 5.6590000 1.9370000 + 361 361 1 0.0000000 15.7760000 13.0220000 8.3090000 + 362 362 1 0.0000000 17.0960000 9.8020000 6.8980000 + 363 363 1 0.0000000 14.4040000 20.5780000 7.1330000 + 364 364 1 0.0000000 10.5700000 7.4740000 12.5610000 + 365 365 1 0.0000000 7.1880000 17.4800000 12.1560000 + 366 366 1 0.0000000 19.2640000 6.6050000 0.0900000 + 367 367 1 0.0000000 2.4860000 20.3860000 7.9620000 + 368 368 1 0.0000000 1.6540000 17.4650000 21.0330000 + 369 369 1 0.0000000 0.8570000 14.9180000 7.7750000 + 370 370 1 0.0000000 15.6360000 3.0200000 12.0780000 + 371 371 1 0.0000000 20.9520000 6.0750000 16.1620000 + 372 372 1 0.0000000 6.5150000 10.9720000 15.0530000 + 373 373 1 0.0000000 1.6150000 2.1220000 0.1040000 + 374 374 1 0.0000000 12.4880000 14.7040000 1.3780000 + 375 375 1 0.0000000 1.8720000 14.8200000 18.2130000 + 376 376 1 0.0000000 1.3840000 6.3060000 16.9560000 + 377 377 1 0.0000000 13.1420000 8.3550000 21.5020000 + 378 378 1 0.0000000 10.3950000 19.1540000 12.7720000 + 379 379 1 0.0000000 18.9350000 15.8660000 19.2180000 + 380 380 1 0.0000000 19.6110000 0.3890000 20.4600000 + 381 381 1 0.0000000 1.6460000 14.9430000 1.9780000 + 382 382 1 0.0000000 16.9420000 8.7780000 9.0500000 + 383 383 1 0.0000000 15.0770000 11.3050000 19.7190000 + 384 384 1 0.0000000 6.2370000 17.3890000 15.8170000 + 385 385 1 0.0000000 14.6890000 16.8390000 8.2540000 + 386 386 1 0.0000000 5.9660000 6.4540000 15.1720000 + 387 387 1 0.0000000 6.1100000 4.8320000 21.2820000 + 388 388 1 0.0000000 5.9710000 14.6570000 4.7110000 + 389 389 1 0.0000000 3.1780000 19.7080000 5.8410000 + 390 390 1 0.0000000 5.7600000 19.5340000 14.8080000 + 391 391 1 0.0000000 18.1190000 11.5110000 15.1550000 + 392 392 1 0.0000000 17.0450000 3.0230000 19.5700000 + 393 393 1 0.0000000 11.7520000 21.8180000 19.7610000 + 394 394 1 0.0000000 15.5870000 18.5610000 6.9700000 + 395 395 1 0.0000000 6.0680000 8.8370000 18.0920000 + 396 396 1 0.0000000 14.2730000 18.8060000 21.1250000 + 397 397 1 0.0000000 14.8640000 7.7480000 18.0510000 + 398 398 1 0.0000000 7.1970000 14.3360000 8.4160000 + 399 399 1 0.0000000 12.4080000 8.9750000 12.3640000 + 400 400 1 0.0000000 15.7690000 0.5910000 7.2330000 + 401 401 1 0.0000000 14.1880000 18.6730000 16.7170000 + 402 402 1 0.0000000 0.1070000 17.0650000 14.8780000 + 403 403 1 0.0000000 1.2690000 21.0730000 19.1580000 + 404 404 1 0.0000000 8.3320000 15.5390000 0.1550000 + 405 405 1 0.0000000 3.4890000 20.2250000 18.9410000 + 406 406 1 0.0000000 16.7760000 7.8120000 16.6050000 + 407 407 1 0.0000000 0.5070000 4.7570000 5.2510000 + 408 408 1 0.0000000 19.1810000 3.0200000 9.7780000 + 409 409 1 0.0000000 4.7160000 9.7900000 16.3110000 + 410 410 1 0.0000000 2.4040000 18.9600000 12.6390000 + 411 411 1 0.0000000 3.3380000 4.6500000 7.9680000 + 412 412 1 0.0000000 17.7990000 4.9620000 9.4940000 + 413 413 1 0.0000000 12.7390000 16.3390000 11.5840000 + 414 414 1 0.0000000 17.5550000 6.7730000 20.3200000 + 415 415 1 0.0000000 14.1770000 9.8840000 3.2060000 + 416 416 1 0.0000000 14.4790000 10.5810000 15.6890000 + 417 417 1 0.0000000 14.7570000 21.0200000 10.8010000 + 418 418 1 0.0000000 19.6820000 0.5930000 12.8140000 + 419 419 1 0.0000000 8.6600000 0.3420000 21.6710000 + 420 420 1 0.0000000 9.6300000 4.0130000 11.4620000 + 421 421 1 0.0000000 21.1990000 7.8220000 3.8780000 + 422 422 1 0.0000000 1.0220000 15.3220000 20.3160000 + 423 423 1 0.0000000 19.5230000 9.5210000 18.2400000 + 424 424 1 0.0000000 6.0420000 4.8470000 1.8140000 + 425 425 1 0.0000000 19.0970000 2.7310000 20.7130000 + 426 426 1 0.0000000 20.7220000 12.9310000 18.9570000 + 427 427 1 0.0000000 12.0420000 5.2830000 19.3670000 + 428 428 1 0.0000000 12.3510000 14.1340000 10.8070000 + 429 429 1 0.0000000 0.6760000 0.6980000 4.6080000 + 430 430 1 0.0000000 17.9010000 21.6070000 7.6530000 + 431 431 1 0.0000000 12.9910000 4.6940000 10.9090000 + 432 432 1 0.0000000 4.1650000 0.3790000 10.2450000 + 433 433 1 0.0000000 11.0350000 2.5880000 2.7230000 + 434 434 1 0.0000000 0.8260000 16.8030000 9.2410000 + 435 435 1 0.0000000 1.2930000 1.5320000 19.6910000 + 436 436 1 0.0000000 3.6360000 0.6300000 7.9720000 + 437 437 1 0.0000000 18.7690000 21.6650000 18.3160000 + 438 438 1 0.0000000 15.9900000 1.2130000 10.5660000 + 439 439 1 0.0000000 3.6880000 0.2170000 17.3680000 + 440 440 1 0.0000000 15.4550000 13.7970000 16.7760000 + 441 441 1 0.0000000 13.6260000 0.3920000 16.0690000 + 442 442 1 0.0000000 2.2090000 7.7760000 18.5900000 + 443 443 1 0.0000000 7.5390000 1.2670000 1.6990000 + 444 444 1 0.0000000 5.8870000 7.1350000 20.9610000 + 445 445 1 0.0000000 3.5460000 9.4970000 8.9750000 + 446 446 1 0.0000000 1.7030000 10.1450000 12.4300000 + 447 447 1 0.0000000 4.5220000 7.2320000 19.0140000 + 448 448 1 0.0000000 12.0790000 18.5320000 17.7390000 + 449 449 1 0.0000000 11.8150000 12.7440000 20.4040000 + 450 450 1 0.0000000 14.1450000 16.3300000 20.6400000 + 451 451 1 0.0000000 13.9790000 11.9100000 13.7820000 + 452 452 1 0.0000000 5.7860000 9.0870000 8.2180000 + 453 453 1 0.0000000 5.7610000 18.5920000 3.4730000 + 454 454 1 0.0000000 17.1860000 12.2100000 20.2580000 + 455 455 1 0.0000000 19.9590000 17.8190000 5.1360000 + 456 456 1 0.0000000 17.0590000 15.4900000 5.5810000 + 457 457 1 0.0000000 3.6710000 3.1920000 4.2290000 + 458 458 1 0.0000000 9.3110000 4.4320000 0.2320000 + 459 459 1 0.0000000 7.2900000 10.5480000 9.3640000 + 460 460 1 0.0000000 3.1990000 11.3340000 19.5640000 + 461 461 1 0.0000000 18.7960000 19.0310000 15.8960000 + 462 462 1 0.0000000 16.4530000 21.1730000 18.6370000 + 463 463 1 0.0000000 19.0360000 1.4790000 16.6070000 + 464 464 1 0.0000000 15.1190000 6.7220000 5.0610000 + 465 465 1 0.0000000 14.6980000 6.3460000 10.8900000 + 466 466 1 0.0000000 9.5270000 15.6660000 5.6890000 + 467 467 1 0.0000000 9.8670000 0.7250000 18.4290000 + 468 468 1 0.0000000 3.5070000 11.8220000 15.5670000 + 469 469 1 0.0000000 5.2170000 0.8530000 1.6550000 + 470 470 1 0.0000000 14.2830000 11.9310000 17.5860000 + 471 471 1 0.0000000 21.4650000 11.2840000 8.7140000 + 472 472 1 0.0000000 0.2700000 13.5140000 17.1240000 + 473 473 1 0.0000000 8.7330000 20.7300000 17.4130000 + 474 474 1 0.0000000 7.4140000 12.9760000 3.8660000 + 475 475 1 0.0000000 8.5520000 8.7210000 12.3480000 + 476 476 1 0.0000000 7.4770000 9.7280000 1.7090000 + 477 477 1 0.0000000 16.9200000 14.6800000 20.0740000 + 478 478 1 0.0000000 6.5920000 20.9910000 6.6400000 + 479 479 1 0.0000000 18.3870000 7.4290000 18.2380000 + 480 480 1 0.0000000 21.2320000 15.1360000 2.5810000 + 481 481 1 0.0000000 16.7390000 8.6780000 21.4380000 + 482 482 1 0.0000000 18.2260000 6.2380000 5.6140000 + 483 483 1 0.0000000 12.7550000 3.5820000 20.8720000 + 484 484 1 0.0000000 14.8870000 9.0010000 20.0300000 + 485 485 1 0.0000000 6.1970000 16.3000000 3.0880000 + 486 486 1 0.0000000 6.9450000 13.1810000 15.8140000 + 487 487 1 0.0000000 20.1770000 18.7700000 1.5020000 + 488 488 1 0.0000000 19.8750000 14.4220000 0.7710000 + 489 489 1 0.0000000 13.0770000 5.0280000 14.9330000 + 490 490 1 0.0000000 10.9540000 0.5380000 0.0170000 + 491 491 1 0.0000000 0.3310000 3.0520000 18.1720000 + 492 492 1 0.0000000 8.8200000 14.8310000 10.0110000 + 493 493 1 0.0000000 6.9570000 20.3870000 8.9230000 + 494 494 1 0.0000000 21.4900000 6.8560000 12.0490000 + 495 495 1 0.0000000 8.1550000 13.1990000 21.7210000 + 496 496 1 0.0000000 2.1970000 4.5290000 11.8290000 + 497 497 1 0.0000000 14.2880000 5.5560000 18.5960000 + 498 498 1 0.0000000 15.0910000 15.4110000 18.5470000 + 499 499 1 0.0000000 18.9760000 15.1930000 16.8970000 + 500 500 1 0.0000000 19.4100000 5.3490000 17.7540000 + 501 501 1 0.0000000 0.5430000 8.3990000 13.7700000 + 502 502 1 0.0000000 18.0770000 19.1690000 4.8770000 + 503 503 1 0.0000000 3.3760000 17.8650000 19.2940000 + 504 504 1 0.0000000 16.3760000 0.5870000 3.6340000 + 505 505 1 0.0000000 10.4990000 18.5190000 21.1770000 + 506 506 1 0.0000000 15.7320000 12.7570000 3.0200000 + 507 507 1 0.0000000 16.9190000 8.1780000 5.2430000 + 508 508 1 0.0000000 6.9450000 7.4210000 6.8040000 + 509 509 1 0.0000000 11.6120000 21.2610000 15.3620000 + 510 510 1 0.0000000 18.0500000 0.6840000 14.5470000 + 511 511 1 0.0000000 20.4340000 4.0240000 4.2040000 + 512 512 1 0.0000000 18.0190000 10.7210000 0.2160000 + diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp new file mode 100755 index 0000000000..893d75e69b --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_216.lmp @@ -0,0 +1,238 @@ +LAMMPS description + + 216 atoms + 0 bonds + 0 angles + 0 dihedrals + 0 impropers + + 1 atom types + 0 bond types + 0 angle types + 0 dihedral types + 0 improper types + + + 0.0000000 16.293000 xlo xhi + 0.0000000 16.293000 ylo yhi + 0.0000000 16.293000 zlo zhi + + Atoms + + 1 1 1 0.0000000 0.0000000 0.0000000 0.0000000 + 2 2 1 0.0000000 0.0000000 2.7160000 2.7160000 + 3 3 1 0.0000000 2.7160000 2.7160000 0.0000000 + 4 4 1 0.0000000 2.7160000 0.0000000 2.7160000 + 5 5 1 0.0000000 4.0730000 1.3580000 4.0730000 + 6 6 1 0.0000000 1.3580000 1.3580000 1.3580000 + 7 7 1 0.0000000 1.3580000 4.0730000 4.0730000 + 8 8 1 0.0000000 4.0730000 4.0730000 1.3580000 + 9 9 1 0.0000000 0.0000000 0.0000000 5.4310000 + 10 10 1 0.0000000 0.0000000 2.7160000 8.1460000 + 11 11 1 0.0000000 2.7160000 2.7160000 5.4310000 + 12 12 1 0.0000000 2.7160000 0.0000000 8.1460000 + 13 13 1 0.0000000 4.0730000 1.3580000 9.5040000 + 14 14 1 0.0000000 1.3580000 1.3580000 6.7890000 + 15 15 1 0.0000000 1.3580000 4.0730000 9.5040000 + 16 16 1 0.0000000 4.0730000 4.0730000 6.7890000 + 17 17 1 0.0000000 0.0000000 0.0000000 10.8620000 + 18 18 1 0.0000000 0.0000000 2.7160000 13.5780000 + 19 19 1 0.0000000 2.7160000 2.7160000 10.8620000 + 20 20 1 0.0000000 2.7160000 0.0000000 13.5780000 + 21 21 1 0.0000000 4.0730000 1.3580000 14.9350000 + 22 22 1 0.0000000 1.3580000 1.3580000 12.2200000 + 23 23 1 0.0000000 1.3580000 4.0730000 14.9350000 + 24 24 1 0.0000000 4.0730000 4.0730000 12.2200000 + 25 25 1 0.0000000 0.0000000 5.4310000 0.0000000 + 26 26 1 0.0000000 0.0000000 8.1460000 2.7160000 + 27 27 1 0.0000000 2.7160000 8.1460000 0.0000000 + 28 28 1 0.0000000 2.7160000 5.4310000 2.7160000 + 29 29 1 0.0000000 4.0730000 6.7890000 4.0730000 + 30 30 1 0.0000000 1.3580000 6.7890000 1.3580000 + 31 31 1 0.0000000 1.3580000 9.5040000 4.0730000 + 32 32 1 0.0000000 4.0730000 9.5040000 1.3580000 + 33 33 1 0.0000000 0.0000000 5.4310000 5.4310000 + 34 34 1 0.0000000 0.0000000 8.1460000 8.1460000 + 35 35 1 0.0000000 2.7160000 8.1460000 5.4310000 + 36 36 1 0.0000000 2.7160000 5.4310000 8.1460000 + 37 37 1 0.0000000 4.0730000 6.7890000 9.5040000 + 38 38 1 0.0000000 1.3580000 6.7890000 6.7890000 + 39 39 1 0.0000000 1.3580000 9.5040000 9.5040000 + 40 40 1 0.0000000 4.0730000 9.5040000 6.7890000 + 41 41 1 0.0000000 0.0000000 5.4310000 10.8620000 + 42 42 1 0.0000000 0.0000000 8.1460000 13.5780000 + 43 43 1 0.0000000 2.7160000 8.1460000 10.8620000 + 44 44 1 0.0000000 2.7160000 5.4310000 13.5780000 + 45 45 1 0.0000000 4.0730000 6.7890000 14.9350000 + 46 46 1 0.0000000 1.3580000 6.7890000 12.2200000 + 47 47 1 0.0000000 1.3580000 9.5040000 14.9350000 + 48 48 1 0.0000000 4.0730000 9.5040000 12.2200000 + 49 49 1 0.0000000 0.0000000 10.8620000 0.0000000 + 50 50 1 0.0000000 0.0000000 13.5780000 2.7160000 + 51 51 1 0.0000000 2.7160000 13.5780000 0.0000000 + 52 52 1 0.0000000 2.7160000 10.8620000 2.7160000 + 53 53 1 0.0000000 4.0730000 12.2200000 4.0730000 + 54 54 1 0.0000000 1.3580000 12.2200000 1.3580000 + 55 55 1 0.0000000 1.3580000 14.9350000 4.0730000 + 56 56 1 0.0000000 4.0730000 14.9350000 1.3580000 + 57 57 1 0.0000000 0.0000000 10.8620000 5.4310000 + 58 58 1 0.0000000 0.0000000 13.5780000 8.1460000 + 59 59 1 0.0000000 2.7160000 13.5780000 5.4310000 + 60 60 1 0.0000000 2.7160000 10.8620000 8.1460000 + 61 61 1 0.0000000 4.0730000 12.2200000 9.5040000 + 62 62 1 0.0000000 1.3580000 12.2200000 6.7890000 + 63 63 1 0.0000000 1.3580000 14.9350000 9.5040000 + 64 64 1 0.0000000 4.0730000 14.9350000 6.7890000 + 65 65 1 0.0000000 0.0000000 10.8620000 10.8620000 + 66 66 1 0.0000000 0.0000000 13.5780000 13.5780000 + 67 67 1 0.0000000 2.7160000 13.5780000 10.8620000 + 68 68 1 0.0000000 2.7160000 10.8620000 13.5780000 + 69 69 1 0.0000000 4.0730000 12.2200000 14.9350000 + 70 70 1 0.0000000 1.3580000 12.2200000 12.2200000 + 71 71 1 0.0000000 1.3580000 14.9350000 14.9350000 + 72 72 1 0.0000000 4.0730000 14.9350000 12.2200000 + 73 73 1 0.0000000 5.4310000 0.0000000 0.0000000 + 74 74 1 0.0000000 5.4310000 2.7160000 2.7160000 + 75 75 1 0.0000000 8.1460000 2.7160000 0.0000000 + 76 76 1 0.0000000 8.1460000 0.0000000 2.7160000 + 77 77 1 0.0000000 9.5040000 1.3580000 4.0730000 + 78 78 1 0.0000000 6.7890000 1.3580000 1.3580000 + 79 79 1 0.0000000 6.7890000 4.0730000 4.0730000 + 80 80 1 0.0000000 9.5040000 4.0730000 1.3580000 + 81 81 1 0.0000000 5.4310000 0.0000000 5.4310000 + 82 82 1 0.0000000 5.4310000 2.7160000 8.1460000 + 83 83 1 0.0000000 8.1460000 2.7160000 5.4310000 + 84 84 1 0.0000000 8.1460000 0.0000000 8.1460000 + 85 85 1 0.0000000 9.5040000 1.3580000 9.5040000 + 86 86 1 0.0000000 6.7890000 1.3580000 6.7890000 + 87 87 1 0.0000000 6.7890000 4.0730000 9.5040000 + 88 88 1 0.0000000 9.5040000 4.0730000 6.7890000 + 89 89 1 0.0000000 5.4310000 0.0000000 10.8620000 + 90 90 1 0.0000000 5.4310000 2.7160000 13.5780000 + 91 91 1 0.0000000 8.1460000 2.7160000 10.8620000 + 92 92 1 0.0000000 8.1460000 0.0000000 13.5780000 + 93 93 1 0.0000000 9.5040000 1.3580000 14.9350000 + 94 94 1 0.0000000 6.7890000 1.3580000 12.2200000 + 95 95 1 0.0000000 6.7890000 4.0730000 14.9350000 + 96 96 1 0.0000000 9.5040000 4.0730000 12.2200000 + 97 97 1 0.0000000 5.4310000 5.4310000 0.0000000 + 98 98 1 0.0000000 5.4310000 8.1460000 2.7160000 + 99 99 1 0.0000000 8.1460000 8.1460000 0.0000000 + 100 100 1 0.0000000 8.1460000 5.4310000 2.7160000 + 101 101 1 0.0000000 9.5040000 6.7890000 4.0730000 + 102 102 1 0.0000000 6.7890000 6.7890000 1.3580000 + 103 103 1 0.0000000 6.7890000 9.5040000 4.0730000 + 104 104 1 0.0000000 9.5040000 9.5040000 1.3580000 + 105 105 1 0.0000000 5.4310000 5.4310000 5.4310000 + 106 106 1 0.0000000 5.4310000 8.1460000 8.1460000 + 107 107 1 0.0000000 8.1460000 8.1460000 5.4310000 + 108 108 1 0.0000000 8.1460000 5.4310000 8.1460000 + 109 109 1 0.0000000 9.5040000 6.7890000 9.5040000 + 110 110 1 0.0000000 6.7890000 6.7890000 6.7890000 + 111 111 1 0.0000000 6.7890000 9.5040000 9.5040000 + 112 112 1 0.0000000 9.5040000 9.5040000 6.7890000 + 113 113 1 0.0000000 5.4310000 5.4310000 10.8620000 + 114 114 1 0.0000000 5.4310000 8.1460000 13.5780000 + 115 115 1 0.0000000 8.1460000 8.1460000 10.8620000 + 116 116 1 0.0000000 8.1460000 5.4310000 13.5780000 + 117 117 1 0.0000000 9.5040000 6.7890000 14.9350000 + 118 118 1 0.0000000 6.7890000 6.7890000 12.2200000 + 119 119 1 0.0000000 6.7890000 9.5040000 14.9350000 + 120 120 1 0.0000000 9.5040000 9.5040000 12.2200000 + 121 121 1 0.0000000 5.4310000 10.8620000 0.0000000 + 122 122 1 0.0000000 5.4310000 13.5780000 2.7160000 + 123 123 1 0.0000000 8.1460000 13.5780000 0.0000000 + 124 124 1 0.0000000 8.1460000 10.8620000 2.7160000 + 125 125 1 0.0000000 9.5040000 12.2200000 4.0730000 + 126 126 1 0.0000000 6.7890000 12.2200000 1.3580000 + 127 127 1 0.0000000 6.7890000 14.9350000 4.0730000 + 128 128 1 0.0000000 9.5040000 14.9350000 1.3580000 + 129 129 1 0.0000000 5.4310000 10.8620000 5.4310000 + 130 130 1 0.0000000 5.4310000 13.5780000 8.1460000 + 131 131 1 0.0000000 8.1460000 13.5780000 5.4310000 + 132 132 1 0.0000000 8.1460000 10.8620000 8.1460000 + 133 133 1 0.0000000 9.5040000 12.2200000 9.5040000 + 134 134 1 0.0000000 6.7890000 12.2200000 6.7890000 + 135 135 1 0.0000000 6.7890000 14.9350000 9.5040000 + 136 136 1 0.0000000 9.5040000 14.9350000 6.7890000 + 137 137 1 0.0000000 5.4310000 10.8620000 10.8620000 + 138 138 1 0.0000000 5.4310000 13.5780000 13.5780000 + 139 139 1 0.0000000 8.1460000 13.5780000 10.8620000 + 140 140 1 0.0000000 8.1460000 10.8620000 13.5780000 + 141 141 1 0.0000000 9.5040000 12.2200000 14.9350000 + 142 142 1 0.0000000 6.7890000 12.2200000 12.2200000 + 143 143 1 0.0000000 6.7890000 14.9350000 14.9350000 + 144 144 1 0.0000000 9.5040000 14.9350000 12.2200000 + 145 145 1 0.0000000 10.8620000 0.0000000 0.0000000 + 146 146 1 0.0000000 10.8620000 2.7160000 2.7160000 + 147 147 1 0.0000000 13.5780000 2.7160000 0.0000000 + 148 148 1 0.0000000 13.5780000 0.0000000 2.7160000 + 149 149 1 0.0000000 14.9350000 1.3580000 4.0730000 + 150 150 1 0.0000000 12.2200000 1.3580000 1.3580000 + 151 151 1 0.0000000 12.2200000 4.0730000 4.0730000 + 152 152 1 0.0000000 14.9350000 4.0730000 1.3580000 + 153 153 1 0.0000000 10.8620000 0.0000000 5.4310000 + 154 154 1 0.0000000 10.8620000 2.7160000 8.1460000 + 155 155 1 0.0000000 13.5780000 2.7160000 5.4310000 + 156 156 1 0.0000000 13.5780000 0.0000000 8.1460000 + 157 157 1 0.0000000 14.9350000 1.3580000 9.5040000 + 158 158 1 0.0000000 12.2200000 1.3580000 6.7890000 + 159 159 1 0.0000000 12.2200000 4.0730000 9.5040000 + 160 160 1 0.0000000 14.9350000 4.0730000 6.7890000 + 161 161 1 0.0000000 10.8620000 0.0000000 10.8620000 + 162 162 1 0.0000000 10.8620000 2.7160000 13.5780000 + 163 163 1 0.0000000 13.5780000 2.7160000 10.8620000 + 164 164 1 0.0000000 13.5780000 0.0000000 13.5780000 + 165 165 1 0.0000000 14.9350000 1.3580000 14.9350000 + 166 166 1 0.0000000 12.2200000 1.3580000 12.2200000 + 167 167 1 0.0000000 12.2200000 4.0730000 14.9350000 + 168 168 1 0.0000000 14.9350000 4.0730000 12.2200000 + 169 169 1 0.0000000 10.8620000 5.4310000 0.0000000 + 170 170 1 0.0000000 10.8620000 8.1460000 2.7160000 + 171 171 1 0.0000000 13.5780000 8.1460000 0.0000000 + 172 172 1 0.0000000 13.5780000 5.4310000 2.7160000 + 173 173 1 0.0000000 14.9350000 6.7890000 4.0730000 + 174 174 1 0.0000000 12.2200000 6.7890000 1.3580000 + 175 175 1 0.0000000 12.2200000 9.5040000 4.0730000 + 176 176 1 0.0000000 14.9350000 9.5040000 1.3580000 + 177 177 1 0.0000000 10.8620000 5.4310000 5.4310000 + 178 178 1 0.0000000 10.8620000 8.1460000 8.1460000 + 179 179 1 0.0000000 13.5780000 8.1460000 5.4310000 + 180 180 1 0.0000000 13.5780000 5.4310000 8.1460000 + 181 181 1 0.0000000 14.9350000 6.7890000 9.5040000 + 182 182 1 0.0000000 12.2200000 6.7890000 6.7890000 + 183 183 1 0.0000000 12.2200000 9.5040000 9.5040000 + 184 184 1 0.0000000 14.9350000 9.5040000 6.7890000 + 185 185 1 0.0000000 10.8620000 5.4310000 10.8620000 + 186 186 1 0.0000000 10.8620000 8.1460000 13.5780000 + 187 187 1 0.0000000 13.5780000 8.1460000 10.8620000 + 188 188 1 0.0000000 13.5780000 5.4310000 13.5780000 + 189 189 1 0.0000000 14.9350000 6.7890000 14.9350000 + 190 190 1 0.0000000 12.2200000 6.7890000 12.2200000 + 191 191 1 0.0000000 12.2200000 9.5040000 14.9350000 + 192 192 1 0.0000000 14.9350000 9.5040000 12.2200000 + 193 193 1 0.0000000 10.8620000 10.8620000 0.0000000 + 194 194 1 0.0000000 10.8620000 13.5780000 2.7160000 + 195 195 1 0.0000000 13.5780000 13.5780000 0.0000000 + 196 196 1 0.0000000 13.5780000 10.8620000 2.7160000 + 197 197 1 0.0000000 14.9350000 12.2200000 4.0730000 + 198 198 1 0.0000000 12.2200000 12.2200000 1.3580000 + 199 199 1 0.0000000 12.2200000 14.9350000 4.0730000 + 200 200 1 0.0000000 14.9350000 14.9350000 1.3580000 + 201 201 1 0.0000000 10.8620000 10.8620000 5.4310000 + 202 202 1 0.0000000 10.8620000 13.5780000 8.1460000 + 203 203 1 0.0000000 13.5780000 13.5780000 5.4310000 + 204 204 1 0.0000000 13.5780000 10.8620000 8.1460000 + 205 205 1 0.0000000 14.9350000 12.2200000 9.5040000 + 206 206 1 0.0000000 12.2200000 12.2200000 6.7890000 + 207 207 1 0.0000000 12.2200000 14.9350000 9.5040000 + 208 208 1 0.0000000 14.9350000 14.9350000 6.7890000 + 209 209 1 0.0000000 10.8620000 10.8620000 10.8620000 + 210 210 1 0.0000000 10.8620000 13.5780000 13.5780000 + 211 211 1 0.0000000 13.5780000 13.5780000 10.8620000 + 212 212 1 0.0000000 13.5780000 10.8620000 13.5780000 + 213 213 1 0.0000000 14.9350000 12.2200000 14.9350000 + 214 214 1 0.0000000 12.2200000 12.2200000 12.2200000 + 215 215 1 0.0000000 12.2200000 14.9350000 14.9350000 + 216 216 1 0.0000000 14.9350000 14.9350000 12.2200000 + diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp new file mode 100755 index 0000000000..8c1ecd30bd --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_512.lmp @@ -0,0 +1,534 @@ +LAMMPS description + + 512 atoms + 0 bonds + 0 angles + 0 dihedrals + 0 impropers + + 1 atom types + 0 bond types + 0 angle types + 0 dihedral types + 0 improper types + + + 0.0000000 21.724000 xlo xhi + 0.0000000 21.724000 ylo yhi + 0.0000000 21.724000 zlo zhi + + Atoms + + 1 1 1 0.0000000 0.0000000 0.0000000 0.0000000 + 2 2 1 0.0000000 0.0000000 2.7150000 2.7150000 + 3 3 1 0.0000000 2.7150000 2.7150000 0.0000000 + 4 4 1 0.0000000 2.7150000 0.0000000 2.7150000 + 5 5 1 0.0000000 4.0730000 1.3580000 4.0730000 + 6 6 1 0.0000000 1.3580000 1.3580000 1.3580000 + 7 7 1 0.0000000 1.3580000 4.0730000 4.0730000 + 8 8 1 0.0000000 4.0730000 4.0730000 1.3580000 + 9 9 1 0.0000000 0.0000000 0.0000000 5.4310000 + 10 10 1 0.0000000 0.0000000 2.7150000 8.1460000 + 11 11 1 0.0000000 2.7150000 2.7150000 5.4310000 + 12 12 1 0.0000000 2.7150000 0.0000000 8.1460000 + 13 13 1 0.0000000 4.0730000 1.3580000 9.5040000 + 14 14 1 0.0000000 1.3580000 1.3580000 6.7890000 + 15 15 1 0.0000000 1.3580000 4.0730000 9.5040000 + 16 16 1 0.0000000 4.0730000 4.0730000 6.7890000 + 17 17 1 0.0000000 0.0000000 0.0000000 10.8620000 + 18 18 1 0.0000000 0.0000000 2.7150000 13.5770000 + 19 19 1 0.0000000 2.7150000 2.7150000 10.8620000 + 20 20 1 0.0000000 2.7150000 0.0000000 13.5770000 + 21 21 1 0.0000000 4.0730000 1.3580000 14.9350000 + 22 22 1 0.0000000 1.3580000 1.3580000 12.2200000 + 23 23 1 0.0000000 1.3580000 4.0730000 14.9350000 + 24 24 1 0.0000000 4.0730000 4.0730000 12.2200000 + 25 25 1 0.0000000 0.0000000 0.0000000 16.2930000 + 26 26 1 0.0000000 0.0000000 2.7150000 19.0080000 + 27 27 1 0.0000000 2.7150000 2.7150000 16.2930000 + 28 28 1 0.0000000 2.7150000 0.0000000 19.0080000 + 29 29 1 0.0000000 4.0730000 1.3580000 20.3660000 + 30 30 1 0.0000000 1.3580000 1.3580000 17.6510000 + 31 31 1 0.0000000 1.3580000 4.0730000 20.3660000 + 32 32 1 0.0000000 4.0730000 4.0730000 17.6510000 + 33 33 1 0.0000000 0.0000000 5.4310000 0.0000000 + 34 34 1 0.0000000 0.0000000 8.1460000 2.7150000 + 35 35 1 0.0000000 2.7150000 8.1460000 0.0000000 + 36 36 1 0.0000000 2.7150000 5.4310000 2.7150000 + 37 37 1 0.0000000 4.0730000 6.7890000 4.0730000 + 38 38 1 0.0000000 1.3580000 6.7890000 1.3580000 + 39 39 1 0.0000000 1.3580000 9.5040000 4.0730000 + 40 40 1 0.0000000 4.0730000 9.5040000 1.3580000 + 41 41 1 0.0000000 0.0000000 5.4310000 5.4310000 + 42 42 1 0.0000000 0.0000000 8.1460000 8.1460000 + 43 43 1 0.0000000 2.7150000 8.1460000 5.4310000 + 44 44 1 0.0000000 2.7150000 5.4310000 8.1460000 + 45 45 1 0.0000000 4.0730000 6.7890000 9.5040000 + 46 46 1 0.0000000 1.3580000 6.7890000 6.7890000 + 47 47 1 0.0000000 1.3580000 9.5040000 9.5040000 + 48 48 1 0.0000000 4.0730000 9.5040000 6.7890000 + 49 49 1 0.0000000 0.0000000 5.4310000 10.8620000 + 50 50 1 0.0000000 0.0000000 8.1460000 13.5770000 + 51 51 1 0.0000000 2.7150000 8.1460000 10.8620000 + 52 52 1 0.0000000 2.7150000 5.4310000 13.5770000 + 53 53 1 0.0000000 4.0730000 6.7890000 14.9350000 + 54 54 1 0.0000000 1.3580000 6.7890000 12.2200000 + 55 55 1 0.0000000 1.3580000 9.5040000 14.9350000 + 56 56 1 0.0000000 4.0730000 9.5040000 12.2200000 + 57 57 1 0.0000000 0.0000000 5.4310000 16.2930000 + 58 58 1 0.0000000 0.0000000 8.1460000 19.0080000 + 59 59 1 0.0000000 2.7150000 8.1460000 16.2930000 + 60 60 1 0.0000000 2.7150000 5.4310000 19.0080000 + 61 61 1 0.0000000 4.0730000 6.7890000 20.3660000 + 62 62 1 0.0000000 1.3580000 6.7890000 17.6510000 + 63 63 1 0.0000000 1.3580000 9.5040000 20.3660000 + 64 64 1 0.0000000 4.0730000 9.5040000 17.6510000 + 65 65 1 0.0000000 0.0000000 10.8620000 0.0000000 + 66 66 1 0.0000000 0.0000000 13.5770000 2.7150000 + 67 67 1 0.0000000 2.7150000 13.5770000 0.0000000 + 68 68 1 0.0000000 2.7150000 10.8620000 2.7150000 + 69 69 1 0.0000000 4.0730000 12.2200000 4.0730000 + 70 70 1 0.0000000 1.3580000 12.2200000 1.3580000 + 71 71 1 0.0000000 1.3580000 14.9350000 4.0730000 + 72 72 1 0.0000000 4.0730000 14.9350000 1.3580000 + 73 73 1 0.0000000 0.0000000 10.8620000 5.4310000 + 74 74 1 0.0000000 0.0000000 13.5770000 8.1460000 + 75 75 1 0.0000000 2.7150000 13.5770000 5.4310000 + 76 76 1 0.0000000 2.7150000 10.8620000 8.1460000 + 77 77 1 0.0000000 4.0730000 12.2200000 9.5040000 + 78 78 1 0.0000000 1.3580000 12.2200000 6.7890000 + 79 79 1 0.0000000 1.3580000 14.9350000 9.5040000 + 80 80 1 0.0000000 4.0730000 14.9350000 6.7890000 + 81 81 1 0.0000000 0.0000000 10.8620000 10.8620000 + 82 82 1 0.0000000 0.0000000 13.5770000 13.5770000 + 83 83 1 0.0000000 2.7150000 13.5770000 10.8620000 + 84 84 1 0.0000000 2.7150000 10.8620000 13.5770000 + 85 85 1 0.0000000 4.0730000 12.2200000 14.9350000 + 86 86 1 0.0000000 1.3580000 12.2200000 12.2200000 + 87 87 1 0.0000000 1.3580000 14.9350000 14.9350000 + 88 88 1 0.0000000 4.0730000 14.9350000 12.2200000 + 89 89 1 0.0000000 0.0000000 10.8620000 16.2930000 + 90 90 1 0.0000000 0.0000000 13.5770000 19.0080000 + 91 91 1 0.0000000 2.7150000 13.5770000 16.2930000 + 92 92 1 0.0000000 2.7150000 10.8620000 19.0080000 + 93 93 1 0.0000000 4.0730000 12.2200000 20.3660000 + 94 94 1 0.0000000 1.3580000 12.2200000 17.6510000 + 95 95 1 0.0000000 1.3580000 14.9350000 20.3660000 + 96 96 1 0.0000000 4.0730000 14.9350000 17.6510000 + 97 97 1 0.0000000 0.0000000 16.2930000 0.0000000 + 98 98 1 0.0000000 0.0000000 19.0080000 2.7150000 + 99 99 1 0.0000000 2.7150000 19.0080000 0.0000000 + 100 100 1 0.0000000 2.7150000 16.2930000 2.7150000 + 101 101 1 0.0000000 4.0730000 17.6510000 4.0730000 + 102 102 1 0.0000000 1.3580000 17.6510000 1.3580000 + 103 103 1 0.0000000 1.3580000 20.3660000 4.0730000 + 104 104 1 0.0000000 4.0730000 20.3660000 1.3580000 + 105 105 1 0.0000000 0.0000000 16.2930000 5.4310000 + 106 106 1 0.0000000 0.0000000 19.0080000 8.1460000 + 107 107 1 0.0000000 2.7150000 19.0080000 5.4310000 + 108 108 1 0.0000000 2.7150000 16.2930000 8.1460000 + 109 109 1 0.0000000 4.0730000 17.6510000 9.5040000 + 110 110 1 0.0000000 1.3580000 17.6510000 6.7890000 + 111 111 1 0.0000000 1.3580000 20.3660000 9.5040000 + 112 112 1 0.0000000 4.0730000 20.3660000 6.7890000 + 113 113 1 0.0000000 0.0000000 16.2930000 10.8620000 + 114 114 1 0.0000000 0.0000000 19.0080000 13.5770000 + 115 115 1 0.0000000 2.7150000 19.0080000 10.8620000 + 116 116 1 0.0000000 2.7150000 16.2930000 13.5770000 + 117 117 1 0.0000000 4.0730000 17.6510000 14.9350000 + 118 118 1 0.0000000 1.3580000 17.6510000 12.2200000 + 119 119 1 0.0000000 1.3580000 20.3660000 14.9350000 + 120 120 1 0.0000000 4.0730000 20.3660000 12.2200000 + 121 121 1 0.0000000 0.0000000 16.2930000 16.2930000 + 122 122 1 0.0000000 0.0000000 19.0080000 19.0080000 + 123 123 1 0.0000000 2.7150000 19.0080000 16.2930000 + 124 124 1 0.0000000 2.7150000 16.2930000 19.0080000 + 125 125 1 0.0000000 4.0730000 17.6510000 20.3660000 + 126 126 1 0.0000000 1.3580000 17.6510000 17.6510000 + 127 127 1 0.0000000 1.3580000 20.3660000 20.3660000 + 128 128 1 0.0000000 4.0730000 20.3660000 17.6510000 + 129 129 1 0.0000000 5.4310000 0.0000000 0.0000000 + 130 130 1 0.0000000 5.4310000 2.7150000 2.7150000 + 131 131 1 0.0000000 8.1460000 2.7150000 0.0000000 + 132 132 1 0.0000000 8.1460000 0.0000000 2.7150000 + 133 133 1 0.0000000 9.5040000 1.3580000 4.0730000 + 134 134 1 0.0000000 6.7890000 1.3580000 1.3580000 + 135 135 1 0.0000000 6.7890000 4.0730000 4.0730000 + 136 136 1 0.0000000 9.5040000 4.0730000 1.3580000 + 137 137 1 0.0000000 5.4310000 0.0000000 5.4310000 + 138 138 1 0.0000000 5.4310000 2.7150000 8.1460000 + 139 139 1 0.0000000 8.1460000 2.7150000 5.4310000 + 140 140 1 0.0000000 8.1460000 0.0000000 8.1460000 + 141 141 1 0.0000000 9.5040000 1.3580000 9.5040000 + 142 142 1 0.0000000 6.7890000 1.3580000 6.7890000 + 143 143 1 0.0000000 6.7890000 4.0730000 9.5040000 + 144 144 1 0.0000000 9.5040000 4.0730000 6.7890000 + 145 145 1 0.0000000 5.4310000 0.0000000 10.8620000 + 146 146 1 0.0000000 5.4310000 2.7150000 13.5770000 + 147 147 1 0.0000000 8.1460000 2.7150000 10.8620000 + 148 148 1 0.0000000 8.1460000 0.0000000 13.5770000 + 149 149 1 0.0000000 9.5040000 1.3580000 14.9350000 + 150 150 1 0.0000000 6.7890000 1.3580000 12.2200000 + 151 151 1 0.0000000 6.7890000 4.0730000 14.9350000 + 152 152 1 0.0000000 9.5040000 4.0730000 12.2200000 + 153 153 1 0.0000000 5.4310000 0.0000000 16.2930000 + 154 154 1 0.0000000 5.4310000 2.7150000 19.0080000 + 155 155 1 0.0000000 8.1460000 2.7150000 16.2930000 + 156 156 1 0.0000000 8.1460000 0.0000000 19.0080000 + 157 157 1 0.0000000 9.5040000 1.3580000 20.3660000 + 158 158 1 0.0000000 6.7890000 1.3580000 17.6510000 + 159 159 1 0.0000000 6.7890000 4.0730000 20.3660000 + 160 160 1 0.0000000 9.5040000 4.0730000 17.6510000 + 161 161 1 0.0000000 5.4310000 5.4310000 0.0000000 + 162 162 1 0.0000000 5.4310000 8.1460000 2.7150000 + 163 163 1 0.0000000 8.1460000 8.1460000 0.0000000 + 164 164 1 0.0000000 8.1460000 5.4310000 2.7150000 + 165 165 1 0.0000000 9.5040000 6.7890000 4.0730000 + 166 166 1 0.0000000 6.7890000 6.7890000 1.3580000 + 167 167 1 0.0000000 6.7890000 9.5040000 4.0730000 + 168 168 1 0.0000000 9.5040000 9.5040000 1.3580000 + 169 169 1 0.0000000 5.4310000 5.4310000 5.4310000 + 170 170 1 0.0000000 5.4310000 8.1460000 8.1460000 + 171 171 1 0.0000000 8.1460000 8.1460000 5.4310000 + 172 172 1 0.0000000 8.1460000 5.4310000 8.1460000 + 173 173 1 0.0000000 9.5040000 6.7890000 9.5040000 + 174 174 1 0.0000000 6.7890000 6.7890000 6.7890000 + 175 175 1 0.0000000 6.7890000 9.5040000 9.5040000 + 176 176 1 0.0000000 9.5040000 9.5040000 6.7890000 + 177 177 1 0.0000000 5.4310000 5.4310000 10.8620000 + 178 178 1 0.0000000 5.4310000 8.1460000 13.5770000 + 179 179 1 0.0000000 8.1460000 8.1460000 10.8620000 + 180 180 1 0.0000000 8.1460000 5.4310000 13.5770000 + 181 181 1 0.0000000 9.5040000 6.7890000 14.9350000 + 182 182 1 0.0000000 6.7890000 6.7890000 12.2200000 + 183 183 1 0.0000000 6.7890000 9.5040000 14.9350000 + 184 184 1 0.0000000 9.5040000 9.5040000 12.2200000 + 185 185 1 0.0000000 5.4310000 5.4310000 16.2930000 + 186 186 1 0.0000000 5.4310000 8.1460000 19.0080000 + 187 187 1 0.0000000 8.1460000 8.1460000 16.2930000 + 188 188 1 0.0000000 8.1460000 5.4310000 19.0080000 + 189 189 1 0.0000000 9.5040000 6.7890000 20.3660000 + 190 190 1 0.0000000 6.7890000 6.7890000 17.6510000 + 191 191 1 0.0000000 6.7890000 9.5040000 20.3660000 + 192 192 1 0.0000000 9.5040000 9.5040000 17.6510000 + 193 193 1 0.0000000 5.4310000 10.8620000 0.0000000 + 194 194 1 0.0000000 5.4310000 13.5770000 2.7150000 + 195 195 1 0.0000000 8.1460000 13.5770000 0.0000000 + 196 196 1 0.0000000 8.1460000 10.8620000 2.7150000 + 197 197 1 0.0000000 9.5040000 12.2200000 4.0730000 + 198 198 1 0.0000000 6.7890000 12.2200000 1.3580000 + 199 199 1 0.0000000 6.7890000 14.9350000 4.0730000 + 200 200 1 0.0000000 9.5040000 14.9350000 1.3580000 + 201 201 1 0.0000000 5.4310000 10.8620000 5.4310000 + 202 202 1 0.0000000 5.4310000 13.5770000 8.1460000 + 203 203 1 0.0000000 8.1460000 13.5770000 5.4310000 + 204 204 1 0.0000000 8.1460000 10.8620000 8.1460000 + 205 205 1 0.0000000 9.5040000 12.2200000 9.5040000 + 206 206 1 0.0000000 6.7890000 12.2200000 6.7890000 + 207 207 1 0.0000000 6.7890000 14.9350000 9.5040000 + 208 208 1 0.0000000 9.5040000 14.9350000 6.7890000 + 209 209 1 0.0000000 5.4310000 10.8620000 10.8620000 + 210 210 1 0.0000000 5.4310000 13.5770000 13.5770000 + 211 211 1 0.0000000 8.1460000 13.5770000 10.8620000 + 212 212 1 0.0000000 8.1460000 10.8620000 13.5770000 + 213 213 1 0.0000000 9.5040000 12.2200000 14.9350000 + 214 214 1 0.0000000 6.7890000 12.2200000 12.2200000 + 215 215 1 0.0000000 6.7890000 14.9350000 14.9350000 + 216 216 1 0.0000000 9.5040000 14.9350000 12.2200000 + 217 217 1 0.0000000 5.4310000 10.8620000 16.2930000 + 218 218 1 0.0000000 5.4310000 13.5770000 19.0080000 + 219 219 1 0.0000000 8.1460000 13.5770000 16.2930000 + 220 220 1 0.0000000 8.1460000 10.8620000 19.0080000 + 221 221 1 0.0000000 9.5040000 12.2200000 20.3660000 + 222 222 1 0.0000000 6.7890000 12.2200000 17.6510000 + 223 223 1 0.0000000 6.7890000 14.9350000 20.3660000 + 224 224 1 0.0000000 9.5040000 14.9350000 17.6510000 + 225 225 1 0.0000000 5.4310000 16.2930000 0.0000000 + 226 226 1 0.0000000 5.4310000 19.0080000 2.7150000 + 227 227 1 0.0000000 8.1460000 19.0080000 0.0000000 + 228 228 1 0.0000000 8.1460000 16.2930000 2.7150000 + 229 229 1 0.0000000 9.5040000 17.6510000 4.0730000 + 230 230 1 0.0000000 6.7890000 17.6510000 1.3580000 + 231 231 1 0.0000000 6.7890000 20.3660000 4.0730000 + 232 232 1 0.0000000 9.5040000 20.3660000 1.3580000 + 233 233 1 0.0000000 5.4310000 16.2930000 5.4310000 + 234 234 1 0.0000000 5.4310000 19.0080000 8.1460000 + 235 235 1 0.0000000 8.1460000 19.0080000 5.4310000 + 236 236 1 0.0000000 8.1460000 16.2930000 8.1460000 + 237 237 1 0.0000000 9.5040000 17.6510000 9.5040000 + 238 238 1 0.0000000 6.7890000 17.6510000 6.7890000 + 239 239 1 0.0000000 6.7890000 20.3660000 9.5040000 + 240 240 1 0.0000000 9.5040000 20.3660000 6.7890000 + 241 241 1 0.0000000 5.4310000 16.2930000 10.8620000 + 242 242 1 0.0000000 5.4310000 19.0080000 13.5770000 + 243 243 1 0.0000000 8.1460000 19.0080000 10.8620000 + 244 244 1 0.0000000 8.1460000 16.2930000 13.5770000 + 245 245 1 0.0000000 9.5040000 17.6510000 14.9350000 + 246 246 1 0.0000000 6.7890000 17.6510000 12.2200000 + 247 247 1 0.0000000 6.7890000 20.3660000 14.9350000 + 248 248 1 0.0000000 9.5040000 20.3660000 12.2200000 + 249 249 1 0.0000000 5.4310000 16.2930000 16.2930000 + 250 250 1 0.0000000 5.4310000 19.0080000 19.0080000 + 251 251 1 0.0000000 8.1460000 19.0080000 16.2930000 + 252 252 1 0.0000000 8.1460000 16.2930000 19.0080000 + 253 253 1 0.0000000 9.5040000 17.6510000 20.3660000 + 254 254 1 0.0000000 6.7890000 17.6510000 17.6510000 + 255 255 1 0.0000000 6.7890000 20.3660000 20.3660000 + 256 256 1 0.0000000 9.5040000 20.3660000 17.6510000 + 257 257 1 0.0000000 10.8620000 0.0000000 0.0000000 + 258 258 1 0.0000000 10.8620000 2.7150000 2.7150000 + 259 259 1 0.0000000 13.5770000 2.7150000 0.0000000 + 260 260 1 0.0000000 13.5770000 0.0000000 2.7150000 + 261 261 1 0.0000000 14.9350000 1.3580000 4.0730000 + 262 262 1 0.0000000 12.2200000 1.3580000 1.3580000 + 263 263 1 0.0000000 12.2200000 4.0730000 4.0730000 + 264 264 1 0.0000000 14.9350000 4.0730000 1.3580000 + 265 265 1 0.0000000 10.8620000 0.0000000 5.4310000 + 266 266 1 0.0000000 10.8620000 2.7150000 8.1460000 + 267 267 1 0.0000000 13.5770000 2.7150000 5.4310000 + 268 268 1 0.0000000 13.5770000 0.0000000 8.1460000 + 269 269 1 0.0000000 14.9350000 1.3580000 9.5040000 + 270 270 1 0.0000000 12.2200000 1.3580000 6.7890000 + 271 271 1 0.0000000 12.2200000 4.0730000 9.5040000 + 272 272 1 0.0000000 14.9350000 4.0730000 6.7890000 + 273 273 1 0.0000000 10.8620000 0.0000000 10.8620000 + 274 274 1 0.0000000 10.8620000 2.7150000 13.5770000 + 275 275 1 0.0000000 13.5770000 2.7150000 10.8620000 + 276 276 1 0.0000000 13.5770000 0.0000000 13.5770000 + 277 277 1 0.0000000 14.9350000 1.3580000 14.9350000 + 278 278 1 0.0000000 12.2200000 1.3580000 12.2200000 + 279 279 1 0.0000000 12.2200000 4.0730000 14.9350000 + 280 280 1 0.0000000 14.9350000 4.0730000 12.2200000 + 281 281 1 0.0000000 10.8620000 0.0000000 16.2930000 + 282 282 1 0.0000000 10.8620000 2.7150000 19.0080000 + 283 283 1 0.0000000 13.5770000 2.7150000 16.2930000 + 284 284 1 0.0000000 13.5770000 0.0000000 19.0080000 + 285 285 1 0.0000000 14.9350000 1.3580000 20.3660000 + 286 286 1 0.0000000 12.2200000 1.3580000 17.6510000 + 287 287 1 0.0000000 12.2200000 4.0730000 20.3660000 + 288 288 1 0.0000000 14.9350000 4.0730000 17.6510000 + 289 289 1 0.0000000 10.8620000 5.4310000 0.0000000 + 290 290 1 0.0000000 10.8620000 8.1460000 2.7150000 + 291 291 1 0.0000000 13.5770000 8.1460000 0.0000000 + 292 292 1 0.0000000 13.5770000 5.4310000 2.7150000 + 293 293 1 0.0000000 14.9350000 6.7890000 4.0730000 + 294 294 1 0.0000000 12.2200000 6.7890000 1.3580000 + 295 295 1 0.0000000 12.2200000 9.5040000 4.0730000 + 296 296 1 0.0000000 14.9350000 9.5040000 1.3580000 + 297 297 1 0.0000000 10.8620000 5.4310000 5.4310000 + 298 298 1 0.0000000 10.8620000 8.1460000 8.1460000 + 299 299 1 0.0000000 13.5770000 8.1460000 5.4310000 + 300 300 1 0.0000000 13.5770000 5.4310000 8.1460000 + 301 301 1 0.0000000 14.9350000 6.7890000 9.5040000 + 302 302 1 0.0000000 12.2200000 6.7890000 6.7890000 + 303 303 1 0.0000000 12.2200000 9.5040000 9.5040000 + 304 304 1 0.0000000 14.9350000 9.5040000 6.7890000 + 305 305 1 0.0000000 10.8620000 5.4310000 10.8620000 + 306 306 1 0.0000000 10.8620000 8.1460000 13.5770000 + 307 307 1 0.0000000 13.5770000 8.1460000 10.8620000 + 308 308 1 0.0000000 13.5770000 5.4310000 13.5770000 + 309 309 1 0.0000000 14.9350000 6.7890000 14.9350000 + 310 310 1 0.0000000 12.2200000 6.7890000 12.2200000 + 311 311 1 0.0000000 12.2200000 9.5040000 14.9350000 + 312 312 1 0.0000000 14.9350000 9.5040000 12.2200000 + 313 313 1 0.0000000 10.8620000 5.4310000 16.2930000 + 314 314 1 0.0000000 10.8620000 8.1460000 19.0080000 + 315 315 1 0.0000000 13.5770000 8.1460000 16.2930000 + 316 316 1 0.0000000 13.5770000 5.4310000 19.0080000 + 317 317 1 0.0000000 14.9350000 6.7890000 20.3660000 + 318 318 1 0.0000000 12.2200000 6.7890000 17.6510000 + 319 319 1 0.0000000 12.2200000 9.5040000 20.3660000 + 320 320 1 0.0000000 14.9350000 9.5040000 17.6510000 + 321 321 1 0.0000000 10.8620000 10.8620000 0.0000000 + 322 322 1 0.0000000 10.8620000 13.5770000 2.7150000 + 323 323 1 0.0000000 13.5770000 13.5770000 0.0000000 + 324 324 1 0.0000000 13.5770000 10.8620000 2.7150000 + 325 325 1 0.0000000 14.9350000 12.2200000 4.0730000 + 326 326 1 0.0000000 12.2200000 12.2200000 1.3580000 + 327 327 1 0.0000000 12.2200000 14.9350000 4.0730000 + 328 328 1 0.0000000 14.9350000 14.9350000 1.3580000 + 329 329 1 0.0000000 10.8620000 10.8620000 5.4310000 + 330 330 1 0.0000000 10.8620000 13.5770000 8.1460000 + 331 331 1 0.0000000 13.5770000 13.5770000 5.4310000 + 332 332 1 0.0000000 13.5770000 10.8620000 8.1460000 + 333 333 1 0.0000000 14.9350000 12.2200000 9.5040000 + 334 334 1 0.0000000 12.2200000 12.2200000 6.7890000 + 335 335 1 0.0000000 12.2200000 14.9350000 9.5040000 + 336 336 1 0.0000000 14.9350000 14.9350000 6.7890000 + 337 337 1 0.0000000 10.8620000 10.8620000 10.8620000 + 338 338 1 0.0000000 10.8620000 13.5770000 13.5770000 + 339 339 1 0.0000000 13.5770000 13.5770000 10.8620000 + 340 340 1 0.0000000 13.5770000 10.8620000 13.5770000 + 341 341 1 0.0000000 14.9350000 12.2200000 14.9350000 + 342 342 1 0.0000000 12.2200000 12.2200000 12.2200000 + 343 343 1 0.0000000 12.2200000 14.9350000 14.9350000 + 344 344 1 0.0000000 14.9350000 14.9350000 12.2200000 + 345 345 1 0.0000000 10.8620000 10.8620000 16.2930000 + 346 346 1 0.0000000 10.8620000 13.5770000 19.0080000 + 347 347 1 0.0000000 13.5770000 13.5770000 16.2930000 + 348 348 1 0.0000000 13.5770000 10.8620000 19.0080000 + 349 349 1 0.0000000 14.9350000 12.2200000 20.3660000 + 350 350 1 0.0000000 12.2200000 12.2200000 17.6510000 + 351 351 1 0.0000000 12.2200000 14.9350000 20.3660000 + 352 352 1 0.0000000 14.9350000 14.9350000 17.6510000 + 353 353 1 0.0000000 10.8620000 16.2930000 0.0000000 + 354 354 1 0.0000000 10.8620000 19.0080000 2.7150000 + 355 355 1 0.0000000 13.5770000 19.0080000 0.0000000 + 356 356 1 0.0000000 13.5770000 16.2930000 2.7150000 + 357 357 1 0.0000000 14.9350000 17.6510000 4.0730000 + 358 358 1 0.0000000 12.2200000 17.6510000 1.3580000 + 359 359 1 0.0000000 12.2200000 20.3660000 4.0730000 + 360 360 1 0.0000000 14.9350000 20.3660000 1.3580000 + 361 361 1 0.0000000 10.8620000 16.2930000 5.4310000 + 362 362 1 0.0000000 10.8620000 19.0080000 8.1460000 + 363 363 1 0.0000000 13.5770000 19.0080000 5.4310000 + 364 364 1 0.0000000 13.5770000 16.2930000 8.1460000 + 365 365 1 0.0000000 14.9350000 17.6510000 9.5040000 + 366 366 1 0.0000000 12.2200000 17.6510000 6.7890000 + 367 367 1 0.0000000 12.2200000 20.3660000 9.5040000 + 368 368 1 0.0000000 14.9350000 20.3660000 6.7890000 + 369 369 1 0.0000000 10.8620000 16.2930000 10.8620000 + 370 370 1 0.0000000 10.8620000 19.0080000 13.5770000 + 371 371 1 0.0000000 13.5770000 19.0080000 10.8620000 + 372 372 1 0.0000000 13.5770000 16.2930000 13.5770000 + 373 373 1 0.0000000 14.9350000 17.6510000 14.9350000 + 374 374 1 0.0000000 12.2200000 17.6510000 12.2200000 + 375 375 1 0.0000000 12.2200000 20.3660000 14.9350000 + 376 376 1 0.0000000 14.9350000 20.3660000 12.2200000 + 377 377 1 0.0000000 10.8620000 16.2930000 16.2930000 + 378 378 1 0.0000000 10.8620000 19.0080000 19.0080000 + 379 379 1 0.0000000 13.5770000 19.0080000 16.2930000 + 380 380 1 0.0000000 13.5770000 16.2930000 19.0080000 + 381 381 1 0.0000000 14.9350000 17.6510000 20.3660000 + 382 382 1 0.0000000 12.2200000 17.6510000 17.6510000 + 383 383 1 0.0000000 12.2200000 20.3660000 20.3660000 + 384 384 1 0.0000000 14.9350000 20.3660000 17.6510000 + 385 385 1 0.0000000 16.2930000 0.0000000 0.0000000 + 386 386 1 0.0000000 16.2930000 2.7150000 2.7150000 + 387 387 1 0.0000000 19.0080000 2.7150000 0.0000000 + 388 388 1 0.0000000 19.0080000 0.0000000 2.7150000 + 389 389 1 0.0000000 20.3660000 1.3580000 4.0730000 + 390 390 1 0.0000000 17.6510000 1.3580000 1.3580000 + 391 391 1 0.0000000 17.6510000 4.0730000 4.0730000 + 392 392 1 0.0000000 20.3660000 4.0730000 1.3580000 + 393 393 1 0.0000000 16.2930000 0.0000000 5.4310000 + 394 394 1 0.0000000 16.2930000 2.7150000 8.1460000 + 395 395 1 0.0000000 19.0080000 2.7150000 5.4310000 + 396 396 1 0.0000000 19.0080000 0.0000000 8.1460000 + 397 397 1 0.0000000 20.3660000 1.3580000 9.5040000 + 398 398 1 0.0000000 17.6510000 1.3580000 6.7890000 + 399 399 1 0.0000000 17.6510000 4.0730000 9.5040000 + 400 400 1 0.0000000 20.3660000 4.0730000 6.7890000 + 401 401 1 0.0000000 16.2930000 0.0000000 10.8620000 + 402 402 1 0.0000000 16.2930000 2.7150000 13.5770000 + 403 403 1 0.0000000 19.0080000 2.7150000 10.8620000 + 404 404 1 0.0000000 19.0080000 0.0000000 13.5770000 + 405 405 1 0.0000000 20.3660000 1.3580000 14.9350000 + 406 406 1 0.0000000 17.6510000 1.3580000 12.2200000 + 407 407 1 0.0000000 17.6510000 4.0730000 14.9350000 + 408 408 1 0.0000000 20.3660000 4.0730000 12.2200000 + 409 409 1 0.0000000 16.2930000 0.0000000 16.2930000 + 410 410 1 0.0000000 16.2930000 2.7150000 19.0080000 + 411 411 1 0.0000000 19.0080000 2.7150000 16.2930000 + 412 412 1 0.0000000 19.0080000 0.0000000 19.0080000 + 413 413 1 0.0000000 20.3660000 1.3580000 20.3660000 + 414 414 1 0.0000000 17.6510000 1.3580000 17.6510000 + 415 415 1 0.0000000 17.6510000 4.0730000 20.3660000 + 416 416 1 0.0000000 20.3660000 4.0730000 17.6510000 + 417 417 1 0.0000000 16.2930000 5.4310000 0.0000000 + 418 418 1 0.0000000 16.2930000 8.1460000 2.7150000 + 419 419 1 0.0000000 19.0080000 8.1460000 0.0000000 + 420 420 1 0.0000000 19.0080000 5.4310000 2.7150000 + 421 421 1 0.0000000 20.3660000 6.7890000 4.0730000 + 422 422 1 0.0000000 17.6510000 6.7890000 1.3580000 + 423 423 1 0.0000000 17.6510000 9.5040000 4.0730000 + 424 424 1 0.0000000 20.3660000 9.5040000 1.3580000 + 425 425 1 0.0000000 16.2930000 5.4310000 5.4310000 + 426 426 1 0.0000000 16.2930000 8.1460000 8.1460000 + 427 427 1 0.0000000 19.0080000 8.1460000 5.4310000 + 428 428 1 0.0000000 19.0080000 5.4310000 8.1460000 + 429 429 1 0.0000000 20.3660000 6.7890000 9.5040000 + 430 430 1 0.0000000 17.6510000 6.7890000 6.7890000 + 431 431 1 0.0000000 17.6510000 9.5040000 9.5040000 + 432 432 1 0.0000000 20.3660000 9.5040000 6.7890000 + 433 433 1 0.0000000 16.2930000 5.4310000 10.8620000 + 434 434 1 0.0000000 16.2930000 8.1460000 13.5770000 + 435 435 1 0.0000000 19.0080000 8.1460000 10.8620000 + 436 436 1 0.0000000 19.0080000 5.4310000 13.5770000 + 437 437 1 0.0000000 20.3660000 6.7890000 14.9350000 + 438 438 1 0.0000000 17.6510000 6.7890000 12.2200000 + 439 439 1 0.0000000 17.6510000 9.5040000 14.9350000 + 440 440 1 0.0000000 20.3660000 9.5040000 12.2200000 + 441 441 1 0.0000000 16.2930000 5.4310000 16.2930000 + 442 442 1 0.0000000 16.2930000 8.1460000 19.0080000 + 443 443 1 0.0000000 19.0080000 8.1460000 16.2930000 + 444 444 1 0.0000000 19.0080000 5.4310000 19.0080000 + 445 445 1 0.0000000 20.3660000 6.7890000 20.3660000 + 446 446 1 0.0000000 17.6510000 6.7890000 17.6510000 + 447 447 1 0.0000000 17.6510000 9.5040000 20.3660000 + 448 448 1 0.0000000 20.3660000 9.5040000 17.6510000 + 449 449 1 0.0000000 16.2930000 10.8620000 0.0000000 + 450 450 1 0.0000000 16.2930000 13.5770000 2.7150000 + 451 451 1 0.0000000 19.0080000 13.5770000 0.0000000 + 452 452 1 0.0000000 19.0080000 10.8620000 2.7150000 + 453 453 1 0.0000000 20.3660000 12.2200000 4.0730000 + 454 454 1 0.0000000 17.6510000 12.2200000 1.3580000 + 455 455 1 0.0000000 17.6510000 14.9350000 4.0730000 + 456 456 1 0.0000000 20.3660000 14.9350000 1.3580000 + 457 457 1 0.0000000 16.2930000 10.8620000 5.4310000 + 458 458 1 0.0000000 16.2930000 13.5770000 8.1460000 + 459 459 1 0.0000000 19.0080000 13.5770000 5.4310000 + 460 460 1 0.0000000 19.0080000 10.8620000 8.1460000 + 461 461 1 0.0000000 20.3660000 12.2200000 9.5040000 + 462 462 1 0.0000000 17.6510000 12.2200000 6.7890000 + 463 463 1 0.0000000 17.6510000 14.9350000 9.5040000 + 464 464 1 0.0000000 20.3660000 14.9350000 6.7890000 + 465 465 1 0.0000000 16.2930000 10.8620000 10.8620000 + 466 466 1 0.0000000 16.2930000 13.5770000 13.5770000 + 467 467 1 0.0000000 19.0080000 13.5770000 10.8620000 + 468 468 1 0.0000000 19.0080000 10.8620000 13.5770000 + 469 469 1 0.0000000 20.3660000 12.2200000 14.9350000 + 470 470 1 0.0000000 17.6510000 12.2200000 12.2200000 + 471 471 1 0.0000000 17.6510000 14.9350000 14.9350000 + 472 472 1 0.0000000 20.3660000 14.9350000 12.2200000 + 473 473 1 0.0000000 16.2930000 10.8620000 16.2930000 + 474 474 1 0.0000000 16.2930000 13.5770000 19.0080000 + 475 475 1 0.0000000 19.0080000 13.5770000 16.2930000 + 476 476 1 0.0000000 19.0080000 10.8620000 19.0080000 + 477 477 1 0.0000000 20.3660000 12.2200000 20.3660000 + 478 478 1 0.0000000 17.6510000 12.2200000 17.6510000 + 479 479 1 0.0000000 17.6510000 14.9350000 20.3660000 + 480 480 1 0.0000000 20.3660000 14.9350000 17.6510000 + 481 481 1 0.0000000 16.2930000 16.2930000 0.0000000 + 482 482 1 0.0000000 16.2930000 19.0080000 2.7150000 + 483 483 1 0.0000000 19.0080000 19.0080000 0.0000000 + 484 484 1 0.0000000 19.0080000 16.2930000 2.7150000 + 485 485 1 0.0000000 20.3660000 17.6510000 4.0730000 + 486 486 1 0.0000000 17.6510000 17.6510000 1.3580000 + 487 487 1 0.0000000 17.6510000 20.3660000 4.0730000 + 488 488 1 0.0000000 20.3660000 20.3660000 1.3580000 + 489 489 1 0.0000000 16.2930000 16.2930000 5.4310000 + 490 490 1 0.0000000 16.2930000 19.0080000 8.1460000 + 491 491 1 0.0000000 19.0080000 19.0080000 5.4310000 + 492 492 1 0.0000000 19.0080000 16.2930000 8.1460000 + 493 493 1 0.0000000 20.3660000 17.6510000 9.5040000 + 494 494 1 0.0000000 17.6510000 17.6510000 6.7890000 + 495 495 1 0.0000000 17.6510000 20.3660000 9.5040000 + 496 496 1 0.0000000 20.3660000 20.3660000 6.7890000 + 497 497 1 0.0000000 16.2930000 16.2930000 10.8620000 + 498 498 1 0.0000000 16.2930000 19.0080000 13.5770000 + 499 499 1 0.0000000 19.0080000 19.0080000 10.8620000 + 500 500 1 0.0000000 19.0080000 16.2930000 13.5770000 + 501 501 1 0.0000000 20.3660000 17.6510000 14.9350000 + 502 502 1 0.0000000 17.6510000 17.6510000 12.2200000 + 503 503 1 0.0000000 17.6510000 20.3660000 14.9350000 + 504 504 1 0.0000000 20.3660000 20.3660000 12.2200000 + 505 505 1 0.0000000 16.2930000 16.2930000 16.2930000 + 506 506 1 0.0000000 16.2930000 19.0080000 19.0080000 + 507 507 1 0.0000000 19.0080000 19.0080000 16.2930000 + 508 508 1 0.0000000 19.0080000 16.2930000 19.0080000 + 509 509 1 0.0000000 20.3660000 17.6510000 20.3660000 + 510 510 1 0.0000000 17.6510000 17.6510000 17.6510000 + 511 511 1 0.0000000 17.6510000 20.3660000 20.3660000 + 512 512 1 0.0000000 20.3660000 20.3660000 17.6510000 + diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp new file mode 100755 index 0000000000..5066049895 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/lmp_bank/silicon_8.lmp @@ -0,0 +1,29 @@ +LAMMPS description + + 8 atoms + 0 bonds + 0 angles + 0 dihedrals + 0 impropers + + 1 atom types + 0 bond types + 0 angle types + 0 dihedral types + 0 improper types + + + 0.0000000 5.4310000 xlo xhi + 0.0000000 5.4310000 ylo yhi + 0.0000000 5.4310000 zlo zhi + + Atoms + + 1 1 1 0.0000000 0.0000000 0.0000000 0.0000000 + 2 2 1 0.0000000 1.3577500 1.3577500 1.3572000 + 3 3 1 0.0000000 2.7155000 2.7155000 0.0000000 + 4 4 1 0.0000000 4.0732500 4.0732500 1.3572000 + 5 5 1 0.0000000 2.7155000 0.0000000 2.7144000 + 6 6 1 0.0000000 4.0732500 1.3577500 4.0732500 + 7 7 1 0.0000000 0.0000000 2.7155000 2.7155000 + 8 8 1 0.0000000 1.3577500 4.0732500 4.0732500 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/results/dynmat.dat b/examples/USER/phonon/dynamical_matrix_command/Silicon/results/dynmat.dat new file mode 100755 index 0000000000..676f897416 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/results/dynmat.dat @@ -0,0 +1,192 @@ +5409.83472486 3.05075234 0.00000214 +-1277.48270695 -863.24917964 -862.95613831 +-193.14095266 0.11071645 0.00000015 +-1277.48270619 -863.24917934 862.95613793 +-193.17613831 0.34066975 -0.00000031 +-1276.01088244 861.54715125 -861.62537402 +83.46959051 -0.09801326 0.00000000 +-1276.01088167 861.54715064 861.62537387 +3.05073556 5409.83419867 0.00000137 +-863.13224993 -1277.34160622 -862.92133430 +0.12865796 -193.14095472 -0.00000023 +-863.13224825 -1277.34160485 862.92133392 +-0.23661028 83.46934214 -0.00000046 +861.66402909 -1276.15172701 861.66024333 +-0.00634065 -193.17585981 -0.00000015 +861.66402909 -1276.15172686 -861.66024394 +0.00000031 0.00000031 5410.11037330 +-862.89766079 -862.97973912 -1277.71823542 +0.00000000 -0.00000008 83.84059083 +862.89766018 862.97973851 -1277.71823557 +0.00000015 0.00000015 -193.17558390 +-861.60900269 861.52691291 -1276.08157137 +-0.00000015 -0.00000031 -193.17573821 +861.60900330 -861.52691284 -1276.08157236 +-1277.48271824 -863.13225435 -862.89768596 +5409.83567916 3.04882502 2.82007861 +-1277.34161080 -863.24919475 862.97975804 +-193.14089260 0.11950100 0.11994134 +-1277.52243157 863.24943259 -863.11331046 +-193.17597070 0.16713301 -0.02106496 +-1274.64156872 859.96385388 860.17328202 +83.46945758 -0.16730525 -0.06100253 +-863.24919444 -1277.34161103 -862.97975804 +3.04882666 5409.83567944 -2.82007731 +-863.13225496 -1277.48271916 862.89768688 +0.11950094 -193.14089255 -0.11994043 +863.24943320 -1277.52243118 863.11331076 +-0.16730522 83.46945778 0.06100314 +859.96385365 -1274.64156819 -860.17328225 +0.16713979 -193.17596607 0.02106008 +-862.95611199 -862.92132598 -1277.71824411 +2.82004085 -2.82004013 5410.11000835 +862.92132743 862.95611344 -1277.71824587 +-0.11994722 0.11994786 83.84083834 +-862.88110757 862.88110699 -1277.34764097 +0.02099713 0.06108924 -193.17561785 +860.25587487 -860.25587502 -1274.81548840 +-0.06108897 -0.02099687 -193.17561808 +-193.14095465 0.12865765 0.00000015 +-1277.34160508 -863.13224794 862.92133361 +5409.83419867 3.05073968 0.00000092 +-1277.34160584 -863.13224924 -862.92133483 +83.46934214 -0.23660998 -0.00000076 +-1276.15172724 861.66402917 861.66024325 +-193.17585988 -0.00634042 -0.00000031 +-1276.15172694 861.66402940 -861.66024325 +0.11071645 -193.14095243 0.00000046 +-863.24917949 -1277.48270718 862.95613831 +3.05075524 5409.83472478 -0.00000046 +-863.24918117 -1277.48270825 -862.95613923 +0.34066922 -193.17613823 0.00000046 +861.54715094 -1276.01088228 -861.62537295 +-0.09801303 83.46959035 0.00000015 +861.54713538 -1276.01088145 861.62537387 +-0.00000046 -0.00000023 83.84059068 +862.97973867 862.89766010 -1277.71823633 +-0.00000214 -0.00000053 5410.11037574 +-862.97973943 -862.89766079 -1277.71823633 +0.00000015 0.00000008 -193.17558374 +861.52691291 -861.60900269 -1276.08157198 +-0.00000015 -0.00000015 -193.17573814 +-861.52691368 861.60900261 -1276.08157243 +-1277.48271786 -863.13225450 862.89768520 +-193.14089232 0.11950085 -0.11994115 +-1277.34161255 -863.24919673 -862.97975957 +5409.83568051 3.04882517 -2.82007644 +-1277.52243110 863.24943259 863.11330990 +83.46945732 -0.16730494 0.06100319 +-1274.64156796 859.96385342 -860.17328103 +-193.17597041 0.16713331 0.02106477 +-863.24919482 -1277.34161057 862.97975774 +0.11950077 -193.14089270 0.11994160 +-863.13225473 -1277.48271839 -862.89768673 +3.04882502 5409.83568081 2.82007903 +863.24943084 -1277.52242966 -863.11330868 +0.16713324 -193.17597064 -0.02106522 +859.96385510 -1274.64156926 860.17328255 +-0.16730411 83.46945641 -0.06100350 +862.95611161 862.92132537 -1277.71824365 +0.11994725 -0.11994740 83.84083859 +-862.92132606 -862.95611207 -1277.71824548 +-2.82003936 2.82004013 5410.11000806 +862.88110509 -862.88110547 -1277.34764015 +0.06108893 0.02099703 -193.17561792 +-860.25587388 860.25587441 -1274.81548916 +-0.02099726 -0.06108878 -193.17561777 +-193.17613465 -0.23660693 0.00000015 +-1277.52241409 863.24943328 -862.88111478 +83.46934549 0.34066334 -0.00000015 +-1277.52241425 863.24943335 862.88111508 +5404.58897235 -9.71806749 0.00000015 +-1273.31333522 -858.38273960 -858.96245956 +-193.21062369 -0.11938368 0.00000000 +-1273.31333598 -858.38273967 858.96245926 +0.34066342 83.46934572 0.00000015 +863.24943335 -1277.52241402 862.88111478 +-0.23660723 -193.17613480 -0.00000046 +863.24943320 -1277.52241425 -862.88111432 +-9.71806582 5404.58897135 -0.00000183 +-858.38273891 -1273.31333552 -858.96245926 +-0.11938338 -193.21062369 0.00000000 +-858.38273937 -1273.31333598 858.96245987 +-0.00000031 -0.00000008 -193.17559595 +-863.11328229 863.11328297 -1277.34763999 +0.00000000 -0.00000015 -193.17559595 +863.11328305 -863.11328282 -1277.34763984 +0.00000122 -0.00000259 5404.30470550 +-858.80486827 -858.80486866 -1273.17865241 +-0.00000031 0.00000000 83.09905870 +858.80486827 858.80486812 -1273.17865272 +-1276.01089136 861.66402482 -861.60900483 +-193.17596134 -0.16730494 0.02099535 +-1276.15175745 861.54714988 861.52691337 +83.46947097 0.16714109 0.06108436 +-1273.31334651 -858.38273311 -858.80488185 +5404.58493608 -3.04507687 -2.81778617 +-1276.19187193 -861.66399965 861.74280750 +-193.21058304 -0.11920641 -0.12012575 +861.54714972 -1276.15175730 861.52691337 +0.16714140 83.46947120 0.06108451 +861.66402345 -1276.01089022 -861.60900330 +-0.16730487 -193.17596164 0.02099489 +-858.38273281 -1273.31334681 -858.80488063 +-3.04507603 5404.58493554 -2.81778617 +-861.66400079 -1276.19187270 861.74280887 +-0.11920511 -193.21058281 -0.12012498 +-861.62536929 861.66025668 -1276.08157121 +-0.02106026 0.06099877 -193.17561197 +861.66025752 -861.62537051 -1276.08157274 +0.06099923 -0.02106049 -193.17561227 +-858.96244980 -858.96244965 -1273.17866523 +-2.81780608 -2.81780615 5404.30474272 +861.58531232 861.58531248 -1275.71087663 +0.12013467 0.12013460 83.09915619 +83.46958166 -0.00634218 -0.00000023 +-1274.64157002 859.96383191 860.25587098 +-193.17585332 -0.09802844 0.00000023 +-1274.64157155 859.96383290 -860.25587243 +-193.21062064 -0.11939070 -0.00000008 +-1276.19189573 -861.66398638 861.58531118 +5404.58377546 3.62403097 0.00000015 +-1276.19189558 -861.66398615 -861.58531103 +-0.09802859 -193.17585355 -0.00000015 +859.96383206 -1274.64156979 -860.25587113 +-0.00634187 83.46958204 -0.00000008 +859.96383282 -1274.64157132 860.25587212 +-0.11939055 -193.21062041 0.00000000 +-861.66398576 -1276.19189528 861.58531087 +3.62402982 5404.58377698 -0.00000076 +-861.66398927 -1276.19189772 -861.58531331 +0.00000000 0.00000000 -193.17573654 +860.17327676 -860.17327637 -1274.81551212 +0.00000031 0.00000023 -193.17573676 +-860.17327615 860.17327645 -1274.81551258 +0.00000000 0.00000015 83.09907327 +861.74281299 861.74281299 -1275.71086763 +-0.00000046 -0.00000015 5404.30514861 +-861.74281406 -861.74281421 -1275.71086938 +-1276.01088968 861.66402284 861.60900330 +83.46947136 0.16714109 -0.06108436 +-1276.15175722 861.54714957 -861.52691391 +-193.17596141 -0.16730510 -0.02099527 +-1273.31334666 -858.38273281 858.80488124 +-193.21058304 -0.11920641 0.12012636 +-1276.19187285 -861.66400087 -861.74280773 +5404.58493638 -3.04507565 2.81778602 +861.54715133 -1276.15175913 -861.52691490 +-0.16730502 -193.17596118 -0.02099497 +861.66402314 -1276.01088976 861.60900383 +0.16714125 83.46947151 -0.06108497 +-858.38273296 -1273.31334681 858.80488139 +-0.11920686 -193.21058311 0.12012605 +-861.66400079 -1276.19187255 -861.74280811 +-3.04506703 5404.58493432 2.81779319 +861.62536952 -861.66025637 -1276.08157175 +-0.06099938 0.02106080 -193.17561235 +-861.66025645 861.62536929 -1276.08157213 +0.02106049 -0.06099862 -193.17561189 +858.96245049 858.96245041 -1273.17866553 +-0.12013444 -0.12013475 83.09915550 +-861.58531232 -861.58531217 -1275.71087655 +2.81780737 2.81780753 5404.30474547 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/results/out.silicon b/examples/USER/phonon/dynamical_matrix_command/Silicon/results/out.silicon new file mode 100755 index 0000000000..9920ddac51 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/results/out.silicon @@ -0,0 +1,58 @@ +LAMMPS (16 Jul 2018) +Reading data file ... + orthogonal box = (0 0 0) to (5.431 5.431 5.431) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 8 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4 + ghost atom cutoff = 4 + binsize = 2, bins = 3 3 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair tersoff, perpetual + attributes: full, newton on + pair build: full/bin + stencil: full/bin/3d + bin: standard +Calculating Dynamical Matrix... +Dynamical Matrix calculation took 0.001183 seconds +Finished Calculating Dynamical Matrix +Loop time of 1.22396e+06 on 4 procs for 0 steps with 8 atoms + +0.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.00016781 | 0.00041345 | 0.00051464 | 0.0 | 0.00 +Bond | 1.9255e-06 | 2.1775e-06 | 2.4787e-06 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00056143 | 0.00066602 | 0.00090865 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1.224e+06 | | |100.00 + +Nlocal: 2 ave 3 max 1 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 56 ave 57 max 55 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 32 ave 48 max 16 min +Histogram: 1 0 0 0 0 2 0 0 0 1 + +Total # of neighbors = 128 +Ave neighs/atom = 16 +Ave special neighs/atom = 0 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp b/examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp new file mode 100755 index 0000000000..5066049895 --- /dev/null +++ b/examples/USER/phonon/dynamical_matrix_command/Silicon/silicon_input_file.lmp @@ -0,0 +1,29 @@ +LAMMPS description + + 8 atoms + 0 bonds + 0 angles + 0 dihedrals + 0 impropers + + 1 atom types + 0 bond types + 0 angle types + 0 dihedral types + 0 improper types + + + 0.0000000 5.4310000 xlo xhi + 0.0000000 5.4310000 ylo yhi + 0.0000000 5.4310000 zlo zhi + + Atoms + + 1 1 1 0.0000000 0.0000000 0.0000000 0.0000000 + 2 2 1 0.0000000 1.3577500 1.3577500 1.3572000 + 3 3 1 0.0000000 2.7155000 2.7155000 0.0000000 + 4 4 1 0.0000000 4.0732500 4.0732500 1.3572000 + 5 5 1 0.0000000 2.7155000 0.0000000 2.7144000 + 6 6 1 0.0000000 4.0732500 1.3577500 4.0732500 + 7 7 1 0.0000000 0.0000000 2.7155000 2.7155000 + 8 8 1 0.0000000 1.3577500 4.0732500 4.0732500 diff --git a/examples/USER/qtb/methane_qbmsst/methane_qtb.mod b/examples/USER/qtb/methane_qbmsst/methane_qtb.mod index 9ed62b74b5..181fb99d00 100644 --- a/examples/USER/qtb/methane_qbmsst/methane_qtb.mod +++ b/examples/USER/qtb/methane_qbmsst/methane_qtb.mod @@ -38,8 +38,9 @@ mass 2 1.007970 ## This part defines the reax pair potential in methane, force field coefficients are specified in "ffield.reax" #Pair Potentials -pair_style reax 10.0 1 1 1.0e-6 -pair_coeff * * ffield.reax 1 2 +pair_style reax/c NULL +pair_coeff * * ffield.reax C H +fix 0 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c #Neighbor Style neighbor 2.5 bin diff --git a/examples/USER/qtb/methane_qtb/methane_qtb.in b/examples/USER/qtb/methane_qtb/methane_qtb.in index 7389b65f19..f0ea94a221 100644 --- a/examples/USER/qtb/methane_qtb/methane_qtb.in +++ b/examples/USER/qtb/methane_qtb/methane_qtb.in @@ -44,8 +44,9 @@ mass 2 1.007970 ## This part defines the reax pair potential in methane, force field coefficients are specified in "ffield.reax" #Pair Potentials -pair_style reax 10.0 1 1 1.0e-6 -pair_coeff * * ffield.reax 1 2 +pair_style reax/c NULL +pair_coeff * * ffield.reax C H +fix 0 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c #Neighbor Style neighbor 2.5 bin diff --git a/examples/USER/smtbq/data.Alpha b/examples/USER/smtbq/data.Alpha old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/ffield.smtbq.Al b/examples/USER/smtbq/ffield.smtbq.Al old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/ffield.smtbq.Al2O3 b/examples/USER/smtbq/ffield.smtbq.Al2O3 old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/ffield.smtbq.TiO2 b/examples/USER/smtbq/ffield.smtbq.TiO2 old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/in.smtbq.Al b/examples/USER/smtbq/in.smtbq.Al old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/in.smtbq.Al2O3 b/examples/USER/smtbq/in.smtbq.Al2O3 old mode 100755 new mode 100644 diff --git a/examples/USER/smtbq/in.smtbq.TiO2 b/examples/USER/smtbq/in.smtbq.TiO2 old mode 100755 new mode 100644 diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp.newton-off similarity index 77% rename from examples/kim/in.kim.lj.lmp rename to examples/kim/in.kim.lj.lmp.newton-off index 8879024590..197755294a 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp.newton-off @@ -10,6 +10,7 @@ variable zz equal 20*$z units metal atom_style atomic +newton off lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} @@ -17,13 +18,12 @@ create_box 1 box create_atoms 1 box pair_style lj/cut 8.1500 -pair_coeff 1 1 0.0031 2.7400 -pair_modify shift yes +pair_coeff 1 1 0.0104 3.4000 -#pair_style kim KIMvirial ex_model_Ne_P_fastLJ -#pair_coeff * * Ne +#pair_style kim LennardJones_Ar +#pair_coeff * * Ar -mass 1 20.18 +mass 1 39.95 velocity all create 200.0 232345 loop geom neighbor 0.3 bin diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj.lmp.newton-on similarity index 73% rename from examples/kim/in.kim.lj rename to examples/kim/in.kim.lj.lmp.newton-on index f33b258be8..f9f79e2bb2 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj.lmp.newton-on @@ -10,20 +10,20 @@ variable zz equal 20*$z units metal atom_style atomic +newton on lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} create_box 1 box create_atoms 1 box -#pair_style lj/cut 8.1500 -#pair_coeff 1 1 0.0031 2.7400 -#pair_modify shift yes +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 -pair_style kim KIMvirial ex_model_Ne_P_fastLJ -pair_coeff * * Ne +#pair_style kim LennardJones_Ar +#pair_coeff * * Ar -mass 1 20.18 +mass 1 39.95 velocity all create 200.0 232345 loop geom neighbor 0.3 bin diff --git a/examples/kim/in.kim.lj.newton-off b/examples/kim/in.kim.lj.newton-off new file mode 100644 index 0000000000..82cf5ba602 --- /dev/null +++ b/examples/kim/in.kim.lj.newton-off @@ -0,0 +1,41 @@ +# 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the ./lib/kim/README or +# ./lib/kim/Install.py files for details on how to install these +# example models. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units metal +atom_style atomic +newton off + +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box + +#pair_style lj/cut 8.1500 +#pair_coeff 1 1 0.0104 3.4000 + +pair_style kim LennardJones_Ar +pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 diff --git a/examples/kim/in.kim.lj.newton-on b/examples/kim/in.kim.lj.newton-on new file mode 100644 index 0000000000..3a95f1dbb0 --- /dev/null +++ b/examples/kim/in.kim.lj.newton-on @@ -0,0 +1,41 @@ +# 3d Lennard-Jones melt +# +# This example requires that the example models provided with +# the kim-api package are installed. see the ./lib/kim/README or +# ./lib/kim/Install.py files for details on how to install these +# example models. +# + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units metal +atom_style atomic +newton on + +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box + +#pair_style lj/cut 8.1500 +#pair_coeff 1 1 0.0104 3.4000 + +pair_style kim LennardJones_Ar +pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 new file mode 100644 index 0000000000..5925fd750d --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.1 @@ -0,0 +1,55 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.004499 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.92885 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.950 ns/day, 8.136 hours/ns, 34.143 timesteps/s +99.1% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.5638 | 2.5638 | 2.5638 | 0.0 | 87.54 +Neigh | 0.31935 | 0.31935 | 0.31935 | 0.0 | 10.90 +Comm | 0.006833 | 0.006833 | 0.006833 | 0.0 | 0.23 +Output | 0.000107 | 0.000107 | 0.000107 | 0.0 | 0.00 +Modify | 0.027806 | 0.027806 | 0.027806 | 0.0 | 0.95 +Other | | 0.01091 | | | 0.37 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 new file mode 100644 index 0000000000..c1ca108c7b --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-off.4 @@ -0,0 +1,55 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.001039 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.778581 on 4 procs for 100 steps with 32000 atoms + +Performance: 11.097 ns/day, 2.163 hours/ns, 128.439 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.65171 | 0.65891 | 0.67656 | 1.3 | 84.63 +Neigh | 0.07924 | 0.079548 | 0.07997 | 0.1 | 10.22 +Comm | 0.006755 | 0.0069015 | 0.007072 | 0.2 | 0.89 +Output | 4.6e-05 | 9.725e-05 | 0.000203 | 0.0 | 0.01 +Modify | 0.006841 | 0.006941 | 0.007015 | 0.1 | 0.89 +Other | | 0.02618 | | | 3.36 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 new file mode 100644 index 0000000000..53555743d7 --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.1 @@ -0,0 +1,55 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.003479 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.17978 on 1 procs for 100 steps with 32000 atoms + +Performance: 3.964 ns/day, 6.055 hours/ns, 45.876 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.9892 | 1.9892 | 1.9892 | 0.0 | 91.26 +Neigh | 0.14506 | 0.14506 | 0.14506 | 0.0 | 6.65 +Comm | 0.011049 | 0.011049 | 0.011049 | 0.0 | 0.51 +Output | 9.1e-05 | 9.1e-05 | 9.1e-05 | 0.0 | 0.00 +Modify | 0.02347 | 0.02347 | 0.02347 | 0.0 | 1.08 +Other | | 0.01094 | | | 0.50 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2.12688e+06 ave 2.12688e+06 max 2.12688e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 new file mode 100644 index 0000000000..f0fdf66193 --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.lmp.newton-on.4 @@ -0,0 +1,55 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.000919 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.63515 on 4 procs for 100 steps with 32000 atoms + +Performance: 13.603 ns/day, 1.764 hours/ns, 157.443 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.55365 | 0.5566 | 0.55868 | 0.2 | 87.63 +Neigh | 0.041495 | 0.0418 | 0.04211 | 0.1 | 6.58 +Comm | 0.019086 | 0.021075 | 0.023898 | 1.2 | 3.32 +Output | 4.4e-05 | 5.025e-05 | 6e-05 | 0.0 | 0.01 +Modify | 0.009315 | 0.0093595 | 0.009422 | 0.0 | 1.47 +Other | | 0.006263 | | | 0.99 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 531719 ave 533273 max 529395 min +Histogram: 1 0 0 0 1 0 0 0 0 2 + +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 new file mode 100644 index 0000000000..0ab258fe0d --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.1 @@ -0,0 +1,59 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.003446 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 28.51 | 28.51 | 28.51 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 3.01669 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.864 ns/day, 8.380 hours/ns, 33.149 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.6562 | 2.6562 | 2.6562 | 0.0 | 88.05 +Neigh | 0.31903 | 0.31903 | 0.31903 | 0.0 | 10.58 +Comm | 0.00634 | 0.00634 | 0.00634 | 0.0 | 0.21 +Output | 9.1e-05 | 9.1e-05 | 9.1e-05 | 0.0 | 0.00 +Modify | 0.024723 | 0.024723 | 0.024723 | 0.0 | 0.82 +Other | | 0.01032 | | | 0.34 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 new file mode 100644 index 0000000000..c17ea6afb7 --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-off.4 @@ -0,0 +1,65 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.000921 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 10.05 | 10.05 | 10.05 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.890192 on 4 procs for 100 steps with 32000 atoms + +Performance: 9.706 ns/day, 2.473 hours/ns, 112.335 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.77867 | 0.77906 | 0.7794 | 0.0 | 87.52 +Neigh | 0.087831 | 0.088176 | 0.088805 | 0.1 | 9.91 +Comm | 0.006358 | 0.0065898 | 0.006815 | 0.3 | 0.74 +Output | 4.9e-05 | 5.975e-05 | 6.8e-05 | 0.0 | 0.01 +Modify | 0.010265 | 0.010429 | 0.010678 | 0.2 | 1.17 +Other | | 0.005874 | | | 0.66 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 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: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min +Histogram: 1 0 0 0 0 0 1 0 0 2 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 new file mode 100644 index 0000000000..59d018e12a --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.1 @@ -0,0 +1,59 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.003089 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 28.12 | 28.12 | 28.12 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 3.05849 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.825 ns/day, 8.496 hours/ns, 32.696 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.6786 | 2.6786 | 2.6786 | 0.0 | 87.58 +Neigh | 0.33105 | 0.33105 | 0.33105 | 0.0 | 10.82 +Comm | 0.012602 | 0.012602 | 0.012602 | 0.0 | 0.41 +Output | 9.5e-05 | 9.5e-05 | 9.5e-05 | 0.0 | 0.00 +Modify | 0.024858 | 0.024858 | 0.024858 | 0.0 | 0.81 +Other | | 0.01132 | | | 0.37 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 4.25375e+06 ave 4.25375e+06 max 4.25375e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 new file mode 100644 index 0000000000..da8c9f0faa --- /dev/null +++ b/examples/kim/log.06Feb2019.in.kim.lj.newton-on.4 @@ -0,0 +1,65 @@ +LAMMPS (1 Feb 2019) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) + using 1 OpenMP thread(s) per MPI task +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.000893 secs +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1097) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1102) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: full, newton off, cut 8.45 + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 9.789 | 9.789 | 9.789 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 0.903182 on 4 procs for 100 steps with 32000 atoms + +Performance: 9.566 ns/day, 2.509 hours/ns, 110.720 timesteps/s +99.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.76173 | 0.76349 | 0.76597 | 0.2 | 84.53 +Neigh | 0.088773 | 0.088938 | 0.089074 | 0.0 | 9.85 +Comm | 0.032018 | 0.03452 | 0.03638 | 0.9 | 3.82 +Output | 4e-05 | 4.425e-05 | 5.2e-05 | 0.0 | 0.00 +Modify | 0.009278 | 0.0093917 | 0.009528 | 0.1 | 1.04 +Other | | 0.006797 | | | 0.75 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 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: 1.06344e+06 ave 1.06594e+06 max 1.05881e+06 min +Histogram: 1 0 0 0 0 0 1 0 0 2 + +Total # of neighbors = 4253750 +Ave neighs/atom = 132.93 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 b/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 deleted file mode 100644 index efae0587a1..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.1 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 9.18789 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 2.95205 on 1 procs for 100 steps with 32000 atoms - -Pair time (%) = 2.52074 (85.3894) -Neigh time (%) = 0.347949 (11.7867) -Comm time (%) = 0.0228171 (0.772925) -Outpt time (%) = 0.000188828 (0.00639649) -Other time (%) = 0.0603588 (2.04464) - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 20131 ave 20131 max 20131 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.88909e+06 ave 1.88909e+06 max 1.88909e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1889091 -Ave neighs/atom = 59.0341 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 b/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 deleted file mode 100644 index 12c1c76695..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.lmp.ubuntu.4 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 4.58461 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 6.15911 on 4 procs for 100 steps with 32000 atoms - -Pair time (%) = 1.76201 (28.6083) -Neigh time (%) = 0.265002 (4.30261) -Comm time (%) = 3.64452 (59.1729) -Outpt time (%) = 0.0169877 (0.275815) -Other time (%) = 0.470582 (7.64042) - -Nlocal: 8000 ave 8010 max 7989 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 9240.25 ave 9249 max 9228 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 472273 ave 473390 max 471652 min -Histogram: 2 0 0 1 0 0 0 0 0 1 - -Total # of neighbors = 1889091 -Ave neighs/atom = 59.0341 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.ubuntu.1 b/examples/kim/log.28Jun15.kim.lj.ubuntu.1 deleted file mode 100644 index 95284453b1..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.ubuntu.1 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 1 by 1 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 9.43789 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 3.79746 on 1 procs for 100 steps with 32000 atoms - -Pair time (%) = 3.18686 (83.9207) -Neigh time (%) = 0.524724 (13.8178) -Comm time (%) = 0.0244031 (0.642616) -Outpt time (%) = 0.000174046 (0.00458321) -Other time (%) = 0.061305 (1.61437) - -Nlocal: 32000 ave 32000 max 32000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 20131 ave 20131 max 20131 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2.09236e+06 ave 2.09236e+06 max 2.09236e+06 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2092355 -Ave neighs/atom = 65.3861 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/examples/kim/log.28Jun15.kim.lj.ubuntu.4 b/examples/kim/log.28Jun15.kim.lj.ubuntu.4 deleted file mode 100644 index 7eaf58aad4..0000000000 --- a/examples/kim/log.28Jun15.kim.lj.ubuntu.4 +++ /dev/null @@ -1,33 +0,0 @@ -LAMMPS (15 May 2015) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms -Neighbor list info ... - 1 neighbor list requests - update every 1 steps, delay 0 steps, check yes - master list distance cutoff = 8.45 -Setting up run ... -Memory usage per processor = 4.70961 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -741.55469 0 85.684388 -34.939092 - 100 108.37517 -362.56658 0 85.694308 3963.7892 -Loop time of 7.25305 on 4 procs for 100 steps with 32000 atoms - -Pair time (%) = 2.52571 (34.8227) -Neigh time (%) = 0.500287 (6.8976) -Comm time (%) = 3.70236 (51.0456) -Outpt time (%) = 0.00146681 (0.0202234) -Other time (%) = 0.523229 (7.21391) - -Nlocal: 8000 ave 8010 max 7989 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 9240.25 ave 9249 max 9228 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 555266 ave 555920 max 554805 min -Histogram: 2 0 0 0 0 1 0 0 0 1 - -Total # of neighbors = 2221065 -Ave neighs/atom = 69.4083 -Neighbor list builds = 5 -Dangerous builds = 0 diff --git a/lib/kim/.gitignore b/lib/kim/.gitignore index c1f57fe64c..bfd4b35d87 100644 --- a/lib/kim/.gitignore +++ b/lib/kim/.gitignore @@ -1,3 +1,2 @@ -/Makefile.KIM_DIR -/Makefile.KIM_Config +/kim-prefix.txt /installed-kim-api-* diff --git a/lib/kim/Install.py b/lib/kim/Install.py index 7031fbd473..dfb6bc53dc 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -18,7 +18,7 @@ parser = ArgumentParser(prog='Install.py', # settings thisdir = fullpath('.') -version = "kim-api-v1.9.5" +version = "kim-api-v2-2.0.1" # help message @@ -35,19 +35,15 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name Examples: make lib-kim args="-b" # install KIM API lib with only example models -make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # Ditto plus one model +make lib-kim args="-b -a EAM_ErcolessiAdams_1994_Al__MO_324507536345_002" # Ditto plus one model make lib-kim args="-b -a everything" # install KIM API lib with all models -make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # only add one model or model driver +make lib-kim args="-n -a EAM_Dynamo_Ackland_2003_W__MO_141627196590_005" # only add one model or model driver See the list of KIM model drivers here: -https://openkim.org/kim-items/model-drivers/alphabetical +https://openkim.org/browse/model-drivers/alphabetical See the list of all KIM models here: -https://openkim.org/kim-items/models/by-model-drivers - -See the list of example KIM models included by default here: -https://openkim.org/kim-api -in the "What is in the KIM API source package?" section +https://openkim.org/browse/models/by-model-drivers """ pgroup = parser.add_mutually_exclusive_group() @@ -94,13 +90,10 @@ url = "https://s3.openkim.org/kim-api/%s.txz" % version if pathflag: # configure LAMMPS to use existing kim-api installation - with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile: - mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir) - mkfile.write(".DUMMY: print_dir\n\n") - mkfile.write("print_dir:\n") - mkfile.write(" @printf $(KIM_INSTALL_DIR)\n") + with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: + pffile.write("%s" % kimdir) - print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir, kimdir)) + print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) else: kimdir = os.path.join(os.path.abspath(thisdir), "installed-" + version) if args.nobuild and not os.path.isdir(kimdir): @@ -117,13 +110,10 @@ if buildflag: # configure LAMMPS to use kim-api to be installed - with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile: - mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir) - mkfile.write(".DUMMY: print_dir\n\n") - mkfile.write("print_dir:\n") - mkfile.write(" @printf $(KIM_INSTALL_DIR)\n") + with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: + pffile.write("%s" % kimdir) - print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir, kimdir)) + print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) # download entire kim-api tarball @@ -136,12 +126,13 @@ if buildflag: # configure kim-api print("Configuring kim-api ...") - cmd = 'cd "%s/%s"; ./configure --prefix="%s"' % (thisdir, version, kimdir) - subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = 'cd "%s/%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (thisdir,version,kimdir) + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + if verboseflag: print(txt.decode("UTF-8")) # build kim-api print("Building kim-api ...") - cmd = 'cd "%s/%s"; make' % (thisdir, version) + cmd = 'cd "%s/%s/build" && make' % (thisdir, version) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) @@ -149,23 +140,13 @@ if buildflag: # install kim-api print("Installing kim-api ...") - cmd = 'cd "%s/%s"; make install' % (thisdir, version) + cmd = 'cd "%s/%s/build" && make install' % (thisdir, version) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) # remove source files - print("Building and installing example Models") - cmd = 'cd "%s/%s/examples"; make model-drivers-all-system' % (thisdir, version) - txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) - if verboseflag: - print(txt.decode("UTF-8")) - cmd = 'cd "%s/%s/examples"; make models-all-system' % (thisdir, version) - txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) - if verboseflag: - print(txt.decode("UTF-8")) - print("Removing kim-api source and build files ...") cmd = 'cd "%s"; rm -rf %s; rm -rf %s.txz' % (thisdir, version, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) @@ -173,7 +154,7 @@ if buildflag: # add all OpenKIM models, if desired if everythingflag: print("Adding all OpenKIM models, this will take a while ...") - cmd = '%s/bin/kim-api-v1-collections-management install system OpenKIM' % (kimdir) + cmd = '%s/bin/kim-api-v2-collections-management install system OpenKIM' % (kimdir) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) @@ -181,16 +162,16 @@ if buildflag: # add single OpenKIM model if addflag: - makefile_path = os.path.join(thisdir, "Makefile.KIM_DIR") - if os.path.isfile(makefile_path): - cmd = 'make --no-print-directory -f %s print_dir' % makefile_path - kimdir = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + pf_path = os.path.join(thisdir, "kim-prefix.txt") + if os.path.isfile(pf_path): + cmd = 'cat %s' % pf_path + kimdir = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if not os.path.isdir(kimdir): sys.exit("\nkim-api is not installed") # download single model - cmd = '%s/bin/kim-api-v1-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) + cmd = '%s/bin/kim-api-v2-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) diff --git a/lib/kim/Makefile.lammps b/lib/kim/Makefile.lammps index d73891d1e2..7c9fc7c5f7 100644 --- a/lib/kim/Makefile.lammps +++ b/lib/kim/Makefile.lammps @@ -5,8 +5,6 @@ # The KIM API package can be downloaded from https://openkim.org/kim-api # Follow the instructions in the INSTALL file to build and install the # KIM API. Add the openkim.org Models you are interested in using. -# Make sure the directory where the "kim-api-build-conifg" utility is -# located is on the PATH. # # As long as you have followed the KIM API build and install instructions, # there should not be any reason to change this file. @@ -16,17 +14,17 @@ # Settings that the LAMMPS build will import when this package is installed -include ../../lib/kim/Makefile.KIM_DIR - -ifeq ($(wildcard $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config),) - KIM_CONFIG_HELPER = kim-api-v1-build-config -else - KIM_CONFIG_HELPER = $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config -endif -ifeq ($(shell $(KIM_CONFIG_HELPER) --version 2> /dev/null),) - $(error $(KIM_CONFIG_HELPER) utility is not available. Something is wrong with your KIM API package setup) +ifeq ($(strip $(shell pkg-config --version)),) + $(error 'pkg-config' not found, but is required to configure the KIM API) endif -kim_SYSINC = $(shell $(KIM_CONFIG_HELPER) --includes) -kim_SYSLIB = $(shell $(KIM_CONFIG_HELPER) --ldlibs) -kim_SYSPATH = $(shell $(KIM_CONFIG_HELPER) --ldflags) +kim_PREFIX := $(shell cat ../../lib/kim/kim-prefix.txt 2> /dev/null) +kim_PREFIX := $(if $(kim_PREFIX),$(kim_PREFIX)/lib/pkgconfig,) +kim_PREFIX := $(if $(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX):$(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX)) + +kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api-v2 2> /dev/null) +kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api-v2 2> /dev/null) + +ifeq ($(strip $(kim_SYSINC)),) + $(error 'pkg-config' could not find an installed KIM API library.) +endif diff --git a/lib/kim/README b/lib/kim/README index ce4ea1bdff..0e51a30870 100644 --- a/lib/kim/README +++ b/lib/kim/README @@ -3,10 +3,9 @@ is required to use the KIM package and its pair_style kim command in a LAMMPS input script. Information about the KIM project can be found at https://openkim.org. -The KIM project is lead by Ellad Tadmor and Ryan Elliott (U Minn) and -James Sethna (Cornell U). Ryan Elliott is the main developer for the -KIM API and he also maintains the code that implements the pair_style -kim command. +The KIM project is lead by Ellad Tadmor and Ryan Elliott (U Minn). +Ryan Elliott is the main developer for the KIM API and he also +maintains the code that implements the pair_style kim command. You can type "make lib-kim" from the src directory to see help on how to download and build this library via make commands, or you can @@ -21,33 +20,34 @@ Instructions: 1. Configure lammps for use with the kim-api library installed in this directory # replace X.Y.Z as appropriate here and below -$ printf "KIM_INSTALL_DIR=${PWD}/installed-kim-api-vX.Y.Z\n" > ./Makefile.KIM_DIR +$ printf "${PWD}/installed-kim-api-vX-X.Y.Z" > ./kim-prefix.txt 2. Download and unpack the kim-api -$ wget http://s3.openkim.org/kim-api/kim-api-vX.Y.Z.txz -$ tar zxvf kim-api-vX.Y.Z.txz +$ wget http://s3.openkim.org/kim-api/kim-api-vX-X.Y.Z.txz +$ tar zxvf kim-api-vX-X.Y.Z.txz # configure the kim-api -$ cd kim-api-vX.Y.Z -$ ./configure --prefix=${PWD}/../installed-kim-api-vX.Y.Z +$ cd kim-api-vX-X.Y.Z +$ mkdir build && cd build +$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-vX-X.Y.Z 3. Build and install the kim-api and model $ make $ make install -$ cd .. 4. Remove source and build files -$ rm -rf kim-api-vX.Y.Z -$ rm -rf kim-api-vX.Y.Z.txz +$ cd ../../ +$ rm -rf kim-api-vX-X.Y.Z +$ rm -rf kim-api-vX-X.Y.Z.txz 5. To add items do the following (replace the kim item name with your desired value) -$ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-v1-activate -$ kim-api-v1-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 +$ source ${PWD}/kim-api-vX-X.Y.Z/bin/kim-api-vX-activate +$ kim-api-vX-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 ----------------- @@ -59,6 +59,6 @@ $ cd lammpos/src $ make yes-kim $ make g++ (or whatever target you wish) -Note that the Makefile.lammps and Makefile.KIM_DIR files in this directory -are required to allow the LAMMPS build to find the necessary KIM files. -You should not normally need to edit these files. +Note that the Makefile.lammps file in this directory is required to +allow the LAMMPS build to find the necessary KIM files. You should +not normally need to edit these files. diff --git a/python/lammps.py b/python/lammps.py index c393ee7ec7..9b3790f2db 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -85,14 +85,19 @@ class lammps(object): # fall back to loading with a relative path, # typically requires LD_LIBRARY_PATH to be set appropriately + if any([f.startswith('liblammps') and f.endswith('.dylib') for f in os.listdir(modpath)]): + lib_ext = ".dylib" + else: + lib_ext = ".so" + if not self.lib: try: - if not name: self.lib = CDLL(join(modpath,"liblammps.so"),RTLD_GLOBAL) - else: self.lib = CDLL(join(modpath,"liblammps_%s.so" % name), + if not name: self.lib = CDLL(join(modpath,"liblammps" + lib_ext),RTLD_GLOBAL) + else: self.lib = CDLL(join(modpath,"liblammps_%s" % name + lib_ext), RTLD_GLOBAL) except: - if not name: self.lib = CDLL("liblammps.so",RTLD_GLOBAL) - else: self.lib = CDLL("liblammps_%s.so" % name,RTLD_GLOBAL) + if not name: self.lib = CDLL("liblammps" + lib_ext,RTLD_GLOBAL) + else: self.lib = CDLL("liblammps_%s" % name + lib_ext,RTLD_GLOBAL) # define ctypes API for each library method # NOTE: should add one of these for each lib function diff --git a/src/.gitignore b/src/.gitignore index 9670d1ca20..d405cb209e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -6,6 +6,7 @@ /style_*.h /lmpinstalledpkgs.h +/lmpgitversion.h /*_gpu.h /*_gpu.cpp diff --git a/src/KIM/README b/src/KIM/README index 496db92cf2..a69206596f 100644 --- a/src/KIM/README +++ b/src/KIM/README @@ -26,5 +26,4 @@ library you can test it using an input file from the examples dir: ./lmp_serial < lammps/examples/kim/in.kim.lj -This pair_style was written by Valeriu Smirichinski and Ryan -S. Elliott (U Minn). +This pair_style was written by Ryan S. Elliott (U Minn). diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index fe638214ba..a4517b848c 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -12,14 +12,45 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the openkim-api-v1.5.0 package and for use with - the kim-api-v1.6.0 (and newer) package + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Designed for use with the kim-api-v2-2.0.0 (and newer) package ------------------------------------------------------------------------- */ #include @@ -38,17 +69,6 @@ #include "domain.h" #include "error.h" -// includes from KIM -#include "KIM_API.h" -#include "KIM_API_status.h" - -#ifndef KIM_API_VERSION_MAJOR -// support v1.5.0 -#define KIM_API_VERSION_MAJOR 1 -#define KIM_API_VERSION_MINOR 5 -#define KIM_API_VERSION_PATCH 0 -#endif - using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -57,44 +77,47 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(0), - lmps_map_species_to_unique(0), - lmps_unique_elements(0), + kim_modelname(NULL), + lmps_map_species_to_unique(NULL), + lmps_unique_elements(NULL), lmps_num_unique_elements(0), lmps_units(METAL), - pkim(0), - kim_ind_coordinates(-1), - kim_ind_numberOfParticles(-1), - kim_ind_numberContributingParticles(-1), - kim_ind_numberOfSpecies(-1), - kim_ind_particleSpecies(-1), - kim_ind_get_neigh(-1), - kim_ind_neighObject(-1), - kim_ind_cutoff(-1), - kim_ind_energy(-1), - kim_ind_particleEnergy(-1), - kim_ind_forces(-1), - kim_ind_virial(-1), - kim_ind_particleVirial(-1), - kim_particle_codes(0), + lengthUnit(KIM_LENGTH_UNIT_unused), + energyUnit(KIM_ENERGY_UNIT_unused), + chargeUnit(KIM_CHARGE_UNIT_unused), + temperatureUnit(KIM_TEMPERATURE_UNIT_unused), + timeUnit(KIM_TIME_UNIT_unused), + pkim(NULL), + pargs(NULL), + kim_model_support_for_energy(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_forces(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_particleEnergy(KIM_SUPPORT_STATUS_notSupported), + kim_model_support_for_particleVirial(KIM_SUPPORT_STATUS_notSupported), lmps_local_tot_num_atoms(0), - kim_global_cutoff(0.0), + kim_global_influence_distance(0.0), + kim_number_of_neighbor_lists(0), + kim_cutoff_values(NULL), + modelWillNotRequestNeighborsOfNoncontributingParticles(NULL), + neighborLists(NULL), + kim_particle_codes(NULL), lmps_maxalloc(0), - kim_particleSpecies(0), - lmps_force_tmp(0), - lmps_stripped_neigh_list(0), - kim_iterator_position(0), - Rij(0) + kim_particleSpecies(NULL), + kim_particleContributing(NULL), + lmps_stripped_neigh_list(NULL), + lmps_stripped_neigh_ptr(NULL) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function restartinfo = 0; // We do not write any restart info one_coeff = 1; // We only allow one coeff * * call + // set to 1, regardless use of fdotr, to avoid ev_set()'s futzing with + // vflag_global + no_virial_fdotr_compute = 1; // BEGIN: initial values that determine the KIM state // (used by kim_free(), etc.) - kim_model_init_ok = false; kim_init_ok = false; + kim_particle_codes_ok = false; // END return; @@ -113,10 +136,23 @@ PairKIM::~PairKIM() delete [] lmps_unique_elements[i]; delete [] lmps_unique_elements; + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + // clean up local memory used to support KIM interface memory->destroy(kim_particleSpecies); - memory->destroy(lmps_force_tmp); + memory->destroy(kim_particleContributing); memory->destroy(lmps_stripped_neigh_list); + // clean up lmps_stripped_neigh_ptr + if (lmps_stripped_neigh_ptr) + { + delete [] lmps_stripped_neigh_ptr; + lmps_stripped_neigh_ptr = 0; + } // clean up allocated memory for standard Pair class usage // also, we allocate lmps_map_species_to_uniuqe in the allocate() function @@ -126,8 +162,12 @@ PairKIM::~PairKIM() delete [] lmps_map_species_to_unique; } - // clean up Rij array - memory->destroy(Rij); + // clean up neighborlist pointers + if (neighborLists) + { + delete [] neighborLists; + neighborLists = 0; + } // clean up KIM interface (if necessary) kim_free(); @@ -135,6 +175,16 @@ PairKIM::~PairKIM() return; } +/* ---------------------------------------------------------------------- */ +void PairKIM::set_contributing() +{ + int const nall = atom->nlocal + atom->nghost; + for (int i = 0; i < nall; ++i) + { + kim_particleContributing[i] = ( (i < atom->nlocal) ? 1 : 0 ); + } +} + /* ---------------------------------------------------------------------- */ void PairKIM::compute(int eflag , int vflag) @@ -146,19 +196,31 @@ void PairKIM::compute(int eflag , int vflag) else ev_unset(); - // grow kim_particleSpecies array if necessary + // grow kim_particleSpecies and kim_particleContributing array if necessary // needs to be atom->nmax in length if (atom->nmax > lmps_maxalloc) { memory->destroy(kim_particleSpecies); - memory->destroy(lmps_force_tmp); + memory->destroy(kim_particleContributing); lmps_maxalloc = atom->nmax; - memory->create(kim_particleSpecies,lmps_maxalloc,"pair:kim_particleSpecies"); - memory->create(lmps_force_tmp,lmps_maxalloc,3,"pair:lmps_force_tmp"); + memory->create(kim_particleSpecies,lmps_maxalloc, + "pair:kim_particleSpecies"); + int kimerror = KIM_ComputeArguments_SetArgumentPointerInteger(pargs, + KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes, + kim_particleSpecies); + memory->create(kim_particleContributing,lmps_maxalloc, + "pair:kim_particleContributing"); + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerInteger( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_particleContributing, + kim_particleContributing); + if (kimerror) + error->all( + FLERR, + "Unable to set KIM particle species codes and/or contributing"); } // kim_particleSpecies = KIM atom species for each LAMMPS atom - // set ielement to valid 0 if lmps_map_species_to_unique[] stores an un-used -1 int *species = atom->type; int nall = atom->nlocal + atom->nghost; @@ -166,57 +228,38 @@ void PairKIM::compute(int eflag , int vflag) for (int i = 0; i < nall; i++) { ielement = lmps_map_species_to_unique[species[i]]; - ielement = MAX(ielement,0); - // @@ this (above line) provides bogus info - // @@ (when lmps_map_species_to_unique[species[i]]==-1) to KIM, but - // @@ I guess this only happens when lmps_hybrid==true, - // @@ and we are sure that iterator mode will - // @@ not use these atoms.... (?) kim_particleSpecies[i] = kim_particle_codes[ielement]; } - // pass current atom pointers to KIM - set_volatiles(); + // Set kim contributing flags + set_contributing(); - pkim->setm_compute_by_index(&kimerror,3*3, - kim_ind_particleEnergy, eflag_atom, - (int) kim_model_has_particleEnergy, - kim_ind_particleVirial, vflag_atom, - (int) kim_model_has_particleVirial, - kim_ind_virial, vflag_global!=0, - no_virial_fdotr_compute); - kim_error(__LINE__,"setm_compute_by_index",kimerror); + // pass current atom pointers to KIM + set_argument_pointers(); + + // set number of particles + lmps_local_tot_num_atoms = (int) nall; // compute via KIM model - kimerror = pkim->model_compute(); - kim_error(__LINE__,"PairKIM::pkim->model_compute() error",kimerror); - // assemble force and particleVirial if needed - if (!lmps_using_newton) comm->reverse_comm_pair(this); + kimerror = KIM_Model_Compute(pkim, pargs); + if (kimerror) error->all(FLERR,"KIM Compute returned error"); - // sum lmps_force_tmp to f if running in hybrid mode - if (lmps_hybrid) { - double **f = atom->f; - for (int i = 0; i < nall; i++) { - f[i][0] += lmps_force_tmp[i][0]; - f[i][1] += lmps_force_tmp[i][1]; - f[i][2] += lmps_force_tmp[i][2]; - } + // compute virial before reverse comm! + if (vflag_global) + { + virial_fdotr_compute(); } - if ((no_virial_fdotr_compute == 1) && (vflag_global)) - { // flip sign and order of virial if KIM is computing it - for (int i = 0; i < 3; ++i) virial[i] = -1.0*virial[i]; - double tmp = virial[3]; - virial[3] = -virial[5]; - virial[4] = -virial[4]; - virial[5] = -tmp; - } - else - { // compute virial via LAMMPS fdotr mechanism - if (vflag_fdotr) virial_fdotr_compute(); + // if newton is off, perform reverse comm + if (!lmps_using_newton) + { + comm->reverse_comm_pair(this); } - if ((kim_model_has_particleVirial) && (vflag_atom)) + if ((vflag_atom) && + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported) + ) { // flip sign and order of virial if KIM is computing it double tmp; for (int i = 0; i < nall; ++i) @@ -267,10 +310,20 @@ void PairKIM::settings(int narg, char **arg) ++settings_call_count; init_style_call_count = 0; - if (narg < 2) error->all(FLERR,"Illegal pair_style command"); - // arg[0] is the virial handling option: "LAMMPSvirial" or "KIMvirial" - // arg[1] is the KIM Model name - // arg[2] is the print-kim-file flag: 0/1 do-not/do print (default 0) + if (narg != 1) + { + if ((narg > 0) && ((0 == strcmp("KIMvirial", arg[0])) || + (0 == strcmp("LAMMPSvirial", arg[0])))) + { + error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with " + "kim-api-v2."); + } + else + error->all(FLERR,"Illegal pair_style command"); + } + // arg[0] is the KIM Model name + + lmps_using_molecular = (atom->molecular > 0); // ensure we are in a clean state for KIM (needed on repeated call) // first time called will do nothing... @@ -288,39 +341,18 @@ void PairKIM::settings(int narg, char **arg) // set lmps_* bool flags set_lmps_flags(); - // set virial handling - if (strcmp(arg[0],"LAMMPSvirial") == 0) - { - no_virial_fdotr_compute = 0; - } - else if (strcmp(arg[0],"KIMvirial") == 0) - { - no_virial_fdotr_compute = 1; - } - else - { - error->all(FLERR,"Unrecognized virial argument in pair_style command"); - } - // set KIM Model name - int nmlen = strlen(arg[1]); + int nmlen = strlen(arg[0]); if (kim_modelname != 0) { delete [] kim_modelname; kim_modelname = 0; } kim_modelname = new char[nmlen+1]; - strcpy(kim_modelname, arg[1]); + strcpy(kim_modelname, arg[0]); - // set print_kim_file - if ((2 == narg) || ('0' == *(arg[2]))) - { - print_kim_file = false; - } - else - { - print_kim_file = true; - } + // initialize KIM Model + kim_init(); return; } @@ -341,13 +373,19 @@ void PairKIM::coeff(int narg, char **arg) if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); + // insure I,J args are * * + + if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) + error->all(FLERR,"Incorrect args for pair coefficients"); + + int ilo,ihi,jlo,jhi; force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); // read args that map atom species to KIM elements // lmps_map_species_to_unique[i] = - // which element the Ith atom type is, -1 if NULL + // which element the Ith atom type is // lmps_num_unique_elements = # of unique elements // lmps_unique_elements = list of element names @@ -360,23 +398,20 @@ void PairKIM::coeff(int narg, char **arg) lmps_unique_elements = new char*[atom->ntypes]; for (i = 0; i < atom->ntypes; i++) lmps_unique_elements[i] = 0; + + // Assume all species arguments are valid + // errors will be detected by below lmps_num_unique_elements = 0; for (i = 2; i < narg; i++) { - if (strcmp(arg[i],"NULL") == 0) { - if (!lmps_hybrid) - error->all(FLERR,"Invalid args for non-hybrid pair coefficients"); - lmps_map_species_to_unique[i-1] = -1; - continue; - } - for (j = 0; j < lmps_num_unique_elements; j++) - if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break; - lmps_map_species_to_unique[i-1] = j; - if (j == lmps_num_unique_elements) { - n = strlen(arg[i]) + 1; - lmps_unique_elements[j] = new char[n]; - strcpy(lmps_unique_elements[j],arg[i]); - lmps_num_unique_elements++; - } + for (j = 0; j < lmps_num_unique_elements; j++) + if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break; + lmps_map_species_to_unique[i-1] = j; + if (j == lmps_num_unique_elements) { + n = strlen(arg[i]) + 1; + lmps_unique_elements[j] = new char[n]; + strcpy(lmps_unique_elements[j],arg[i]); + lmps_num_unique_elements++; + } } int count = 0; @@ -392,6 +427,35 @@ void PairKIM::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); + // setup mapping between LAMMPS unique elements and KIM species codes + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + kim_particle_codes = new int[lmps_num_unique_elements]; + kim_particle_codes_ok = true; + for(int i = 0; i < lmps_num_unique_elements; i++){ + int kimerror; + int supported; + int code; + kimerror = KIM_Model_GetSpeciesSupportAndCode( + pkim, + KIM_SpeciesName_FromString(lmps_unique_elements[i]), + &supported, + &code); + if (supported) + kim_particle_codes[i] = code; + else + { + std::stringstream msg; + msg << "create_kim_particle_codes: symbol not found: " + << lmps_unique_elements[i]; + error->all(FLERR, msg.str().c_str()); + } + } + return; } @@ -408,58 +472,64 @@ void PairKIM::init_style() error->all(FLERR,"PairKIM only works with 3D problems"); int kimerror; - // KIM and Model initialization (only once) - // also sets kim_ind_* and kim_* bool flags - if (!kim_init_ok) - { - kim_init(); - kimerror = pkim->model_init(); - if (kimerror != KIM_STATUS_OK) - kim_error(__LINE__, "KIM API:model_init() failed", kimerror); - else - { - kim_model_init_ok = true; - // allocate enough memory to ensure we are safe - // (by using neighbor->oneatom) - if (kim_model_using_Rij) - memory->create(Rij,3*(neighbor->oneatom),"pair:Rij"); + // setup lmps_stripped_neigh_list for neighbors of one atom, if needed + if (lmps_using_molecular) { + memory->destroy(lmps_stripped_neigh_list); + memory->create(lmps_stripped_neigh_list, + kim_number_of_neighbor_lists*neighbor->oneatom, + "pair:lmps_stripped_neigh_list"); + delete [] lmps_stripped_neigh_ptr; + lmps_stripped_neigh_ptr = new int*[kim_number_of_neighbor_lists]; + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) + { + lmps_stripped_neigh_ptr[i] + = &(lmps_stripped_neigh_list[(i-1)*(neighbor->oneatom)]); } + } - // request none, half, or full neighbor list - // depending on KIM model requirement + // make sure comm_reverse expects (at most) 9 values when newton is off + if (!lmps_using_newton) comm_reverse_off = 9; - int irequest = neighbor->request(this,instance_me); - if (kim_model_using_cluster) + // request full neighbor + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 0; - } - else - { - // make sure comm_reverse expects (at most) 9 values when newton is off - if (!lmps_using_newton) comm_reverse_off = 9; + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->id = i; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; - if (kim_model_using_half) - { - neighbor->requests[irequest]->half = 1; - neighbor->requests[irequest]->full = 0; - // make sure half lists also include local-ghost pairs - if (lmps_using_newton) neighbor->requests[irequest]->newton = 2; - } - else - { - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - // make sure full lists also include local-ghost pairs - if (lmps_using_newton) neighbor->requests[irequest]->newton = 0; - } + if (modelWillNotRequestNeighborsOfNoncontributingParticles[i]) + { + neighbor->requests[irequest]->ghost = 0; + } + else + { + neighbor->requests[irequest]->ghost = 1; + + } + // always want all owned/ghost pairs + neighbor->requests[irequest]->newton = 2; + // set cutoff + neighbor->requests[irequest]->cut = 1; + neighbor->requests[irequest]->cutoff + = kim_cutoff_values[i] + neighbor->skin; } return; } +/* ---------------------------------------------------------------------- + neighbor callback to inform pair style of neighbor list to use + half or full +------------------------------------------------------------------------- */ + +void PairKIM::init_list(int id, NeighList *ptr) +{ + neighborLists[id] = ptr; +} + /* ---------------------------------------------------------------------- init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ @@ -471,22 +541,7 @@ double PairKIM::init_one(int i, int j) if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - return kim_global_cutoff; -} - -/* ---------------------------------------------------------------------- */ - -void PairKIM::reinit() -{ - // This is called by fix-adapt - - // Call parent class implementation - Pair::reinit(); - - // Then reinit KIM model - int kimerror; - kimerror = pkim->model_reinit(); - kim_error(__LINE__,"model_reinit unsuccessful", kimerror); + return kim_global_influence_distance; } /* ---------------------------------------------------------------------- */ @@ -495,13 +550,16 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) { int i,m,last; double *fp; - if (lmps_hybrid) fp = &(lmps_force_tmp[0][0]); - else fp = &(atom->f[0][0]); + fp = &(atom->f[0][0]); m = 0; last = first + n; - if ((kim_model_has_forces) && ((vflag_atom == 0) || - (!kim_model_has_particleVirial))) + if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && + ((vflag_atom == 0) || + KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported))) { for (i = first; i < last; i++) { @@ -511,8 +569,11 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) && + (vflag_atom == 1) && + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -530,8 +591,12 @@ int PairKIM::pack_reverse_comm(int n, int first, double *buf) } return m; } - else if ((!kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && + (vflag_atom == 1) && + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = first; i < last; i++) @@ -555,12 +620,15 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) { int i,j,m; double *fp; - if (lmps_hybrid) fp = &(lmps_force_tmp[0][0]); - else fp = &(atom->f[0][0]); + fp = &(atom->f[0][0]); m = 0; - if ((kim_model_has_forces) && ((vflag_atom == 0) || - (!kim_model_has_particleVirial))) + if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && + ((vflag_atom == 0) || + KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported))) { for (i = 0; i < n; i++) { @@ -570,8 +638,12 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) fp[3*j+2]+= buf[m++]; } } - else if ((kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && + (vflag_atom == 1) && + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -589,8 +661,12 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) va[j*6+5]+=buf[m++]; } } - else if ((!kim_model_has_forces) && (vflag_atom == 1) && - (kim_model_has_particleVirial)) + else if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported) + && + (vflag_atom == 1) && + KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) { double *va=&(vatom[0][0]); for (i = 0; i < n; i++) @@ -616,7 +692,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf) double PairKIM::memory_usage() { - double bytes = lmps_maxalloc * sizeof(int); + double bytes = 2 * lmps_maxalloc * sizeof(int); return bytes; } @@ -624,45 +700,30 @@ double PairKIM::memory_usage() KIM-specific interface ------------------------------------------------------------------------- */ -void PairKIM::kim_error(int ln, const char* msg, int errcode) +int PairKIM::get_neigh(void const * const dataObject, + int const numberOfNeighborLists, + double const * const cutoffs, + int const neighborListIndex, int const particleNumber, + int * const numberOfNeighbors, + int const ** const neighborsOfParticle) { - if (errcode == KIM_STATUS_OK) return; - KIM_API_model::report_error(ln,(char *) __FILE__, (char *) msg,errcode); - error->all(__FILE__,ln,"Internal KIM error"); + PairKIM const * const Model + = reinterpret_cast(dataObject); - return; -} - -/* ---------------------------------------------------------------------- */ - -int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, - int *atom, int *numnei, int **nei1atom, double **pRij) -{ - KIM_API_model *pkim = (KIM_API_model *) *kimmdl; - - int kimerror; - PairKIM *self = (PairKIM *) pkim->get_sim_buffer(&kimerror); - - if (self->kim_model_using_Rij) { - *pRij = &(self->Rij[0]); - } else { - *pRij = 0; + if (numberOfNeighborLists != Model->kim_number_of_neighbor_lists) + return true; + for (int i = 0; i < numberOfNeighborLists; ++i) + { + if (Model->kim_cutoff_values[i] < cutoffs[i]) return true; } + // neighborListIndex and particleNumber are validated by KIM API - // subvert KIM api by using direct access to self->list - // - // get neighObj from KIM API obj - // NeighList * neiobj = (NeighList * ) - // (*pkim).get_data_by_index(self->kim_ind_neighObject, &kimerror); - NeighList * neiobj = self->list; + // initialize numNeigh + *numberOfNeighbors = 0; - // subvert KIM api by using direct acces to self->lmps_local_tot_num_atoms - // - //int * pnAtoms = (int *) - // (*pkim).get_data_by_index(self->kim_ind_numberOfParticles, &kimerror); - //int nAtoms = *pnAtoms; - int nAtoms = self->lmps_local_tot_num_atoms; + NeighList * neiobj = Model->neighborLists[neighborListIndex]; + int nAtoms = Model->lmps_local_tot_num_atoms; int j, jj, inum, *ilist, *numneigh, **firstneigh; inum = neiobj->inum; //# of I atoms neighbors are stored for @@ -670,97 +731,22 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request, numneigh = neiobj->numneigh; // # of J neighbors for each I atom firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom - if (*mode==0){ //iterator mode - if (*request==1) { //increment iterator - if (self->kim_iterator_position < inum) { - *atom = ilist[self->kim_iterator_position]; - *numnei = numneigh[*atom]; + *numberOfNeighbors = numneigh[particleNumber]; - // strip off neighbor mask for molecular systems - if (!self->lmps_using_molecular) - *nei1atom = firstneigh[*atom]; - else - { - int n = *numnei; - int *ptr = firstneigh[*atom]; - int *lmps_stripped_neigh_list = self->lmps_stripped_neigh_list; - for (int i = 0; i < n; i++) - lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; - *nei1atom = lmps_stripped_neigh_list; - } - - // set Rij if needed - if (self->kim_model_using_Rij) { - double* x = (double *) - (*pkim).get_data_by_index(self->kim_ind_coordinates, - &kimerror); - for (jj=0; jj < *numnei; jj++) { - int i = *atom; - j = (*nei1atom)[jj]; - self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0]; - self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1]; - self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2]; - } - } - - // increment iterator - self->kim_iterator_position++; - - return KIM_STATUS_OK; //successful increment - } else if (self->kim_iterator_position == inum) { - *numnei = 0; - return KIM_STATUS_NEIGH_ITER_PAST_END; //reached end by iterator - } else if (self->kim_iterator_position > inum || inum < 0){ - self->error->one(FLERR, "KIM neighbor iterator exceeded range"); - } - } else if (*request == 0){ //restart iterator - self->kim_iterator_position = 0; - *numnei = 0; - return KIM_STATUS_NEIGH_ITER_INIT_OK; //succsesful restart - } - } else if (*mode == 1){//locator mode - //... - if (*request < inum) { - *atom = *request; - *numnei = numneigh[*atom]; - - // strip off neighbor mask for molecular systems - if (!self->lmps_using_molecular) - *nei1atom = firstneigh[*atom]; - else - { - int n = *numnei; - int *ptr = firstneigh[*atom]; - int *lmps_stripped_neigh_list = self->lmps_stripped_neigh_list; - for (int i = 0; i < n; i++) - lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; - *nei1atom = lmps_stripped_neigh_list; - } - - // set Rij if needed - if (self->kim_model_using_Rij){ - double* x = (double *) - (*pkim).get_data_by_index(self->kim_ind_coordinates, &kimerror); - for(int jj=0; jj < *numnei; jj++){ - int i = *atom; - int j = (*nei1atom)[jj]; - self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0]; - self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1]; - self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2]; - } - } - return KIM_STATUS_OK; //successful end - } - else if (*request >= nAtoms || inum < 0) - return KIM_STATUS_NEIGH_INVALID_REQUEST; - else if (*request >= inum) { - *atom = *request; - *numnei = 0; - return KIM_STATUS_OK; //successfull but no neighbors in the list - } - } else return KIM_STATUS_NEIGH_INVALID_MODE; //invalid mode - - return -16; //should not get here: unspecified error + // strip off neighbor mask for molecular systems + if (!Model->lmps_using_molecular) + *neighborsOfParticle = firstneigh[particleNumber]; + else + { + int n = *numberOfNeighbors; + int *ptr = firstneigh[particleNumber]; + int *lmps_stripped_neigh_list + = Model->lmps_stripped_neigh_ptr[neighborListIndex]; + for (int i = 0; i < n; i++) + lmps_stripped_neigh_list[i] = *(ptr++) & NEIGHMASK; + *neighborsOfParticle = lmps_stripped_neigh_list; + } + return false; } /* ---------------------------------------------------------------------- */ @@ -769,27 +755,15 @@ void PairKIM::kim_free() { int kimerror; - if (kim_model_init_ok) - { - kimerror = pkim->model_destroy(); - kim_model_init_ok = false; - } if (kim_init_ok) { - pkim->free(&kimerror); - kim_init_ok = false; - } - if (pkim != 0) - { - delete pkim; - pkim = 0; - } - if (kim_particle_codes_ok) - { - delete [] kim_particle_codes; - kim_particle_codes = 0; - kim_particle_codes_ok = false; + int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs); + if (kimerror) + error->all(FLERR,"Unable to destroy Compute Arguments Object"); + + KIM_Model_Destroy(&pkim); } + kim_init_ok = false; return; } @@ -800,182 +774,165 @@ void PairKIM::kim_init() { int kimerror; - // + // initialize KIM model + int requestedUnitsAccepted; + kimerror = KIM_Model_Create( + KIM_NUMBERING_zeroBased, + lengthUnit, energyUnit, chargeUnit, temperatureUnit, timeUnit, + kim_modelname, + &requestedUnitsAccepted, + &pkim); + if (kimerror) + error->all(FLERR,"KIM ModelCreate failed"); + else { + if (!requestedUnitsAccepted) { + error->all(FLERR,"KIM Model did not accept the requested unit system"); + } + + // check that the model does not require unknown capabilities + kimerror = check_for_routine_compatibility(); + if (kimerror) + { + error->all(FLERR, + "KIM Model requires unknown Routines. Unable to proceed."); + } + + kimerror = KIM_Model_ComputeArgumentsCreate(pkim, &pargs); + if (kimerror) + { + KIM_Model_Destroy(&pkim); + error->all(FLERR,"KIM ComputeArgumentsCreate failed"); + } + else + { + kim_init_ok = true; + } + } // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); - // create appropriate KIM descriptor file - char* test_descriptor_string = 0; - // allocate memory for test_descriptor_string and write descriptor file - write_descriptor(&test_descriptor_string); - // print descriptor - if (print_kim_file) + KIM_Model_GetInfluenceDistance(pkim, &kim_global_influence_distance); + KIM_Model_GetNeighborListPointers( + pkim, + &kim_number_of_neighbor_lists, + &kim_cutoff_values, + &modelWillNotRequestNeighborsOfNoncontributingParticles); + if (neighborLists) { - error->message(FLERR, test_descriptor_string); + delete [] neighborLists; + neighborLists = 0; } + neighborLists = new NeighList*[kim_number_of_neighbor_lists]; - // initialize KIM model - pkim = new KIM_API_model(); - kimerror = pkim->string_init(test_descriptor_string, kim_modelname); - if (kimerror != KIM_STATUS_OK) - kim_error(__LINE__,"KIM initialization failed", kimerror); - else - { - kim_init_ok = true; - delete [] test_descriptor_string; - test_descriptor_string = 0; - } + kimerror = KIM_ComputeArguments_SetArgumentPointerInteger(pargs, + KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles, + &lmps_local_tot_num_atoms); + if (KIM_SupportStatus_NotEqual(kim_model_support_for_energy, + KIM_SUPPORT_STATUS_notSupported)) + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble(pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialEnergy, + &(eng_vdwl)); - // determine kim_model_using_* true/false values - // - // check for half or full list - kim_model_using_half = (pkim->is_half_neighbors(&kimerror)); - // - const char* NBC_method; - kimerror = pkim->get_NBC_method(&NBC_method); - kim_error(__LINE__,"NBC method not set",kimerror); - // check for CLUSTER mode - kim_model_using_cluster = (strcmp(NBC_method,"CLUSTER")==0); - // check if Rij needed for get_neigh - kim_model_using_Rij = ((strcmp(NBC_method,"NEIGH_RVEC_H")==0) || - (strcmp(NBC_method,"NEIGH_RVEC_F")==0)); + kimerror = KIM_ComputeArguments_SetCallbackPointer(pargs, + KIM_COMPUTE_CALLBACK_NAME_GetNeighborList, + KIM_LANGUAGE_NAME_cpp, + reinterpret_cast(get_neigh), + reinterpret_cast(this)); - // get correct index of each variable in kim_api object - pkim->getm_index(&kimerror, 3*13, - "coordinates", &kim_ind_coordinates, 1, - "cutoff", &kim_ind_cutoff, 1, - "numberOfParticles", &kim_ind_numberOfParticles, 1, -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "numberParticleTypes", &kim_ind_numberOfSpecies, 1, - "particleTypes", &kim_ind_particleSpecies, 1, -#else - "numberOfSpecies", &kim_ind_numberOfSpecies, 1, - "particleSpecies", &kim_ind_particleSpecies, 1, -#endif - "numberContributingParticles", &kim_ind_numberContributingParticles, - kim_model_using_half, - "particleEnergy", &kim_ind_particleEnergy, - (int) kim_model_has_particleEnergy, - "energy", &kim_ind_energy, (int) kim_model_has_energy, - "forces", &kim_ind_forces, (int) kim_model_has_forces, - "neighObject", &kim_ind_neighObject, (int) !kim_model_using_cluster, - "get_neigh", &kim_ind_get_neigh, (int) !kim_model_using_cluster, - "particleVirial", &kim_ind_particleVirial, - (int) kim_model_has_particleVirial, - "virial", &kim_ind_virial, no_virial_fdotr_compute); - kim_error(__LINE__,"getm_index",kimerror); - - // setup mapping between LAMMPS unique elements and KIM species codes - kim_particle_codes = new int[lmps_num_unique_elements]; - kim_particle_codes_ok = true; - for(int i = 0; i < lmps_num_unique_elements; i++){ - int kimerror; - kim_particle_codes[i] - = pkim->get_species_code(lmps_unique_elements[i], &kimerror); - kim_error(__LINE__, "create_kim_particle_codes: symbol not found ", - kimerror); - } - - // set pointer values in KIM API object that will not change during run - set_statics(); + if (kimerror) + error->all(FLERR,"Unable to register KIM pointers"); return; } /* ---------------------------------------------------------------------- */ -void PairKIM::set_statics() +void PairKIM::set_argument_pointers() { - // set total number of atoms - lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); + int kimerror; + kimerror = KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_coordinates, &(atom->x[0][0])); - int kimerror; - pkim->setm_data_by_index(&kimerror, 4*6, - kim_ind_numberOfSpecies, 1, (void *) &(atom->ntypes), 1, - kim_ind_cutoff, 1, (void *) &(kim_global_cutoff), 1, - kim_ind_numberOfParticles, 1, (void *) &lmps_local_tot_num_atoms, 1, - kim_ind_numberContributingParticles, 1, (void *) &(atom->nlocal), - (int) kim_model_using_half, - kim_ind_energy, 1, (void *) &(eng_vdwl), (int) kim_model_has_energy, - kim_ind_virial, 1, (void *) &(virial[0]), no_virial_fdotr_compute); - kim_error(__LINE__, "setm_data_by_index", kimerror); - if (!kim_model_using_cluster) - { - kimerror = pkim->set_method_by_index(kim_ind_get_neigh, 1, - (func_ptr) &get_neigh); - kim_error(__LINE__, "set_method_by_index", kimerror); - } + // Set KIM pointer appropriately for particalEnergy + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_required) + && (eflag_atom != 1)) + { + // reallocate per-atom energy array if necessary + if (atom->nmax > maxeatom) + { + maxeatom = atom->nmax; + memory->destroy(eatom); + memory->create(eatom,comm->nthreads*maxeatom,"pair:eatom"); + } + } + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_optional) + && (eflag_atom != 1)) + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, + reinterpret_cast(NULL)); + } + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_notSupported)) + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, eatom); + } - pkim->set_sim_buffer((void *)this, &kimerror); - kim_error(__LINE__, "set_sim_buffer", kimerror); + // Set KIM pointer appropriately for forces + if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported)) + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialForces, + reinterpret_cast(NULL)); + } + else + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, &(atom->f[0][0])); + } - return; -} + // Set KIM pointer appropriately for particleVirial + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_required) + && (vflag_atom != 1)) + { + // reallocate per-atom virial array if necessary + if (atom->nmax > maxeatom) + { + maxvatom = atom->nmax; + memory->destroy(vatom); + memory->create(vatom,comm->nthreads*maxvatom,6,"pair:vatom"); + } + } + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_optional) + && (vflag_atom != 1)) + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial, + reinterpret_cast(NULL)); + } + else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) + { + kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( + pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, &(vatom[0][0])); + } -/* ---------------------------------------------------------------------- */ + if (kimerror) + { + error->all(FLERR,"Unable to set KIM argument pointers"); + } -void PairKIM::set_volatiles() -{ - int kimerror; - lmps_local_tot_num_atoms = (int) (atom->nghost + atom->nlocal); - intptr_t nall = (intptr_t) lmps_local_tot_num_atoms; - - pkim->setm_data_by_index(&kimerror, 4*2, - kim_ind_coordinates, 3*nall, (void*) &(atom->x[0][0]), 1, - kim_ind_particleSpecies, nall, (void*) kim_particleSpecies, 1); - kim_error(__LINE__, "setm_data_by_index", kimerror); - - if (kim_model_has_particleEnergy && (eflag_atom == 1)) - { - kimerror = pkim->set_data_by_index(kim_ind_particleEnergy, nall, - (void*) eatom); - kim_error(__LINE__, "set_data_by_index", kimerror); - } - - if (kim_model_has_particleVirial && (vflag_atom == 1)) - { - kimerror = pkim->set_data_by_index(kim_ind_particleVirial, 6*nall, - (void*) &(vatom[0][0])); - kim_error(__LINE__, "set_data_by_index", kimerror); - } - - if (kim_model_has_forces) - { - if (lmps_hybrid) - kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, - (void*) &(lmps_force_tmp[0][0])); - else - kimerror = pkim->set_data_by_index(kim_ind_forces, nall*3, - (void*) &(atom->f[0][0])); - kim_error(__LINE__, "setm_data_by_index", kimerror); - } - - // subvert the KIM api by direct access to this->list in get_neigh - // - //if (!kim_model_using_cluster) - // kimerror = pkim->set_data_by_index(kim_ind_neighObject, 1, - // (void*) this->list); - - if (kim_model_has_particleVirial) - { - if(vflag_atom != 1) { - pkim->set_compute_by_index(kim_ind_particleVirial, KIM_COMPUTE_FALSE, - &kimerror); - } else { - pkim->set_compute_by_index(kim_ind_particleVirial, KIM_COMPUTE_TRUE, - &kimerror); - } - } - - if (no_virial_fdotr_compute == 1) - { - pkim->set_compute_by_index(kim_ind_virial, - ((vflag_global != 1) ? KIM_COMPUTE_FALSE : KIM_COMPUTE_TRUE), - &kimerror); - } - - return; + return; } /* ---------------------------------------------------------------------- */ @@ -985,432 +942,183 @@ void PairKIM::set_lmps_flags() // determint if newton is on or off lmps_using_newton = (force->newton_pair == 1); - // setup lmps_stripped_neigh_list for neighbors of one atom, if needed - lmps_using_molecular = (atom->molecular > 0); - if (lmps_using_molecular) { - memory->destroy(lmps_stripped_neigh_list); - memory->create(lmps_stripped_neigh_list,neighbor->oneatom, - "pair:lmps_stripped_neigh_list"); + // determine if running with pair hybrid + if (force->pair_match("hybrid",0)) + { + error->all(FLERR,"pair_kim does not support hybrid"); } - // determine if running with pair hybrid - lmps_hybrid = (force->pair_match("hybrid",0)); - - // support cluster mode if everything is just right - lmps_support_cluster = ((domain->xperiodic == 0 && - domain->yperiodic == 0 && - domain->zperiodic == 0 - ) - && - (comm->nprocs == 1) - ); - // determine unit system and set lmps_units flag - if ((strcmp(update->unit_style,"real")==0)) - lmps_units = REAL; - else if ((strcmp(update->unit_style,"metal")==0)) - lmps_units = METAL; - else if ((strcmp(update->unit_style,"si")==0)) - lmps_units = SI; - else if ((strcmp(update->unit_style,"cgs")==0)) - lmps_units = CGS; - else if ((strcmp(update->unit_style,"electron")==0)) - lmps_units = ELECTRON; - else if ((strcmp(update->unit_style,"lj")==0)) - error->all(FLERR,"LAMMPS unit_style lj not supported by KIM models"); - else - error->all(FLERR,"Unknown unit_style"); + if ((strcmp(update->unit_style,"real")==0)) { + lmps_units = REAL; + lengthUnit = KIM_LENGTH_UNIT_A; + energyUnit = KIM_ENERGY_UNIT_kcal_mol; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_fs; + } else if ((strcmp(update->unit_style,"metal")==0)) { + lmps_units = METAL; + lengthUnit = KIM_LENGTH_UNIT_A; + energyUnit = KIM_ENERGY_UNIT_eV; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_ps; + } else if ((strcmp(update->unit_style,"si")==0)) { + lmps_units = SI; + lengthUnit = KIM_LENGTH_UNIT_m; + energyUnit = KIM_ENERGY_UNIT_J; + chargeUnit = KIM_CHARGE_UNIT_C; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_s; + } else if ((strcmp(update->unit_style,"cgs")==0)) { + lmps_units = CGS; + lengthUnit = KIM_LENGTH_UNIT_cm; + energyUnit = KIM_ENERGY_UNIT_erg; + chargeUnit = KIM_CHARGE_UNIT_statC; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_s; + } else if ((strcmp(update->unit_style,"electron")==0)) { + lmps_units = ELECTRON; + lengthUnit = KIM_LENGTH_UNIT_Bohr; + energyUnit = KIM_ENERGY_UNIT_Hartree; + chargeUnit = KIM_CHARGE_UNIT_e; + temperatureUnit = KIM_TEMPERATURE_UNIT_K; + timeUnit = KIM_TIME_UNIT_fs; + } else if ((strcmp(update->unit_style,"lj")==0)) { + error->all(FLERR,"LAMMPS unit_style lj not supported by KIM models"); + } else { + error->all(FLERR,"Unknown unit_style"); + } return; } /* ---------------------------------------------------------------------- */ +int PairKIM::check_for_routine_compatibility() +{ + /* Check that we know about all required routines */ + int numberOfModelRoutineNames; + KIM_MODEL_ROUTINE_NAME_GetNumberOfModelRoutineNames( + &numberOfModelRoutineNames); + for (int i = 0; i < numberOfModelRoutineNames; ++i) + { + KIM_ModelRoutineName modelRoutineName; + KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(i, &modelRoutineName); + + int present; + int required; + int error = KIM_Model_IsRoutinePresent( + pkim, modelRoutineName, &present, &required); + if (error) { return true; } + + if ((present == true) && (required == true)) + { + if (!(KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Create) + || KIM_ModelRoutineName_Equal( + modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Compute) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Refresh) + || KIM_ModelRoutineName_Equal( + modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_Destroy))) + { return true; } + } + } + + /* everything is good */ + return false; +} + +/* ---------------------------------------------------------------------- */ + void PairKIM::set_kim_model_has_flags() { - KIM_API_model mdl; - - int kimerror; - - // get KIM API object representing the KIM Model only - kimerror = mdl.model_info(kim_modelname); - kim_error(__LINE__,"KIM initialization failed", kimerror); - - // determine if the KIM Model can compute the total energy - mdl.get_index((char*) "energy", &kimerror); - kim_model_has_energy = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_energy) - error->warning(FLERR,"KIM Model does not provide `energy'; " - "Potential energy will be zero"); - - // determine if the KIM Model can compute the forces - mdl.get_index((char*) "forces", &kimerror); - kim_model_has_forces = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_forces) - error->warning(FLERR,"KIM Model does not provide `forces'; " - "Forces will be zero"); - - // determine if the KIM Model can compute the particleEnergy - mdl.get_index((char*) "particleEnergy", &kimerror); - kim_model_has_particleEnergy = (kimerror == KIM_STATUS_OK); - if (!kim_model_has_particleEnergy) - error->warning(FLERR,"KIM Model does not provide `particleEnergy'; " - "energy per atom will be zero"); - - // determine if the KIM Model can compute the particleVerial - mdl.get_index((char*) "particleVirial", &kimerror); - kim_model_has_particleVirial = (kimerror == KIM_STATUS_OK); - mdl.get_index((char*) "process_dEdr", &kimerror); - kim_model_has_particleVirial = kim_model_has_particleVirial || - (kimerror == KIM_STATUS_OK); - if (!kim_model_has_particleVirial) - error->warning(FLERR,"KIM Model does not provide `particleVirial'; " - "virial per atom will be zero"); - - // tear down KIM API object - mdl.free(&kimerror); - // now destructor will do the remaining tear down for mdl - - return; -} - -/* ---------------------------------------------------------------------- */ - -void PairKIM::write_descriptor(char** test_descriptor_string) -{ - // allocate memory - if (*test_descriptor_string != 0) - error->all(FLERR, "Test_descriptor_string already allocated"); - // assuming 75 lines at 100 characters each (should be plenty) - *test_descriptor_string = new char[100*75]; - // initialize - strcpy(*test_descriptor_string, ""); - - // Write Test name and units - strcat(*test_descriptor_string, - "#\n" - "# BEGINNING OF KIM DESCRIPTOR FILE\n" - "#\n" - "# This file is automatically generated from LAMMPS pair_style " - "kim command\n"); - strcat(*test_descriptor_string, - "\n" - "# The call number is (pair_style).(init_style): "); - char tmp_num[100]; - sprintf(tmp_num, "%i.%i\n", settings_call_count, init_style_call_count); - strcat(*test_descriptor_string, tmp_num); - strcat(*test_descriptor_string, - "#\n" - "\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSION_MINOR == 5 -#else - "KIM_API_Version := 1.6.0\n\n" -#endif - "# Base units\n"); - switch (lmps_units) - { - case REAL: - strcat(*test_descriptor_string, - "Unit_length := A\n" - "Unit_energy := kcal/mol\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := fs\n\n"); - break; - case METAL: - strcat(*test_descriptor_string, - "Unit_length := A\n" - "Unit_energy := eV\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := ps\n\n"); - break; - case SI: - strcat(*test_descriptor_string, - "Unit_length := m\n" - "Unit_energy := J\n" - "Unit_charge := C\n" - "Unit_temperature := K\n" - "Unit_time := s\n\n"); - break; - case CGS: - strcat(*test_descriptor_string, - "Unit_length := cm\n" - "Unit_energy := erg\n" - "Unit_charge := statC\n" - "Unit_temperature := K\n" - "Unit_time := s\n\n"); - break; - case ELECTRON: - strcat(*test_descriptor_string, - "Unit_length := Bohr\n" - "Unit_energy := Hartree\n" - "Unit_charge := e\n" - "Unit_temperature := K\n" - "Unit_time := fs\n\n"); - break; - } - - // Write Supported species section - strcat(*test_descriptor_string, - "\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "SUPPORTED_ATOM/PARTICLES_TYPES:\n" -#else - "PARTICLE_SPECIES:\n" -#endif - "# Symbol/name Type code\n"); - int code=1; - char* tmp_line = 0; - tmp_line = new char[100]; - for (int i=0; i < lmps_num_unique_elements; i++){ - sprintf(tmp_line, "%-24s%-16s%-3i\n", lmps_unique_elements[i], - "spec", code++); - strcat(*test_descriptor_string, tmp_line); - } - delete [] tmp_line; - tmp_line = 0; - strcat(*test_descriptor_string, "\n"); - - // Write conventions section - strcat(*test_descriptor_string, - "\n" - "CONVENTIONS:\n" - "# Name Type\n" - "ZeroBasedLists flag\n"); - // can use iterator or locator neighbor mode, unless in hybrid mode - if (lmps_hybrid) - strcat(*test_descriptor_string, - "Neigh_IterAccess flag\n"); - else - strcat(*test_descriptor_string, - "Neigh_BothAccess flag\n\n"); - - strcat(*test_descriptor_string, - "NEIGH_PURE_H flag\n" - "NEIGH_PURE_F flag\n" - "NEIGH_RVEC_H flag\n" - "NEIGH_RVEC_F flag\n"); - // @@ add code for MI_OPBC_? support ???? - if (lmps_support_cluster) - { - strcat(*test_descriptor_string, - "CLUSTER flag\n\n"); - } - else - { - strcat(*test_descriptor_string, "\n"); - } - - // Write input section - strcat(*test_descriptor_string, - "\n" - "MODEL_INPUT:\n" - "# Name Type Unit Shape\n" - "numberOfParticles integer none []\n" - "numberContributingParticles integer none []\n" -#if KIM_API_VERSION_MAJOR == 1 && KIM_API_VERSON_MINOR == 5 - "numberParticleTypes integer none []\n" - "particleTypes integer none " -#else - "numberOfSpecies integer none []\n" - "particleSpecies integer none " -#endif - "[numberOfParticles]\n" - "coordinates double length " - "[numberOfParticles,3]\n" - "neighObject pointer none []\n" - "get_neigh method none []\n"); - - // Write output section - strcat(*test_descriptor_string, - "\n" - "MODEL_OUPUT:\n" - "# Name Type Unit Shape\n" - "compute method none []\n" - "destroy method none []\n" - "cutoff double length []\n"); - if (!kim_model_has_energy) strcat(*test_descriptor_string,"# "); - strcat(*test_descriptor_string, - "energy double energy []\n"); - if (!kim_model_has_forces) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "forces double force " - "[numberOfParticles,3]\n"); - if (!kim_model_has_particleEnergy) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "particleEnergy double energy " - "[numberOfParticles]\n"); - if (no_virial_fdotr_compute != 1) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "virial double energy [6]\n"); - if (!kim_model_has_particleVirial) strcat(*test_descriptor_string, "# "); - strcat(*test_descriptor_string, - "particleVirial double energy " - "[numberOfParticles,6]\n" - "\n"); - strcat(*test_descriptor_string, - "#\n" - "# END OF KIM DESCRIPTOR FILE\n" - "#\n"); - - return; -} - -void *PairKIM::extract(const char *str, int &dim) -{ - void *paramData; - int kimerror=0; - int ier; - int dummyint; - int isIndexed = 0; - const int MAXLINE = 1024; - int rank; - int validParam = 0; - int numParams; - int *speciesIndex = new int[MAXLINE]; - char *paramStr = new char[MAXLINE]; - char *paramName; - char *indexStr; - char message[MAXLINE]; - int offset; - double* paramPtr; - - // set dim to 0, we will always deal with scalars to circumvent lammps species - // indexing - dim = 0; - - // copy the input str into paramStr for parsing - strcpy(paramStr, str); - // get the name of the parameter (whatever is before ":") - paramName = strtok(paramStr, ":"); - if (0 == strcmp(paramName, str)) - paramName = (char*) str; - else - isIndexed = 1; - - // parse the rest of the string into tokens deliminated by "," and convert - // them to integers, saving them into speciesIndex - int count = -1; - if (isIndexed == 1) + int numberOfComputeArgumentNames; + KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames( + &numberOfComputeArgumentNames); + for (int i = 0; i < numberOfComputeArgumentNames; ++i) { - while((indexStr = strtok(NULL, ",")) != NULL) + KIM_ComputeArgumentName computeArgumentName; + int kimerror = KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName( + i, &computeArgumentName); + KIM_SupportStatus supportStatus; + kimerror = KIM_ComputeArguments_GetArgumentSupportStatus( + pargs, computeArgumentName, &supportStatus); + + if (KIM_ComputeArgumentName_Equal(computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialEnergy) + ) + kim_model_support_for_energy = supportStatus; + else if (KIM_ComputeArgumentName_Equal( + computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces) + ) + kim_model_support_for_forces = supportStatus; + else if + (KIM_ComputeArgumentName_Equal( + computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy)\ + ) + kim_model_support_for_particleEnergy = supportStatus; + else if + (KIM_ComputeArgumentName_Equal( + computeArgumentName, + KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial) + ) + kim_model_support_for_particleVirial = supportStatus; + else if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required) + ) { - count++; - ier = sscanf(indexStr, "%d", &speciesIndex[count]); - if (ier != 1) - { - ier = -1; - break; - } + std::stringstream msg; + msg << "KIM Model requires unsupported compute argument: " + << KIM_ComputeArgumentName_ToString(computeArgumentName); + error->all(FLERR, msg.str().c_str()); } } - if (ier == -1) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - kim_error(__LINE__,"error in PairKIM::extract(), invalid parameter-indicie format", KIM_STATUS_FAIL); - } - // check to make sure that the requested parameter is a valid free parameter + if (KIM_SupportStatus_Equal(kim_model_support_for_energy, + KIM_SUPPORT_STATUS_notSupported)) + error->warning(FLERR,"KIM Model does not provide `partialEnergy'; " + "Potential energy will be zero"); - kimerror = pkim->get_num_params(&numParams, &dummyint); - kim_error(__LINE__, "get_num_free_params", kimerror); - char **freeParamNames = new char*[numParams]; - for (int k = 0; k < numParams; k++) + if (KIM_SupportStatus_Equal(kim_model_support_for_forces, + KIM_SUPPORT_STATUS_notSupported)) + error->warning(FLERR,"KIM Model does not provide `partialForce'; " + "Forces will be zero"); + + if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, + KIM_SUPPORT_STATUS_notSupported)) + error->warning(FLERR,"KIM Model does not provide `partialParticleEnergy'; " + "energy per atom will be zero"); + + if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, + KIM_SUPPORT_STATUS_notSupported)) + error->warning(FLERR,"KIM Model does not provide `partialParticleVirial'; " + "virial per atom will be zero"); + + int numberOfComputeCallbackNames; + KIM_COMPUTE_CALLBACK_NAME_GetNumberOfComputeCallbackNames( + &numberOfComputeCallbackNames); + for (int i = 0; i < numberOfComputeCallbackNames; ++i) { - kimerror = pkim->get_free_parameter(k, (const char**) &freeParamNames[k]); - kim_error(__LINE__, "get_free_parameter", kimerror); - if (0 == strcmp(paramName, freeParamNames[k])) + KIM_ComputeCallbackName computeCallbackName; + int kimerror = KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName( + i, &computeCallbackName); + KIM_SupportStatus supportStatus; + kimerror = KIM_ComputeArguments_GetCallbackSupportStatus( + pargs, computeCallbackName, &supportStatus); + + if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required)) { - validParam = 1; - break; + error->all(FLERR,"KIM Model requires unsupported compute callback"); } } - delete [] freeParamNames, freeParamNames = 0; - if (validParam == 0) - { - sprintf(message, "Invalid parameter to adapt: \"%s\" is not a FREE_PARAM", paramName); - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - kim_error(__LINE__, message, KIM_STATUS_FAIL); - } - // get the parameter arry from pkim object - paramData = pkim->get_data(paramName, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - } - kim_error(__LINE__,"get_data",kimerror); - - // get rank and shape of parameter - rank = (*pkim).get_rank(paramName, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - } - kim_error(__LINE__,"get_rank",kimerror); - - int *shape = new int[MAXLINE]; - dummyint = (*pkim).get_shape(paramName, shape, &kimerror); - if (kimerror == KIM_STATUS_FAIL) - { - delete [] speciesIndex, speciesIndex = 0; - delete [] paramStr, paramStr = 0; - delete [] shape, shape = 0; - } - kim_error(__LINE__,"get_shape",kimerror); - - delete [] paramStr, paramStr = 0; - // check that number of inputs is rank, and that input indicies are less than - // their respective dimensions in shape - if ((count+1) != rank) - { - sprintf(message, "Number of input indicies not equal to rank of specified parameter (%d)", rank); - kimerror = KIM_STATUS_FAIL; - delete [] speciesIndex, speciesIndex = 0; - delete [] shape, shape = 0; - kim_error(__LINE__,message, kimerror); - } - if (isIndexed == 1) - { - for (int i=0; i <= count; i++) - { - if (shape[i] <= speciesIndex[i] || speciesIndex[i] < 0) - { - kimerror = KIM_STATUS_FAIL; - break; - } - } - } - delete [] shape, shape = 0; - if (kimerror == KIM_STATUS_FAIL) - { - sprintf(message, "One or more parameter indicies out of bounds"); - delete [] speciesIndex, speciesIndex = 0; - kim_error(__LINE__, message, kimerror); - } - - // Cast it to a double - paramPtr = static_cast(paramData); - - // If it is indexed (not just a scalar for the whole model), then get pointer - // corresponding to specified indicies by calculating the adress offset using - // specified indicies and the shape - if (isIndexed == 1) - { - offset = 0; - for (int i = 0; i < (rank-1); i++) - { - offset = (offset + speciesIndex[i]) * shape[i+1]; - } - offset = offset + speciesIndex[(rank - 1)]; - paramPtr = (paramPtr + offset); - } - delete [] speciesIndex, speciesIndex = 0; - - return ((void*) paramPtr); + return; } diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index fb4cda8af9..a6f882347d 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -12,14 +12,45 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor (U Minn) + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the openkim-api-v1.5.0 package and for use with - the kim-api-v1.6.0 (and newer) package + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, see . + + Linking LAMMPS statically or dynamically with other modules is making a + combined work based on LAMMPS. Thus, the terms and conditions of the GNU + General Public License cover the whole combination. + + In addition, as a special exception, the copyright holders of LAMMPS give + you permission to combine LAMMPS with free software programs or libraries + that are released under the GNU LGPL and with code included in the standard + release of the "kim-api" under the CDDL (or modified versions of such code, + with unchanged license). You may copy and distribute such a system following + the terms of the GNU GPL for LAMMPS and the licenses of the other code + concerned, provided that you include the source code of that other code + when and as the GNU GPL requires distribution of source code. + + Note that people who make modified versions of LAMMPS are not obligated to + grant this special exception for their modified versions; it is their choice + whether to do so. The GNU General Public License gives permission to release + a modified version without this exception; this exception also makes it + possible to release a modified version which carries forward this exception. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Designed for use with the kim-api-v2-2.0.0 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -34,6 +65,10 @@ PairStyle(kim,PairKIM) // includes from KIM & LAMMPS class KIM_API_model; #include "pair.h" +extern "C" { +#include "KIM_SimulatorHeaders.h" +} +#include namespace LAMMPS_NS { @@ -48,14 +83,13 @@ namespace LAMMPS_NS { virtual void settings(int, char**); virtual void coeff(int, char**); virtual void init_style(); + virtual void init_list(int id, NeighList *ptr); virtual double init_one(int, int); - virtual void reinit(); virtual int pack_reverse_comm(int, int, double*); virtual void unpack_reverse_comm(int, int*, double*); virtual double memory_usage(); - void *extract(const char *, int &); - private: + protected: // (nearly) all bool flags are not initialized in constructor, but set // explicitly in the indicated function. All other data members are // initialized in constructor @@ -64,12 +98,11 @@ namespace LAMMPS_NS { // values set in settings() char* kim_modelname; - bool print_kim_file; // values set in coeff() // values set in allocate(), called by coeff() - void allocate(); + virtual void allocate(); int* lmps_map_species_to_unique; // values set in coeff(), after calling allocate() @@ -80,74 +113,59 @@ namespace LAMMPS_NS { // values set in set_lmps_flags(), called from init_style() bool lmps_using_newton; bool lmps_using_molecular; - bool lmps_hybrid; // true if running with pair hybrid - bool lmps_support_cluster; // true if running in mode compat. - // with CLUSTER enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; unit_sys lmps_units; + KIM_LengthUnit lengthUnit; + KIM_EnergyUnit energyUnit; + KIM_ChargeUnit chargeUnit; + KIM_TemperatureUnit temperatureUnit; + KIM_TimeUnit timeUnit; + + KIM_Model * pkim; + KIM_ComputeArguments * pargs; // values set in set_kim_model_has_flags(), called by kim_init() - KIM_API_model* pkim; - bool kim_model_has_energy; - bool kim_model_has_forces; - bool kim_model_has_particleEnergy; - bool kim_model_has_particleVirial; + KIM_SupportStatus kim_model_support_for_energy; + KIM_SupportStatus kim_model_support_for_forces; + KIM_SupportStatus kim_model_support_for_particleEnergy; + KIM_SupportStatus kim_model_support_for_particleVirial; - // values set in kim_init(), after call to string_init(_) + // values set in kim_init() bool kim_init_ok; - bool kim_model_using_half; - bool kim_model_using_cluster; - bool kim_model_using_Rij; - int kim_ind_coordinates; - int kim_ind_numberOfParticles; - int kim_ind_numberContributingParticles; - int kim_ind_numberOfSpecies; - int kim_ind_particleSpecies; - int kim_ind_get_neigh; - int kim_ind_neighObject; - int kim_ind_cutoff; - int kim_ind_energy; - int kim_ind_particleEnergy; - int kim_ind_forces; - int kim_ind_virial; - int kim_ind_particleVirial; + int lmps_local_tot_num_atoms; + double kim_global_influence_distance; // KIM Model cutoff value + int kim_number_of_neighbor_lists; + double const * kim_cutoff_values; + int const * modelWillNotRequestNeighborsOfNoncontributingParticles; + class NeighList ** neighborLists; - // values set in init_style(), after calling pkim->model_init() - bool kim_model_init_ok; + // values set in init_style() bool kim_particle_codes_ok; int *kim_particle_codes; - // values set in set_statics(), called at end of kim_init(), - // then again in set_volatiles(), called in compute() - int lmps_local_tot_num_atoms; - double kim_global_cutoff; // KIM Model cutoff value - // values set in compute() int lmps_maxalloc; // max allocated memory value int* kim_particleSpecies; // array of KIM particle species - double** lmps_force_tmp; // temp storage for f, when running in - // hybrid mode needed to avoid resetting - // f to zero in each object + int* kim_particleContributing; // array of KIM particle contributing int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS // is in molecular mode - - // values used in get_neigh() - int kim_iterator_position; //get_neigh iterator current position - double *Rij; + int** lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions - void kim_error(int, const char *, int); - void kim_init(); - void kim_free(); - void set_statics(); - void set_volatiles(); - void set_lmps_flags(); - void set_kim_model_has_flags(); - void write_descriptor(char** test_descriptor_string); + virtual void set_contributing(); + virtual void kim_init(); + virtual void kim_free(); + virtual void set_argument_pointers(); + virtual void set_lmps_flags(); + virtual void set_kim_model_has_flags(); + virtual int check_for_routine_compatibility(); // static methods used as callbacks from KIM - static int get_neigh(void** kimmdl, int* mode, int* request, - int* atom, int* numnei, int** nei1atom, - double** pRij); + static int get_neigh( + void const * const dataObject, + int const numberOfCutoffs, double const * const cutoffs, + int const neighborListIndex, int const particleNumber, + int * const numberOfNeighbors, + int const ** const neighborsOfParticle); }; } @@ -156,81 +174,92 @@ namespace LAMMPS_NS { /* ERROR/WARNING messages: -E: Illegal ... command +E: Unable to set KIM particle species codes and/or contributing -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. +A low-level kim-api error has occurred. -E: Unrecognized virial argument in pair_style command +E: KIM Compute returned error -Only two options are supported: LAMMPSvirial and KIMvirial +The KIM model was unable, for some reason, to complete the computation. + +E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api-v2. + +"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api-v2. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api-v2, and rerun. + +E: Illegal pair_style command + +Self-explanatory. E: Incorrect args for pair coefficients -Self-explanatory. Check the input script or data file. +Self-explanatory. -E: Invalid args for non-hybrid pair coefficients +E: create_kim_particle_codes: symbol not found: XX -"NULL" is only supported in pair_coeff calls when using pair hybrid +The KIM model specified does not support the atomic species symbol E: PairKIM only works with 3D problems -This is a current limitation. +Self-explanatory. E: All pair coeffs are not set -All pair coefficients must be set in the data file or by the -pair_coeff command before running a simulation. +Self-explanatory. -E: KIM neighbor iterator exceeded range +E: Unable to destroy Compute Arguments Object -This should not happen. It likely indicates a bug -in the KIM implementation of the interatomic potential -where it is requesting neighbors incorrectly. +A low-level kim-api error has occurred. -E: LAMMPS unit_style lj not supported by KIM models +E: KIM ModelCreate failed -Self-explanatory. Check the input script or data file. +The kim-api was not able to create a model object for the specified model. -E: Unknown unit_style +E: KIM Model did not accept the requested unit system -Self-explanatory. Check the input script or data file. +The KIM Model does not support the specified LAMMPS unit system -W: KIM Model does not provide `energy'; Potential energy will be zero +E: KIM ComputeArgumentsCreate failed -UNDOCUMENTED +A low-level kim-api error has occurred. -W: KIM Model does not provide `forces'; Forces will be zero +E: Unable to register KIM pointers -UNDOCUMENTED +A low-level kim-api error has occurred. -W: KIM Model does not provide `particleEnergy'; energy per atom will be zero +E: Unable to set KIM argument pointers -UNDOCUMENTED +A low-level kim-api error has occurred. -W: KIM Model does not provide `particleVirial'; virial per atom will be zero - -UNDOCUMENTED - -E: Test_descriptor_string already allocated - -This is an internal error. Contact the developers. - -U: KIM Model does not provide 'energy'; Potential energy will be zero +E: pair_kim does not support hybrid Self-explanatory. -U: KIM Model does not provide 'forces'; Forces will be zero +E: LAMMPS unit_style lj not suppored by KIM models Self-explanatory. -U: KIM Model does not provide 'particleEnergy'; energy per atom will be zero +E: KIM Model requires unsupported compute argument: XXX + +A low-level kim-api error has occurred. + +W: KIM Model does not provide `partialEnergy'; Potential energy will be zero Self-explanatory. -U: KIM Model does not provide 'particleVirial'; virial per atom will be zero +W: KIM Model does not provide `partialForce'; Forces will be zero Self-explanatory. +W: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero + +Self-explanatory. + +W: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero + +Self-explanatory. + +E: KIM Model requires unsupported compute callback + +A low-level kim-api error has occurred. + */ diff --git a/src/KOKKOS/angle_charmm_kokkos.cpp b/src/KOKKOS/angle_charmm_kokkos.cpp index 7a83e0d654..ec2955b28d 100644 --- a/src/KOKKOS/angle_charmm_kokkos.cpp +++ b/src/KOKKOS/angle_charmm_kokkos.cpp @@ -447,7 +447,7 @@ void AngleCharmmKokkos::ev_tally(EV_FLOAT &ev, const int i, const in namespace LAMMPS_NS { template class AngleCharmmKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class AngleCharmmKokkos; #endif } diff --git a/src/KOKKOS/angle_class2_kokkos.cpp b/src/KOKKOS/angle_class2_kokkos.cpp index 289753a3ee..fe5b1895fe 100644 --- a/src/KOKKOS/angle_class2_kokkos.cpp +++ b/src/KOKKOS/angle_class2_kokkos.cpp @@ -598,7 +598,7 @@ void AngleClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i, const in namespace LAMMPS_NS { template class AngleClass2Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class AngleClass2Kokkos; #endif } diff --git a/src/KOKKOS/angle_cosine_kokkos.cpp b/src/KOKKOS/angle_cosine_kokkos.cpp index d22ad20f55..08faa254f4 100644 --- a/src/KOKKOS/angle_cosine_kokkos.cpp +++ b/src/KOKKOS/angle_cosine_kokkos.cpp @@ -387,7 +387,7 @@ void AngleCosineKokkos::ev_tally(EV_FLOAT &ev, const int i, const in namespace LAMMPS_NS { template class AngleCosineKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class AngleCosineKokkos; #endif } diff --git a/src/KOKKOS/angle_harmonic_kokkos.cpp b/src/KOKKOS/angle_harmonic_kokkos.cpp index 250397c8e3..8cdab2063a 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.cpp +++ b/src/KOKKOS/angle_harmonic_kokkos.cpp @@ -405,7 +405,7 @@ void AngleHarmonicKokkos::ev_tally(EV_FLOAT &ev, const int i, const namespace LAMMPS_NS { template class AngleHarmonicKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class AngleHarmonicKokkos; #endif } diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index efe55c47ad..58f21b9cd4 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -125,7 +125,7 @@ class AtomVecKokkos : public AtomVec { size_t buffer_size; void* buffer; - #ifdef KOKKOS_HAVE_CUDA + #ifdef KOKKOS_ENABLE_CUDA template Kokkos::View::type, Kokkos::MemoryTraits > mirror_type; if (buffer_size == 0) { - buffer = Kokkos::kokkos_malloc(src.capacity()); - buffer_size = src.capacity(); - } else if (buffer_size < src.capacity()) { - buffer = Kokkos::kokkos_realloc(buffer,src.capacity()); - buffer_size = src.capacity(); + buffer = Kokkos::kokkos_malloc(src.span()); + buffer_size = src.span(); + } else if (buffer_size < src.span()) { + buffer = Kokkos::kokkos_realloc(buffer,src.span()); + buffer_size = src.span(); } return mirror_type( buffer , src.extent(0) , @@ -157,7 +157,7 @@ class AtomVecKokkos : public AtomVec { } template - void perform_async_copy(const ViewType& src, unsigned int space) { + void perform_async_copy(ViewType& src, unsigned int space) { typedef Kokkos::View::type, Kokkos::MemoryTraits > mirror_type; if (buffer_size == 0) { - buffer = Kokkos::kokkos_malloc(src.capacity()*sizeof(typename ViewType::value_type)); - buffer_size = src.capacity(); - } else if (buffer_size < src.capacity()) { - buffer = Kokkos::kokkos_realloc(buffer,src.capacity()*sizeof(typename ViewType::value_type)); - buffer_size = src.capacity(); + buffer = Kokkos::kokkos_malloc(src.span()*sizeof(typename ViewType::value_type)); + buffer_size = src.span(); + } else if (buffer_size < src.span()) { + buffer = Kokkos::kokkos_realloc(buffer,src.span()*sizeof(typename ViewType::value_type)); + buffer_size = src.span(); } mirror_type tmp_view( (typename ViewType::value_type*)buffer , src.extent(0) , @@ -183,11 +183,11 @@ class AtomVecKokkos : public AtomVec { if(space == Device) { Kokkos::deep_copy(LMPHostType(),tmp_view,src.h_view), Kokkos::deep_copy(LMPHostType(),src.d_view,tmp_view); - src.modified_device() = src.modified_host(); + src.clear_sync_state(); } else { Kokkos::deep_copy(LMPHostType(),tmp_view,src.d_view), Kokkos::deep_copy(LMPHostType(),src.h_view,tmp_view); - src.modified_device() = src.modified_host(); + src.clear_sync_state(); } } #else diff --git a/src/KOKKOS/bond_class2_kokkos.cpp b/src/KOKKOS/bond_class2_kokkos.cpp index cb625f06c1..d84b3d390c 100644 --- a/src/KOKKOS/bond_class2_kokkos.cpp +++ b/src/KOKKOS/bond_class2_kokkos.cpp @@ -366,7 +366,7 @@ void BondClass2Kokkos::ev_tally(EV_FLOAT &ev, const int &i, const in namespace LAMMPS_NS { template class BondClass2Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class BondClass2Kokkos; #endif } diff --git a/src/KOKKOS/bond_fene_kokkos.cpp b/src/KOKKOS/bond_fene_kokkos.cpp index 4342223f7e..d37943ba82 100644 --- a/src/KOKKOS/bond_fene_kokkos.cpp +++ b/src/KOKKOS/bond_fene_kokkos.cpp @@ -401,7 +401,7 @@ void BondFENEKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int namespace LAMMPS_NS { template class BondFENEKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class BondFENEKokkos; #endif } diff --git a/src/KOKKOS/bond_harmonic_kokkos.cpp b/src/KOKKOS/bond_harmonic_kokkos.cpp index 35b957ffd3..6cdd4fe856 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.cpp +++ b/src/KOKKOS/bond_harmonic_kokkos.cpp @@ -340,7 +340,7 @@ void BondHarmonicKokkos::ev_tally(EV_FLOAT &ev, const int &i, const namespace LAMMPS_NS { template class BondHarmonicKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class BondHarmonicKokkos; #endif } diff --git a/src/KOKKOS/compute_temp_kokkos.cpp b/src/KOKKOS/compute_temp_kokkos.cpp index d94c6e76b5..7b76f54f57 100644 --- a/src/KOKKOS/compute_temp_kokkos.cpp +++ b/src/KOKKOS/compute_temp_kokkos.cpp @@ -153,7 +153,7 @@ void ComputeTempKokkos::operator()(TagComputeTempVector, cons namespace LAMMPS_NS { template class ComputeTempKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class ComputeTempKokkos; #endif } diff --git a/src/KOKKOS/dihedral_charmm_kokkos.cpp b/src/KOKKOS/dihedral_charmm_kokkos.cpp index 9e25dda894..3931309dc1 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.cpp +++ b/src/KOKKOS/dihedral_charmm_kokkos.cpp @@ -786,7 +786,7 @@ void DihedralCharmmKokkos::ev_tally(EVM_FLOAT &evm, const int i, con namespace LAMMPS_NS { template class DihedralCharmmKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class DihedralCharmmKokkos; #endif } diff --git a/src/KOKKOS/dihedral_class2_kokkos.cpp b/src/KOKKOS/dihedral_class2_kokkos.cpp index de1d9c5458..c7db07a6cb 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.cpp +++ b/src/KOKKOS/dihedral_class2_kokkos.cpp @@ -1127,7 +1127,7 @@ void DihedralClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i1, cons namespace LAMMPS_NS { template class DihedralClass2Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class DihedralClass2Kokkos; #endif } diff --git a/src/KOKKOS/dihedral_opls_kokkos.cpp b/src/KOKKOS/dihedral_opls_kokkos.cpp index 3f34c2f5f3..9d01cf1a54 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.cpp +++ b/src/KOKKOS/dihedral_opls_kokkos.cpp @@ -536,7 +536,7 @@ void DihedralOPLSKokkos::ev_tally(EV_FLOAT &ev, const int i1, const namespace LAMMPS_NS { template class DihedralOPLSKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class DihedralOPLSKokkos; #endif } diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.cpp b/src/KOKKOS/fix_dpd_energy_kokkos.cpp index b12c6a476e..d092cb4802 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.cpp +++ b/src/KOKKOS/fix_dpd_energy_kokkos.cpp @@ -90,7 +90,7 @@ void FixDPDenergyKokkos::final_integrate() namespace LAMMPS_NS { template class FixDPDenergyKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixDPDenergyKokkos; #endif } diff --git a/src/KOKKOS/fix_enforce2d_kokkos.cpp b/src/KOKKOS/fix_enforce2d_kokkos.cpp index f4f239123b..346e440f55 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.cpp +++ b/src/KOKKOS/fix_enforce2d_kokkos.cpp @@ -162,7 +162,7 @@ void FixEnforce2DKokkos::post_force_item( int i ) const namespace LAMMPS_NS { template class FixEnforce2DKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixEnforce2DKokkos; #endif } diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp index 39f612ec46..2f730d1193 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp @@ -563,7 +563,7 @@ void FixEOStableRXKokkos::create_kokkos_tables() namespace LAMMPS_NS { template class FixEOStableRXKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixEOStableRXKokkos; #endif } diff --git a/src/KOKKOS/fix_freeze_kokkos.cpp b/src/KOKKOS/fix_freeze_kokkos.cpp index ccf7c7ff85..fb0c3841e6 100644 --- a/src/KOKKOS/fix_freeze_kokkos.cpp +++ b/src/KOKKOS/fix_freeze_kokkos.cpp @@ -118,7 +118,7 @@ void FixFreezeKokkos::operator()(const int i, OriginalForce &origina namespace LAMMPS_NS { template class FixFreezeKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixFreezeKokkos; #endif } diff --git a/src/KOKKOS/fix_gravity_kokkos.cpp b/src/KOKKOS/fix_gravity_kokkos.cpp index 2aff7af56c..5d3b4f62fb 100644 --- a/src/KOKKOS/fix_gravity_kokkos.cpp +++ b/src/KOKKOS/fix_gravity_kokkos.cpp @@ -115,7 +115,7 @@ void FixGravityKokkos::operator()(TagFixGravityMass, const int i, do namespace LAMMPS_NS { template class FixGravityKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixGravityKokkos; #endif } diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 63b749a556..0947fee693 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -774,7 +774,7 @@ void FixLangevinKokkos::cleanup_copy() namespace LAMMPS_NS { template class FixLangevinKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixLangevinKokkos; #endif } diff --git a/src/KOKKOS/fix_momentum_kokkos.cpp b/src/KOKKOS/fix_momentum_kokkos.cpp index 493dffc3d9..38500531ca 100644 --- a/src/KOKKOS/fix_momentum_kokkos.cpp +++ b/src/KOKKOS/fix_momentum_kokkos.cpp @@ -199,7 +199,7 @@ void FixMomentumKokkos::end_of_step() namespace LAMMPS_NS { template class FixMomentumKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixMomentumKokkos; #endif } diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index ea0bd138f4..5f53950fe6 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -329,7 +329,7 @@ int FixNeighHistoryKokkos::unpack_exchange(int nlocal, double *buf) namespace LAMMPS_NS { template class FixNeighHistoryKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNeighHistoryKokkos; #endif } diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 9e86e47bc9..ba6e8919ea 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -733,7 +733,7 @@ void FixNHKokkos::pre_exchange() namespace LAMMPS_NS { template class FixNHKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNHKokkos; #endif } diff --git a/src/KOKKOS/fix_nph_kokkos.cpp b/src/KOKKOS/fix_nph_kokkos.cpp index ed825ad9ee..c5072e6ae9 100644 --- a/src/KOKKOS/fix_nph_kokkos.cpp +++ b/src/KOKKOS/fix_nph_kokkos.cpp @@ -71,7 +71,7 @@ FixNPHKokkos::FixNPHKokkos(LAMMPS *lmp, int narg, char **arg) : namespace LAMMPS_NS { template class FixNPHKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNPHKokkos; #endif } diff --git a/src/KOKKOS/fix_npt_kokkos.cpp b/src/KOKKOS/fix_npt_kokkos.cpp index b33e733aee..c488c8e4f3 100644 --- a/src/KOKKOS/fix_npt_kokkos.cpp +++ b/src/KOKKOS/fix_npt_kokkos.cpp @@ -71,7 +71,7 @@ FixNPTKokkos::FixNPTKokkos(LAMMPS *lmp, int narg, char **arg) : namespace LAMMPS_NS { template class FixNPTKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNPTKokkos; #endif } diff --git a/src/KOKKOS/fix_nve_kokkos.cpp b/src/KOKKOS/fix_nve_kokkos.cpp index 621f16f420..052bf411d6 100644 --- a/src/KOKKOS/fix_nve_kokkos.cpp +++ b/src/KOKKOS/fix_nve_kokkos.cpp @@ -172,7 +172,7 @@ void FixNVEKokkos::cleanup_copy() namespace LAMMPS_NS { template class FixNVEKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNVEKokkos; #endif } diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.cpp b/src/KOKKOS/fix_nve_sphere_kokkos.cpp index 9c408d0630..95945a858f 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.cpp +++ b/src/KOKKOS/fix_nve_sphere_kokkos.cpp @@ -149,7 +149,7 @@ void FixNVESphereKokkos::final_integrate_item(const int i) const namespace LAMMPS_NS { template class FixNVESphereKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNVESphereKokkos; #endif } diff --git a/src/KOKKOS/fix_nvt_kokkos.cpp b/src/KOKKOS/fix_nvt_kokkos.cpp index 8b2d936274..4db42a62fb 100644 --- a/src/KOKKOS/fix_nvt_kokkos.cpp +++ b/src/KOKKOS/fix_nvt_kokkos.cpp @@ -52,7 +52,7 @@ FixNVTKokkos::FixNVTKokkos(LAMMPS *lmp, int narg, char **arg) : namespace LAMMPS_NS { template class FixNVTKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixNVTKokkos; #endif } diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 52a90eda01..9969ab7257 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1266,7 +1266,7 @@ int FixQEqReaxKokkos::unpack_exchange(int nlocal, double *buf) namespace LAMMPS_NS { template class FixQEqReaxKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixQEqReaxKokkos; #endif } diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index f636f6454d..80333e1e9b 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -2276,7 +2276,7 @@ void FixRxKokkos::unpack_reverse_comm(int n, int *list, double *buf) namespace LAMMPS_NS { template class FixRxKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixRxKokkos; #endif } diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 5150c71249..5d15b88d76 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -184,7 +184,7 @@ void FixSetForceKokkos::operator()(TagFixSetForceNonConstant, const namespace LAMMPS_NS { template class FixSetForceKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixSetForceKokkos; #endif } diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 99e51ebe38..968f877abd 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -808,7 +808,7 @@ double FixShardlowKokkos::memory_usage() namespace LAMMPS_NS { template class FixShardlowKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixShardlowKokkos; #endif } diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.cpp b/src/KOKKOS/fix_wall_lj93_kokkos.cpp index 3aaa45f8a8..5dbb054175 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.cpp +++ b/src/KOKKOS/fix_wall_lj93_kokkos.cpp @@ -98,7 +98,7 @@ void FixWallLJ93Kokkos::wall_particle_item(int i, value_type ewall) namespace LAMMPS_NS { template class FixWallLJ93Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixWallLJ93Kokkos; #endif } diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.cpp b/src/KOKKOS/fix_wall_reflect_kokkos.cpp index 2516ac6577..75a5c1a81e 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.cpp +++ b/src/KOKKOS/fix_wall_reflect_kokkos.cpp @@ -107,7 +107,7 @@ void FixWallReflectKokkos::operator()(TagFixWallReflectPostIntegrate namespace LAMMPS_NS { template class FixWallReflectKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class FixWallReflectKokkos; #endif } diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 64a9d6992f..14b84a5733 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -652,7 +652,7 @@ double GridCommKokkos::memory_usage() namespace LAMMPS_NS { template class GridCommKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class GridCommKokkos; #endif } diff --git a/src/KOKKOS/improper_class2_kokkos.cpp b/src/KOKKOS/improper_class2_kokkos.cpp index 2a7e8076d4..e3af52b494 100644 --- a/src/KOKKOS/improper_class2_kokkos.cpp +++ b/src/KOKKOS/improper_class2_kokkos.cpp @@ -1134,7 +1134,7 @@ void ImproperClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i1, cons namespace LAMMPS_NS { template class ImproperClass2Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class ImproperClass2Kokkos; #endif } diff --git a/src/KOKKOS/improper_harmonic_kokkos.cpp b/src/KOKKOS/improper_harmonic_kokkos.cpp index b364d0b0c7..4d41f3ef48 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.cpp +++ b/src/KOKKOS/improper_harmonic_kokkos.cpp @@ -484,7 +484,7 @@ void ImproperHarmonicKokkos::ev_tally(EV_FLOAT &ev, const int i1, co namespace LAMMPS_NS { template class ImproperHarmonicKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class ImproperHarmonicKokkos; #endif } diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 9973b5a688..295fddc6e7 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -26,7 +26,7 @@ #include "error.h" #include "memory_kokkos.h" -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA // for detecting GPU-direct support: // the function int have_gpu_direct() @@ -55,7 +55,7 @@ GPU_DIRECT_UNKNOWN GPU_DIRECT_UNKNOWN #endif -#endif // KOKKOS_HAVE_CUDA +#endif // KOKKOS_ENABLE_CUDA using namespace LAMMPS_NS; @@ -92,7 +92,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) } else if (strcmp(arg[iarg],"g") == 0 || strcmp(arg[iarg],"gpus") == 0) { -#ifndef KOKKOS_HAVE_CUDA +#ifndef KOKKOS_ENABLE_CUDA error->all(FLERR,"GPUs are requested but Kokkos has not been compiled for CUDA"); #endif if (iarg+2 > narg) error->all(FLERR,"Invalid Kokkos command-line args"); @@ -142,7 +142,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (logfile) fprintf(logfile," will use up to %d GPU(s) per node\n",ngpu); } -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if (ngpu <= 0) error->all(FLERR,"Kokkos has been compiled for CUDA but no GPUs are requested"); @@ -166,7 +166,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) } #endif -#ifndef KOKKOS_HAVE_SERIAL +#ifndef KOKKOS_ENABLE_SERIAL if (num_threads == 1) error->warning(FLERR,"When using a single thread, the Kokkos Serial backend " "(i.e. Makefile.kokkos_mpi_only) gives better performance " diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index b88c92ff73..ff96684edc 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -24,7 +24,7 @@ enum{FULL=1u,HALFTHREAD=2u,HALF=4u,N2=8u}; -#if defined(KOKKOS_HAVE_CXX11) +#if defined(KOKKOS_ENABLE_CXX11) #undef ISFINITE #define ISFINITE(x) std::isfinite(x) #endif @@ -201,7 +201,7 @@ template<> struct ExecutionSpaceFromDevice { static const LAMMPS_NS::ExecutionSpace space = LAMMPS_NS::Host; }; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template<> struct ExecutionSpaceFromDevice { static const LAMMPS_NS::ExecutionSpace space = LAMMPS_NS::Device; @@ -776,7 +776,7 @@ typedef tdual_int_64::t_dev_um t_int_64_um; }; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template <> struct ArrayTypes { @@ -1074,7 +1074,7 @@ void memset_kokkos (ViewType &view) { #ifndef KOKKOS_USING_DEPRECATED_VIEW Kokkos::parallel_for(view.span()*sizeof(typename ViewType::value_type)/4, f); #else - Kokkos::parallel_for(view.capacity()*sizeof(typename ViewType::value_type)/4, f); + Kokkos::parallel_for(view.span()*sizeof(typename ViewType::value_type)/4, f); #endif ViewType::execution_space::fence(); } @@ -1087,12 +1087,12 @@ struct params_lj_coul { F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset; }; -#if defined(KOKKOS_HAVE_CXX11) +#if defined(KOKKOS_ENABLE_CXX11) #undef ISFINITE #define ISFINITE(x) std::isfinite(x) #endif -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #define LAMMPS_LAMBDA [=] __device__ #else #define LAMMPS_LAMBDA [=] diff --git a/src/KOKKOS/nbin_kokkos.cpp b/src/KOKKOS/nbin_kokkos.cpp index c35c349675..090519a5a8 100644 --- a/src/KOKKOS/nbin_kokkos.cpp +++ b/src/KOKKOS/nbin_kokkos.cpp @@ -146,7 +146,7 @@ void NBinKokkos::binatomsItem(const int &i) const namespace LAMMPS_NS { template class NBinKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NBinKokkos; #endif } diff --git a/src/KOKKOS/nbin_ssa_kokkos.cpp b/src/KOKKOS/nbin_ssa_kokkos.cpp index d040ee2c83..ecf0e08535 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.cpp +++ b/src/KOKKOS/nbin_ssa_kokkos.cpp @@ -301,7 +301,7 @@ void NBinSSAKokkos::sortBin( namespace LAMMPS_NS { template class NBinSSAKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NBinSSAKokkos; #endif } diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index 615dc94ee2..05a6fd605c 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -1301,7 +1301,7 @@ void NeighBondKokkos::update_domain_variables() namespace LAMMPS_NS { template class NeighBondKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NeighBondKokkos; #endif } diff --git a/src/KOKKOS/neigh_list_kokkos.cpp b/src/KOKKOS/neigh_list_kokkos.cpp index 93cf0af937..1c78fe3a68 100644 --- a/src/KOKKOS/neigh_list_kokkos.cpp +++ b/src/KOKKOS/neigh_list_kokkos.cpp @@ -53,7 +53,7 @@ void NeighListKokkos::grow(int nmax) namespace LAMMPS_NS { template class NeighListKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NeighListKokkos; #endif } diff --git a/src/KOKKOS/npair_copy_kokkos.cpp b/src/KOKKOS/npair_copy_kokkos.cpp index 8702816033..7dde05745c 100644 --- a/src/KOKKOS/npair_copy_kokkos.cpp +++ b/src/KOKKOS/npair_copy_kokkos.cpp @@ -53,7 +53,7 @@ void NPairCopyKokkos::build(NeighList *list) namespace LAMMPS_NS { template class NPairCopyKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NPairCopyKokkos; #endif } diff --git a/src/KOKKOS/npair_halffull_kokkos.cpp b/src/KOKKOS/npair_halffull_kokkos.cpp index 67481985da..cc8f663ef2 100644 --- a/src/KOKKOS/npair_halffull_kokkos.cpp +++ b/src/KOKKOS/npair_halffull_kokkos.cpp @@ -121,7 +121,7 @@ void NPairHalffullKokkos::operator()(TagNPairHalffullCompute, namespace LAMMPS_NS { template class NPairHalffullKokkos; template class NPairHalffullKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NPairHalffullKokkos; template class NPairHalffullKokkos; #endif diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 88017c3f9d..5e1b7b0414 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -187,7 +187,7 @@ void NPairKokkos::build(NeighList *list_) Kokkos::deep_copy(data.resize, data.h_resize); Kokkos::deep_copy(data.new_maxneighs, data.h_new_maxneighs); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #define BINS_PER_BLOCK 2 const int factor = atoms_per_bin<64?2:1; Kokkos::TeamPolicy config((mbins+factor-1)/factor,atoms_per_bin*factor); @@ -202,7 +202,7 @@ void NPairKokkos::build(NeighList *list_) if (newton_pair) { if (SIZE) { NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if (ExecutionSpaceFromDevice::space == Device) Kokkos::parallel_for(config, f); else @@ -212,7 +212,7 @@ void NPairKokkos::build(NeighList *list_) #endif } else { NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if (ExecutionSpaceFromDevice::space == Device) Kokkos::parallel_for(config, f); else @@ -224,7 +224,7 @@ void NPairKokkos::build(NeighList *list_) } else { if (SIZE) { NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if (ExecutionSpaceFromDevice::space == Device) Kokkos::parallel_for(config, f); else @@ -234,7 +234,7 @@ void NPairKokkos::build(NeighList *list_) #endif } else { NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if (ExecutionSpaceFromDevice::space == Device) Kokkos::parallel_for(config, f); else @@ -470,7 +470,7 @@ void NeighborKokkosExecute:: /* ---------------------------------------------------------------------- */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA extern __shared__ X_FLOAT sharedmem[]; /* ---------------------------------------------------------------------- */ @@ -910,7 +910,7 @@ void NeighborKokkosExecute:: /* ---------------------------------------------------------------------- */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template template __device__ inline void NeighborKokkosExecute::build_ItemSizeCuda(typename Kokkos::TeamPolicy::member_type dev) const @@ -1093,7 +1093,7 @@ template class NPairKokkos; template class NPairKokkos; template class NPairKokkos; template class NPairKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NPairKokkos; template class NPairKokkos; template class NPairKokkos; diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 970e40c9fc..62138bd524 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -311,7 +311,7 @@ class NeighborKokkosExecute KOKKOS_FUNCTION void build_ItemSize(const int &i) const; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template __device__ inline void build_ItemCuda(typename Kokkos::TeamPolicy::member_type dev) const; @@ -388,7 +388,7 @@ struct NPairKokkosBuildFunctor { void operator() (const int & i) const { c.template build_Item(i); } -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA __device__ inline void operator() (typename Kokkos::TeamPolicy::member_type dev) const { @@ -449,7 +449,7 @@ struct NPairKokkosBuildFunctorSize { c.template build_ItemSize(i); } -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA __device__ inline void operator() (typename Kokkos::TeamPolicy::member_type dev) const { c.template build_ItemSizeCuda(dev); diff --git a/src/KOKKOS/npair_skip_kokkos.cpp b/src/KOKKOS/npair_skip_kokkos.cpp index c537afaa6b..e614e624c9 100644 --- a/src/KOKKOS/npair_skip_kokkos.cpp +++ b/src/KOKKOS/npair_skip_kokkos.cpp @@ -151,7 +151,7 @@ void NPairSkipKokkos::operator()(TagNPairSkipCountLocal, const int & namespace LAMMPS_NS { template class NPairSkipKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NPairSkipKokkos; #endif } diff --git a/src/KOKKOS/npair_ssa_kokkos.cpp b/src/KOKKOS/npair_ssa_kokkos.cpp index d17e341f15..5234c4e6d2 100644 --- a/src/KOKKOS/npair_ssa_kokkos.cpp +++ b/src/KOKKOS/npair_ssa_kokkos.cpp @@ -751,7 +751,7 @@ void NPairSSAKokkosExecute::build_ghosts_onePhase(int workPhase) con namespace LAMMPS_NS { template class NPairSSAKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class NPairSSAKokkos; #endif } diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index 9c12d2c978..18d09965be 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -360,7 +360,7 @@ double PairBuckCoulCutKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairBuckCoulCutKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairBuckCoulCutKokkos; #endif } diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index 4978d3d7fc..0b44a83ebb 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -522,7 +522,7 @@ double PairBuckCoulLongKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairBuckCoulLongKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairBuckCoulLongKokkos; #endif } diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index 8785700186..999aefe4c3 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -274,7 +274,7 @@ double PairBuckKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairBuckKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairBuckKokkos; #endif } diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index b6e36d4f0d..7d29adc625 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -280,7 +280,7 @@ double PairCoulCutKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairCoulCutKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairCoulCutKokkos; #endif } diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index 5d15be7d76..3de83b5bc4 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -323,7 +323,7 @@ double PairCoulDebyeKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairCoulDebyeKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairCoulDebyeKokkos; #endif } diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_coul_dsf_kokkos.cpp index a714f665f7..7d03ee4968 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_dsf_kokkos.cpp @@ -422,7 +422,7 @@ int PairCoulDSFKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairCoulDSFKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairCoulDSFKokkos; #endif } diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 1e8c6c5f4e..73b9521da0 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -471,7 +471,7 @@ double PairCoulLongKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairCoulLongKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairCoulLongKokkos; #endif } diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.cpp b/src/KOKKOS/pair_coul_wolf_kokkos.cpp index 2bff824c3d..fe9c581cc1 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_wolf_kokkos.cpp @@ -424,7 +424,7 @@ int PairCoulWolfKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairCoulWolfKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairCoulWolfKokkos; #endif } diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index 3282c9da1e..d2fcc81ea4 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -795,7 +795,7 @@ int PairDPDfdtEnergyKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairDPDfdtEnergyKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairDPDfdtEnergyKokkos; #endif } diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index e198ddb85a..6039282141 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -1199,7 +1199,7 @@ void PairEAMAlloyKokkos::file2array_alloy() namespace LAMMPS_NS { template class PairEAMAlloyKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairEAMAlloyKokkos; #endif } diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index f5e4445db3..81d9ba8326 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -1208,7 +1208,7 @@ void PairEAMFSKokkos::file2array_fs() namespace LAMMPS_NS { template class PairEAMFSKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairEAMFSKokkos; #endif } diff --git a/src/KOKKOS/pair_eam_kokkos.cpp b/src/KOKKOS/pair_eam_kokkos.cpp index 6ef3d99ac3..22383f57c5 100644 --- a/src/KOKKOS/pair_eam_kokkos.cpp +++ b/src/KOKKOS/pair_eam_kokkos.cpp @@ -899,7 +899,7 @@ void PairEAMKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & namespace LAMMPS_NS { template class PairEAMKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairEAMKokkos; #endif } diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index f38feea5f4..df24a5f4c7 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -232,7 +232,7 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) } else Kokkos::parallel_for(Kokkos::RangePolicy(0,np_total),*this); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA Kokkos::parallel_for(Kokkos::RangePolicy(0,np_total),*this); #else int errorFlag = 0; @@ -277,7 +277,7 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) EV_FLOAT ev; -#ifdef KOKKOS_HAVE_CUDA // Use atomics +#ifdef KOKKOS_ENABLE_CUDA // Use atomics if (neighflag == HALF) { if (newton_pair) { @@ -814,7 +814,7 @@ void PairExp6rxKokkos::operator()(TagPairExp6rxComputeNoAtomics unique_token_type; unique_token_type unique_token; @@ -1156,7 +1156,7 @@ void PairExp6rxKokkos::operator()(TagPairExp6rxComputeNoAtomics::vectorized_operator(const int &ii, EV_FLOAT& Kokkos::View::value> > a_uCGnew = uCGnew; int tid = 0; -#ifndef KOKKOS_HAVE_CUDA +#ifndef KOKKOS_ENABLE_CUDA typedef Kokkos::Experimental::UniqueToken< DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; unique_token_type unique_token; @@ -1623,7 +1623,7 @@ void PairExp6rxKokkos::vectorized_operator(const int &ii, EV_FLOAT& t_uCGnew(tid,i) += uCGnew_i; } -#ifndef KOKKOS_HAVE_CUDA +#ifndef KOKKOS_ENABLE_CUDA unique_token.release(tid); #endif } @@ -2128,7 +2128,7 @@ void partition_range( const int begin, const int end, int &thread_begin, int &th /* ---------------------------------------------------------------------- */ -#ifndef KOKKOS_HAVE_CUDA +#ifndef KOKKOS_ENABLE_CUDA template template void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int errorFlag, @@ -2654,7 +2654,7 @@ int PairExp6rxKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairExp6rxKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairExp6rxKokkos; #endif } diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp index 09e6c709a4..189407b541 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp @@ -581,7 +581,7 @@ void PairGranHookeHistoryKokkos::ev_tally_xyz_atom(EV_FLOAT &ev, int namespace LAMMPS_NS { template class PairGranHookeHistoryKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairGranHookeHistoryKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index d0d290d1f1..ce7df2bec1 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -528,7 +528,7 @@ double PairLJCharmmCoulCharmmImplicitKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCharmmCoulCharmmImplicitKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCharmmCoulCharmmImplicitKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index 2203dfa2a0..b31282e595 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -529,7 +529,7 @@ double PairLJCharmmCoulCharmmKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCharmmCoulCharmmKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCharmmCoulCharmmKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index e1ecfbac3c..5d8a202aa4 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -536,7 +536,7 @@ double PairLJCharmmCoulLongKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCharmmCoulLongKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCharmmCoulLongKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index abd0183e21..6eb3028101 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -364,7 +364,7 @@ double PairLJClass2CoulCutKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJClass2CoulCutKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJClass2CoulCutKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index 5f850689d4..a388694876 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -517,7 +517,7 @@ double PairLJClass2CoulLongKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJClass2CoulLongKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJClass2CoulLongKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index 063753f1f8..33d1477443 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -292,7 +292,7 @@ double PairLJClass2Kokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJClass2Kokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJClass2Kokkos; #endif } diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index a2067f8cf9..6001fabbed 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -357,7 +357,7 @@ double PairLJCutCoulCutKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCutCoulCutKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCutCoulCutKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 277f1f658c..10923bc5da 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -386,7 +386,7 @@ double PairLJCutCoulDebyeKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCutCoulDebyeKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCutCoulDebyeKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index 165bd97276..47aa2ea7cc 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -377,7 +377,7 @@ double PairLJCutCoulDSFKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCutCoulDSFKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCutCoulDSFKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index d02e83eb11..fa36cb1866 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -515,7 +515,7 @@ double PairLJCutCoulLongKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCutCoulLongKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCutCoulLongKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index daaab8d29e..9b0ff902af 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -289,7 +289,7 @@ double PairLJCutKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJCutKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJCutKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index 55c8b200ef..3b8b9343d8 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -297,7 +297,7 @@ double PairLJExpandKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJExpandKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJExpandKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index b7fb5acccb..d06ad9b44e 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -516,7 +516,7 @@ double PairLJGromacsCoulGromacsKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJGromacsCoulGromacsKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJGromacsCoulGromacsKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index 5d2725ccdd..d447846333 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -348,7 +348,7 @@ double PairLJGromacsKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJGromacsKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJGromacsKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 8f719582fa..990e464341 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -326,7 +326,7 @@ double PairLJSDKKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairLJSDKKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairLJSDKKokkos; #endif } diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index 97c5f9be84..ab5eb817a1 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -303,7 +303,7 @@ double PairMorseKokkos::init_one(int i, int j) namespace LAMMPS_NS { template class PairMorseKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairMorseKokkos; #endif } diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index a6af26cb0f..5f19d73dfa 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -993,7 +993,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) namespace LAMMPS_NS { template class PairMultiLucyRXKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairMultiLucyRXKokkos; #endif } diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 9930894f45..56d2ebd8aa 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -4292,7 +4292,7 @@ void PairReaxCKokkos::operator()(PairReaxFindBondSpecies, const int } template class PairReaxCKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairReaxCKokkos; #endif } diff --git a/src/KOKKOS/pair_snap_kokkos.cpp b/src/KOKKOS/pair_snap_kokkos.cpp index 32510721d3..76d6aa5462 100644 --- a/src/KOKKOS/pair_snap_kokkos.cpp +++ b/src/KOKKOS/pair_snap_kokkos.cpp @@ -16,7 +16,7 @@ namespace LAMMPS_NS { template class PairSNAPKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairSNAPKokkos; #endif } diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 5452d2293f..24022475ab 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -972,7 +972,7 @@ void PairSWKokkos::ev_tally3_atom(EV_FLOAT &ev, const int &i, namespace LAMMPS_NS { template class PairSWKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairSWKokkos; #endif } diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index b72df04c5f..9522e94706 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -550,7 +550,7 @@ void PairTableKokkos::cleanup_copy() { namespace LAMMPS_NS { template class PairTableKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairTableKokkos; #endif diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 30ca54986b..376984afa2 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -1301,7 +1301,7 @@ void PairTableRXKokkos::cleanup_copy() { namespace LAMMPS_NS { template class PairTableRXKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairTableRXKokkos; #endif diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index c3e1494d0b..a6668ca064 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -1289,7 +1289,7 @@ int PairTersoffKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairTersoffKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairTersoffKokkos; #endif } diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp index 61493794ba..303d2bdfda 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp @@ -1292,7 +1292,7 @@ int PairTersoffMODKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairTersoffMODKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairTersoffMODKokkos; #endif } diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp index f51da2afde..ad4a2d444e 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp @@ -1386,7 +1386,7 @@ int PairTersoffZBLKokkos::sbmask(const int& j) const { namespace LAMMPS_NS { template class PairTersoffZBLKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairTersoffZBLKokkos; #endif } diff --git a/src/KOKKOS/pair_vashishta_kokkos.cpp b/src/KOKKOS/pair_vashishta_kokkos.cpp index 3d4bd22a3c..78ab8bfc85 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.cpp +++ b/src/KOKKOS/pair_vashishta_kokkos.cpp @@ -947,7 +947,7 @@ void PairVashishtaKokkos::ev_tally3_atom(EV_FLOAT &ev, const int &i, namespace LAMMPS_NS { template class PairVashishtaKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairVashishtaKokkos; #endif } diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 8fc2fda120..951613a33e 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -295,7 +295,7 @@ compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, namespace LAMMPS_NS { template class PairYukawaKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairYukawaKokkos; #endif } diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index f57d5eaad0..bcf33b405d 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -433,7 +433,7 @@ void PairZBLKokkos::cleanup_copy() { namespace LAMMPS_NS { template class PairZBLKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PairZBLKokkos; #endif } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 7a02e973b1..bcac29ba9b 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -1648,7 +1648,7 @@ void PPPMKokkos::make_rho() nlocal = atomKK->nlocal; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA copymode = 1; Kokkos::parallel_for(Kokkos::RangePolicy(0,nlocal),*this); copymode = 0; @@ -3121,7 +3121,7 @@ double PPPMKokkos::memory_usage() namespace LAMMPS_NS { template class PPPMKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class PPPMKokkos; #endif } diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index 12255a8a62..c1461c5216 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -50,7 +50,7 @@ class RandPoolWrap : protected Pointers { KOKKOS_INLINE_FUNCTION RandWrap get_state() const { -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA error->all(FLERR,"Cannot use Marsaglia RNG with GPUs"); #endif diff --git a/src/KOKKOS/region_block_kokkos.cpp b/src/KOKKOS/region_block_kokkos.cpp index 8ff6e8937d..730ef81466 100644 --- a/src/KOKKOS/region_block_kokkos.cpp +++ b/src/KOKKOS/region_block_kokkos.cpp @@ -167,7 +167,7 @@ void RegBlockKokkos::rotate(double &x, double &y, double &z, double namespace LAMMPS_NS { template class RegBlockKokkos; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA template class RegBlockKokkos; #endif } diff --git a/src/Makefile b/src/Makefile index 1f0a294e8a..f1030ae08f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,7 @@ OBJDIR = Obj_$@ OBJSHDIR = Obj_shared_$@ SRC = $(wildcard *.cpp) -INC = $(filter-out lmpinstalledpkgs.h,$(wildcard *.h)) +INC = $(filter-out lmpinstalledpkgs.h lmpgitversion.h,$(wildcard *.h)) OBJ = $(SRC:.cpp=.o) SRCLIB = $(filter-out main.cpp,$(SRC)) @@ -58,7 +58,7 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \ molecule mpiio mscg opt peri poems \ python qeq replica rigid shock snap spin srd voronoi -PACKUSER = user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ +PACKUSER = user-adios user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ user-intel user-lb user-manifold user-meamc user-meso \ user-mgpt user-misc user-mofff user-molfile \ @@ -68,7 +68,7 @@ PACKUSER = user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems \ python voronoi \ - user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \ + user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \ user-netcdf user-plumed user-qmmm user-quip user-scafacos \ user-smd user-vtk @@ -77,7 +77,7 @@ PACKSYS = compress mpiio python user-lb PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars PACKEXT = kim latte mscg voronoi \ - user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \ + user-adios user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \ user-smd user-vtk PACKALL = $(PACKAGE) $(PACKUSER) @@ -167,6 +167,31 @@ lmpinstalledpkgs.h: $(SRC) $(INC) mv ${TMPNAME}.lmpinstalled lmpinstalledpkgs.h || rm ${TMPNAME}.lmpinstalled ; \ else mv ${TMPNAME}.lmpinstalled lmpinstalledpkgs.h ; fi +gitversion: + @echo 'Gathering git version information' + @echo '#ifndef LMP_GIT_VERSION_H' > ${TMPNAME}.lmpgitversion + @echo '#define LMP_GIT_VERSION_H' >> ${TMPNAME}.lmpgitversion + @if (type git && test -e ../.git ) >> /dev/null 2>> /dev/null ; then \ + git='true'; \ + commit=$$(git rev-parse HEAD); \ + branch=$$(git rev-parse --abbrev-ref HEAD); \ + describe=$$(git describe --dirty=-modified); \ + else \ + git='false' ; \ + commit='(unknown)' ; \ + branch='(unknown)' ; \ + describe='(unknown)' ; \ + fi ; \ + echo "const bool LAMMPS_NS::LAMMPS::has_git_info = $${git};" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char LAMMPS_NS::LAMMPS::git_commit[] = \"$${commit}\";" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char LAMMPS_NS::LAMMPS::git_branch[] = \"$${branch}\";" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"$${describe}\";" >> ${TMPNAME}.lmpgitversion + @echo '#endif' >> ${TMPNAME}.lmpgitversion + @if [ -f lmpgitversion.h ]; \ + then test "`diff --brief ${TMPNAME}.lmpgitversion lmpgitversion.h`" != "" && \ + mv ${TMPNAME}.lmpgitversion lmpgitversion.h || rm ${TMPNAME}.lmpgitversion ; \ + else mv ${TMPNAME}.lmpgitversion lmpgitversion.h ; fi + # Build LAMMPS in one of 4 modes # exe = exe with static compile in Obj_machine (default) # shexe = exe with shared compile in Obj_shared_machine @@ -180,7 +205,7 @@ lmpinstalledpkgs.h: $(SRC) $(INC) -f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@ @if [ ! -d $(objdir) ]; then mkdir $(objdir); fi @$(SHELL) Make.sh style - @$(MAKE) $(MFLAGS) lmpinstalledpkgs.h + @$(MAKE) $(MFLAGS) lmpinstalledpkgs.h gitversion @echo 'Compiling LAMMPS for machine $@' @if [ -f MAKE/MACHINES/Makefile.$@ ]; \ then cp MAKE/MACHINES/Makefile.$@ $(objdir)/Makefile; fi diff --git a/src/Purge.list b/src/Purge.list index 32b42f5ef1..59c35efca5 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -24,6 +24,7 @@ style_nstencil.h style_ntopo.h # other auto-generated files lmpinstalledpkgs.h +lmpgitversion.h # renamed on 7 January 2019 pair_lebedeva.cpp pair_lebedeva.h diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index 18682fdb9f..8496e40f99 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -329,7 +329,9 @@ void PairSpinDmi::compute(int eflag, int vflag) } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + update the pair interactions fmi acting on the spin ii +------------------------------------------------------------------------- */ void PairSpinDmi::compute_single_pair(int ii, double fmi[3]) { @@ -341,52 +343,76 @@ void PairSpinDmi::compute_single_pair(int ii, double fmi[3]) double delx,dely,delz; double spj[3]; - int i,j,jnum,itype,jtype; - int *ilist,*jlist,*numneigh,**firstneigh; + int i,j,jnum,itype,jtype,ntypes; + int k,locflag; + int *jlist,*numneigh,**firstneigh; double rsq, inorm; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // check if interaction applies to type of ii - i = ilist[ii]; - itype = type[i]; - - xi[0] = x[i][0]; - xi[1] = x[i][1]; - xi[2] = x[i][2]; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (int jj = 0; jj < jnum; jj++) { - - j = jlist[jj]; - j &= NEIGHMASK; - jtype = type[j]; - - spj[0] = sp[j][0]; - spj[1] = sp[j][1]; - spj[2] = sp[j][2]; - - delx = xi[0] - x[j][0]; - dely = xi[1] - x[j][1]; - delz = xi[2] - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - inorm = 1.0/sqrt(rsq); - eij[0] = -inorm*delx; - eij[1] = -inorm*dely; - eij[2] = -inorm*delz; - - local_cut2 = cut_spin_dmi[itype][jtype]*cut_spin_dmi[itype][jtype]; - - if (rsq <= local_cut2) { - compute_dmi(i,j,eij,fmi,spj); - } - + itype = type[ii]; + ntypes = atom->ntypes; + locflag = 0; + k = 1; + while (k <= ntypes) { + if (k <= itype) { + if (setflag[k][itype] == 1) { + locflag =1; + break; + } + k++; + } else if (k > itype) { + if (setflag[itype][k] == 1) { + locflag =1; + break; + } + k++; + } else error->all(FLERR,"Wrong type number"); } + // if interaction applies to type ii, + // locflag = 1 and compute pair interaction + + //i = ilist[ii]; + if (locflag == 1) { + + xi[0] = x[ii][0]; + xi[1] = x[ii][1]; + xi[2] = x[ii][2]; + + jlist = firstneigh[ii]; + jnum = numneigh[ii]; + + for (int jj = 0; jj < jnum; jj++) { + + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + + spj[0] = sp[j][0]; + spj[1] = sp[j][1]; + spj[2] = sp[j][2]; + + delx = xi[0] - x[j][0]; + dely = xi[1] - x[j][1]; + delz = xi[2] - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + inorm = 1.0/sqrt(rsq); + eij[0] = -inorm*delx; + eij[1] = -inorm*dely; + eij[2] = -inorm*delz; + + local_cut2 = cut_spin_dmi[itype][jtype]*cut_spin_dmi[itype][jtype]; + + if (rsq <= local_cut2) { + compute_dmi(ii,j,eij,fmi,spj); + } + } + } } /* ---------------------------------------------------------------------- diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 8cd9d33abd..b2955aafb2 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -97,7 +97,7 @@ void PairSpinExchange::settings(int narg, char **arg) } /* ---------------------------------------------------------------------- - set coeffs for one or more type spin pairs (only one for now) + set coeffs for one or more type spin pairs ------------------------------------------------------------------------- */ void PairSpinExchange::coeff(int narg, char **arg) @@ -318,7 +318,6 @@ void PairSpinExchange::compute(int eflag, int vflag) void PairSpinExchange::compute_single_pair(int ii, double fmi[3]) { - int *type = atom->type; double **x = atom->x; double **sp = atom->sp; @@ -327,46 +326,70 @@ void PairSpinExchange::compute_single_pair(int ii, double fmi[3]) double delx,dely,delz; double spj[3]; - int i,j,jnum,itype,jtype; - int *ilist,*jlist,*numneigh,**firstneigh; + int i,j,jnum,itype,jtype,ntypes; + int k,locflag; + int *jlist,*numneigh,**firstneigh; double rsq; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - i = ilist[ii]; - itype = type[i]; + // check if interaction applies to type of ii - xi[0] = x[i][0]; - xi[1] = x[i][1]; - xi[2] = x[i][2]; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (int jj = 0; jj < jnum; jj++) { - - j = jlist[jj]; - j &= NEIGHMASK; - jtype = type[j]; - local_cut2 = cut_spin_exchange[itype][jtype]*cut_spin_exchange[itype][jtype]; - - spj[0] = sp[j][0]; - spj[1] = sp[j][1]; - spj[2] = sp[j][2]; - - delx = xi[0] - x[j][0]; - dely = xi[1] - x[j][1]; - delz = xi[2] - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - - if (rsq <= local_cut2) { - compute_exchange(i,j,rsq,fmi,spj); - } + itype = type[ii]; + ntypes = atom->ntypes; + locflag = 0; + k = 1; + while (k <= ntypes) { + if (k <= itype) { + if (setflag[k][itype] == 1) { + locflag =1; + break; + } + k++; + } else if (k > itype) { + if (setflag[itype][k] == 1) { + locflag =1; + break; + } + k++; + } else error->all(FLERR,"Wrong type number"); } + // if interaction applies to type ii, + // locflag = 1 and compute pair interaction + + if (locflag == 1) { + + xi[0] = x[ii][0]; + xi[1] = x[ii][1]; + xi[2] = x[ii][2]; + + jlist = firstneigh[ii]; + jnum = numneigh[ii]; + + for (int jj = 0; jj < jnum; jj++) { + + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + local_cut2 = cut_spin_exchange[itype][jtype]*cut_spin_exchange[itype][jtype]; + + spj[0] = sp[j][0]; + spj[1] = sp[j][1]; + spj[2] = sp[j][2]; + + delx = xi[0] - x[j][0]; + dely = xi[1] - x[j][1]; + delz = xi[2] - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= local_cut2) { + compute_exchange(ii,j,rsq,fmi,spj); + } + } + } } /* ---------------------------------------------------------------------- @@ -528,3 +551,4 @@ void PairSpinExchange::read_restart_settings(FILE *fp) MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } + diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 570c995754..a7357f61e3 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -142,7 +142,6 @@ void PairSpinMagelec::coeff(int narg, char **arg) } if (count == 0) error->all(FLERR,"Incorrect args in pair_style command"); - } /* ---------------------------------------------------------------------- @@ -287,7 +286,7 @@ void PairSpinMagelec::compute(int eflag, int vflag) // compute me interaction if (rsq <= local_cut2) { - compute_magelec(i,j,rsq,eij,fmi,spj); + compute_magelec(i,j,eij,fmi,spj); if (lattice_flag) { compute_magelec_mech(i,j,fi,spi,spj); } @@ -320,7 +319,9 @@ void PairSpinMagelec::compute(int eflag, int vflag) } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + update the pair interactions fmi acting on the spin ii +------------------------------------------------------------------------- */ void PairSpinMagelec::compute_single_pair(int ii, double fmi[3]) { @@ -332,55 +333,79 @@ void PairSpinMagelec::compute_single_pair(int ii, double fmi[3]) double delx,dely,delz; double spj[3]; - int i,j,jnum,itype,jtype; - int *ilist,*jlist,*numneigh,**firstneigh; + int i,j,jnum,itype,jtype,ntypes; + int k,locflag; + int *jlist,*numneigh,**firstneigh; double rsq, inorm; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // check if interaction applies to type of ii - i = ilist[ii]; - itype = type[i]; - - xi[0] = x[i][0]; - xi[1] = x[i][1]; - xi[2] = x[i][2]; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (int jj = 0; jj < jnum; jj++) { - - j = jlist[jj]; - j &= NEIGHMASK; - jtype = type[j]; - local_cut2 = cut_spin_magelec[itype][jtype]*cut_spin_magelec[itype][jtype]; - - spj[0] = sp[j][0]; - spj[1] = sp[j][1]; - spj[2] = sp[j][2]; - - delx = xi[0] - x[j][0]; - dely = xi[1] - x[j][1]; - delz = xi[2] - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - inorm = 1.0/sqrt(rsq); - eij[0] = -inorm*delx; - eij[1] = -inorm*dely; - eij[2] = -inorm*delz; - - if (rsq <= local_cut2) { - compute_magelec(i,j,rsq,eij,fmi,spj); - } + itype = type[ii]; + ntypes = atom->ntypes; + locflag = 0; + k = 1; + while (k <= ntypes) { + if (k <= itype) { + if (setflag[k][itype] == 1) { + locflag =1; + break; + } + k++; + } else if (k > itype) { + if (setflag[itype][k] == 1) { + locflag =1; + break; + } + k++; + } else error->all(FLERR,"Wrong type number"); } + // if interaction applies to type ii, + // locflag = 1 and compute pair interaction + + if (locflag == 1) { + + xi[0] = x[ii][0]; + xi[1] = x[ii][1]; + xi[2] = x[ii][2]; + + jlist = firstneigh[ii]; + jnum = numneigh[ii]; + + for (int jj = 0; jj < jnum; jj++) { + + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + local_cut2 = cut_spin_magelec[itype][jtype]*cut_spin_magelec[itype][jtype]; + + spj[0] = sp[j][0]; + spj[1] = sp[j][1]; + spj[2] = sp[j][2]; + + delx = xi[0] - x[j][0]; + dely = xi[1] - x[j][1]; + delz = xi[2] - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + inorm = 1.0/sqrt(rsq); + eij[0] = -inorm*delx; + eij[1] = -inorm*dely; + eij[2] = -inorm*delz; + + if (rsq <= local_cut2) { + compute_magelec(ii,j,eij,fmi,spj); + } + } + } } /* ---------------------------------------------------------------------- */ -void PairSpinMagelec::compute_magelec(int i, int j, double /*rsq*/, double eij[3], double fmi[3], double spj[3]) +void PairSpinMagelec::compute_magelec(int i, int j, double eij[3], double fmi[3], double spj[3]) { int *type = atom->type; int itype, jtype; diff --git a/src/SPIN/pair_spin_magelec.h b/src/SPIN/pair_spin_magelec.h index ce13476271..5e72a4c35e 100644 --- a/src/SPIN/pair_spin_magelec.h +++ b/src/SPIN/pair_spin_magelec.h @@ -37,7 +37,7 @@ class PairSpinMagelec : public PairSpin { void compute(int, int); void compute_single_pair(int, double *); - void compute_magelec(int, int, double, double *, double *, double *); + void compute_magelec(int, int, double *, double *, double *); void compute_magelec_mech(int, int, double *, double *, double *); void write_restart(FILE *); diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 55f537cf4f..bd12832a8d 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -330,7 +330,9 @@ void PairSpinNeel::compute(int eflag, int vflag) } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + update the pair interactions fmi acting on the spin ii +------------------------------------------------------------------------- */ void PairSpinNeel::compute_single_pair(int ii, double fmi[3]) { @@ -342,57 +344,81 @@ void PairSpinNeel::compute_single_pair(int ii, double fmi[3]) double xi[3], rij[3], eij[3]; double spi[3], spj[3]; - int i,j,jnum,itype,jtype; - int *ilist,*jlist,*numneigh,**firstneigh; + int i,j,jnum,itype,jtype,ntypes; + int k,locflag; + int *jlist,*numneigh,**firstneigh; double rsq, inorm; - ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // check if interaction applies to type of ii - i = ilist[ii]; - itype = type[i]; - - spi[0] = sp[i][0]; - spi[1] = sp[i][1]; - spi[2] = sp[i][2]; - - xi[0] = x[i][0]; - xi[1] = x[i][1]; - xi[2] = x[i][2]; - - eij[0] = eij[1] = eij[2] = 0.0; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (int jj = 0; jj < jnum; jj++) { - - j = jlist[jj]; - j &= NEIGHMASK; - jtype = type[j]; - - local_cut2 = cut_spin_neel[itype][jtype]*cut_spin_neel[itype][jtype]; - - spj[0] = sp[j][0]; - spj[1] = sp[j][1]; - spj[2] = sp[j][2]; - - rij[0] = x[j][0] - xi[0]; - rij[1] = x[j][1] - xi[1]; - rij[2] = x[j][2] - xi[2]; - rsq = rij[0]*rij[0] + rij[1]*rij[1] + rij[2]*rij[2]; - inorm = 1.0/sqrt(rsq); - eij[0] = inorm*rij[0]; - eij[1] = inorm*rij[1]; - eij[2] = inorm*rij[2]; - - if (rsq <= local_cut2) { - compute_neel(i,j,rsq,eij,fmi,spi,spj); - } + itype = type[ii]; + ntypes = atom->ntypes; + locflag = 0; + k = 1; + while (k <= ntypes) { + if (k <= itype) { + if (setflag[k][itype] == 1) { + locflag =1; + break; + } + k++; + } else if (k > itype) { + if (setflag[itype][k] == 1) { + locflag =1; + break; + } + k++; + } else error->all(FLERR,"Wrong type number"); } + // if interaction applies to type ii, + // locflag = 1 and compute pair interaction + + if (locflag == 1) { + + spi[0] = sp[ii][0]; + spi[1] = sp[ii][1]; + spi[2] = sp[ii][2]; + + xi[0] = x[ii][0]; + xi[1] = x[ii][1]; + xi[2] = x[ii][2]; + + eij[0] = eij[1] = eij[2] = 0.0; + + jlist = firstneigh[ii]; + jnum = numneigh[ii]; + + for (int jj = 0; jj < jnum; jj++) { + + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + + local_cut2 = cut_spin_neel[itype][jtype]*cut_spin_neel[itype][jtype]; + + spj[0] = sp[j][0]; + spj[1] = sp[j][1]; + spj[2] = sp[j][2]; + + rij[0] = x[j][0] - xi[0]; + rij[1] = x[j][1] - xi[1]; + rij[2] = x[j][2] - xi[2]; + rsq = rij[0]*rij[0] + rij[1]*rij[1] + rij[2]*rij[2]; + inorm = 1.0/sqrt(rsq); + eij[0] = inorm*rij[0]; + eij[1] = inorm*rij[1]; + eij[2] = inorm*rij[2]; + + if (rsq <= local_cut2) { + compute_neel(ii,j,rsq,eij,fmi,spi,spj); + } + } + } } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-ADIOS/Install.sh b/src/USER-ADIOS/Install.sh new file mode 100644 index 0000000000..434df14f60 --- /dev/null +++ b/src/USER-ADIOS/Install.sh @@ -0,0 +1,93 @@ +# Install/unInstall package files in LAMMPS +# mode = 0/1/2 for uninstall/install/update + +mode=$1 + +# arg1 = file, arg2 = file it depends on + +action () { + if (test $mode = 0) then + rm -f ../$1 + elif (! cmp -s $1 ../$1) then + if (test -z "$2" || test -e ../$2) then + cp $1 .. + if (test $mode = 2) then + echo " updating src/$1" + fi + fi + elif (test -n "$2") then + if (test ! -e ../$2) then + rm -f ../$1 + fi + fi +} + +for file in *.cpp *.h; do + action $file +done + +# edit 2 Makefile.package files to include/exclude package info + +if (test $1 = 1) then + + CONFIGSCRIPT=none + if ( test `which adios2-config 2>> /dev/null` ) then + CONFIGSCRIPT=adios2-config + elif ( ! test -z "$ADIOS2_DIR" ) then + if ( test `which $ADIOS2_DIR/bin/adios2-config` ) then + CONFIGSCRIPT=$ADIOS2_DIR/bin/adios2-config + else + echo "ERROR: ADIOS2_DIR environment variable is set but" \ + "\$ADIOS2_DIR/bin/adios2-config does not exist" + fi + elif ( ! test -z "$ADIOS_DIR" ) then + if ( test `which $ADIOS_DIR/bin/adios2-config` ) then + CONFIGSCRIPT=$ADIOS_DIR/bin/adios2-config + else + echo "ERROR: ADIOS_DIR environment variable is set but" \ + "\$ADIOS_DIR/bin/adios2-config does not exist" + fi + else + echo "ERROR: ADIOS2_DIR environment variable must point to ADIOS 2.x" \ + "installation directory or adios2-config should be in PATH" + fi + + if [ "$CONFIGSCRIPT" != "none" ]; then + ADIOS2_INC=`$CONFIGSCRIPT --cxx-flags` + ADIOS2_LIB=`$CONFIGSCRIPT --cxx-libs` + + echo "adios_SYSINC=${ADIOS2_INC} +adios_SYSLIB=${ADIOS2_LIB} +" > Makefile.lammps + + + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*adios[^ \t]* //g' ../Makefile.package + sed -i -e '/^adios_SYS.*$/d' ../Makefile.package + sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(adios_SYSINC) |' ../Makefile.package + sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(adios_SYSLIB) |' ../Makefile.package + fi + + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*ADIOS.*$/d' ../Makefile.package.settings + # multiline form needed for BSD sed on Macs + sed -i -e '4 i \ +include ../USER-ADIOS/Makefile.lammps +' ../Makefile.package.settings + fi + fi + +elif (test $1 = 0) then + + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*adios[^ \t]* //g' ../Makefile.package + sed -i -e '/^adios_SYS.*$/d' ../Makefile.package + fi + + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*ADIOS.*$/d' ../Makefile.package.settings + fi + + rm -f Makefile.lammps + +fi diff --git a/src/USER-ADIOS/README b/src/USER-ADIOS/README new file mode 100644 index 0000000000..49717a741f --- /dev/null +++ b/src/USER-ADIOS/README @@ -0,0 +1,16 @@ +This package provides the adios dump and restart styles. + +See the doc page for the "dump adios" and "restart adios" commands. +These styles require having ADIOS 2.x itself installed on your system. + +Configure LAMMPS with CMake + a. set the environment variable + ADIOS2_DIR + to the ADIOS 2.x installation path + b. use the cmake option + -D PKG_USER-ADIOS=yes + +The person who created this package is Norbert Podhorszki (Oak Ridge National Laboratory); +If you need help, please submit a ticket at the OLCF ticket user support mentioning his name in the ticket. +https://www.olcf.ornl.gov/support/submit-ticket + diff --git a/src/USER-ADIOS/dump_atom_adios.cpp b/src/USER-ADIOS/dump_atom_adios.cpp new file mode 100644 index 0000000000..55d6c5fbf9 --- /dev/null +++ b/src/USER-ADIOS/dump_atom_adios.cpp @@ -0,0 +1,339 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Norbert Podhorszki (ORNL) +------------------------------------------------------------------------- */ + +#include "dump_atom_adios.h" +#include "atom.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "memory.h" +#include "universe.h" +#include "update.h" +#include + +#include "adios2.h" + +using namespace LAMMPS_NS; + +#define MAX_TEXT_HEADER_SIZE 4096 +#define DUMP_BUF_CHUNK_SIZE 16384 +#define DUMP_BUF_INCREMENT_SIZE 4096 + +namespace LAMMPS_NS +{ +class DumpAtomADIOSInternal +{ + +public: + DumpAtomADIOSInternal(){}; + ~DumpAtomADIOSInternal() = default; + + // name of adios group, referrable in adios2_config.xml + const std::string ioName = "atom"; + adios2::ADIOS *ad = nullptr; // adios object + adios2::IO io; // adios group of variables and attributes in this dump + adios2::Engine fh; // adios file/stream handle object + // one ADIOS output variable we need to change every step + adios2::Variable varAtoms; +}; +} + +/* ---------------------------------------------------------------------- */ + +DumpAtomADIOS::DumpAtomADIOS(LAMMPS *lmp, int narg, char **arg) +: DumpAtom(lmp, narg, arg) +{ + internal = new DumpAtomADIOSInternal(); + internal->ad = + new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); +} + +/* ---------------------------------------------------------------------- */ + +DumpAtomADIOS::~DumpAtomADIOS() +{ + if (internal->fh) { + internal->fh.Close(); + } + delete internal->ad; + delete internal; +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomADIOS::openfile() +{ + if (multifile) { + // if one file per timestep, replace '*' with current timestep + char *filestar = strdup(filename); + char *filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar, '*'); + *ptr = '\0'; + if (padflag == 0) + snprintf(filecurrent, sizeof(filecurrent), "%s" BIGINT_FORMAT "%s", + filestar, update->ntimestep, ptr + 1); + else { + char bif[8], pad[16]; + strcpy(bif, BIGINT_FORMAT); + snprintf(pad, sizeof(pad), "%%s%%0%d%s%%s", padflag, &bif[1]); + snprintf(filecurrent, sizeof(filecurrent), pad, filestar, + update->ntimestep, ptr + 1); + } + internal->fh = + internal->io.Open(filecurrent, adios2::Mode::Write, world); + if (!internal->fh) { + char str[128]; + snprintf(str, sizeof(str), "Cannot open dump file %s", filecurrent); + error->one(FLERR, str); + } + free(filestar); + delete[] filecurrent; + } else { + if (!singlefile_opened) { + internal->fh = + internal->io.Open(filename, adios2::Mode::Write, world); + if (!internal->fh) { + char str[128]; + snprintf(str, sizeof(str), "Cannot open dump file %s", + filename); + error->one(FLERR, str); + } + singlefile_opened = 1; + } + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomADIOS::write() +{ + if (domain->triclinic == 0) { + boxxlo = domain->boxlo[0]; + boxxhi = domain->boxhi[0]; + boxylo = domain->boxlo[1]; + boxyhi = domain->boxhi[1]; + boxzlo = domain->boxlo[2]; + boxzhi = domain->boxhi[2]; + } else { + boxxlo = domain->boxlo_bound[0]; + boxxhi = domain->boxhi_bound[0]; + boxylo = domain->boxlo_bound[1]; + boxyhi = domain->boxhi_bound[1]; + boxzlo = domain->boxlo_bound[2]; + boxzhi = domain->boxhi_bound[2]; + boxxy = domain->xy; + boxxz = domain->xz; + boxyz = domain->yz; + } + + // nme = # of dump lines this proc contributes to dump + + nme = count(); + + // ntotal = total # of atoms in snapshot + // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) + + bigint bnme = nme; + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); + + bigint atomOffset; // sum of all atoms on processes 0..me-1 + MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); + atomOffset -= nme; // exclusive prefix sum needed + + // Now we know the global size and the local subset size and offset + // of the atoms table + size_t nAtomsGlobal = static_cast(ntotal); + size_t startRow = static_cast(atomOffset); + size_t nAtomsLocal = static_cast(nme); + size_t nColumns = static_cast(size_one); + internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); + internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); + + // insure buf is sized for packing + // adios does not limit per-process data size so nme*size_one is not + // constrained to int + // if sorting on IDs also request ID list from pack() + // sort buf as needed + + if (nme > maxbuf) { + maxbuf = nme; + memory->destroy(buf); + memory->create(buf, (maxbuf * size_one), "dump:buf"); + } + if (sort_flag && sortcol == 0 && nme > maxids) { + maxids = nme; + memory->destroy(ids); + memory->create(ids, maxids, "dump:ids"); + } + + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(NULL); + if (sort_flag) + sort(); + + openfile(); + internal->fh.BeginStep(); + // write info on data as scalars (by me==0) + if (me == 0) { + internal->fh.Put("ntimestep", update->ntimestep); + internal->fh.Put("nprocs", nprocs); + + internal->fh.Put("boxxlo", boxxlo); + internal->fh.Put("boxxhi", boxxhi); + internal->fh.Put("boxylo", boxylo); + internal->fh.Put("boxyhi", boxyhi); + internal->fh.Put("boxzlo", boxzlo); + internal->fh.Put("boxzhi", boxzhi); + + if (domain->triclinic) { + internal->fh.Put("boxxy", boxxy); + internal->fh.Put("boxxz", boxxz); + internal->fh.Put("boxyz", boxyz); + } + } + // Everyone needs to write scalar variables that are used as dimensions and + // offsets of arrays + internal->fh.Put("natoms", ntotal); + internal->fh.Put("ncolumns", size_one); + internal->fh.Put("nme", bnme); + internal->fh.Put("offset", atomOffset); + // now write the atoms + internal->fh.Put(internal->varAtoms, buf); + internal->fh.EndStep(); // I/O will happen now... + + if (multifile) { + internal->fh.Close(); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomADIOS::init_style() +{ + if (image_flag == 0) + size_one = 5; + else + size_one = 8; + + // setup boundary string + + domain->boundary_string(boundstr); + + // remove % from filename since ADIOS always writes a global file with + // data/metadata + int len = strlen(filename); + char *ptr = strchr(filename, '%'); + if (ptr) { + *ptr = '\0'; + char *s = new char[len - 1]; + snprintf(s, sizeof(s), "%s%s", filename, ptr + 1); + strncpy(filename, s, len); + } + + // setup column string + + if (scale_flag == 0 && image_flag == 0) + columns = (char *)"id type x y z"; + else if (scale_flag == 0 && image_flag == 1) + columns = (char *)"id type x y z ix iy iz"; + else if (scale_flag == 1 && image_flag == 0) + columns = (char *)"id type xs ys zs"; + else if (scale_flag == 1 && image_flag == 1) + columns = (char *)"id type xs ys zs ix iy iz"; + + // setup function ptrs + + if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0) + pack_choice = &DumpAtomADIOS::pack_scale_noimage; + else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 0) + pack_choice = &DumpAtomADIOS::pack_scale_image; + else if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 1) + pack_choice = &DumpAtomADIOS::pack_scale_noimage_triclinic; + else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 1) + pack_choice = &DumpAtomADIOS::pack_scale_image_triclinic; + else if (scale_flag == 0 && image_flag == 0) + pack_choice = &DumpAtomADIOS::pack_noscale_noimage; + else if (scale_flag == 0 && image_flag == 1) + pack_choice = &DumpAtomADIOS::pack_noscale_image; + + /* Define the group of variables for the atom style here since it's a fixed + * set */ + internal->io = internal->ad->DeclareIO(internal->ioName); + if (!internal->io.InConfigFile()) { + // if not defined by user, we can change the default settings + // BPFile is the default writer + internal->io.SetEngine("BPFile"); + int num_aggregators = multiproc; + if (num_aggregators == 0) + num_aggregators = 1; + char nstreams[128]; + snprintf(nstreams, sizeof(nstreams), "%d", num_aggregators); + internal->io.SetParameters({{"substreams", nstreams}}); + if (me == 0 && screen) + fprintf( + screen, + "ADIOS method for %s is n-to-m (aggregation with %s writers)\n", + filename, nstreams); + } + + internal->io.DefineVariable("ntimestep"); + internal->io.DefineVariable("natoms"); + + internal->io.DefineVariable("nprocs"); + internal->io.DefineVariable("ncolumns"); + + internal->io.DefineVariable("boxxlo"); + internal->io.DefineVariable("boxxhi"); + internal->io.DefineVariable("boxylo"); + internal->io.DefineVariable("boxyhi"); + internal->io.DefineVariable("boxzlo"); + internal->io.DefineVariable("boxzhi"); + + internal->io.DefineVariable("boxxy"); + internal->io.DefineVariable("boxxz"); + internal->io.DefineVariable("boxyz"); + + internal->io.DefineAttribute("triclinic", domain->triclinic); + internal->io.DefineAttribute("scaled", scale_flag); + internal->io.DefineAttribute("image", image_flag); + + int *boundaryptr = reinterpret_cast(domain->boundary); + internal->io.DefineAttribute("boundary", boundaryptr, 6); + + internal->io.DefineAttribute("columns", columns); + internal->io.DefineAttribute("boundarystr", boundstr); + internal->io.DefineAttribute("LAMMPS/dump_style", "atom"); + internal->io.DefineAttribute("LAMMPS/version", + universe->version); + internal->io.DefineAttribute("LAMMPS/num_ver", + universe->num_ver); + + internal->io.DefineVariable( + "nme", {adios2::LocalValueDim}); // local dimension variable + internal->io.DefineVariable( + "offset", {adios2::LocalValueDim}); // local dimension variable + + // atom table size is not known at the moment + // it will be correctly defined at the moment of write + size_t UnknownSizeYet = 1; + size_t nColumns = static_cast(size_one); + internal->varAtoms = internal->io.DefineVariable( + "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, + {UnknownSizeYet, nColumns}); +} diff --git a/src/USER-ADIOS/dump_atom_adios.h b/src/USER-ADIOS/dump_atom_adios.h new file mode 100644 index 0000000000..dc6bc519bb --- /dev/null +++ b/src/USER-ADIOS/dump_atom_adios.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef DUMP_CLASS +// clang-format off +DumpStyle(atom/adios, DumpAtomADIOS) +// clang-format on +#else + +#ifndef LMP_DUMP_ATOM_ADIOS_H +#define LMP_DUMP_ATOM_ADIOS_H + +#include "dump_atom.h" + +namespace LAMMPS_NS +{ + +class DumpAtomADIOSInternal; + +class DumpAtomADIOS : public DumpAtom +{ + +public: + DumpAtomADIOS(class LAMMPS *, int, char **); + virtual ~DumpAtomADIOS(); + +protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); + +private: + DumpAtomADIOSInternal *internal; +}; +} + +#endif +#endif + + /* ERROR/WARNING messages: + + E: Cannot open dump file %s + + The output file for the dump command cannot be opened. Check that the + path and name are correct. + + E: Too much per-proc info for dump + + Number of local atoms times number of columns must fit in a 32-bit + integer for dump. + + */ diff --git a/src/USER-ADIOS/dump_custom_adios.cpp b/src/USER-ADIOS/dump_custom_adios.cpp new file mode 100644 index 0000000000..67f3deeb64 --- /dev/null +++ b/src/USER-ADIOS/dump_custom_adios.cpp @@ -0,0 +1,435 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Norbert Podhorszki (ORNL) +------------------------------------------------------------------------- */ + +#include "dump_custom_adios.h" +#include "atom.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "region.h" +#include "universe.h" +#include "update.h" +#include "variable.h" +#include +#include + +#include "adios2.h" + +using namespace LAMMPS_NS; + +#define MAX_TEXT_HEADER_SIZE 4096 +#define DUMP_BUF_CHUNK_SIZE 16384 +#define DUMP_BUF_INCREMENT_SIZE 4096 + +enum { + ID, + MOL, + TYPE, + ELEMENT, + MASS, + X, + Y, + Z, + XS, + YS, + ZS, + XSTRI, + YSTRI, + ZSTRI, + XU, + YU, + ZU, + XUTRI, + YUTRI, + ZUTRI, + XSU, + YSU, + ZSU, + XSUTRI, + YSUTRI, + ZSUTRI, + IX, + IY, + IZ, + VX, + VY, + VZ, + FX, + FY, + FZ, + Q, + MUX, + MUY, + MUZ, + MU, + RADIUS, + DIAMETER, + OMEGAX, + OMEGAY, + OMEGAZ, + ANGMOMX, + ANGMOMY, + ANGMOMZ, + TQX, + TQY, + TQZ, + SPIN, + ERADIUS, + ERVEL, + ERFORCE, + COMPUTE, + FIX, + VARIABLE +}; +enum { LT, LE, GT, GE, EQ, NEQ }; +enum { INT, DOUBLE, STRING, BIGINT }; // same as in DumpCustom + +namespace LAMMPS_NS +{ +class DumpCustomADIOSInternal +{ + +public: + DumpCustomADIOSInternal(){}; + ~DumpCustomADIOSInternal() = default; + + // name of adios group, referrable in adios2_config.xml + const std::string ioName = "custom"; + adios2::ADIOS *ad = nullptr; // adios object + adios2::IO io; // adios group of variables and attributes in this dump + adios2::Engine fh; // adios file/stream handle object + // one ADIOS output variable we need to change every step + adios2::Variable varAtoms; + // list of column names for the atom table + // (individual list of 'columns' string) + std::vector columnNames; +}; +} + +/* ---------------------------------------------------------------------- */ + +DumpCustomADIOS::DumpCustomADIOS(LAMMPS *lmp, int narg, char **arg) +: DumpCustom(lmp, narg, arg) +{ + internal = new DumpCustomADIOSInternal(); + internal->ad = + new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); + + // if (screen) fprintf(screen, "DumpCustomADIOS constructor: nvariable=%d + // id_variable=%p, variables=%p, nfield=%d, earg=%p\n", nvariable, + // id_variable, variable, nfield, earg); + internal->columnNames.reserve(nfield); + for (int i = 0; i < nfield; ++i) { + internal->columnNames.push_back(earg[i]); + // if (screen) fprintf(screen, "earg[%d] = '%s'\n", i, earg[i]); + } +} + +/* ---------------------------------------------------------------------- */ + +DumpCustomADIOS::~DumpCustomADIOS() +{ + internal->columnNames.clear(); + if (internal->fh) { + internal->fh.Close(); + } + delete internal->ad; + delete internal; +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomADIOS::openfile() +{ + if (multifile) { + // if one file per timestep, replace '*' with current timestep + char *filestar = strdup(filename); + char *filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar, '*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, + update->ntimestep, ptr + 1); + else { + char bif[8], pad[16]; + strcpy(bif, BIGINT_FORMAT); + sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); + sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); + } + internal->fh = + internal->io.Open(filecurrent, adios2::Mode::Write, world); + if (!internal->fh) { + char str[128]; + sprintf(str, "Cannot open dump file %s", filecurrent); + error->one(FLERR, str); + } + free(filestar); + delete[] filecurrent; + } else { + if (!singlefile_opened) { + internal->fh = + internal->io.Open(filename, adios2::Mode::Write, world); + if (!internal->fh) { + char str[128]; + sprintf(str, "Cannot open dump file %s", filename); + error->one(FLERR, str); + } + singlefile_opened = 1; + } + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomADIOS::write() +{ + if (domain->triclinic == 0) { + boxxlo = domain->boxlo[0]; + boxxhi = domain->boxhi[0]; + boxylo = domain->boxlo[1]; + boxyhi = domain->boxhi[1]; + boxzlo = domain->boxlo[2]; + boxzhi = domain->boxhi[2]; + } else { + boxxlo = domain->boxlo_bound[0]; + boxxhi = domain->boxhi_bound[0]; + boxylo = domain->boxlo_bound[1]; + boxyhi = domain->boxhi_bound[1]; + boxzlo = domain->boxlo_bound[2]; + boxzhi = domain->boxhi_bound[2]; + boxxy = domain->xy; + boxxz = domain->xz; + boxyz = domain->yz; + } + + // nme = # of dump lines this proc contributes to dump + + nme = count(); + + // ntotal = total # of atoms in snapshot + // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) + + bigint bnme = nme; + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); + + bigint atomOffset; // sum of all atoms on processes 0..me-1 + MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); + atomOffset -= nme; // exclusive prefix sum needed + + // Now we know the global size and the local subset size and offset + // of the atoms table + size_t nAtomsGlobal = static_cast(ntotal); + size_t startRow = static_cast(atomOffset); + size_t nAtomsLocal = static_cast(nme); + size_t nColumns = static_cast(size_one); + internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); + internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); + + // insure filewriter proc can receive everyone's info + // limit nmax*size_one to int since used as arg in MPI_Rsend() below + // pack my data into buf + // if sorting on IDs also request ID list from pack() + // sort buf as needed + + if (nme > maxbuf) { + if ((bigint)nme * size_one > MAXSMALLINT) + error->all(FLERR, "Too much per-proc info for dump"); + maxbuf = nme; + memory->destroy(buf); + memory->create(buf, (maxbuf * size_one), "dump:buf"); + } + if (sort_flag && sortcol == 0 && nme > maxids) { + maxids = nme; + memory->destroy(ids); + memory->create(ids, maxids, "dump:ids"); + } + + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(NULL); + if (sort_flag) + sort(); + + openfile(); + internal->fh.BeginStep(); + // write info on data as scalars (by me==0) + if (me == 0) { + internal->fh.Put("ntimestep", update->ntimestep); + internal->fh.Put("nprocs", nprocs); + + internal->fh.Put("boxxlo", boxxlo); + internal->fh.Put("boxxhi", boxxhi); + internal->fh.Put("boxylo", boxylo); + internal->fh.Put("boxyhi", boxyhi); + internal->fh.Put("boxzlo", boxzlo); + internal->fh.Put("boxzhi", boxzhi); + + if (domain->triclinic) { + internal->fh.Put("boxxy", boxxy); + internal->fh.Put("boxxz", boxxz); + internal->fh.Put("boxyz", boxyz); + } + } + // Everyone needs to write scalar variables that are used as dimensions and + // offsets of arrays + internal->fh.Put("natoms", ntotal); + internal->fh.Put("ncolumns", size_one); + internal->fh.Put("nme", bnme); + internal->fh.Put("offset", atomOffset); + // now write the atoms + internal->fh.Put("atoms", buf); + internal->fh.EndStep(); // I/O will happen now... + + if (multifile) { + internal->fh.Close(); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomADIOS::init_style() +{ + + // setup boundary string + + domain->boundary_string(boundstr); + + // remove % from filename since ADIOS always writes a global file with + // data/metadata + int len = strlen(filename); + char *ptr = strchr(filename, '%'); + if (ptr) { + *ptr = '\0'; + char *s = new char[len - 1]; + sprintf(s, "%s%s", filename, ptr + 1); + strncpy(filename, s, len); + } + + /* The next four loops are copied from dump_custom_mpiio, but nothing is + * done with them. + * It is unclear why we need them here. + * For metadata, variable[] will be written out as an ADIOS attribute if + * nvariable>0 + */ + // find current ptr for each compute,fix,variable + // check that fix frequency is acceptable + int icompute; + for (int i = 0; i < ncompute; i++) { + icompute = modify->find_compute(id_compute[i]); + if (icompute < 0) + error->all(FLERR, "Could not find dump custom compute ID"); + compute[i] = modify->compute[icompute]; + } + + int ifix; + for (int i = 0; i < nfix; i++) { + ifix = modify->find_fix(id_fix[i]); + if (ifix < 0) + error->all(FLERR, "Could not find dump custom fix ID"); + fix[i] = modify->fix[ifix]; + if (nevery % modify->fix[ifix]->peratom_freq) + error->all(FLERR, + "Dump custom and fix not computed at compatible times"); + } + + int ivariable; + for (int i = 0; i < nvariable; i++) { + ivariable = input->variable->find(id_variable[i]); + if (ivariable < 0) + error->all(FLERR, "Could not find dump custom variable name"); + variable[i] = ivariable; + } + + // set index and check validity of region + if (iregion >= 0) { + iregion = domain->find_region(idregion); + if (iregion == -1) + error->all(FLERR, "Region ID for dump custom does not exist"); + } + + /* Define the group of variables for the atom style here since it's a fixed + * set */ + internal->io = internal->ad->DeclareIO(internal->ioName); + if (!internal->io.InConfigFile()) { + // if not defined by user, we can change the default settings + // BPFile is the default writer + internal->io.SetEngine("BPFile"); + int num_aggregators = multiproc; + if (num_aggregators == 0) + num_aggregators = 1; + char nstreams[128]; + sprintf(nstreams, "%d", num_aggregators); + internal->io.SetParameters({{"substreams", nstreams}}); + if (me == 0 && screen) + fprintf( + screen, + "ADIOS method for %s is n-to-m (aggregation with %s writers)\n", + filename, nstreams); + } + + internal->io.DefineVariable("ntimestep"); + internal->io.DefineVariable("natoms"); + + internal->io.DefineVariable("nprocs"); + internal->io.DefineVariable("ncolumns"); + + internal->io.DefineVariable("boxxlo"); + internal->io.DefineVariable("boxxhi"); + internal->io.DefineVariable("boxylo"); + internal->io.DefineVariable("boxyhi"); + internal->io.DefineVariable("boxzlo"); + internal->io.DefineVariable("boxzhi"); + + internal->io.DefineVariable("boxxy"); + internal->io.DefineVariable("boxxz"); + internal->io.DefineVariable("boxyz"); + + internal->io.DefineAttribute("triclinic", domain->triclinic); + + int *boundaryptr = reinterpret_cast(domain->boundary); + internal->io.DefineAttribute("boundary", boundaryptr, 6); + + size_t nColumns = static_cast(size_one); + internal->io.DefineAttribute( + "columns", internal->columnNames.data(), nColumns); + internal->io.DefineAttribute("columnstr", columns); + internal->io.DefineAttribute("boundarystr", boundstr); + internal->io.DefineAttribute("LAMMPS/dump_style", "atom"); + internal->io.DefineAttribute("LAMMPS/version", + universe->version); + internal->io.DefineAttribute("LAMMPS/num_ver", + universe->num_ver); + + internal->io.DefineVariable( + "nme", {adios2::LocalValueDim}); // local dimension variable + internal->io.DefineVariable( + "offset", {adios2::LocalValueDim}); // local dimension variable + + // atom table size is not known at the moment + // it will be correctly defined at the moment of write + size_t UnknownSizeYet = 1; + internal->varAtoms = internal->io.DefineVariable( + "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, + {UnknownSizeYet, nColumns}); +} diff --git a/src/USER-ADIOS/dump_custom_adios.h b/src/USER-ADIOS/dump_custom_adios.h new file mode 100644 index 0000000000..d5d41eb8c7 --- /dev/null +++ b/src/USER-ADIOS/dump_custom_adios.h @@ -0,0 +1,87 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef DUMP_CLASS +// clang-format off +DumpStyle(custom/adios, DumpCustomADIOS) +// clang-format on +#else + +#ifndef LMP_DUMP_CUSTOM_ADIOS_H +#define LMP_DUMP_CUSTOM_ADIOS_H + +#include "dump_custom.h" + +namespace LAMMPS_NS +{ + +class DumpCustomADIOSInternal; + +class DumpCustomADIOS : public DumpCustom +{ +public: + DumpCustomADIOS(class LAMMPS *, int, char **); + virtual ~DumpCustomADIOS(); + +protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); + +private: + DumpCustomADIOSInternal *internal; +}; +} + +#endif +#endif + + /* ERROR/WARNING messages: + + E: Cannot open dump file %s + + The output file for the dump command cannot be opened. Check that the + path and name are correct. + + E: Too much per-proc info for dump + + Number of local atoms times number of columns must fit in a 32-bit + integer for dump. + + E: Dump_modify format string is too short + + There are more fields to be dumped in a line of output than your + format string specifies. + + E: Could not find dump custom compute ID + + Self-explanatory. + + E: Could not find dump custom fix ID + + Self-explanatory. + + E: Dump custom and fix not computed at compatible times + + The fix must produce per-atom quantities on timesteps that dump custom + needs them. + + E: Could not find dump custom variable name + + Self-explanatory. + + E: Region ID for dump custom does not exist + + Self-explanatory. + + */ diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index bf11b1d6ba..7bdb8933e3 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -697,6 +697,11 @@ int FixBocs::read_F_table( char *filename, int p_basis_type ) "of %d in read_F_table",p_basis_type); error->all(FLERR,errmsg); } + // cleanup + for (i = 0; i < N_columns; ++i) { + free(data[i]); + } + free(data); return n_entries; } diff --git a/src/USER-PHONON/Install.sh b/src/USER-PHONON/Install.sh index 3428415443..a73f529cfa 100755 --- a/src/USER-PHONON/Install.sh +++ b/src/USER-PHONON/Install.sh @@ -40,3 +40,7 @@ fi action fix_phonon.cpp fft3d_wrap.h action fix_phonon.h fft3d_wrap.h +action dynamical_matrix.cpp +action dynamical_matrix.h +action third_order.cpp +action third_order.h diff --git a/src/USER-PHONON/README b/src/USER-PHONON/README index 2212eaaebd..b554eacd5e 100644 --- a/src/USER-PHONON/README +++ b/src/USER-PHONON/README @@ -1,19 +1,23 @@ This package contains a fix phonon command that calculates dynamical -matrices, which can then be used to compute phonon dispersion -relations, directly from molecular dynamics simulations. +matrices from finite temperature MD simulations, which can then be +used to compute phonon dispersion relations, directly from molecular +dynamics simulations. -See the doc page for the fix phonon command for detailed usage -instructions. +It also contains a command to compute the dynamical matrix at +pre-optimized positions through finite differences. + +See the doc page for the fix phonon command or the dynamical_matrix +command for detailed usage instructions. Use of this package requires building LAMMPS with FFT suppport, as described in doc/Section_start.html. -There are example scripts for using this package in +There are example scripts for using commands in this package in examples/USER/phonon. There is an auxiliary post-processing tool in tools/phonon that will compute phonon frequencies and dispersion relations from the dynamical -matrices output by this command. +matrices output by the fix phonon command. There is also an alternative code, dump2phonon, available which enables one to use the functions of fix-phonon by reading in atom-style dump @@ -21,6 +25,10 @@ files of lammps (which can be converted from the trajectories of any other MD code): https://github.com/lingtikong/dump2phonon -The person who created this package is Ling-Ti Kong (konglt at +The person who created fix phonon is Ling-Ti Kong (konglt at sjtu.edu.cn) at Shanghai Jiao Tong University. Contact him directly if you have questions. + +The person who created the dynamical_matrix command is Charlie Sievers +(charliesievers at cox.net) at UC Davis. Contact him directly if you +have questions about his code. diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp new file mode 100644 index 0000000000..372f4e4e31 --- /dev/null +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -0,0 +1,551 @@ +// +// Created by charlie sievers on 6/21/18. +// + +#include +#include +#include "dynamical_matrix.h" +#include "atom.h" +#include "modify.h" +#include "domain.h" +#include "comm.h" +#include "group.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "bond.h" +#include "angle.h" +#include "dihedral.h" +#include "improper.h" +#include "kspace.h" +#include "update.h" +#include "neighbor.h" +#include "pair.h" +#include "timer.h" +#include "finish.h" +#include + + +using namespace LAMMPS_NS; +enum{REGULAR,ESKM}; + +/* ---------------------------------------------------------------------- */ + +DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +{ + external_force_clear = 1; +} + +/* ---------------------------------------------------------------------- */ + +DynamicalMatrix::~DynamicalMatrix() +{ + if (fp && me == 0) fclose(fp); + memory->destroy(groupmap); + fp = NULL; +} + +/* ---------------------------------------------------------------------- + setup without output or one-time post-init setup + flag = 0 = just force calculation + flag = 1 = reneighbor and force calculation +------------------------------------------------------------------------- */ + +void DynamicalMatrix::setup() +{ + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + comm->setup(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); + neighbor->ncalls = 0; + neighbor->every = 2; // build every this many steps + neighbor->delay = 1; + neighbor->ago = 0; + neighbor->ndanger = 0; + + // compute all forces + external_force_clear = 0; + eflag=0; + vflag=0; + update_force(); + + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; inatoms; i++) + groupmap[i] = i; + else + create_groupmap(); +} + +/* ---------------------------------------------------------------------- */ + +void DynamicalMatrix::command(int narg, char **arg) +{ + MPI_Comm_rank(world,&me); + + if (domain->box_exist == 0) + error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); + if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); + + lmp->init(); + + // orthogonal vs triclinic simulation box + + triclinic = domain->triclinic; + + if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; + else pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; + else kspace_compute_flag = 0; + + // group and style + + igroup = group->find(arg[0]); + if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); + groupbit = group->bitmask[igroup]; + gcount = group->count(igroup); + dynlen = (gcount)*3; + memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); + update->setupflag = 1; + + int style = -1; + if (strcmp(arg[1],"regular") == 0) style = REGULAR; + else if (strcmp(arg[1],"eskm") == 0) style = ESKM; + else error->all(FLERR,"Illegal Dynamical Matrix command"); + del = force->numeric(FLERR, arg[2]); + + // set option defaults + + binaryflag = 0; + scaleflag = 0; + compressed = 0; + file_flag = 0; + file_opened = 0; + conversion = 1; + + // read options from end of input line + if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK + else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK + else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + + // move atoms by 3-vector or specified variable(s) + + if (style == REGULAR) { + setup(); + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } + + if (style == ESKM) { + setup(); + convert_units(update->unit_style); + conversion = conv_energy/conv_distance/conv_mass; + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } + + Finish finish(lmp); + finish.end(1); +} + +/* ---------------------------------------------------------------------- + parse optional parameters +------------------------------------------------------------------------- */ + +void DynamicalMatrix::options(int narg, char **arg) +{ + if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); + int iarg = 0; + const char* filename = "dynmat.dyn"; + while (iarg < narg) { + if (strcmp(arg[iarg],"binary") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"gzip") == 0) { + compressed = 1; + } + else if (strcmp(arg[iarg+1],"yes") == 0) { + binaryflag = 1; + } + iarg += 2; + } + else if (strcmp(arg[iarg],"file") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + filename = arg[iarg + 1]; + file_flag = 1; + iarg += 2; + } else error->all(FLERR,"Illegal dynamical_matrix command"); + } + if (file_flag == 1) { + openfile(filename); + } +} + +/* ---------------------------------------------------------------------- + generic opening of a file + ASCII or binary or gzipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DynamicalMatrix::openfile(const char* filename) +{ + // if file already opened, return + //if (me!=0) return; + if (file_opened) return; + + if (compressed) { +#ifdef LAMMPS_GZIP + char gzip[128]; + sprintf(gzip,"gzip -6 > %s",filename); +#ifdef _WIN32 + fp = _popen(gzip,"wb"); +#else + fp = popen(gzip,"w"); +#endif +#else + error->one(FLERR,"Cannot open gzipped file"); +#endif + } else if (binaryflag) { + fp = fopen(filename,"wb"); + } else { + fp = fopen(filename,"w"); + } + + if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + + file_opened = 1; +} + +/* ---------------------------------------------------------------------- + create dynamical matrix +------------------------------------------------------------------------- */ + +void DynamicalMatrix::calculateMatrix() +{ + int local_idx; // local index + int local_jdx; // second local index + int nlocal = atom->nlocal; + bigint natoms = atom->natoms; + int *type = atom->type; + int *gm = groupmap; + double imass; // dynamical matrix element + double *m = atom->mass; + double **f = atom->f; + + double **dynmat = new double*[3]; + for (int i=0; i<3; i++) + dynmat[i] = new double[dynlen]; + + double **fdynmat = new double*[3]; + for (int i=0; i<3; i++) + fdynmat[i] = new double[dynlen]; + + //initialize dynmat to all zeros + dynmat_clear(dynmat); + + if (comm->me == 0 && screen) fprintf(screen,"Calculating Dynamical Matrix...\n"); + + update->nsteps = 0; + for (bigint i=1; i<=natoms; i++){ + local_idx = atom->map(i); + for (bigint alpha=0; alpha<3; alpha++){ + displace_atom(local_idx, alpha, 1); + update_force(); + for (bigint j=1; j<=natoms; j++){ + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && gm[i-1] >= 0 && gm[j-1] >= 0){ + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(gm[j-1])*3+beta] -= f[local_jdx][beta]; + } + } + } + displace_atom(local_idx,alpha,-2); + update_force(); + for (bigint j=1; j<=natoms; j++){ + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && gm[i-1] >= 0 && gm[j-1] >= 0){ + for (bigint beta=0; beta<3; beta++){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + dynmat[alpha][(gm[j-1])*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][(gm[j-1])*3+beta] /= (2 * del * imass); + dynmat[alpha][(gm[j-1])*3+beta] *= conversion; + } + } + } + displace_atom(local_idx,alpha,1); + } + for (int k=0; k<3; k++) + MPI_Reduce(dynmat[k],fdynmat[k],dynlen,MPI_DOUBLE,MPI_SUM,0,world); + if (me == 0) + writeMatrix(fdynmat); + dynmat_clear(dynmat); + } + + for (int i=0; i < 3; i++) + delete [] dynmat[i]; + delete [] dynmat; + + for (int i=0; i < 3; i++) + delete [] fdynmat[i]; + delete [] fdynmat; + + if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); +} + +/* ---------------------------------------------------------------------- + write dynamical matrix +------------------------------------------------------------------------- */ + +void DynamicalMatrix::writeMatrix(double **dynmat) +{ + if (me != 0 || fp == NULL) return; + + // print file comment lines + + if (!binaryflag && fp) { + clearerr(fp); + for (int i = 0; i < 3; i++) { + for (bigint j = 0; j < dynlen; j++) { + if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); + else fprintf(fp, "%4.8f ",dynmat[i][j]); + } + } + } + if (ferror(fp)) + error->one(FLERR,"Error writing to file"); + + if (binaryflag && fp) { + clearerr(fp); + fwrite(&dynmat[0], sizeof(double), 3 * dynlen, fp); + if (ferror(fp)) + error->one(FLERR, "Error writing to binary file"); + } +} + +/* ---------------------------------------------------------------------- + Displace atoms + ---------------------------------------------------------------------- */ + +void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) +{ + if (local_idx < 0) return; + + double **x = atom->x; + int *sametag = atom->sametag; + int j = local_idx; + + x[local_idx][direction] += del*magnitude; + + while (sametag[j] >= 0){ + j = sametag[j]; + x[j][direction] += del*magnitude; + } +} + + +/* ---------------------------------------------------------------------- + evaluate potential energy and forces + may migrate atoms due to reneighboring + return new energy, which should include nextra_global dof + return negative gradient stored in atom->f + return negative gradient for nextra_global dof in fextra +------------------------------------------------------------------------- */ + +void DynamicalMatrix::update_force() +{ + force_clear(); + + if (pair_compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (atom->molecular) { + if (force->bond) force->bond->compute(eflag,vflag); + if (force->angle) force->angle->compute(eflag,vflag); + if (force->dihedral) force->dihedral->compute(eflag,vflag); + if (force->improper) force->improper->compute(eflag,vflag); + timer->stamp(Timer::BOND); + } + if (kspace_compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } + ++ update->nsteps; +} + +/* ---------------------------------------------------------------------- + clear force on own & ghost atoms + clear other arrays as needed +------------------------------------------------------------------------- */ + +void DynamicalMatrix::force_clear() +{ + if (external_force_clear) return; + + // clear global force array + // if either newton flag is set, also include ghosts + + size_t nbytes = sizeof(double) * atom->nlocal; + if (force->newton) nbytes += sizeof(double) * atom->nghost; + + if (nbytes) { + memset(&atom->f[0][0],0,3*nbytes); + } +} + +/* ---------------------------------------------------------------------- + clear dynmat needed +------------------------------------------------------------------------- */ + +void DynamicalMatrix::dynmat_clear(double **dynmat) +{ + + size_t nbytes = sizeof(double) * dynlen; + + if (nbytes) { + for (int i=0; i<3; i++) + memset(&dynmat[i][0],0,nbytes); + } +} + +/* ---------------------------------------------------------------------- */ + +void DynamicalMatrix::convert_units(const char *style) +{ + // physical constants from: + // http://physics.nist.gov/cuu/Constants/Table/allascii.txt + // using thermochemical calorie = 4.184 J + + if (strcmp(style,"lj") == 0) { + error->all(FLERR,"Conversion Not Set"); + //conversion = 1; // lj -> 10 J/mol + + } else if (strcmp(style,"real") == 0) { + conv_energy = 418.4; // kcal/mol -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom + + } else if (strcmp(style,"metal") == 0) { + conv_energy = 9648.5; // eV -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom + + } else if (strcmp(style,"si") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E22; // J -> 10 J/mol + conv_mass = 6.022E26; // kg -> g/mol + conv_distance = 1E-10; // meter -> angstrom + + } else if (strcmp(style,"cgs") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E12; // Erg -> 10 J/mol + conv_mass = 6.022E23; // g -> g/mol + conv_distance = 1E-7; // centimeter -> angstrom + + } else if (strcmp(style,"electron") == 0) { + conv_energy = 262550; // Hartree -> 10 J/mol + conv_mass = 1; // amu -> g/mol + conv_distance = 0.529177249; // bohr -> angstrom + + } else if (strcmp(style,"micro") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol + conv_mass = 6.022E11; // pg -> g/mol + conv_distance = 1E-4; // micrometer -> angstrom + + } else if (strcmp(style,"nano") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol + conv_mass = 6.022E5; // ag -> g/mol + conv_distance = 0.1; // angstrom -> angstrom + + } else error->all(FLERR,"Units Type Conversion Not Found"); + +} + +/* ---------------------------------------------------------------------- */ + +void DynamicalMatrix::create_groupmap() +{ + //Create a group map which maps atom order onto group + + int local_idx; // local index + int gid = 0; //group index + int nlocal = atom->nlocal; + int *mask = atom->mask; + bigint natoms = atom->natoms; + int *recv = new int[comm->nprocs]; + int *displs = new int[comm->nprocs]; + int *temp_groupmap = new int[natoms]; + + //find number of local atoms in the group (final_gid) + for (bigint i=1; i<=natoms; i++){ + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) + gid += 1; // gid at the end of loop is final_Gid + } + //create an array of length final_gid + int *sub_groupmap = new int[gid]; + + gid = 0; + //create a map between global atom id and group atom id for each proc + for (bigint i=1; i<=natoms; i++){ + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit){ + sub_groupmap[gid] = i; + gid += 1; + } + } + + //populate arrays for Allgatherv + for (int i=0; inprocs; i++){ + recv[i] = 0; + } + recv[comm->me] = gid; + MPI_Allreduce(recv,displs,4,MPI_INT,MPI_SUM,world); + for (int i=0; inprocs; i++){ + recv[i]=displs[i]; + if (i>0) displs[i] = displs[i-1]+recv[i-1]; + else displs[i] = 0; + } + + //combine subgroup maps into total temporary groupmap + MPI_Allgatherv(sub_groupmap,gid,MPI_INT,temp_groupmap,recv,displs,MPI_INT,world); + std::sort(temp_groupmap,temp_groupmap+gcount); + + //populate member groupmap based on temp groupmap + for (bigint i=0; icompute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped + + int nvec; // local atomic dof = length of xvec + + void update_force(); + void force_clear(); + virtual void openfile(const char* filename); + + private: + void options(int, char **); + void calculateMatrix(); + void dynmat_clear(double **dynmat); + void create_groupmap(); + void writeMatrix(double **dynmat); + void convert_units(const char *style); + void displace_atom(int local_idx, int direction, int magnitude); + + double conversion; + double conv_energy; + double conv_distance; + double conv_mass; + double del; + int igroup,groupbit; + bigint gcount; // number of atoms in group + bigint dynlen; // rank of dynamical matrix + int scaleflag; + int me; + int *groupmap; + + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat + + FILE *fp; + }; +} + + +#endif //LMP_DYNAMICAL_MATRIX_H +#endif diff --git a/src/USER-PTM/compute_ptm_atom.h b/src/USER-PTM/compute_ptm_atom.h index 5c10e0c443..586d7a44cd 100644 --- a/src/USER-PTM/compute_ptm_atom.h +++ b/src/USER-PTM/compute_ptm_atom.h @@ -35,7 +35,7 @@ class ComputePTMAtom : public Compute { private: int nmax; - int32_t input_flags; + smallint input_flags; double rmsd_threshold; class NeighList *list; double **output; diff --git a/src/USER-PTM/ptm_neighbour_ordering.h b/src/USER-PTM/ptm_neighbour_ordering.h index 4a4fb8ce8b..2a619880bb 100644 --- a/src/USER-PTM/ptm_neighbour_ordering.h +++ b/src/USER-PTM/ptm_neighbour_ordering.h @@ -11,6 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #define PTM_NEIGHBOUR_ORDERING_H #include +#include namespace ptm { diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c470173663..361733f3ca 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -41,17 +41,15 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : { // perform initial allocation of atom-based arrays // register with atom class - + + oldnmax = 0; num_bonds = NULL; num_hbonds = NULL; grow_arrays(atom->nmax); atom->add_callback(0); // initialize arrays to MIN so atom migration is OK the 1st time - - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) - num_bonds[i] = num_hbonds[i] = MIN_REAX_BONDS; + // it is done in grow_arrays() now // set comm sizes needed by this fix @@ -99,6 +97,11 @@ void FixReaxC::grow_arrays(int nmax) { memory->grow(num_bonds,nmax,"reaxc:num_bonds"); memory->grow(num_hbonds,nmax,"reaxc:num_hbonds"); + for (int i = oldnmax; i < nmax; i++) { + num_hbonds[i] = MIN_REAX_HBONDS; + num_bonds[i] = MIN_REAX_BONDS; + } + oldnmax = nmax; } /* ---------------------------------------------------------------------- diff --git a/src/USER-REAXC/fix_reaxc.h b/src/USER-REAXC/fix_reaxc.h index 0e173f5ece..6a37002847 100644 --- a/src/USER-REAXC/fix_reaxc.h +++ b/src/USER-REAXC/fix_reaxc.h @@ -56,6 +56,7 @@ class FixReaxC : public Fix { int maxhbonds; // max # of Hbonds for any atom int *num_bonds; // # of bonds for each atom int *num_hbonds; // # of Hbonds for each atom + int oldnmax; // arrays' size before growing }; } diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index c2690dc864..5c3189fc31 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include "pair_smtbq.h" #include "atom.h" #include "comm.h" @@ -122,7 +123,6 @@ PairSMTBQ::PairSMTBQ(LAMMPS *lmp) : Pair(lmp) sbcov = NULL; coord = NULL; sbmet = NULL; - chimet = NULL; ecov = NULL; potmad = NULL; @@ -187,6 +187,16 @@ PairSMTBQ::~PairSMTBQ() memory->destroy(potqn); memory->destroy(dpotqn); + memory->destroy(fafbOxOxSurf); + memory->destroy(dfafbOxOxSurf); + memory->destroy(fafbTiOxSurf); + memory->destroy(dfafbTiOxSurf); + + memory->destroy(fafbOxOxBB); + memory->destroy(dfafbOxOxBB); + memory->destroy(fafbTiOxBB); + memory->destroy(dfafbTiOxBB); + memory->destroy(ecov); memory->destroy(sbcov); memory->destroy(coord); @@ -199,7 +209,6 @@ PairSMTBQ::~PairSMTBQ() memory->destroy(potmad); memory->destroy(potself); memory->destroy(potcov); - memory->destroy(chimet); memory->destroy(nvsm); memory->destroy(vsm);; @@ -242,7 +251,7 @@ void PairSMTBQ::allocate() global settings ------------------------------------------------------------------------- */ -void PairSMTBQ::settings(int narg, char **/*arg*/) +void PairSMTBQ::settings(int narg, char ** /* arg */) { if (narg > 0) error->all(FLERR,"Illegal pair_style command"); } @@ -394,7 +403,13 @@ void PairSMTBQ::read_file(char *file) verbose = 1; verbose = 0; - // open file on all processors + coordOxBB = 0.0; + coordOxBulk = 0.0; + coordOxSurf = 0.0; + ROxBB = 0.0; + ROxSurf = 0.0; + + // open file on all processors FILE *fp; fp = force->open_potential(file); if ( fp == NULL ) { @@ -444,14 +459,12 @@ void PairSMTBQ::read_file(char *file) // load up parameter settings and error check their values - if (nparams == maxparam) { - maxparam += DELTA; - params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + nparams = maxparam = num_atom_types; + params = (Param *) memory->create(params,maxparam*sizeof(Param), "pair:params"); - maxintparam += m; - intparams = (Intparam *) memory->srealloc(intparams,(maxintparam+1)*sizeof(Intparam), + maxintparam = m; + intparams = (Intparam *) memory->create(intparams,(maxintparam+1)*sizeof(Intparam), "pair:intparams"); - } for (i=0; i < num_atom_types; i++) params[i].nom = (char*) malloc(sizeof(char)*3); @@ -828,7 +841,8 @@ void PairSMTBQ::read_file(char *file) } //A adapter au STO - ncov = min((params[0].sto)*(params[0].n0),(params[1].sto)*(params[1].n0)); + for (i=1,ncov=params[0].sto*params[0].n0; i < nparams; ++i) + ncov = min(ncov,(params[1].sto)*(params[1].n0)); if (verbose) printf (" Parametre ncov = %f\n",ncov); if (verbose) printf (" ********************************************* \n"); @@ -859,7 +873,6 @@ void PairSMTBQ::compute(int eflag, int vflag) memory->destroy(sbcov); memory->destroy(coord); memory->destroy(sbmet); - memory->destroy(chimet); memory->destroy(flag_QEq); memory->destroy(qf); memory->destroy(q1); @@ -875,7 +888,6 @@ void PairSMTBQ::compute(int eflag, int vflag) memory->create(sbcov,nmax,"pair:sbcov"); memory->create(coord,nmax,"pair:coord"); memory->create(sbmet,nmax,"pair:sbmet"); - memory->create(chimet,nmax,"pair:chimet"); memory->create(flag_QEq,nmax,"pair:flag_QEq"); memory->create(qf,nmax,"pair:qf"); memory->create(q1,nmax,"pair:q1"); @@ -1312,10 +1324,7 @@ void PairSMTBQ::tabqeq() memory->create(sbcov,nmax,"pair:sbcov"); memory->create(coord,nmax,"pair:coord"); memory->create(sbmet,nmax,"pair:sbmet"); - memory->create(chimet,nmax,"pair:chimet"); - // memory->create(nvsm,nmax,"pair:nvsm"); - // memory->create(vsm,nmax,nmax,"pair:vsm"); memory->create(flag_QEq,nmax,"pair:flag_QEq"); memory->create(qf,nmax,"pair:qf"); @@ -2529,10 +2538,10 @@ void PairSMTBQ::Charge() // --------------------------- - double enegtotall[nteam+1],enegchkall[nteam+1],enegmaxall[nteam+1],qtota[nteam+1],qtotc[nteam+1]; - double qtotcll[nteam+1],qtotall[nteam+1]; - double sigmaa[nteam+1],sigmac[nteam+1],sigmaall[nteam+1],sigmacll[nteam+1]; - int end[nteam+1], nQEq[nteam+1],nQEqc[nteam+1],nQEqa[nteam+1]; + std::vector enegtotall(nteam+1),enegchkall(nteam+1),enegmaxall(nteam+1); + std::vector qtotcll(nteam+1),qtotall(nteam+1),qtota(nteam+1),qtotc(nteam+1); + std::vector sigmaa(nteam+1),sigmac(nteam+1),sigmaall(nteam+1),sigmacll(nteam+1); + std::vector end(nteam+1), nQEq(nteam+1),nQEqc(nteam+1),nQEqa(nteam+1); iloop = 0; @@ -2543,9 +2552,7 @@ void PairSMTBQ::Charge() dtq = 0.0006; // 0.0006 dtq2 = 0.5*dtq*dtq/qmass; - double enegchk[nteam+1]; - double enegtot[nteam+1]; - double enegmax[nteam+1]; + std::vector enegchk(nteam+1),enegtot(nteam+1),enegmax(nteam+1); @@ -2570,12 +2577,12 @@ void PairSMTBQ::Charge() if (itype == 0) { qtota[gp] += q[i]; nQEqa[gp] += 1; } } - MPI_Allreduce(nQEq,nQEqall,nteam+1,MPI_INT,MPI_SUM,world); - MPI_Allreduce(nQEqc,nQEqcall,nteam+1,MPI_INT,MPI_SUM,world); - MPI_Allreduce(nQEqa,nQEqaall,nteam+1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(nQEq.data(),nQEqall,nteam+1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(nQEqc.data(),nQEqcall,nteam+1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(nQEqa.data(),nQEqaall,nteam+1,MPI_INT,MPI_SUM,world); - MPI_Allreduce(qtotc,qtotcll,nteam+1,MPI_DOUBLE,MPI_SUM,world); - MPI_Allreduce(qtota,qtotall,nteam+1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(qtotc.data(),qtotcll.data(),nteam+1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(qtota.data(),qtotall.data(),nteam+1,MPI_DOUBLE,MPI_SUM,world); MPI_Allreduce(&qtot,&qtotll,1,MPI_DOUBLE,MPI_SUM,world); @@ -2667,7 +2674,8 @@ void PairSMTBQ::Charge() gp = flag_QEq[i]; qf[i] = 0.0; - qf[i] = potself[i]+potmad[i]+potcov[i]+chimet[i] ; + // AK: chimet is not set anywhere + qf[i] = potself[i]+potmad[i]+potcov[i]; // +chimet[i]; Transf[gp] += qf[i]; } @@ -2694,8 +2702,8 @@ void PairSMTBQ::Charge() } // Boucle local - MPI_Allreduce(enegchk,enegchkall,nteam+1,MPI_DOUBLE,MPI_SUM,world); - MPI_Allreduce(enegmax,enegmaxall,nteam+1,MPI_DOUBLE,MPI_MAX,world); + MPI_Allreduce(enegchk.data(),enegchkall.data(),nteam+1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(enegmax.data(),enegmaxall.data(),nteam+1,MPI_DOUBLE,MPI_MAX,world); for (gp = 0; gp < nteam+1; gp++) { @@ -2783,8 +2791,8 @@ void PairSMTBQ::Charge() if (itype == 1) sigmac[gp] += (q[i]-TransfAll[gp+cluster])*(q[i]-TransfAll[gp+cluster]); } - MPI_Allreduce(sigmaa,sigmaall,nteam+1,MPI_DOUBLE,MPI_SUM,world); - MPI_Allreduce(sigmac,sigmacll,nteam+1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(sigmaa.data(),sigmaall.data(),nteam+1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(sigmac.data(),sigmacll.data(),nteam+1,MPI_DOUBLE,MPI_SUM,world); for (gp = 1; gp < nteam+1; gp++) { sigmaall[gp] = sqrt(sigmaall[gp]/static_cast(nQEqaall[gp])) ; @@ -2886,11 +2894,12 @@ void PairSMTBQ::groupSurface_QEq() void PairSMTBQ::groupQEqAllParallel_QEq() { int ii,i,jj,j,kk,k,itype,jtype,ktype,jnum,m,gp,zz,z,kgp; - int iproc,team_elt[10][nproc],team_QEq[10][nproc][5]; + int iproc; // ,team_elt[10][nproc],team_QEq[10][nproc][5]; + int **team_elt,***team_QEq; int *ilist,*jlist,*numneigh,**firstneigh,ngp,igp; double delr[3],xtmp,ytmp,ztmp,rsq; int **flag_gp, *nelt, **tab_gp; - int QEq,QEqall[nproc]; + int QEq,*QEqall; double **x = atom->x; int *type = atom->type; @@ -2918,6 +2927,9 @@ void PairSMTBQ::groupQEqAllParallel_QEq() memory->create(nelt,nall,"pair:nelt"); memory->create(tab_gp,10,nall,"pair:flag_gp"); + memory->create(team_elt,10,nproc,"pair:team_elt"); + memory->create(team_QEq,10,nproc,5,"pair:team_QEq"); + memory->create(QEqall,nproc,"pair:QEqall"); for (i = 0; i < nall ; i++) { flag_QEq[i] = 0; } for (i = 0; i < 10*nproc; i++) { @@ -2993,6 +3005,9 @@ void PairSMTBQ::groupQEqAllParallel_QEq() memory->destroy(tab_gp); memory->destroy(nelt); + memory->destroy(team_elt); + memory->destroy(team_QEq); + memory->destroy(QEqall); return; } // ::::::::::::::::::::::::::::::::::::::::::::::::::::::: @@ -3330,6 +3345,9 @@ void PairSMTBQ::groupQEqAllParallel_QEq() memory->destroy(tab_gp); memory->destroy(nelt); + memory->destroy(team_elt); + memory->destroy(team_QEq); + memory->destroy(QEqall); } /* ---------------------------------------------------------------------- */ @@ -3337,7 +3355,8 @@ void PairSMTBQ::groupQEqAllParallel_QEq() void PairSMTBQ::Init_charge(int * /*nQEq*/, int * /*nQEqa*/, int * /*nQEqc*/) { int ii,i,gp,itype; - int *ilist,test[nteam],init[nteam]; + int *ilist; + std::vector test(cluster),init(cluster); double bound,tot,totll; int inum = list->inum; @@ -3367,7 +3386,8 @@ void PairSMTBQ::Init_charge(int * /*nQEq*/, int * /*nQEqa*/, int * /*nQEqc*/) } } - MPI_Allreduce(test,init,nteam+1,MPI_INT,MPI_SUM,world); + // TODO + MPI_Allreduce(test.data(),init.data(),cluster,MPI_INT,MPI_SUM,world); // On fait que sur les atomes hybrides!!! // ---------------------------------------- diff --git a/src/USER-SMTBQ/pair_smtbq.h b/src/USER-SMTBQ/pair_smtbq.h index ac8ed70ac0..05e4b67242 100644 --- a/src/USER-SMTBQ/pair_smtbq.h +++ b/src/USER-SMTBQ/pair_smtbq.h @@ -90,7 +90,7 @@ protected: double coordOxBulk,coordOxSurf,ROxSurf,coordOxBB,ROxBB; // Covalent interaction - double *ecov, *potmad, *potself, *potcov, *chimet; + double *ecov, *potmad, *potself, *potcov; //, *chimet; double **tabsmb,**dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; double ncov; diff --git a/src/atom.cpp b/src/atom.cpp index be4d12d52e..34ea253751 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -58,6 +58,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) natoms = 0; nlocal = nghost = nmax = 0; ntypes = 0; + nellipsoids = nlines = ntris = nbodies = 0; nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; nbonds = nangles = ndihedrals = nimpropers = 0; @@ -738,6 +739,45 @@ int Atom::tag_consecutive() return 1; } +/* ---------------------------------------------------------------------- + check that bonus data settings are valid + error if number of atoms with ellipsoid/line/tri/body flags + are consistent with global setting. +------------------------------------------------------------------------- */ + +void Atom::bonus_check() +{ + bigint local_ellipsoids = 0, local_lines = 0, local_tris = 0; + bigint local_bodies = 0, num_global; + + for (int i = 0; i < nlocal; ++i) { + if (ellipsoid && (ellipsoid[i] >=0)) ++local_ellipsoids; + if (line && (line[i] >=0)) ++local_lines; + if (tri && (tri[i] >=0)) ++local_tris; + if (body && (body[i] >=0)) ++local_bodies; + } + + MPI_Allreduce(&local_ellipsoids,&num_global,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (nellipsoids != num_global) + error->all(FLERR,"Inconsistent 'ellipsoids' header value and number of " + "atoms with enabled ellipsoid flags"); + + MPI_Allreduce(&local_lines,&num_global,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (nlines != num_global) + error->all(FLERR,"Inconsistent 'lines' header value and number of " + "atoms with enabled line flags"); + + MPI_Allreduce(&local_tris,&num_global,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (ntris != num_global) + error->all(FLERR,"Inconsistent 'tris' header value and number of " + "atoms with enabled tri flags"); + + MPI_Allreduce(&local_bodies,&num_global,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (nbodies != num_global) + error->all(FLERR,"Inconsistent 'bodies' header value and number of " + "atoms with enabled body flags"); +} + /* ---------------------------------------------------------------------- count and return words in a single line make copy of line before using strtok so as not to change line diff --git a/src/atom.h b/src/atom.h index 324ad0f2d2..b2a657cf1a 100644 --- a/src/atom.h +++ b/src/atom.h @@ -34,6 +34,10 @@ class Atom : protected Pointers { int tag_enable; // 0/1 if atom ID tags are defined int molecular; // 0 = atomic, 1 = standard molecular system, // 2 = molecule template system + bigint nellipsoids; // number of ellipsoids + bigint nlines; // number of lines + bigint ntris; // number of triangles + bigint nbodies; // number of bodies bigint nbonds,nangles,ndihedrals,nimpropers; int ntypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; @@ -233,6 +237,8 @@ class Atom : protected Pointers { void tag_extend(); int tag_consecutive(); + void bonus_check(); + int parse_data(const char *); int count_words(const char *); int count_words(const char *, char *); diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 5a277627ee..893a4c7dc4 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -1286,7 +1286,7 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values) body[nlocal] = atoi(values[2]); if (body[nlocal] == 0) body[nlocal] = -1; else if (body[nlocal] == 1) body[nlocal] = 0; - else error->one(FLERR,"Invalid atom type in Atoms section of data file"); + else error->one(FLERR,"Invalid bodyflag in Atoms section of data file"); rmass[nlocal] = atof(values[3]); if (rmass[nlocal] <= 0.0) diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 3244b0f64d..7cc052b6c5 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -92,6 +92,8 @@ class AtomVecBody : public AtomVec { double radius_body(int, int, int *, double *); void set_quat(int, double *); + int nlocal_bonus; + private: tagint *tag; int *type,*mask; @@ -102,7 +104,7 @@ class AtomVecBody : public AtomVec { double **angmom,**torque; int *body; - int nlocal_bonus,nghost_bonus,nmax_bonus; + int nghost_bonus,nmax_bonus; int intdoubleratio; // sizeof(double) / sizeof(int) MyPoolChunk *icp; diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index c569f89a09..2bf3f683d0 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -1148,7 +1148,7 @@ void AtomVecEllipsoid::data_atom(double *coord, imageint imagetmp, ellipsoid[nlocal] = atoi(values[2]); if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1; else if (ellipsoid[nlocal] == 1) ellipsoid[nlocal] = 0; - else error->one(FLERR,"Invalid atom type in Atoms section of data file"); + else error->one(FLERR,"Invalid ellipsoidflag in Atoms section of data file"); rmass[nlocal] = atof(values[3]); if (rmass[nlocal] <= 0.0) diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index 6beb68b176..d71859624e 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -83,6 +83,8 @@ class AtomVecEllipsoid : public AtomVec { void set_shape(int, double, double, double); + int nlocal_bonus; + private: tagint *tag; int *type,*mask; @@ -92,7 +94,7 @@ class AtomVecEllipsoid : public AtomVec { double **angmom,**torque; int *ellipsoid; - int nlocal_bonus,nghost_bonus,nmax_bonus; + int nghost_bonus,nmax_bonus; void grow_bonus(); void copy_bonus(int, int); diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 9babfe3735..020b622c93 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -1044,7 +1044,7 @@ void AtomVecLine::data_atom(double *coord, imageint imagetmp, char **values) line[nlocal] = atoi(values[3]); if (line[nlocal] == 0) line[nlocal] = -1; else if (line[nlocal] == 1) line[nlocal] = 0; - else error->one(FLERR,"Invalid atom type in Atoms section of data file"); + else error->one(FLERR,"Invalid lineflag in Atoms section of data file"); rmass[nlocal] = atof(values[4]); if (rmass[nlocal] <= 0.0) diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index 7f07532fa4..6c8701cfc2 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -83,6 +83,8 @@ class AtomVecLine : public AtomVec { void set_length(int, double); + int nlocal_bonus; + private: tagint *tag; int *type,*mask; @@ -93,7 +95,7 @@ class AtomVecLine : public AtomVec { double **omega,**torque; int *line; - int nlocal_bonus,nghost_bonus,nmax_bonus; + int nghost_bonus,nmax_bonus; void grow_bonus(); void copy_bonus(int, int); diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index 2c31b95cfe..8fbe0a92dc 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -1443,7 +1443,7 @@ void AtomVecTri::data_atom(double *coord, imageint imagetmp, char **values) tri[nlocal] = atoi(values[3]); if (tri[nlocal] == 0) tri[nlocal] = -1; else if (tri[nlocal] == 1) tri[nlocal] = 0; - else error->one(FLERR,"Invalid atom type in Atoms section of data file"); + else error->one(FLERR,"Invalid triflag in Atoms section of data file"); rmass[nlocal] = atof(values[4]); if (rmass[nlocal] <= 0.0) diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index 390efc7c10..81b4c1ada9 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -85,6 +85,8 @@ class AtomVecTri : public AtomVec { void set_equilateral(int, double); + int nlocal_bonus; + private: tagint *tag; int *type,*mask; @@ -95,7 +97,7 @@ class AtomVecTri : public AtomVec { double **omega,**angmom,**torque; int *tri; - int nlocal_bonus,nghost_bonus,nmax_bonus; + int nghost_bonus,nmax_bonus; void grow_bonus(); void copy_bonus(int, int); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index ba04de026d..cb0da42970 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -705,6 +705,26 @@ void CreateAtoms::add_lattice() bboxlo[2] = domain->sublo[2]; bboxhi[2] = domain->subhi[2]; } else domain->bbox(domain->sublo_lamda,domain->subhi_lamda,bboxlo,bboxhi); + // narrow down the subbox by the bounding box of the given region, if available. + // for small regions in large boxes, this can result in a significant speedup + + if ((style == REGION) && domain->regions[nregion]->bboxflag) { + + const double rxmin = domain->regions[nregion]->extent_xlo; + const double rxmax = domain->regions[nregion]->extent_xhi; + const double rymin = domain->regions[nregion]->extent_ylo; + const double rymax = domain->regions[nregion]->extent_yhi; + const double rzmin = domain->regions[nregion]->extent_zlo; + const double rzmax = domain->regions[nregion]->extent_zhi; + + if (rxmin > bboxlo[0]) bboxlo[0] = (rxmin > bboxhi[0]) ? bboxhi[0] : rxmin; + if (rxmax < bboxhi[0]) bboxhi[0] = (rxmax < bboxlo[0]) ? bboxlo[0] : rxmax; + if (rymin > bboxlo[1]) bboxlo[1] = (rymin > bboxhi[1]) ? bboxhi[1] : rymin; + if (rymax < bboxhi[1]) bboxhi[1] = (rymax < bboxlo[1]) ? bboxlo[1] : rymax; + if (rzmin > bboxlo[2]) bboxlo[2] = (rzmin > bboxhi[2]) ? bboxhi[2] : rzmin; + if (rzmax < bboxhi[2]) bboxhi[2] = (rzmax < bboxlo[2]) ? bboxlo[2] : rzmax; + } + double xmin,ymin,zmin,xmax,ymax,zmax; xmin = ymin = zmin = BIG; xmax = ymax = zmax = -BIG; diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index ec713b8b84..41df167f07 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -16,6 +16,10 @@ #include "delete_atoms.h" #include "atom.h" #include "atom_vec.h" +#include "atom_vec_ellipsoid.h" +#include "atom_vec_line.h" +#include "atom_vec_tri.h" +#include "atom_vec_body.h" #include "molecule.h" #include "comm.h" #include "domain.h" @@ -121,11 +125,39 @@ void DeleteAtoms::command(int narg, char **arg) } // reset atom->natoms and also topology counts - // reset atom->map if it exists - // set nghost to 0 so old ghosts of deleted atoms won't be mapped bigint nblocal = atom->nlocal; MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + + // reset bonus data counts + + AtomVecEllipsoid *avec_ellipsoid = + (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); + AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); + AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); + bigint nlocal_bonus; + + if (atom->nellipsoids > 0) { + nlocal_bonus = avec_ellipsoid->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->nellipsoids,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + if (atom->nlines > 0) { + nlocal_bonus = avec_line->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->nlines,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + if (atom->ntris > 0) { + nlocal_bonus = avec_tri->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->ntris,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + if (atom->nbodies > 0) { + nlocal_bonus = avec_body->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->nbodies,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + + // reset atom->map if it exists + // set nghost to 0 so old ghosts of deleted atoms won't be mapped + if (atom->map_style) { atom->nghost = 0; atom->map_init(); diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index d829982274..36ea47daf6 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -177,8 +177,6 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } } - if (tallyflag && zeroflag && comm->me == 0) - error->warning(FLERR,"Energy tally does not account for 'zero yes'"); } /* ---------------------------------------------------------------------- */ @@ -605,6 +603,11 @@ void FixLangevin::post_force_untemplated f[i][0] -= fsumall[0]; f[i][1] -= fsumall[1]; f[i][2] -= fsumall[2]; + if (Tp_TALLY) { + flangevin[i][0] -= fsumall[0]; + flangevin[i][1] -= fsumall[1]; + flangevin[i][2] -= fsumall[2]; + } } } } diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 2883ac9ea2..024e7a9539 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -104,12 +104,6 @@ E: Fix langevin period must be > 0.0 The time window for temperature relaxation must be > 0 -W: Energy tally does not account for 'zero yes' - -The energy removed by using the 'zero yes' flag is not accounted -for in the energy tally and thus energy conservation cannot be -monitored in this case. - E: Fix langevin omega requires atom style sphere Self-explanatory. diff --git a/src/group.cpp b/src/group.cpp index 3bc3f3d7bf..6c19af8bc6 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -207,6 +207,12 @@ void Group::assign(int narg, char **arg) else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE; else if (strcmp(arg[1],"id") == 0) category = ID; + if ((category == MOLECULE) && (!atom->molecular)) + error->all(FLERR,"Group command requires atom attribute molecule"); + + if ((category == ID) && (!atom->tag_enable)) + error->all(FLERR,"Group command requires atom IDs"); + // args = logical condition if (narg > 3 && @@ -362,10 +368,13 @@ void Group::assign(int narg, char **arg) } else if (strcmp(arg[1],"include") == 0) { if (narg != 3) error->all(FLERR,"Illegal group command"); - if (strcmp(arg[2],"molecule") != 0) - error->all(FLERR,"Illegal group command"); + if (strcmp(arg[2],"molecule") == 0) { + if (!atom->molecular) + error->all(FLERR,"Group command requires atom attribute molecule"); - add_molecules(igroup,bit); + add_molecules(igroup,bit); + + } else error->all(FLERR,"Illegal group command"); // style = subtract diff --git a/src/info.cpp b/src/info.cpp index 983a1e9e92..3d8a8d7b9e 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -260,9 +260,14 @@ void Info::command(int narg, char **arg) fprintf(out,"Printed on %s\n",ctime(&now)); if (flags & CONFIG) { - fprintf(out,"\nLAMMPS version: %s / %s\n\n", - universe->version, universe->num_ver); - + if (lmp->has_git_info) { + fprintf(out,"\nLAMMPS version: %s / %s\nGit info: %s / %s / %s\n\n", + universe->version, universe->num_ver,lmp->git_branch, + lmp->git_descriptor,lmp->git_commit); + } else { + fprintf(out,"\nLAMMPS version: %s / %s\n\n", + universe->version, universe->num_ver); + } const char *infobuf = get_os_info(); fprintf(out,"OS information: %s\n\n",infobuf); delete[] infobuf; diff --git a/src/lammps.cpp b/src/lammps.cpp index 8a23a4297b..2b3f001b09 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -52,6 +52,7 @@ #include "error.h" #include "lmpinstalledpkgs.h" +#include "lmpgitversion.h" using namespace LAMMPS_NS; @@ -898,9 +899,14 @@ void LAMMPS::help() // general help message about command line and flags + if (has_git_info) { + fprintf(fp,"\nLarge-scale Atomic/Molecular Massively Parallel Simulator - " + LAMMPS_VERSION "\nGit info (%s / %s)\n\n",git_branch, git_descriptor); + } else { + fprintf(fp,"\nLarge-scale Atomic/Molecular Massively Parallel Simulator - " + LAMMPS_VERSION "\n\n"); + } fprintf(fp, - "\nLarge-scale Atomic/Molecular Massively Parallel Simulator - " - LAMMPS_VERSION "\n\n" "Usage example: %s -var t 300 -echo screen -in in.alloy\n\n" "List of command line options supported by this LAMMPS executable:\n\n" "-echo none/screen/log/both : echoing of input script (-e)\n" diff --git a/src/lammps.h b/src/lammps.h index 151b4fc49b..2e052e5ed2 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -65,6 +65,11 @@ class LAMMPS { static const char * installed_packages[]; + static const bool has_git_info; + static const char git_commit[]; + static const char git_branch[]; + static const char git_descriptor[]; + LAMMPS(int, char **, MPI_Comm); ~LAMMPS(); void create(); diff --git a/src/library.cpp b/src/library.cpp index 429dd14cd9..d8c55159a2 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1363,9 +1363,11 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, int *dptr = (int *) data; if (count == 1) { - for (i = 0; i < ndata; i++) - if ((m = lmp->atom->map(i+1)) >= 0) + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) vector[m] = dptr[i]; + } } else if (imgpack) { for (i = 0; i < ndata; i++) { diff --git a/src/read_data.cpp b/src/read_data.cpp index a640368fb0..2f4484010b 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -396,7 +396,8 @@ void ReadData::command(int narg, char **arg) // values in this data file - natoms = ntypes = 0; + natoms = 0; + ntypes = 0; nbonds = nangles = ndihedrals = nimpropers = 0; nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; @@ -993,18 +994,29 @@ void ReadData::header(int firstpass) if (!avec_ellipsoid) error->all(FLERR,"No ellipsoids allowed with this atom style"); sscanf(line,BIGINT_FORMAT,&nellipsoids); + if (addflag == NONE) atom->nellipsoids = nellipsoids; + else if (firstpass) atom->nellipsoids += nellipsoids; + } else if (strstr(line,"lines")) { if (!avec_line) error->all(FLERR,"No lines allowed with this atom style"); sscanf(line,BIGINT_FORMAT,&nlines); + if (addflag == NONE) atom->nlines = nlines; + else if (firstpass) atom->nlines += nlines; + } else if (strstr(line,"triangles")) { if (!avec_tri) error->all(FLERR,"No triangles allowed with this atom style"); sscanf(line,BIGINT_FORMAT,&ntris); + if (addflag == NONE) atom->ntris = ntris; + else if (firstpass) atom->ntris += ntris; + } else if (strstr(line,"bodies")) { if (!avec_body) error->all(FLERR,"No bodies allowed with this atom style"); sscanf(line,BIGINT_FORMAT,&nbodies); + if (addflag == NONE) atom->nbodies = nbodies; + else if (firstpass) atom->nbodies += nbodies; } else if (strstr(line,"bonds")) { sscanf(line,BIGINT_FORMAT,&nbonds); @@ -1084,6 +1096,10 @@ void ReadData::header(int firstpass) // error check on total system size if (atom->natoms < 0 || atom->natoms >= MAXBIGINT || + atom->nellipsoids < 0 || atom->nellipsoids >= MAXBIGINT || + atom->nlines < 0 || atom->nlines >= MAXBIGINT || + atom->ntris < 0 || atom->ntris >= MAXBIGINT || + atom->nbodies < 0 || atom->nbodies >= MAXBIGINT || atom->nbonds < 0 || atom->nbonds >= MAXBIGINT || atom->nangles < 0 || atom->nangles >= MAXBIGINT || atom->ndihedrals < 0 || atom->ndihedrals >= MAXBIGINT || @@ -1174,6 +1190,10 @@ void ReadData::atoms() atom->tag_check(); + // check that bonus data has been reserved as needed + + atom->bonus_check(); + // create global mapping of atoms if (atom->map_style) { diff --git a/src/set.cpp b/src/set.cpp index 34b86ea328..00b2d8a9b0 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -964,6 +964,21 @@ void Set::set(int keyword) count++; } + // update bonus data numbers + if (keyword == SHAPE) { + bigint nlocal_bonus = avec_ellipsoid->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->nellipsoids,1, + MPI_LMP_BIGINT,MPI_SUM,world); + } + if (keyword == LENGTH) { + bigint nlocal_bonus = avec_line->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->nlines,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + if (keyword == TRI) { + bigint nlocal_bonus = avec_tri->nlocal_bonus; + MPI_Allreduce(&nlocal_bonus,&atom->ntris,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + // clear up per-atom memory if allocated memory->destroy(vec1); diff --git a/src/variable.cpp b/src/variable.cpp index 56924c507b..c0e4dae7d0 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -1101,6 +1101,7 @@ void Variable::remove(int n) pad[i-1] = pad[i]; reader[i-1] = reader[i]; data[i-1] = data[i]; + dvalue[i-1] = dvalue[i]; } nvar--; } diff --git a/src/version.h b/src/version.h index f15fa13e02..0539f757c9 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "8 Feb 2019" +#define LAMMPS_VERSION "28 Feb 2019" diff --git a/src/write_data.cpp b/src/write_data.cpp index 7047aacfd4..decc92ea8c 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -177,6 +177,17 @@ void WriteData::write(char *file) MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); } + // check for bonus data. + if (me == 0) { + if ((atom->nellipsoids > 0) + || (atom->nlines > 0) + || (atom->ntris > 0) + || (atom->nbodies > 0)) + error->warning(FLERR,"System has ellipsoids, lines, triangles, or bodies. " + "Those are not yet supported by write_data. The data file " + "will thus be incomplete."); + } + // open data file if (me == 0) {