Merge branch 'master' of github.com:lammps/lammps into pair-style-nnp

This commit is contained in:
Andreas Singraber
2021-02-24 23:37:21 +01:00
79 changed files with 5000 additions and 2694 deletions

View File

@ -778,9 +778,7 @@ if(PKG_GPU)
message(STATUS "<<< GPU package settings >>> message(STATUS "<<< GPU package settings >>>
-- GPU API: ${GPU_API}") -- GPU API: ${GPU_API}")
if(GPU_API STREQUAL "CUDA") if(GPU_API STREQUAL "CUDA")
message(STATUS "GPU architecture: ${GPU_ARCH}") message(STATUS "GPU default architecture: ${GPU_ARCH}")
elseif(GPU_API STREQUAL "OPENCL")
message(STATUS "OpenCL tuning: ${OCL_TUNE}")
elseif(GPU_API STREQUAL "HIP") elseif(GPU_API STREQUAL "HIP")
message(STATUS "HIP platform: ${HIP_PLATFORM}") message(STATUS "HIP platform: ${HIP_PLATFORM}")
message(STATUS "HIP architecture: ${HIP_ARCH}") message(STATUS "HIP architecture: ${HIP_ARCH}")

View File

@ -20,10 +20,10 @@ ExternalProject_Add(googletest
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_BYPRODUCTS <BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a BUILD_BYPRODUCTS <BINARY_DIR>/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a <BINARY_DIR>/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a <BINARY_DIR>/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a <BINARY_DIR>/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
LOG_DOWNLOAD ON LOG_DOWNLOAD ON
LOG_CONFIGURE ON LOG_CONFIGURE ON
LOG_BUILD ON LOG_BUILD ON
@ -39,10 +39,10 @@ file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR}) file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
ExternalProject_Get_Property(googletest BINARY_DIR) ExternalProject_Get_Property(googletest BINARY_DIR)
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a) set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a) set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a) set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a) set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
# Prevent GoogleTest from overriding our compiler/linker options # Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio # when building with Visual Studio

View File

@ -0,0 +1,54 @@
message(STATUS "Downloading and building OpenCL loader library")
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(OPENCL_LOADER_LIB_POSTFIX d)
else()
set(OPENCL_LOADER_LIB_POSTFIX)
endif()
include(ExternalProject)
set(OPENCL_LOADER_URL "https://download.lammps.org/thirdparty/opencl-loader-2020.12.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
mark_as_advanced(OPENCL_LOADER_URL)
ExternalProject_Add(opencl_loader
URL ${OPENCL_LOADER_URL}
URL_MD5 011cdcbd41030be94f3fced6d763a52a
SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build"
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
BUILD_BYPRODUCTS <BINARY_DIR>/libOpenCL${OPENCL_LOADER_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
INSTALL_COMMAND ""
TEST_COMMAND "")
ExternalProject_Get_Property(opencl_loader SOURCE_DIR)
set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc)
# workaround for CMake 3.10 on ubuntu 18.04
file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR})
ExternalProject_Get_Property(opencl_loader BINARY_DIR)
set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${OPENCL_LOADER_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
find_package(Threads QUIET)
if(NOT WIN32)
set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}")
else()
set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject")
endif()
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
add_dependencies(OpenCL::OpenCL opencl_loader)
set_target_properties(OpenCL::OpenCL PROPERTIES
IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH}
INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}")

View File

@ -99,9 +99,13 @@ if(GPU_API STREQUAL "CUDA")
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]") string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
endif() endif()
# Ampere (GPU Arch 8.0 and 8.6) is supported by CUDA 11 and later # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86]") string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
endif()
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
endif() endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
message(WARNING "Unsupported CUDA version. Use at your own risk.") message(WARNING "Unsupported CUDA version. Use at your own risk.")
@ -141,19 +145,10 @@ if(GPU_API STREQUAL "CUDA")
target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS}) target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
elseif(GPU_API STREQUAL "OPENCL") elseif(GPU_API STREQUAL "OPENCL")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") option(USE_STATIC_OPENCL_LOADER "Download and include a static OpenCL ICD loader" ON)
# download and unpack support binaries for compilation of windows binaries. mark_as_advanced(USE_STATIC_OPENCL_LOADER)
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty") if (USE_STATIC_OPENCL_LOADER)
file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz" include(OpenCLLoader)
EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win32/libOpenCL.dll")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win64/libOpenCL.dll")
endif()
set_target_properties(OpenCL::OpenCL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/include")
else() else()
find_package(OpenCL REQUIRED) find_package(OpenCL REQUIRED)
endif() endif()
@ -208,6 +203,7 @@ elseif(GPU_API STREQUAL "OPENCL")
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL) target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL)
add_dependencies(ocl_get_devices OpenCL::OpenCL)
elseif(GPU_API STREQUAL "HIP") elseif(GPU_API STREQUAL "HIP")
if(NOT DEFINED HIP_PATH) if(NOT DEFINED HIP_PATH)
if(NOT DEFINED ENV{HIP_PATH}) if(NOT DEFINED ENV{HIP_PATH})
@ -390,13 +386,10 @@ elseif(GPU_API STREQUAL "HIP")
target_link_libraries(lammps PRIVATE gpu) target_link_libraries(lammps PRIVATE gpu)
endif() endif()
# GPU package
FindStyleHeaders(${GPU_SOURCES_DIR} FIX_CLASS fix_ FIX)
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}") set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
# detect styles which have a GPU version
# detects styles which have GPU version
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h)
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)

View File

@ -12,7 +12,7 @@ ExternalProject_Add(libyaml
CXX=${CMAKE_CXX_COMPILER} CXX=${CMAKE_CXX_COMPILER}
CC=${CMAKE_C_COMPILER} CC=${CMAKE_C_COMPILER}
--prefix=<INSTALL_DIR> --disable-shared --prefix=<INSTALL_DIR> --disable-shared
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}
TEST_COMMAND "") TEST_COMMAND "")
ExternalProject_Get_Property(libyaml INSTALL_DIR) ExternalProject_Get_Property(libyaml INSTALL_DIR)
@ -23,7 +23,7 @@ set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib)
file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR}) file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR})
file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR}) file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR})
set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a) set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX})
add_library(Yaml::Yaml UNKNOWN IMPORTED) add_library(Yaml::Yaml UNKNOWN IMPORTED)
set_target_properties(Yaml::Yaml PROPERTIES set_target_properties(Yaml::Yaml PROPERTIES

View File

@ -134,6 +134,8 @@ CMake build
# value = yes (default) or no # value = yes (default) or no
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon -D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon
# value = yes or no (default) # value = yes or no (default)
-D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed
# value = yes (default) or no
:code:`GPU_ARCH` settings for different GPU hardware is as follows: :code:`GPU_ARCH` settings for different GPU hardware is as follows:
@ -160,6 +162,12 @@ When building with CMake, you **must NOT** build the GPU library in ``lib/gpu``
using the traditional build procedure. CMake will detect files generated by that using the traditional build procedure. CMake will detect files generated by that
process and will terminate with an error and a suggestion for how to remove them. process and will terminate with an error and a suggestion for how to remove them.
If you are compiling for OpenCL, the default setting is to download, build, and
link with a static OpenCL ICD loader library and standard OpenCL headers. This
way no local OpenCL development headers or library needs to be present and only
OpenCL compatible drivers need to be installed to use OpenCL. If this is not
desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`.
If you are compiling with HIP, note that before running CMake you will have to If you are compiling with HIP, note that before running CMake you will have to
set appropriate environment variables. Some variables such as set appropriate environment variables. Some variables such as
:code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc` :code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc`
@ -257,18 +265,18 @@ To build with this package, the KIM library with API v2 must be downloaded
and built on your system. It must include the KIM models that you want to and built on your system. It must include the KIM models that you want to
use with LAMMPS. use with LAMMPS.
If you would like to use the :doc:`kim_query <kim_commands>` If you would like to use the :doc:`kim query <kim_commands>`
command, you also need to have libcurl installed with the matching command, you also need to have libcurl installed with the matching
development headers and the curl-config tool. development headers and the curl-config tool.
If you would like to use the :doc:`kim_property <kim_commands>` If you would like to use the :doc:`kim property <kim_commands>`
command, you need to build LAMMPS with the PYTHON package installed command, you need to build LAMMPS with the PYTHON package installed
and linked to Python 3.6 or later. See the :ref:`PYTHON package build info <python>` and linked to Python 3.6 or later. See the :ref:`PYTHON package build info <python>`
for more details on this. After successfully building LAMMPS with Python, you for more details on this. After successfully building LAMMPS with Python, you
also need to install the kim-property Python package, which can be easily done using also need to install the ``kim-property`` Python package, which can be easily
*pip* as ``pip install kim-property``, or from the *conda-forge* channel as done using *pip* as ``pip install kim-property``, or from the *conda-forge*
``conda install kim-property`` if LAMMPS is built in Conda. More detailed channel as ``conda install kim-property`` if LAMMPS is built in Conda. More
information is available at: detailed information is available at:
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_. `kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
In addition to installing the KIM API, it is also necessary to install the In addition to installing the KIM API, it is also necessary to install the
@ -308,7 +316,7 @@ minutes to hours) to build. Of course you only need to do that once.)
You can download and build the KIM library manually if you prefer; You can download and build the KIM library manually if you prefer;
follow the instructions in ``lib/kim/README``. You can also do follow the instructions in ``lib/kim/README``. You can also do
this in one step from the lammps/src dir, using a command like this in one step from the lammps/src directory, using a command like
these, which simply invoke the ``lib/kim/Install.py`` script with these, which simply invoke the ``lib/kim/Install.py`` script with
the specified args. the specified args.
@ -376,10 +384,11 @@ Enabling the extra unit tests have some requirements,
Conda. More detailed information is available at: Conda. More detailed information is available at:
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_. `kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
* It is also necessary to install * It is also necessary to install
``EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000``, and ``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`` KIM models. ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_ See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
to learn how to install a pre-build binary of the OpenKIM Repository of to learn how to install a pre-built binary of the OpenKIM Repository of
Models or see Models or see
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_ `Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
to learn how to install the specific KIM models. to learn how to install the specific KIM models.

View File

@ -60,11 +60,7 @@ An alphabetic list of all general LAMMPS commands.
* :doc:`include <include>` * :doc:`include <include>`
* :doc:`info <info>` * :doc:`info <info>`
* :doc:`jump <jump>` * :doc:`jump <jump>`
* :doc:`kim_init <kim_commands>` * :doc:`kim <kim_commands>`
* :doc:`kim_interactions <kim_commands>`
* :doc:`kim_param <kim_commands>`
* :doc:`kim_property <kim_commands>`
* :doc:`kim_query <kim_commands>`
* :doc:`kspace_modify <kspace_modify>` * :doc:`kspace_modify <kspace_modify>`
* :doc:`kspace_style <kspace_style>` * :doc:`kspace_style <kspace_style>`
* :doc:`label <label>` * :doc:`label <label>`

View File

@ -85,7 +85,7 @@ commands)
* water potentials: TIP3P, TIP4P, SPC * water potentials: TIP3P, TIP4P, SPC
* implicit solvent potentials: hydrodynamic lubrication, Debye * implicit solvent potentials: hydrodynamic lubrication, Debye
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options * force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim_init, kim_interactions, and kim_query <kim_commands>` commands * access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation * hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
* overlaid potentials: superposition of multiple pair potentials * overlaid potentials: superposition of multiple pair potentials

View File

@ -368,17 +368,19 @@ KIM package
**Contents:** **Contents:**
This package contains a set of commands that serve as a wrapper on the This package contains a command with a set of subcommands that serve as a
wrapper on the
`Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_ `Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_
repository of interatomic models (IMs) enabling compatible ones to be used in repository of interatomic models (IMs) enabling compatible ones to be used in
LAMMPS simulations. LAMMPS simulations.
This includes :doc:`kim_init <kim_commands>`, and
:doc:`kim_interactions <kim_commands>` commands to select, initialize and This includes :doc:`kim init <kim_commands>`, and
instantiate the IM, a :doc:`kim_query <kim_commands>` command to perform web :doc:`kim interactions <kim_commands>` commands to select, initialize and
instantiate the IM, a :doc:`kim query <kim_commands>` command to perform web
queries for material property predictions of OpenKIM IMs, a queries for material property predictions of OpenKIM IMs, a
:doc:`kim_param <kim_commands>` command to access KIM Model Parameters from :doc:`kim param <kim_commands>` command to access KIM Model Parameters from
LAMMPS, and a :doc:`kim_property <kim_commands>` command to write material LAMMPS, and a :doc:`kim property <kim_commands>` command to write material
properties computed in LAMMPS to standard KIM property instance format. properties computed in LAMMPS to standard KIM property instance format.
Support for KIM IMs that conform to the Support for KIM IMs that conform to the
@ -387,8 +389,8 @@ is provided by the :doc:`pair_style kim <pair_kim>` command.
.. note:: .. note::
The command *pair_style kim* is called by *kim_interactions* and The command *pair_style kim* is called by *kim interactions* and is not
is not recommended to be directly used in input scripts. recommended to be directly used in input scripts.
To use this package you must have the KIM API library available on your To use this package you must have the KIM API library available on your
system. The KIM API is available for download on the system. The KIM API is available for download on the
@ -405,7 +407,7 @@ and is funded by the `National Science Foundation <https://www.nsf.gov/>`_.
API and the *pair_style kim* command. Yaser Afshar (U Minnesota), API and the *pair_style kim* command. Yaser Afshar (U Minnesota),
Axel Kohlmeyer (Temple U), Ellad Tadmor (U Minnesota), and Axel Kohlmeyer (Temple U), Ellad Tadmor (U Minnesota), and
Daniel Karls (U Minnesota) contributed to the Daniel Karls (U Minnesota) contributed to the
:doc:`kim_commands <kim_commands>` interface in close collaboration with :doc:`kim command <kim_commands>` interface in close collaboration with
Ryan Elliott. Ryan Elliott.
**Install:** **Install:**
@ -415,7 +417,7 @@ This package has :ref:`specific installation instructions <kim>` on the
**Supporting info:** **Supporting info:**
* :doc:`kim_commands <kim_commands>` * :doc:`kim command <kim_commands>`
* :doc:`pair_style kim <pair_kim>` * :doc:`pair_style kim <pair_kim>`
* src/KIM: filenames -> commands * src/KIM: filenames -> commands
* src/KIM/README * src/KIM/README

View File

@ -153,7 +153,7 @@ temp/chunk calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>
compute cc1 all chunk/atom molecule compute cc1 all chunk/atom molecule
compute myChunk all temp/chunk cc1 temp compute myChunk all temp/chunk cc1 temp
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector fix 1 all ave/time 100 1 100 c_myChunk[1] file tmp.out mode vector
---------- ----------

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,7 @@ command to specify them.
* The OpenKIM Project at * The OpenKIM Project at
`https://openkim.org/browse/models/by-type <https://openkim.org/browse/models/by-type>`_ `https://openkim.org/browse/models/by-type <https://openkim.org/browse/models/by-type>`_
provides ADP potentials that can be used directly in LAMMPS with the provides ADP potentials that can be used directly in LAMMPS with the
:doc:`kim_commands <kim_commands>` interface. :doc:`kim command <kim_commands>` interface.
---------- ----------

View File

@ -141,7 +141,7 @@ interatomic potentials and file formats.
The OpenKIM Project at The OpenKIM Project at
`https://openkim.org/browse/models/by-type <https://openkim.org/browse/models/by-type>`_ `https://openkim.org/browse/models/by-type <https://openkim.org/browse/models/by-type>`_
provides EAM potentials that can be used directly in LAMMPS with the provides EAM potentials that can be used directly in LAMMPS with the
:doc:`kim_commands <kim_commands>` interface. :doc:`kim command <kim_commands>` interface.
---------- ----------

View File

@ -23,29 +23,30 @@ Examples
Description Description
""""""""""" """""""""""
This pair style is a wrapper on the `Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_ repository of interatomic This pair style is a wrapper on the
potentials to enable their use in LAMMPS scripts. `Open Knowledgebase of Interatomic Models (OpenKIM) <https://openkim.org>`_
repository of interatomic potentials to enable their use in LAMMPS scripts.
The preferred interface for using interatomic models archived in The preferred interface for using interatomic models archived in
OpenKIM is the :doc:`kim_commands interface <kim_commands>`. That OpenKIM is the :doc:`kim command <kim_commands>` interface. That
interface supports both "KIM Portable Models" (PMs) that conform to the interface supports both "KIM Portable Models" (PMs) that conform to the
KIM API Portable Model Interface (PMI) and can be used by any KIM API Portable Model Interface (PMI) and can be used by any
simulation code that conforms to the KIM API/PMI, and simulation code that conforms to the KIM API/PMI, and
"KIM Simulator Models" that are natively implemented within a single "KIM Simulator Models" (SMs) that are natively implemented within a single
simulation code (like LAMMPS) and can only be used with it. simulation code (like LAMMPS) and can only be used with it.
The *pair_style kim* command is limited to KIM PMs. It is The *pair_style kim* command is limited to KIM PMs. It is
used by the :doc:`kim_commands interface <kim_commands>` as needed. used by the :doc:`kim command <kim_commands>` interface as needed.
.. note:: .. note::
Since *pair_style kim* is called by *kim_interactions* as needed, Since *pair_style kim* is called by *kim interactions* as needed,
is not recommended to be directly used in input scripts. it is not recommended to be directly used in input scripts.
---------- ----------
The argument *model* is the name of the KIM PM. The argument *model* is the name of the KIM PM.
For potentials archived in OpenKIM For potentials archived in OpenKIM
this is the extended KIM ID (see :doc:`kim_commands <kim_commands>` this is the extended KIM ID (see :doc:`kim command <kim_commands>`
for details). LAMMPS can invoke any KIM PM, however there can for details). LAMMPS can invoke any KIM PM, however there can
be incompatibilities (for example due to unit matching issues). be incompatibilities (for example due to unit matching issues).
In the event of an incompatibility, the code will terminate with In the event of an incompatibility, the code will terminate with
@ -106,7 +107,7 @@ Restrictions
"""""""""""" """"""""""""
This pair style is part of the KIM package. See details on This pair style is part of the KIM package. See details on
restrictions in :doc:`kim_commands <kim_commands>`. restrictions in :doc:`kim command <kim_commands>`.
This current version of pair_style kim is compatible with the This current version of pair_style kim is compatible with the
kim-api package version 2.0.0 and higher. kim-api package version 2.0.0 and higher.
@ -114,7 +115,7 @@ kim-api package version 2.0.0 and higher.
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`pair_coeff <pair_coeff>`, :doc:`kim_commands <kim_commands>` :doc:`pair_coeff <pair_coeff>`, :doc:`kim command <kim_commands>`
Default Default
""""""" """""""

View File

@ -8,8 +8,8 @@ LAMMPS_COMMANDS = ("angle_coeff", "angle_style", "atom_modify", "atom_style",
"delete_bonds", "dielectric", "dihedral_coeff", "dihedral_style", "dimension", "delete_bonds", "dielectric", "dihedral_coeff", "dihedral_style", "dimension",
"displace_atoms", "dump_modify", "dynamical_matrix", "echo", "displace_atoms", "dump_modify", "dynamical_matrix", "echo",
"fix_modify", "group2ndx", "hyper", "if", "improper_coeff", "fix_modify", "group2ndx", "hyper", "if", "improper_coeff",
"improper_style", "include", "info", "jump", "kim_init", "kim_interactions", "improper_style", "include", "info", "jump", "kim",
"kim_param", "kim_query", "kspace_modify", "kspace_style", "label", "lattice", "kspace_modify", "kspace_style", "label", "lattice",
"log", "mass", "message", "minimize", "min_modify", "min_style", "molecule", "log", "mass", "message", "minimize", "min_modify", "min_style", "molecule",
"ndx2group", "neb", "neb/spin", "neighbor", "neigh_modify", "newton", "next", "ndx2group", "neb", "neb/spin", "neighbor", "neigh_modify", "newton", "next",
"package", "pair_coeff", "pair_modify", "pair_style", "pair_write", "package", "pair_coeff", "pair_modify", "pair_style", "pair_write",

View File

@ -22,7 +22,7 @@ improper_style class2
read_data tiny_nylon.data read_data tiny_nylon.data
variable runsteps equal 1000 variable runsteps equal 1000
variable prob1 equal step/v_runsteps*2 variable prob1 equal step/v_runsteps*2+0.1
variable prob2 equal (step/v_runsteps)>0.5 variable prob2 equal (step/v_runsteps)>0.5
velocity all create 300.0 4928459 dist gaussian velocity all create 300.0 4928459 dist gaussian

View File

@ -1,8 +1,8 @@
# 3d Lennard-Jones melt # 3d Lennard-Jones melt
# #
# This example requires that the example models provided with # This example requires that the example models provided with
# the kim-api package are installed. see the ./lib/kim/README or # the kim-api package are installed. see the `./lib/kim/README` or
# ./lib/kim/Install.py files for details on how to install these # `./lib/kim/Install.py` files for details on how to install these
# example models. # example models.
# #
@ -14,14 +14,14 @@ variable xx equal 20*$x
variable yy equal 20*$y variable yy equal 20*$y
variable zz equal 20*$z variable zz equal 20*$z
kim_init LennardJones_Ar real kim init LennardJones_Ar real
lattice fcc 4.4300 lattice fcc 4.4300
region box block 0 ${xx} 0 ${yy} 0 ${zz} region box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box 1 box create_box 1 box
create_atoms 1 box create_atoms 1 box
kim_interactions Ar kim interactions Ar
mass 1 39.95 mass 1 39.95
velocity all create 200.0 232345 loop geom velocity all create 200.0 232345 loop geom

View File

@ -1,7 +1,7 @@
# kim-property example # kim property example
# #
# For detailed information of this example please refer to: # For detailed information of this example please refer to:
# https://openkim.org/doc/evaluation/tutorial-lammps/ # `https://openkim.org/doc/evaluation/tutorial-lammps/`
# #
# Description: # Description:
# #
@ -10,10 +10,10 @@
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for # `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for
# argon. The material properties computed in LAMMPS are represented as a # argon. The material properties computed in LAMMPS are represented as a
# standard KIM property instance format. (See # standard KIM property instance format. (See
# https://openkim.org/doc/schema/properties-framework/ and # `https://openkim.org/doc/schema/properties-framework/` and
# https://lammps.sandia.gov/doc/kim_commands.html for further details). # `https://lammps.sandia.gov/doc/kim_commands.html` for further details).
# Then the created property instance is written to a file named results.edn # Then the created property instance is written to a file named `results.edn`
# using the `kim_property dump` commands. # using the `kim property dump` command.
# #
# Requirement: # Requirement:
# #
@ -28,7 +28,7 @@
# This example requires that the KIM Portable Model (PM) # This example requires that the KIM Portable Model (PM)
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` # `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004`
# is installed. This can be done with the command # is installed. This can be done with the command
# `kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` # kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004
# If this command does not work, you may need to setup your PATH to find the utility. # If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following # If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory) # (where the current working directory is assumed to be the LAMMPS build directory)
@ -38,14 +38,14 @@
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number). # (where you should relplace X.Y.Z with the appropriate kim-api version number).
# #
# Or, see https://openkim.org/doc/obtaining-models for alternative options. # Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
# #
# Initialize interatomic potential (KIM model) and units # Initialize interatomic potential (KIM model) and units
atom_style atomic atom_style atomic
# Set the OpenKIM model that will be used # Set the OpenKIM model that will be used
kim_init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal
# the equilibrium lattice constant for the fcc structure # the equilibrium lattice constant for the fcc structure
variable lattice_constant equal 5.248509056866169 variable lattice_constant equal 5.248509056866169
@ -62,7 +62,7 @@ create_atoms 1 box
mass 1 39.948 mass 1 39.948
# Specify the KIM interactions # Specify the KIM interactions
kim_interactions Ar kim interactions Ar
# Compute energy # Compute energy
run 0 run 0
@ -72,10 +72,10 @@ variable natoms equal "count(all)"
variable ecohesive equal "-pe/v_natoms" variable ecohesive equal "-pe/v_natoms"
# Create a property instance # Create a property instance
kim_property create 1 cohesive-potential-energy-cubic-crystal kim property create 1 cohesive-potential-energy-cubic-crystal
# Set all the key-value pairs for this property instance # Set all the key-value pairs for this property instance
kim_property modify 1 key short-name source-value 1 fcc & kim property modify 1 key short-name source-value 1 fcc &
key species source-value 1 Ar & key species source-value 1 Ar &
key a source-value ${lattice_constant} & key a source-value ${lattice_constant} &
source-unit angstrom & source-unit angstrom &
@ -88,4 +88,4 @@ kim_property modify 1 key short-name source-value 1 fcc
source-unit eV source-unit eV
# Dump the results in a file # Dump the results in a file
kim_property dump "results.edn" kim property dump "results.edn"

View File

@ -1,7 +1,7 @@
# 3d Lennard-Jones melt # 3d Lennard-Jones melt
# #
# This example requires that the KIM Portable Model (PM) # This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005 # `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command # is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 # kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility. # If this command does not work, you may need to setup your PATH to find the utility.
@ -13,7 +13,7 @@
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number). # (where you should relplace X.Y.Z with the appropriate kim-api version number).
# #
# Or, see https://openkim.org/doc/obtaining-models for alternative options. # Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
# #
variable x index 1 variable x index 1
@ -24,15 +24,15 @@ variable xx equal 20*$x
variable yy equal 20*$y variable yy equal 20*$y
variable zz equal 20*$z variable zz equal 20*$z
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"] kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"]
lattice fcc ${a0} lattice fcc ${a0}
region box block 0 ${xx} 0 ${yy} 0 ${zz} region box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box 1 box create_box 1 box
create_atoms 1 box create_atoms 1 box
kim_interactions Si kim interactions Si
mass 1 39.95 mass 1 39.95
velocity all create 200.0 232345 loop geom velocity all create 200.0 232345 loop geom

View File

@ -1,7 +1,7 @@
# 3d Lennard-Jones melt # 3d Lennard-Jones melt
# #
# This example requires that the KIM Portable Model (PM) # This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005 # `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command # is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005 # kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility. # If this command does not work, you may need to setup your PATH to find the utility.
@ -13,7 +13,7 @@
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number). # (where you should relplace X.Y.Z with the appropriate kim-api version number).
# #
# Or, see https://openkim.org/doc/obtaining-models for alternative options. # Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
# #
variable x index 1 variable x index 1
@ -24,14 +24,14 @@ variable xx equal 20*$x
variable yy equal 20*$y variable yy equal 20*$y
variable zz equal 20*$z variable zz equal 20*$z
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
lattice fcc 4.4300 lattice fcc 4.4300
region box block 0 ${xx} 0 ${yy} 0 ${zz} region box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box 1 box create_box 1 box
create_atoms 1 box create_atoms 1 box
kim_interactions Si kim interactions Si
mass 1 39.95 mass 1 39.95
velocity all create 200.0 232345 loop geom velocity all create 200.0 232345 loop geom

76
examples/kim/in.kim-query Normal file
View File

@ -0,0 +1,76 @@
# kim query example
#
# Requirement:
#
# This example requires LAMMPS is built with KIM package. A requirement for
# the KIM package, is the KIM API library that must be downloaded from the
# OpenKIM website and installed before LAMMPS is compiled. The 'kim query'
# command requires the libcurl library to be installed. See the
# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for further
# details
#
# This example requires that the KIM Models
# `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`
# and
# `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000`
# are installed.
#
# This can be done with the commands
# `kim-api-collections-management install user `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`
# `kim-api-collections-management install user `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000`
#
# If these commands do not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
# -----------------------------------------------
# Get an equilibrium fcc crystal lattice constant
# -----------------------------------------------
kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal
kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom]
print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}"
# Get the lattice contant from a different model
kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005]
print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}"
clear
# -----------------------------------------------
# Get an equilibrium fcc crystal lattice constant
# -----------------------------------------------
kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005]
kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005]
print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}"
print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}"
clear
# -----------------------------------------------
# Get an equilibrium hcp crystal lattice constant
# -----------------------------------------------
kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal
kim query latconst split get_lattice_constant_hexagonal crystal=["hcp"] species=["Zr"] units=["angstrom"]
print "HCP lattice constants = ${latconst_1}, ${latconst_2}"
clear
# -----------------------------------------------
# Query for KIM models from openkim.org
# Get all the EAM models that support Al
# -----------------------------------------------
kim query model index get_available_models species=[Al] potential_type=[eam]
label model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
print "FCC lattice constant (${model}) = ${latconst}"
next model
jump SELF model_loop
clear

View File

@ -1,7 +1,7 @@
# 3d Lennard-Jones melt # 3d Lennard-Jones melt
# #
# This example requires that the KIM Simulator Model (PM) # This example requires that the KIM Simulator Model (PM)
# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 # `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000`
# is installed. This can be done with the command # is installed. This can be done with the command
# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 # kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# If this command does not work, you may need to setup your PATH to find the utility. # If this command does not work, you may need to setup your PATH to find the utility.
@ -13,7 +13,7 @@
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate # source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number). # (where you should relplace X.Y.Z with the appropriate kim-api version number).
# #
# See https://openkim.org/doc/obtaining-models for alternative options. # See `https://openkim.org/doc/obtaining-models` for alternative options.
# #
variable x index 1 variable x index 1
@ -24,14 +24,14 @@ variable xx equal 20*$x
variable yy equal 20*$y variable yy equal 20*$y
variable zz equal 20*$z variable zz equal 20*$z
kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real
lattice fcc 4.4300 lattice fcc 4.4300
region box block 0 ${xx} 0 ${yy} 0 ${zz} region box block 0 ${xx} 0 ${yy} 0 ${zz}
create_box 1 box create_box 1 box
create_atoms 1 box create_atoms 1 box
kim_interactions O kim interactions O
mass 1 39.95 mass 1 39.95
velocity all create 200.0 232345 loop geom velocity all create 200.0 232345 loop geom

View File

@ -0,0 +1,107 @@
LAMMPS (10 Feb 2021)
# 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 xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init LennardJones_Ar real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has No mutable parameters.
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.003 seconds
kim interactions Ar
#=== BEGIN kim interactions ==================================
pair_style kim LennardJones_Ar
WARNING: KIM Model does not provide 'partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1139)
WARNING: KIM Model does not provide 'partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1145)
pair_coeff * * Ar
#=== END kim interactions ====================================
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
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.450000000000001
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
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 145069.63 0 164146.22 128015.94
100 95.179703 154939.42 0 164017.94 131602.75
Loop time of 2.8463 on 1 procs for 100 steps with 32000 atoms
Performance: 3.036 ns/day, 7.906 hours/ns, 35.133 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 2.5046 | 2.5046 | 2.5046 | 0.0 | 88.00
Neigh | 0.29437 | 0.29437 | 0.29437 | 0.0 | 10.34
Comm | 0.01182 | 0.01182 | 0.01182 | 0.0 | 0.42
Output | 7e-05 | 7e-05 | 7e-05 | 0.0 | 0.00
Modify | 0.024522 | 0.024522 | 0.024522 | 0.0 | 0.86
Other | | 0.01091 | | | 0.38
Nlocal: 32000.0 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 19911.0 ave 19911 max 19911 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 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.92969
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:02

View File

@ -0,0 +1,107 @@
LAMMPS (10 Feb 2021)
# 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 xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init LennardJones_Ar real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has No mutable parameters.
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001 seconds
kim interactions Ar
#=== BEGIN kim interactions ==================================
pair_style kim LennardJones_Ar
WARNING: KIM Model does not provide 'partialParticleEnergy'; energy per atom will be zero (src/KIM/pair_kim.cpp:1139)
WARNING: KIM Model does not provide 'partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1145)
pair_coeff * * Ar
#=== END kim interactions ====================================
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
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.450000000000001
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 9.791 | 9.791 | 9.791 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 145069.63 0 164146.22 128015.94
100 95.179703 154939.42 0 164017.94 131602.75
Loop time of 0.857614 on 4 procs for 100 steps with 32000 atoms
Performance: 10.074 ns/day, 2.382 hours/ns, 116.603 timesteps/s
99.6% 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.73048 | 0.73398 | 0.73855 | 0.3 | 85.58
Neigh | 0.083739 | 0.083964 | 0.084335 | 0.1 | 9.79
Comm | 0.017996 | 0.022912 | 0.026515 | 2.1 | 2.67
Output | 2.7e-05 | 3.5e-05 | 4.5e-05 | 0.0 | 0.00
Modify | 0.010073 | 0.010158 | 0.010271 | 0.1 | 1.18
Other | | 0.006571 | | | 0.77
Nlocal: 8000.00 ave 8018 max 7967 min
Histogram: 1 0 0 0 0 0 1 0 0 2
Nghost: 9131.00 ave 9164 max 9113 min
Histogram: 2 0 0 1 0 0 0 0 0 1
Neighs: 0.00000 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.92969
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,223 @@
LAMMPS (10 Feb 2021)
# kim property example
#
# For detailed information of this example please refer to:
# `https://openkim.org/doc/evaluation/tutorial-lammps/`
#
# Description:
#
# This example is designed to calculate the cohesive energy corresponding to
# the equilibrium FCC lattice constant for
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for
# argon. The material properties computed in LAMMPS are represented as a
# standard KIM property instance format. (See
# `https://openkim.org/doc/schema/properties-framework/` and
# `https://lammps.sandia.gov/doc/kim_commands.html` for further details).
# Then the created property instance is written to a file named `results.edn`
# using the `kim property dump` command.
#
# Requirement:
#
# This example requires LAMMPS built with the Python 3.6 or later package
# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for
# more info on building LAMMPS with the version of Python on your system.
# After successfully building LAMMPS with Python, you need to install the
# kim-property Python package, See the
# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for
# further details.
#
# This example requires that the KIM Portable Model (PM)
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004`
# is installed. This can be done with the command
# kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
# Initialize interatomic potential (KIM model) and units
atom_style atomic
# Set the OpenKIM model that will be used
kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal
#=== BEGIN kim init ==========================================
units metal
neighbor 2.0 bin # Angstroms
timestep 1.0e-3 # picoseconds
This model has 3 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | cutoff | "Double" | 1
2 | epsilon | "Double" | 1
3 | sigma | "Double" | 1
#=== END kim init ============================================
# the equilibrium lattice constant for the fcc structure
variable lattice_constant equal 5.248509056866169
# Periodic boundary conditions along all three dimensions
boundary p p p
# Create an FCC lattice with the lattice spacing
# using a single conventional (orthogonal) unit cell
lattice fcc ${lattice_constant}
lattice fcc 5.24850905686617
Lattice spacing in x,y,z = 5.2485091 5.2485091 5.2485091
region box block 0 1 0 1 0 1 units lattice
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (5.2485091 5.2485091 5.2485091)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4 atoms
create_atoms CPU = 0.000 seconds
mass 1 39.948
# Specify the KIM interactions
kim interactions Ar
#=== BEGIN kim interactions ==================================
pair_style kim LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004
pair_coeff * * Ar
#=== END kim interactions ====================================
# Compute energy
run 0
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_126566794224_004a} is archived in OpenKIM~\cite{MO_126566794224_004, MD_498634107543_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_126566794224_004.bib}
\end{document}
}
@Misc{MO_126566794224_004,
author = {Ellad Tadmor},
title = {{L}ennard-{J}ones model (shifted) for {A}r with parameters from {B}ernardes (1958) (medium precision cutoff) v004},
doi = {10.25950/9f98b989},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}},
keywords = {OpenKIM, Model, MO_126566794224_004},
publisher = {OpenKIM},
year = 2020,
}
@Misc{MD_498634107543_004,
author = {Ellad Tadmor},
title = {{D}river for the {L}ennard-{J}ones model uniformly shifted to have zero energy at the cutoff radius v004},
doi = {10.25950/bdffd6a6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}},
keywords = {OpenKIM, Model Driver, MD_498634107543_004},
publisher = {OpenKIM},
year = 2020,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_126566794224_004a,
author = {Newton Bernardes},
doi = {10.1103/PhysRev.112.1534},
issue = {5},
journal = {Physical Review},
pages = {1534--1539},
publisher = {American Physical Society},
title = {Theory of Solid {N}e, {A}, {K}r, and {X}e at 0{K}},
volume = {112},
year = {1958},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 15.5
ghost atom cutoff = 15.5
binsize = 7.75, bins = 1 1 1
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 15.5
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.119 | 3.119 | 3.119 Mbytes
Step Temp E_pair E_mol TotEng Press
0 0 -0.34602203 0 -0.34602203 0.00061471244
Loop time of 0 on 1 procs for 0 steps with 4 atoms
0.0% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 0 | | | 0.00
Nlocal: 4.00000 ave 4 max 4 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 1094.00 ave 1094 max 1094 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 1712.00 ave 1712 max 1712 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1712
Ave neighs/atom = 428.00000
Neighbor list builds = 0
Dangerous builds = 0
# Get cohesive energy
variable natoms equal "count(all)"
variable ecohesive equal "-pe/v_natoms"
# Create a property instance
kim property create 1 cohesive-potential-energy-cubic-crystal
#=== kim property ===========================================
# Set all the key-value pairs for this property instance
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value ${lattice_constant} source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value 0.0865055084950546 source-unit eV
#=== kim property ===========================================
# Dump the results in a file
kim property dump "results.edn"
#=== kim property ===========================================
Total wall time: 0:00:00

View File

@ -0,0 +1,223 @@
LAMMPS (10 Feb 2021)
# kim property example
#
# For detailed information of this example please refer to:
# `https://openkim.org/doc/evaluation/tutorial-lammps/`
#
# Description:
#
# This example is designed to calculate the cohesive energy corresponding to
# the equilibrium FCC lattice constant for
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004` model for
# argon. The material properties computed in LAMMPS are represented as a
# standard KIM property instance format. (See
# `https://openkim.org/doc/schema/properties-framework/` and
# `https://lammps.sandia.gov/doc/kim_commands.html` for further details).
# Then the created property instance is written to a file named `results.edn`
# using the `kim property dump` command.
#
# Requirement:
#
# This example requires LAMMPS built with the Python 3.6 or later package
# installed. See the `https://lammps.sandia.gov/doc/python.html` doc page for
# more info on building LAMMPS with the version of Python on your system.
# After successfully building LAMMPS with Python, you need to install the
# kim-property Python package, See the
# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for
# further details.
#
# This example requires that the KIM Portable Model (PM)
# `LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004`
# is installed. This can be done with the command
# kim-api-collections-management install user LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
# Initialize interatomic potential (KIM model) and units
atom_style atomic
# Set the OpenKIM model that will be used
kim init LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004 metal
#=== BEGIN kim init ==========================================
units metal
neighbor 2.0 bin # Angstroms
timestep 1.0e-3 # picoseconds
This model has 3 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | cutoff | "Double" | 1
2 | epsilon | "Double" | 1
3 | sigma | "Double" | 1
#=== END kim init ============================================
# the equilibrium lattice constant for the fcc structure
variable lattice_constant equal 5.248509056866169
# Periodic boundary conditions along all three dimensions
boundary p p p
# Create an FCC lattice with the lattice spacing
# using a single conventional (orthogonal) unit cell
lattice fcc ${lattice_constant}
lattice fcc 5.24850905686617
Lattice spacing in x,y,z = 5.2485091 5.2485091 5.2485091
region box block 0 1 0 1 0 1 units lattice
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (5.2485091 5.2485091 5.2485091)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 4 atoms
create_atoms CPU = 0.000 seconds
mass 1 39.948
# Specify the KIM interactions
kim interactions Ar
#=== BEGIN kim interactions ==================================
pair_style kim LJ_Shifted_Bernardes_1958MedCutoff_Ar__MO_126566794224_004
pair_coeff * * Ar
#=== END kim interactions ====================================
# Compute energy
run 0
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_126566794224_004a} is archived in OpenKIM~\cite{MO_126566794224_004, MD_498634107543_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_126566794224_004.bib}
\end{document}
}
@Misc{MO_126566794224_004,
author = {Ellad Tadmor},
title = {{L}ennard-{J}ones model (shifted) for {A}r with parameters from {B}ernardes (1958) (medium precision cutoff) v004},
doi = {10.25950/9f98b989},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}},
keywords = {OpenKIM, Model, MO_126566794224_004},
publisher = {OpenKIM},
year = 2020,
}
@Misc{MD_498634107543_004,
author = {Ellad Tadmor},
title = {{D}river for the {L}ennard-{J}ones model uniformly shifted to have zero energy at the cutoff radius v004},
doi = {10.25950/bdffd6a6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/9f98b989}},
keywords = {OpenKIM, Model Driver, MD_498634107543_004},
publisher = {OpenKIM},
year = 2020,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_126566794224_004a,
author = {Newton Bernardes},
doi = {10.1103/PhysRev.112.1534},
issue = {5},
journal = {Physical Review},
pages = {1534--1539},
publisher = {American Physical Society},
title = {Theory of Solid {N}e, {A}, {K}r, and {X}e at 0{K}},
volume = {112},
year = {1958},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 15.5
ghost atom cutoff = 15.5
binsize = 7.75, bins = 1 1 1
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 15.5
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.165 | 3.165 | 3.165 Mbytes
Step Temp E_pair E_mol TotEng Press
0 0 -0.34602203 0 -0.34602203 0.00061471244
Loop time of 1.5e-06 on 4 procs for 0 steps with 4 atoms
100.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 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 1.5e-06 | | |100.00
Nlocal: 1.00000 ave 1 max 1 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost: 935.000 ave 935 max 935 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 428.000 ave 428 max 428 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1712
Ave neighs/atom = 428.00000
Neighbor list builds = 0
Dangerous builds = 0
# Get cohesive energy
variable natoms equal "count(all)"
variable ecohesive equal "-pe/v_natoms"
# Create a property instance
kim property create 1 cohesive-potential-energy-cubic-crystal
#=== kim property ===========================================
# Set all the key-value pairs for this property instance
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value ${lattice_constant} source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value ${ecohesive} source-unit eV
kim property modify 1 key short-name source-value 1 fcc key species source-value 1 Ar key a source-value 5.24850905686617 source-unit angstrom key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 source-value 2 1:3 0.0 0.5 0.5 source-value 3 1:3 0.5 0.0 0.5 source-value 4 1:3 0.5 0.5 0.0 key space-group source-value Fm-3m key cohesive-potential-energy source-value 0.0865055084950538 source-unit eV
#=== kim property ===========================================
# Dump the results in a file
kim property dump "results.edn"
#=== kim property ===========================================
Total wall time: 0:00:00

View File

@ -0,0 +1,210 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has 9 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | A | "Double" | 1
2 | B | "Double" | 1
3 | p | "Double" | 1
4 | q | "Double" | 1
5 | sigma | "Double" | 1
6 | gamma | "Double" | 1
7 | cutoff | "Double" | 1
8 | lambda | "Double" | 1
9 | costheta0 | "Double" | 1
#=== END kim init ============================================
kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"]
#=== BEGIN kim-query =========================================
variable a0 string "4.146581932902336"
#=== END kim-query ===========================================
lattice fcc ${a0}
lattice fcc 4.146581932902336
Lattice spacing in x,y,z = 4.1465819 4.1465819 4.1465819
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (82.931639 82.931639 82.931639)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.004 seconds
kim interactions Si
#=== BEGIN kim interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_405512056662_005.bib}
\end{document}
}
@Misc{MO_405512056662_005,
author = {Amit K Singh},
title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005},
doi = {10.25950/c74b293f},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model, MO_405512056662_005},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_335816936951_004,
author = {Mingjian Wen},
title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004},
doi = {10.25950/f3abd2d6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model Driver, MD_335816936951_004},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_405512056662_005a,
author = {Stillinger, Frank H. and Weber, Thomas A.},
doi = {10.1103/PhysRevB.31.5262},
issue = {8},
journal = {Physical Review B},
month = {Apr},
pages = {5262--5271},
publisher = {American Physical Society},
title = {Computer simulation of local order in condensed phases of silicon},
volume = {31},
year = {1985},
}
@Book{MO_405512056662_005b,
author = {Tadmor, Ellad B. and Miller, Ronald E.},
doi = {10.1017/CBO9781139003582},
publisher = {Cambridge University Press},
title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques},
year = {2011},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 41 41 41
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 10.36 | 10.36 | 10.36 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -126084.25 0 -107007.66 1528.8768
100 94.450495 -116016.03 0 -107007.07 2282.2685
Loop time of 18.2886 on 1 procs for 100 steps with 32000 atoms
Performance: 0.472 ns/day, 50.802 hours/ns, 5.468 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 18.155 | 18.155 | 18.155 | 0.0 | 99.27
Neigh | 0.087194 | 0.087194 | 0.087194 | 0.0 | 0.48
Comm | 0.009477 | 0.009477 | 0.009477 | 0.0 | 0.05
Output | 6.7e-05 | 6.7e-05 | 6.7e-05 | 0.0 | 0.00
Modify | 0.02616 | 0.02616 | 0.02616 | 0.0 | 0.14
Other | | 0.0111 | | | 0.06
Nlocal: 32000.0 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 9667.00 ave 9667 max 9667 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 450192.0 ave 450192 max 450192 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 450192
Ave neighs/atom = 14.068500
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:21

View File

@ -0,0 +1,210 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has 9 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | A | "Double" | 1
2 | B | "Double" | 1
3 | p | "Double" | 1
4 | q | "Double" | 1
5 | sigma | "Double" | 1
6 | gamma | "Double" | 1
7 | cutoff | "Double" | 1
8 | lambda | "Double" | 1
9 | costheta0 | "Double" | 1
#=== END kim init ============================================
kim query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"]
#=== BEGIN kim-query =========================================
variable a0 string "4.146581932902336"
#=== END kim-query ===========================================
lattice fcc ${a0}
lattice fcc 4.146581932902336
Lattice spacing in x,y,z = 4.1465819 4.1465819 4.1465819
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (82.931639 82.931639 82.931639)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001 seconds
kim interactions Si
#=== BEGIN kim interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_405512056662_005.bib}
\end{document}
}
@Misc{MO_405512056662_005,
author = {Amit K Singh},
title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005},
doi = {10.25950/c74b293f},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model, MO_405512056662_005},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_335816936951_004,
author = {Mingjian Wen},
title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004},
doi = {10.25950/f3abd2d6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model Driver, MD_335816936951_004},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_405512056662_005a,
author = {Stillinger, Frank H. and Weber, Thomas A.},
doi = {10.1103/PhysRevB.31.5262},
issue = {8},
journal = {Physical Review B},
month = {Apr},
pages = {5262--5271},
publisher = {American Physical Society},
title = {Computer simulation of local order in condensed phases of silicon},
volume = {31},
year = {1985},
}
@Book{MO_405512056662_005b,
author = {Tadmor, Ellad B. and Miller, Ronald E.},
doi = {10.1017/CBO9781139003582},
publisher = {Cambridge University Press},
title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques},
year = {2011},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 41 41 41
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.489 | 3.489 | 3.489 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -126084.25 0 -107007.66 1528.8768
100 94.450495 -116016.03 0 -107007.07 2282.2685
Loop time of 5.00432 on 4 procs for 100 steps with 32000 atoms
Performance: 1.727 ns/day, 13.901 hours/ns, 19.983 timesteps/s
99.7% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 4.9281 | 4.9366 | 4.9447 | 0.3 | 98.65
Neigh | 0.02399 | 0.024135 | 0.024318 | 0.1 | 0.48
Comm | 0.020646 | 0.029014 | 0.037515 | 4.3 | 0.58
Output | 2.9e-05 | 3.325e-05 | 4.2e-05 | 0.0 | 0.00
Modify | 0.008808 | 0.0088445 | 0.00888 | 0.0 | 0.18
Other | | 0.005691 | | | 0.11
Nlocal: 8000.00 ave 8029 max 7968 min
Histogram: 1 1 0 0 0 0 0 0 0 2
Nghost: 4259.00 ave 4303 max 4202 min
Histogram: 1 0 0 0 0 0 2 0 0 1
Neighs: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 112548.0 ave 113091 max 111995 min
Histogram: 1 0 0 1 0 0 0 1 0 1
Total # of neighbors = 450192
Ave neighs/atom = 14.068500
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:07

View File

@ -0,0 +1,204 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has 9 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | A | "Double" | 1
2 | B | "Double" | 1
3 | p | "Double" | 1
4 | q | "Double" | 1
5 | sigma | "Double" | 1
6 | gamma | "Double" | 1
7 | cutoff | "Double" | 1
8 | lambda | "Double" | 1
9 | costheta0 | "Double" | 1
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.002 seconds
kim interactions Si
#=== BEGIN kim interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_405512056662_005.bib}
\end{document}
}
@Misc{MO_405512056662_005,
author = {Amit K Singh},
title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005},
doi = {10.25950/c74b293f},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model, MO_405512056662_005},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_335816936951_004,
author = {Mingjian Wen},
title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004},
doi = {10.25950/f3abd2d6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model Driver, MD_335816936951_004},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_405512056662_005a,
author = {Stillinger, Frank H. and Weber, Thomas A.},
doi = {10.1103/PhysRevB.31.5262},
issue = {8},
journal = {Physical Review B},
month = {Apr},
pages = {5262--5271},
publisher = {American Physical Society},
title = {Computer simulation of local order in condensed phases of silicon},
volume = {31},
year = {1985},
}
@Book{MO_405512056662_005b,
author = {Tadmor, Ellad B. and Miller, Ronald E.},
doi = {10.1017/CBO9781139003582},
publisher = {Cambridge University Press},
title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques},
year = {2011},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 44 44 44
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 10.44 | 10.44 | 10.44 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -85249.847 0 -66173.259 -33302.387
100 253.43357 -90346.68 0 -66173.441 -14888.698
Loop time of 17.7449 on 1 procs for 100 steps with 32000 atoms
Performance: 0.487 ns/day, 49.291 hours/ns, 5.635 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 17.64 | 17.64 | 17.64 | 0.0 | 99.41
Neigh | 0.060149 | 0.060149 | 0.060149 | 0.0 | 0.34
Comm | 0.008585 | 0.008585 | 0.008585 | 0.0 | 0.05
Output | 6.3e-05 | 6.3e-05 | 6.3e-05 | 0.0 | 0.00
Modify | 0.025324 | 0.025324 | 0.025324 | 0.0 | 0.14
Other | | 0.01057 | | | 0.06
Nlocal: 32000.0 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 7760.00 ave 7760 max 7760 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 402352.0 ave 402352 max 402352 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 402352
Ave neighs/atom = 12.573500
Neighbor list builds = 4
Dangerous builds = 0
Total wall time: 0:00:17

View File

@ -0,0 +1,204 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# `SW_StillingerWeber_1985_Si__MO_405512056662_005`
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim init ==========================================
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
This model has 9 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | A | "Double" | 1
2 | B | "Double" | 1
3 | p | "Double" | 1
4 | q | "Double" | 1
5 | sigma | "Double" | 1
6 | gamma | "Double" | 1
7 | cutoff | "Double" | 1
8 | lambda | "Double" | 1
9 | costheta0 | "Double" | 1
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001 seconds
kim interactions Si
#=== BEGIN kim interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_405512056662_005a, MO_405512056662_005b} is archived in OpenKIM~\cite{MO_405512056662_005, MD_335816936951_004, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_405512056662_005.bib}
\end{document}
}
@Misc{MO_405512056662_005,
author = {Amit K Singh},
title = {{S}tillinger-{W}eber potential for {S}i due to {S}tillinger and {W}eber (1985) v005},
doi = {10.25950/c74b293f},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model, MO_405512056662_005},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_335816936951_004,
author = {Mingjian Wen},
title = {{S}tillinger-{W}eber ({SW}) {M}odel {D}river v004},
doi = {10.25950/f3abd2d6},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/c74b293f}},
keywords = {OpenKIM, Model Driver, MD_335816936951_004},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_405512056662_005a,
author = {Stillinger, Frank H. and Weber, Thomas A.},
doi = {10.1103/PhysRevB.31.5262},
issue = {8},
journal = {Physical Review B},
month = {Apr},
pages = {5262--5271},
publisher = {American Physical Society},
title = {Computer simulation of local order in condensed phases of silicon},
volume = {31},
year = {1985},
}
@Book{MO_405512056662_005b,
author = {Tadmor, Ellad B. and Miller, Ronald E.},
doi = {10.1017/CBO9781139003582},
publisher = {Cambridge University Press},
title = {Modeling Materials: {C}ontinuum, Atomistic and Multiscale Techniques},
year = {2011},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 44 44 44
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.517 | 3.517 | 3.517 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -85249.847 0 -66173.259 -33302.387
100 253.43357 -90346.68 0 -66173.441 -14888.698
Loop time of 4.87378 on 4 procs for 100 steps with 32000 atoms
Performance: 1.773 ns/day, 13.538 hours/ns, 20.518 timesteps/s
99.7% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 4.8075 | 4.816 | 4.8244 | 0.3 | 98.81
Neigh | 0.015902 | 0.015996 | 0.016077 | 0.1 | 0.33
Comm | 0.018078 | 0.026375 | 0.034752 | 4.2 | 0.54
Output | 3e-05 | 3.5e-05 | 4.4e-05 | 0.0 | 0.00
Modify | 0.009331 | 0.0094922 | 0.009588 | 0.1 | 0.19
Other | | 0.005919 | | | 0.12
Nlocal: 8000.00 ave 8014 max 7988 min
Histogram: 1 1 0 0 0 0 1 0 0 1
Nghost: 3374.75 ave 3389 max 3361 min
Histogram: 1 0 1 0 0 0 0 1 0 1
Neighs: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 100588.0 ave 100856 max 100392 min
Histogram: 1 0 1 0 1 0 0 0 0 1
Total # of neighbors = 402352
Ave neighs/atom = 12.573500
Neighbor list builds = 4
Dangerous builds = 0
Total wall time: 0:00:04

View File

@ -0,0 +1,655 @@
LAMMPS (10 Feb 2021)
# kim query example
#
# Requirement:
#
# This example requires LAMMPS is built with KIM package. A requirement for
# the KIM package, is the KIM API library that must be downloaded from the
# OpenKIM website and installed before LAMMPS is compiled. The 'kim query'
# command requires the libcurl library to be installed. See the
# `https://lammps.sandia.gov/doc/Build_extras.html#kim` doc page for further
# details
#
# This example requires that the KIM Models
# `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`
# and
# `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000`
# are installed.
#
# This can be done with the commands
# `kim-api-collections-management install user `EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`
# `kim-api-collections-management install user `EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000`
#
# If these commands do not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
# -----------------------------------------------
# Get an equilibrium fcc crystal lattice constant
# -----------------------------------------------
kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal
#=== BEGIN kim init ==========================================
units metal
neighbor 2.0 bin # Angstroms
timestep 1.0e-3 # picoseconds
This model has 6 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | cutoff | "Double" | 1
2 | deltaRho | "Double" | 1
3 | deltaR | "Double" | 1
4 | embeddingData | "Double" | 500
5 | rPhiData | "Double" | 500
6 | densityData | "Double" | 500
#=== END kim init ============================================
kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom]
#=== BEGIN kim-query =========================================
variable latconst_1 string "4.032082033157349"
#=== END kim-query ===========================================
print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}"
FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349
# Get the lattice contant from a different model
kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005]
#=== BEGIN kim-query =========================================
variable latconst_2 string "4.024845376610756"
#=== END kim-query ===========================================
print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}"
FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756
clear
# -----------------------------------------------
# Get an equilibrium fcc crystal lattice constant
# -----------------------------------------------
kim query latconst_1 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005]
#=== BEGIN kim-query =========================================
variable latconst_1 string "4.032082033157349"
#=== END kim-query ===========================================
kim query latconst_2 get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005]
#=== BEGIN kim-query =========================================
variable latconst_2 string "4.024845376610756"
#=== END kim-query ===========================================
print "FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = ${latconst_1}"
FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349
print "FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = ${latconst_2}"
FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756
clear
# -----------------------------------------------
# Get an equilibrium hcp crystal lattice constant
# -----------------------------------------------
kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal
#=== BEGIN kim init ==========================================
units metal
neighbor 2.0 bin # Angstroms
timestep 1.0e-3 # picoseconds
This model has 6 mutable parameters.
No. | Parameter name | data type | extent
-----------------------------------------------------
1 | cutoff | "Double" | 1
2 | deltaRho | "Double" | 1
3 | deltaR | "Double" | 1
4 | embeddingData | "Double" | 10000
5 | rPhiData | "Double" | 10000
6 | densityData | "Double" | 10000
#=== END kim init ============================================
kim query latconst split get_lattice_constant_hexagonal crystal=["hcp"] species=["Zr"] units=["angstrom"]
#=== BEGIN kim-query =========================================
variable latconst_1 string 3.234055244384789
variable latconst_2 string 5.167650199630013
#=== END kim-query ===========================================
print "HCP lattice constants = ${latconst_1}, ${latconst_2}"
HCP lattice constants = 3.234055244384789, 5.167650199630013
clear
# -----------------------------------------------
# Query for KIM models from openkim.org
# Get all the EAM models that support Al
# -----------------------------------------------
kim query model index get_available_models species=[Al] potential_type=[eam]
#=== BEGIN kim-query =========================================
variable model index "EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002" "EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005" "EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005" "EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005" "EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000" "EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000" "EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005" "EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000" "EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000" "EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000" "EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000" "EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005" "EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000" "EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005" "EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005" "EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005" "EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005" "EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005" "EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005" "EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000" "EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000" "EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000" "EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005" "EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005" "EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005" "EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000" "EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000" "EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005" "EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000" "EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005" "EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005" "EAM_ErcolessiAdams_1994_Al__MO_324507536345_003" "EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003" "EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003" "EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003" "EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002" "EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002" "EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001" "EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001"
#=== END kim-query ===========================================
label model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002]
#=== BEGIN kim-query =========================================
variable latconst string "4.032082748413087"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_CubicNaturalSpline_ErcolessiAdams_1994_Al__MO_800509458712_002) = 4.032082748413087
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050000071525574"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_005) = 4.050000071525574
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.049763545393944"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_CaiYe_1996_AlCu__MO_942551040047_005) = 4.049763545393944
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.032082033157349"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005) = 4.032082033157349
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000]
#=== BEGIN kim-query =========================================
variable latconst string "3.869337007403374"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_FarkasJones_1996_NbTiAl__MO_042691367780_000) = 3.869337007403374
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000]
#=== BEGIN kim-query =========================================
variable latconst string "3.987558534741402"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_JacobsenNorskovPuska_1987_Al__MO_411692133366_000) = 3.987558534741402
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.031036108732224"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_LandaWynblattSiegel_2000_AlPb__MO_699137396381_005) = 4.031036108732224
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.03203821182251"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_LiuAdams_1998_AlMg__MO_019873715786_000) = 4.03203821182251
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000]
#=== BEGIN kim-query =========================================
variable latconst string "9.5"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_LiuErcolessiAdams_2004_Al__MO_051157671505_000) = 9.5
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.032073378562927"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_LiuLiuBorucki_1999_AlCu__MO_020851069572_000) = 4.032073378562927
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000]
#=== BEGIN kim-query =========================================
variable latconst string "8.5"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_LiuOhotnickyAdams_1997_AlMg__MO_559870613549_000) = 8.5
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.045270472764969"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MendelevAstaRahman_2009_AlMg__MO_658278549784_005) = 4.045270472764969
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.040926471352577"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MendelevFangYe_2015_AlSm__MO_338600200739_000) = 4.040926471352577
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.045259781181811"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005) = 4.045259781181811
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.03330184519291"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MendelevSrolovitzAckland_2005_AlFe__MO_577453891941_005) = 4.03330184519291
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050004702806472"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MishinFarkasMehl_1999_Al__MO_651801486679_005) = 4.050004702806472
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.051526293158533"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_MishinMehlPapaconstantopoulos_2002_NiAl__MO_109933561507_005) = 4.051526293158533
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.049999862909317"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_Mishin_2004_NiAl__MO_101214310689_005) = 4.049999862909317
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050000071525574"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_PunMishin_2009_NiAl__MO_751354403791_005) = 4.050000071525574
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.05000014603138"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_PunYamakovMishin_2013_AlCo__MO_678952612413_000) = 4.05000014603138
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.05000014603138"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_PunYamakovMishin_2013_NiAlCo__MO_826591359508_000) = 4.05000014603138
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.210718545317654"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_SchopfBrommerFrigan_2012_AlMnPd__MO_137572817842_000) = 4.210718545317654
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050010219216347"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_SturgeonLaird_2000_Al__MO_120808805541_005) = 4.050010219216347
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.049696564674378"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005) = 4.049696564674378
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.024845376610756"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_WineyKubotaGupta_2010_Al__MO_149316865608_005) = 4.024845376610756
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.031999975442885"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_Zhakhovsky_2009_Al__MO_519613893196_000) = 4.031999975442885
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.050199627876282"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ZhouJohnsonWadley_2004NISTretabulation_Al__MO_060567868558_000) = 4.050199627876282
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050180745124819"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ZhouJohnsonWadley_2004_Al__MO_131650261510_005) = 4.050180745124819
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000]
#=== BEGIN kim-query =========================================
variable latconst string "4.081654928624631"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ZhouWadleyJohnson_2001_Al__MO_049243498555_000) = 4.081654928624631
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.050000011920929"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ZopeMishin_2003_Al__MO_664470114311_005) = 4.050000011920929
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005]
#=== BEGIN kim-query =========================================
variable latconst string "4.049999445676804"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_Dynamo_ZopeMishin_2003_TiAl__MO_117656786760_005) = 4.049999445676804
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_ErcolessiAdams_1994_Al__MO_324507536345_003]
#=== BEGIN kim-query =========================================
variable latconst string "4.032082714140415"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_ErcolessiAdams_1994_Al__MO_324507536345_003) = 4.032082714140415
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003]
#=== BEGIN kim-query =========================================
variable latconst string "4.128871455788613"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_IMD_BrommerGaehler_2006A_AlNiCo__MO_122703700223_003) = 4.128871455788613
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003]
#=== BEGIN kim-query =========================================
variable latconst string "4.073718130588532"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_IMD_BrommerGaehler_2006B_AlNiCo__MO_128037485276_003) = 4.073718130588532
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003]
#=== BEGIN kim-query =========================================
variable latconst string "4.210700303316115"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_IMD_SchopfBrommerFrigan_2012_AlMnPd__MO_878712978062_003) = 4.210700303316115
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002]
#=== BEGIN kim-query =========================================
variable latconst string "4.032082897424699"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_QuinticClampedSpline_ErcolessiAdams_1994_Al__MO_450093727396_002) = 4.032082897424699
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002]
#=== BEGIN kim-query =========================================
variable latconst string "4.03208246231079"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EAM_QuinticHermiteSpline_ErcolessiAdams_1994_Al__MO_781138671863_002) = 4.03208246231079
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001]
#=== BEGIN kim-query =========================================
variable latconst string "3.994616635143757"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_AlAgAuCuNiPdPt__MO_115316750986_001) = 3.994616635143757
next model
jump SELF model_loop
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[${model}]
kim query latconst get_lattice_constant_cubic crystal=[fcc] species=[Al] units=[angstrom] model=[EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001]
#=== BEGIN kim-query =========================================
variable latconst string "3.994608342647553"
#=== END kim-query ===========================================
print "FCC lattice constant (${model}) = ${latconst}"
FCC lattice constant (EMT_Asap_Standard_JacobsenStoltzeNorskov_1996_Al__MO_623376124862_001) = 3.994608342647553
next model
jump SELF model_loop
clear
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_123629422045_005a} is archived in OpenKIM~\cite{MO_123629422045_005, MD_120291908751_005, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_123629422045_005.bib}
\end{document}
}
@Misc{MO_123629422045_005,
author = {Ryan S. Elliott},
title = {{EAM} potential ({LAMMPS} cubic hermite tabulation) for {A}l developed by {E}rcolessi and {A}dams (1994) v005},
doi = {10.25950/7cd2a6ab},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/7cd2a6ab}},
keywords = {OpenKIM, Model, MO_123629422045_005},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_120291908751_005,
author = {Ryan S. Elliott},
title = {{EAM} {M}odel {D}river for tabulated potentials with cubic {H}ermite spline interpolation as used in {LAMMPS} v005},
doi = {10.25950/68defa36},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/7cd2a6ab}},
keywords = {OpenKIM, Model Driver, MD_120291908751_005},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_123629422045_005a,
author = {F. Ercolessi and J. B. Adams},
doi = {10.1209/0295-5075/26/8/005},
journal = {Europhysics Letters},
number = {8},
pages = {583},
title = {Interatomic Potentials from First-Principles Calculations: {T}he Force-Matching Method},
volume = {26},
year = {1994},
}
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Model originally published in \cite{MO_004835508849_000a} is archived in OpenKIM~\cite{MO_004835508849_000, MD_120291908751_005, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-MO_004835508849_000.bib}
\end{document}
}
@Misc{MO_004835508849_000,
author = {Ellad Tadmor},
title = {{F}innis-{S}inclair potential ({LAMMPS} cubic hermite tabulation) for {Z}r developed by {M}endelev and {A}ckland (2007); version 3 refitted for radiation studies v000},
doi = {10.25950/7b7b5ab5},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/7b7b5ab5}},
keywords = {OpenKIM, Model, MO_004835508849_000},
publisher = {OpenKIM},
year = 2018,
}
@Misc{MD_120291908751_005,
author = {Ryan S. Elliott},
title = {{EAM} {M}odel {D}river for tabulated potentials with cubic {H}ermite spline interpolation as used in {LAMMPS} v005},
doi = {10.25950/68defa36},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/7b7b5ab5}},
keywords = {OpenKIM, Model Driver, MD_120291908751_005},
publisher = {OpenKIM},
year = 2018,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{MO_004835508849_000a,
author = {Mendelev, M. I. and Ackland, G. J.},
doi = {10.1080/09500830701191393},
journal = {Philosophical Magazine Letters},
number = {5},
pages = {349-359},
title = {Development of an interatomic potential for the simulation of phase transformations in zirconium},
volume = {87},
year = {2007},
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Total wall time: 0:01:58

View File

@ -0,0 +1,208 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Simulator Model (PM)
# `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000`
# is installed. This can be done with the command
# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# See `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real
#=== BEGIN kim init ==========================================
# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# For Simulator : LAMMPS 28 Feb 2019
# Running on : LAMMPS 10 Feb 2021
#
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
atom_style charge
neigh_modify one 4000
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.003 seconds
kim interactions O
#=== BEGIN kim interactions ==================================
variable kim_periodic equal 1
pair_style reax/c /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/lmp_control safezone 2.0 mincap 100
pair_coeff * * /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/ffield.reax.rdx O
Reading potential file /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/ffield.reax.rdx with DATE: 2010-02-19
fix reaxqeq all qeq/reax 1 0.0 10.0 1.0e-6 /var/tmp/kim-shared-library-parameter-file-directory-pgBW45WFK0TI/param.qeq
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Simulator Model originally published in \cite{SM_107643900657_000a} is archived in OpenKIM~\cite{SM_107643900657_000, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-SM_107643900657_000.bib}
\end{document}
}
@Misc{SM_107643900657_000,
author = {Ellad Tadmor},
title = {{LAMMPS} {R}eax{FF} potential for {RDX} ({C}-{H}-{N}-{O}) systems developed by {S}trachan et al. (2003) v000},
doi = {10.25950/acd3fc89},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/acd3fc89}},
keywords = {OpenKIM, Simulator Model, SM_107643900657_000},
publisher = {OpenKIM},
year = 2019,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{SM_107643900657_000a,
author = {Strachan, Alejandro and van Duin, Adri C. T. and Chakraborty, Debashis and Dasgupta, Siddharth and Goddard, William A.},
doi = {10.1103/PhysRevLett.91.098301},
issue = {9},
journal = {Physical Review Letters},
month = {Aug},
numpages = {4},
pages = {098301},
publisher = {American Physical Society},
title = {Shock Waves in High-Energy Materials: {T}he Initial Chemical Events in Nitramine {RDX}},
volume = {91},
year = {2003},
}
- pair reax/c command:
@Article{Aktulga12,
author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},
title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},
journal = {Parallel Computing},
year = 2012,
volume = 38,
pages = {245--259}
}
- fix qeq/reax command:
@Article{Aktulga12,
author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},
title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},
journal = {Parallel Computing},
year = 2012,
volume = 38,
pages = {245--259}
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 4000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15, bins = 18 18 18
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair reax/c, perpetual
attributes: half, newton off, ghost
pair build: half/bin/newtoff/ghost
stencil: half/ghost/bin/3d/newtoff
bin: standard
(2) fix qeq/reax, perpetual, copy from (1)
attributes: half, newton off, ghost
pair build: copy
stencil: none
bin: none
Per MPI rank memory allocation (min/avg/max) = 1803.0 | 1803.0 | 1803.0 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -39091.147 0 -20014.559 19501.107
100 63.198252 -26042.062 0 -20014.027 21497.661
Loop time of 40.2545 on 1 procs for 100 steps with 32000 atoms
Performance: 0.215 ns/day, 111.818 hours/ns, 2.484 timesteps/s
99.1% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 24.364 | 24.364 | 24.364 | 0.0 | 60.52
Neigh | 0.4185 | 0.4185 | 0.4185 | 0.0 | 1.04
Comm | 0.022045 | 0.022045 | 0.022045 | 0.0 | 0.05
Output | 6.6e-05 | 6.6e-05 | 6.6e-05 | 0.0 | 0.00
Modify | 15.438 | 15.438 | 15.438 | 0.0 | 38.35
Other | | 0.01285 | | | 0.03
Nlocal: 32000.0 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 26825.0 ave 26825 max 26825 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 3.73924e+06 ave 3.73924e+06 max 3.73924e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 3739236
Ave neighs/atom = 116.85112
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:41

View File

@ -0,0 +1,208 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Simulator Model (PM)
# `Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000`
# is installed. This can be done with the command
# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# See `https://openkim.org/doc/obtaining-models` for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real
#=== BEGIN kim init ==========================================
# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# For Simulator : LAMMPS 28 Feb 2019
# Running on : LAMMPS 10 Feb 2021
#
units real
neighbor 2.0 bin # Angstroms
timestep 1.0 # femtoseconds
atom_style charge
neigh_modify one 4000
#=== END kim init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001 seconds
kim interactions O
#=== BEGIN kim interactions ==================================
variable kim_periodic equal 1
pair_style reax/c /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/lmp_control safezone 2.0 mincap 100
pair_coeff * * /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/ffield.reax.rdx O
Reading potential file /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/ffield.reax.rdx with DATE: 2010-02-19
fix reaxqeq all qeq/reax 1 0.0 10.0 1.0e-6 /var/tmp/kim-shared-library-parameter-file-directory-zYQfH0ms5WSw/param.qeq
#=== END kim interactions ====================================
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
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- @Comment
{
\documentclass{article}
\usepackage{url}
\begin{document}
This Simulator Model originally published in \cite{SM_107643900657_000a} is archived in OpenKIM~\cite{SM_107643900657_000, tadmor:elliott:2011, elliott:tadmor:2011}.
\bibliographystyle{vancouver}
\bibliography{kimcite-SM_107643900657_000.bib}
\end{document}
}
@Misc{SM_107643900657_000,
author = {Ellad Tadmor},
title = {{LAMMPS} {R}eax{FF} potential for {RDX} ({C}-{H}-{N}-{O}) systems developed by {S}trachan et al. (2003) v000},
doi = {10.25950/acd3fc89},
howpublished = {OpenKIM, \url{https://doi.org/10.25950/acd3fc89}},
keywords = {OpenKIM, Simulator Model, SM_107643900657_000},
publisher = {OpenKIM},
year = 2019,
}
@Article{tadmor:elliott:2011,
author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker},
title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels},
journal = {{JOM}},
year = {2011},
volume = {63},
number = {7},
pages = {17},
doi = {10.1007/s11837-011-0102-6},
}
@Misc{elliott:tadmor:2011,
author = {Ryan S. Elliott and Ellad B. Tadmor},
title = {{K}nowledgebase of {I}nteratomic {M}odels ({KIM}) Application Programming Interface ({API})},
howpublished = {\url{https://openkim.org/kim-api}},
publisher = {OpenKIM},
year = 2011,
doi = {10.25950/ff8f563a},
}
@Article{SM_107643900657_000a,
author = {Strachan, Alejandro and van Duin, Adri C. T. and Chakraborty, Debashis and Dasgupta, Siddharth and Goddard, William A.},
doi = {10.1103/PhysRevLett.91.098301},
issue = {9},
journal = {Physical Review Letters},
month = {Aug},
numpages = {4},
pages = {098301},
publisher = {American Physical Society},
title = {Shock Waves in High-Energy Materials: {T}he Initial Chemical Events in Nitramine {RDX}},
volume = {91},
year = {2003},
}
- pair reax/c command:
@Article{Aktulga12,
author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},
title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},
journal = {Parallel Computing},
year = 2012,
volume = 38,
pages = {245--259}
}
- fix qeq/reax command:
@Article{Aktulga12,
author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},
title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},
journal = {Parallel Computing},
year = 2012,
volume = 38,
pages = {245--259}
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 4000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15, bins = 18 18 18
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair reax/c, perpetual
attributes: half, newton off, ghost
pair build: half/bin/newtoff/ghost
stencil: half/ghost/bin/3d/newtoff
bin: standard
(2) fix qeq/reax, perpetual, copy from (1)
attributes: half, newton off, ghost
pair build: copy
stencil: none
bin: none
Per MPI rank memory allocation (min/avg/max) = 630.2 | 630.2 | 630.2 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -39091.147 0 -20014.559 19501.107
100 63.198252 -26042.062 0 -20014.027 21497.661
Loop time of 15.049 on 4 procs for 100 steps with 32000 atoms
Performance: 0.574 ns/day, 41.803 hours/ns, 6.645 timesteps/s
99.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 | 9.8158 | 9.8159 | 9.8161 | 0.0 | 65.23
Neigh | 0.17685 | 0.17759 | 0.17832 | 0.1 | 1.18
Comm | 0.028692 | 0.028847 | 0.028942 | 0.1 | 0.19
Output | 2.5e-05 | 3.575e-05 | 4.6e-05 | 0.0 | 0.00
Modify | 5.0171 | 5.0179 | 5.0186 | 0.0 | 33.34
Other | | 0.008715 | | | 0.06
Nlocal: 8000.00 ave 8010 max 7993 min
Histogram: 2 0 0 0 0 1 0 0 0 1
Nghost: 12605.0 ave 12612 max 12595 min
Histogram: 1 0 0 0 1 0 0 0 0 2
Neighs: 1.00097e+06 ave 1.00187e+06 max 1.0006e+06 min
Histogram: 2 1 0 0 0 0 0 0 0 1
Total # of neighbors = 4003876
Ave neighs/atom = 125.12113
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:15

View File

@ -0,0 +1,88 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
units real
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.002 seconds
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
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
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 25367.408 6750.7421
100 98.747096 15900.676 0 25319.465 10184.453
Loop time of 1.92822 on 1 procs for 100 steps with 32000 atoms
Performance: 4.481 ns/day, 5.356 hours/ns, 51.861 timesteps/s
99.8% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.7377 | 1.7377 | 1.7377 | 0.0 | 90.12
Neigh | 0.14234 | 0.14234 | 0.14234 | 0.0 | 7.38
Comm | 0.011694 | 0.011694 | 0.011694 | 0.0 | 0.61
Output | 6.7e-05 | 6.7e-05 | 6.7e-05 | 0.0 | 0.00
Modify | 0.02476 | 0.02476 | 0.02476 | 0.0 | 1.28
Other | | 0.01163 | | | 0.60
Nlocal: 32000.0 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 19911.0 ave 19911 max 19911 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 1.96027e+06 ave 1.96027e+06 max 1.96027e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1960266
Ave neighs/atom = 61.258313
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:01

View File

@ -0,0 +1,88 @@
LAMMPS (10 Feb 2021)
# 3d Lennard-Jones melt
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
units real
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.4300000 4.4300000 4.4300000
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (88.600000 88.600000 88.600000)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001 seconds
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
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
Per MPI rank memory allocation (min/avg/max) = 7.633 | 7.633 | 7.633 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 6290.8194 0 25367.408 6750.7421
100 98.747096 15900.676 0 25319.465 10184.453
Loop time of 0.561006 on 4 procs for 100 steps with 32000 atoms
Performance: 15.401 ns/day, 1.558 hours/ns, 178.251 timesteps/s
99.6% 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.48486 | 0.48676 | 0.48817 | 0.2 | 86.77
Neigh | 0.040698 | 0.04091 | 0.041066 | 0.1 | 7.29
Comm | 0.016616 | 0.01811 | 0.0202 | 1.1 | 3.23
Output | 3e-05 | 3.575e-05 | 4.7e-05 | 0.0 | 0.01
Modify | 0.008934 | 0.009025 | 0.009142 | 0.1 | 1.61
Other | | 0.006161 | | | 1.10
Nlocal: 8000.00 ave 8012 max 7989 min
Histogram: 1 0 0 0 2 0 0 0 0 1
Nghost: 9131.00 ave 9142 max 9119 min
Histogram: 1 0 0 0 0 2 0 0 0 1
Neighs: 490066.0 ave 491443 max 489273 min
Histogram: 2 0 0 0 1 0 0 0 0 1
Total # of neighbors = 1960266
Ave neighs/atom = 61.258313
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -1,107 +0,0 @@
LAMMPS (7 Aug 2019)
# 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 xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init LennardJones_Ar real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.004321 secs
kim_interactions Ar
#=== BEGIN kim_interactions ==================================
pair_style kim LennardJones_Ar
WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974)
WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979)
pair_coeff * * Ar
#=== END kim_interactions ====================================
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
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 : real
Current step : 0
Time step : 1
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 145069.63 0 164146.22 128015.94
100 95.179703 154939.42 0 164017.94 131602.75
Loop time of 3.48256 on 1 procs for 100 steps with 32000 atoms
Performance: 2.481 ns/day, 9.674 hours/ns, 28.715 timesteps/s
98.3% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 3.0502 | 3.0502 | 3.0502 | 0.0 | 87.59
Neigh | 0.3646 | 0.3646 | 0.3646 | 0.0 | 10.47
Comm | 0.01783 | 0.01783 | 0.01783 | 0.0 | 0.51
Output | 6.8e-05 | 6.8e-05 | 6.8e-05 | 0.0 | 0.00
Modify | 0.034349 | 0.034349 | 0.034349 | 0.0 | 0.99
Other | | 0.01547 | | | 0.44
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

View File

@ -1,113 +0,0 @@
LAMMPS (7 Aug 2019)
# 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 xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init LennardJones_Ar real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.000989 secs
kim_interactions Ar
#=== BEGIN kim_interactions ==================================
pair_style kim LennardJones_Ar
WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974)
WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979)
pair_coeff * * Ar
WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974)
WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979)
#=== END kim_interactions ====================================
mass 1 39.95
velocity all create 200.0 232345 loop geom
WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974)
WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979)
WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:974)
WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:979)
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
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 : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 9.791 | 9.791 | 9.791 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 145069.63 0 164146.22 128015.94
100 95.179703 154939.42 0 164017.94 131602.75
Loop time of 0.924494 on 4 procs for 100 steps with 32000 atoms
Performance: 9.346 ns/day, 2.568 hours/ns, 108.167 timesteps/s
99.6% 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.76434 | 0.76847 | 0.77207 | 0.3 | 83.12
Neigh | 0.09089 | 0.094446 | 0.099911 | 1.1 | 10.22
Comm | 0.038599 | 0.044759 | 0.051381 | 2.1 | 4.84
Output | 3.5e-05 | 4e-05 | 4.9e-05 | 0.0 | 0.00
Modify | 0.009396 | 0.009685 | 0.009941 | 0.2 | 1.05
Other | | 0.00709 | | | 0.77
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

View File

@ -1,124 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"]
#=== BEGIN kim-query =========================================
variable a0 string 4.146581932902336
#=== END kim-query ===========================================
lattice fcc ${a0}
lattice fcc 4.146581932902336
Lattice spacing in x,y,z = 4.14658 4.14658 4.14658
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (82.9316 82.9316 82.9316)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.005415 secs
kim_interactions Si
#=== BEGIN kim_interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim_interactions ====================================
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
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 41 41 41
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 10.36 | 10.36 | 10.36 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -126084.25 0 -107007.66 1528.8768
100 94.450495 -116016.03 0 -107007.07 2282.2685
Loop time of 74.6055 on 1 procs for 100 steps with 32000 atoms
Performance: 0.116 ns/day, 207.238 hours/ns, 1.340 timesteps/s
98.6% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 74.446 | 74.446 | 74.446 | 0.0 | 99.79
Neigh | 0.096611 | 0.096611 | 0.096611 | 0.0 | 0.13
Comm | 0.014594 | 0.014594 | 0.014594 | 0.0 | 0.02
Output | 7.9e-05 | 7.9e-05 | 7.9e-05 | 0.0 | 0.00
Modify | 0.03454 | 0.03454 | 0.03454 | 0.0 | 0.05
Other | | 0.01396 | | | 0.02
Nlocal: 32000 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 9667 ave 9667 max 9667 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: 450192 ave 450192 max 450192 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 450192
Ave neighs/atom = 14.0685
Neighbor list builds = 3
Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:01:16

View File

@ -1,124 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
kim_query a0 get_lattice_constant_cubic crystal=["fcc"] species=["Si"] units=["angstrom"]
#=== BEGIN kim-query =========================================
variable a0 string 4.146581932902336
#=== END kim-query ===========================================
lattice fcc ${a0}
lattice fcc 4.146581932902336
Lattice spacing in x,y,z = 4.14658 4.14658 4.14658
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (82.9316 82.9316 82.9316)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.000946 secs
kim_interactions Si
#=== BEGIN kim_interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim_interactions ====================================
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
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 41 41 41
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 3.489 | 3.489 | 3.489 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -126084.25 0 -107007.66 1528.8768
100 94.450495 -116016.03 0 -107007.07 2282.2685
Loop time of 19.0792 on 4 procs for 100 steps with 32000 atoms
Performance: 0.453 ns/day, 52.998 hours/ns, 5.241 timesteps/s
99.4% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 18.78 | 18.855 | 18.937 | 1.5 | 98.83
Neigh | 0.026047 | 0.026274 | 0.0266 | 0.1 | 0.14
Comm | 0.09039 | 0.17196 | 0.24675 | 15.9 | 0.90
Output | 3.9e-05 | 4.975e-05 | 6.1e-05 | 0.0 | 0.00
Modify | 0.015667 | 0.015819 | 0.016008 | 0.1 | 0.08
Other | | 0.01008 | | | 0.05
Nlocal: 8000 ave 8029 max 7968 min
Histogram: 1 1 0 0 0 0 0 0 0 2
Nghost: 4259 ave 4303 max 4202 min
Histogram: 1 0 0 0 0 0 2 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 112548 ave 113091 max 111995 min
Histogram: 1 0 0 1 0 0 0 1 0 1
Total # of neighbors = 450192
Ave neighs/atom = 14.0685
Neighbor list builds = 3
Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:00:20

View File

@ -1,118 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.003591 secs
kim_interactions Si
#=== BEGIN kim_interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim_interactions ====================================
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
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 44 44 44
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 10.44 | 10.44 | 10.44 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -85249.847 0 -66173.259 -33302.387
100 253.43357 -90346.68 0 -66173.441 -14888.698
Loop time of 74.248 on 1 procs for 100 steps with 32000 atoms
Performance: 0.116 ns/day, 206.244 hours/ns, 1.347 timesteps/s
98.8% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 74.118 | 74.118 | 74.118 | 0.0 | 99.83
Neigh | 0.069623 | 0.069623 | 0.069623 | 0.0 | 0.09
Comm | 0.0137 | 0.0137 | 0.0137 | 0.0 | 0.02
Output | 7.6e-05 | 7.6e-05 | 7.6e-05 | 0.0 | 0.00
Modify | 0.031883 | 0.031883 | 0.031883 | 0.0 | 0.04
Other | | 0.01433 | | | 0.02
Nlocal: 32000 ave 32000 max 32000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 7760 ave 7760 max 7760 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: 402352 ave 402352 max 402352 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 402352
Ave neighs/atom = 12.5735
Neighbor list builds = 4
Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:01:14

View File

@ -1,118 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Portable Model (PM)
# SW_StillingerWeber_1985_Si__MO_405512056662_005
# is installed. This can be done with the command
# kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# Or, see https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init SW_StillingerWeber_1985_Si__MO_405512056662_005 real
#=== BEGIN kim-init ==========================================
units real
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.000997 secs
kim_interactions Si
#=== BEGIN kim_interactions ==================================
pair_style kim SW_StillingerWeber_1985_Si__MO_405512056662_005
pair_coeff * * Si
#=== END kim_interactions ====================================
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
Neighbor list info ...
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.07118
ghost atom cutoff = 4.07118
binsize = 2.03559, bins = 44 44 44
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair kim, perpetual
attributes: full, newton off, cut 4.07118
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 3.517 | 3.517 | 3.517 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 -85249.847 0 -66173.259 -33302.387
100 253.43357 -90346.68 0 -66173.441 -14888.698
Loop time of 19.0287 on 4 procs for 100 steps with 32000 atoms
Performance: 0.454 ns/day, 52.857 hours/ns, 5.255 timesteps/s
99.1% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 18.81 | 18.838 | 18.883 | 0.6 | 99.00
Neigh | 0.018598 | 0.01914 | 0.020732 | 0.7 | 0.10
Comm | 0.10341 | 0.1475 | 0.17393 | 7.1 | 0.78
Output | 6e-05 | 6.225e-05 | 6.7e-05 | 0.0 | 0.00
Modify | 0.014839 | 0.014925 | 0.015047 | 0.1 | 0.08
Other | | 0.008997 | | | 0.05
Nlocal: 8000 ave 8014 max 7988 min
Histogram: 1 1 0 0 0 0 1 0 0 1
Nghost: 3374.75 ave 3389 max 3361 min
Histogram: 1 0 1 0 0 0 0 1 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 100588 ave 100856 max 100392 min
Histogram: 1 0 1 0 1 0 0 0 0 1
Total # of neighbors = 402352
Ave neighs/atom = 12.5735
Neighbor list builds = 4
Dangerous builds = 0
Please see the log.cite file for references relevant to this simulation
Total wall time: 0:00:19

View File

@ -1,71 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Simulator Model (PM)
# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# is installed. This can be done with the command
# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# See https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real
#=== BEGIN kim-init ==========================================
# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# For Simulator : LAMMPS 28 Feb 2019
# Running on : LAMMPS 7 Aug 2019
#
units real
atom_style charge
neigh_modify one 4000
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.003447 secs
kim_interactions O
#=== BEGIN kim_interactions ==================================
pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6Acs1QDbXgBx/lmp_control safezone 2.0 mincap 100
ERROR: Unrecognized pair style 'reax/c' is part of the USER-REAXC package which is not enabled in this LAMMPS binary. (../force.cpp:262)
Last command: pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6Acs1QDbXgBx/lmp_control safezone 2.0 mincap 100
--------------------------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:
Process name: [[33054,1],0]
Exit code: 1
--------------------------------------------------------------------------

View File

@ -1,60 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
#
# This example requires that the KIM Simulator Model (PM)
# Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# is installed. This can be done with the command
# kim-api-collections-management install user Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# If this command does not work, you may need to setup your PATH to find the utility.
# If you installed the kim-api using the LAMMPS CMake build, you can do the following
# (where the current working directory is assumed to be the LAMMPS build directory)
# source ./kim_build-prefix/bin/kim-api-activate
# If you installed the kim-api using the LAMMPS Make build, you can do the following
# (where the current working directory is assumed to be the LAMMPS src directory)
# source ../lib/kim/installed-kim-api-X.Y.Z/bin/kim-api-activate
# (where you should relplace X.Y.Z with the appropriate kim-api version number).
#
# See https://openkim.org/doc/obtaining-models for alternative options.
#
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
kim_init Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000 real
#=== BEGIN kim-init ==========================================
# Using KIM Simulator Model : Sim_LAMMPS_ReaxFF_StrachanVanDuinChakraborty_2003_CHNO__SM_107643900657_000
# For Simulator : LAMMPS 28 Feb 2019
# Running on : LAMMPS 7 Aug 2019
#
units real
atom_style charge
neigh_modify one 4000
#=== END kim-init ============================================
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001307 secs
kim_interactions O
#=== BEGIN kim_interactions ==================================
pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6tmKtZEXzhgv/lmp_control safezone 2.0 mincap 100
ERROR: Unrecognized pair style 'reax/c' is part of the USER-REAXC package which is not enabled in this LAMMPS binary. (../force.cpp:262)
Last command: pair_style reax/c /var/tmp/kim-simulator-model-parameter-file-directory-6tmKtZEXzhgv/lmp_control safezone 2.0 mincap 100

View File

@ -1,92 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
units real
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.003037 secs
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
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 : real
Current step : 0
Time step : 1
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 25367.408 6750.7421
100 98.747096 15900.676 0 25319.465 10184.453
Loop time of 2.43768 on 1 procs for 100 steps with 32000 atoms
Performance: 3.544 ns/day, 6.771 hours/ns, 41.023 timesteps/s
97.8% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 2.1895 | 2.1895 | 2.1895 | 0.0 | 89.82
Neigh | 0.17546 | 0.17546 | 0.17546 | 0.0 | 7.20
Comm | 0.021001 | 0.021001 | 0.021001 | 0.0 | 0.86
Output | 7.9e-05 | 7.9e-05 | 7.9e-05 | 0.0 | 0.00
Modify | 0.034253 | 0.034253 | 0.034253 | 0.0 | 1.41
Other | | 0.01735 | | | 0.71
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: 1.96027e+06 ave 1.96027e+06 max 1.96027e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1960266
Ave neighs/atom = 61.2583
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:02

View File

@ -1,92 +0,0 @@
LAMMPS (7 Aug 2019)
# 3d Lennard-Jones melt
variable x index 1
variable y index 1
variable z index 1
variable xx equal 20*$x
variable xx equal 20*1
variable yy equal 20*$y
variable yy equal 20*1
variable zz equal 20*$z
variable zz equal 20*1
units real
lattice fcc 4.4300
Lattice spacing in x,y,z = 4.43 4.43 4.43
region box block 0 ${xx} 0 ${yy} 0 ${zz}
region box block 0 20 0 ${yy} 0 ${zz}
region box block 0 20 0 20 0 ${zz}
region box block 0 20 0 20 0 20
create_box 1 box
Created orthogonal box = (0 0 0) to (88.6 88.6 88.6)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 32000 atoms
create_atoms CPU = 0.001194 secs
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
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 : real
Current step : 0
Time step : 1
Per MPI rank memory allocation (min/avg/max) = 7.633 | 7.633 | 7.633 Mbytes
Step Temp E_pair E_mol TotEng Press
0 200 6290.8194 0 25367.408 6750.7421
100 98.747096 15900.676 0 25319.465 10184.453
Loop time of 0.726239 on 4 procs for 100 steps with 32000 atoms
Performance: 11.897 ns/day, 2.017 hours/ns, 137.696 timesteps/s
98.7% 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.57617 | 0.5835 | 0.59084 | 0.9 | 80.34
Neigh | 0.046682 | 0.047783 | 0.048641 | 0.3 | 6.58
Comm | 0.065469 | 0.071509 | 0.07899 | 2.3 | 9.85
Output | 3.9e-05 | 4.6e-05 | 6.1e-05 | 0.0 | 0.01
Modify | 0.013205 | 0.01363 | 0.014044 | 0.3 | 1.88
Other | | 0.009775 | | | 1.35
Nlocal: 8000 ave 8012 max 7989 min
Histogram: 1 0 0 0 2 0 0 0 0 1
Nghost: 9131 ave 9142 max 9119 min
Histogram: 1 0 0 0 0 2 0 0 0 1
Neighs: 490066 ave 491443 max 489273 min
Histogram: 2 0 0 0 1 0 0 0 0 1
Total # of neighbors = 1960266
Ave neighs/atom = 61.2583
Neighbor list builds = 3
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -8,6 +8,9 @@
#ifndef HIP_DEVICE #ifndef HIP_DEVICE
#define HIP_DEVICE #define HIP_DEVICE
// workaround after GPU package Feb2021 update
// todo: make new neighbor code work with HIP
#define LAL_USE_OLD_NEIGHBOR
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <unordered_map> #include <unordered_map>
@ -41,8 +44,8 @@ struct NVDProperties {
int maxThreadsPerBlock; int maxThreadsPerBlock;
int maxThreadsDim[3]; int maxThreadsDim[3];
int maxGridSize[3]; int maxGridSize[3];
int sharedMemPerBlock; CUDA_INT_TYPE sharedMemPerBlock;
int totalConstantMemory; CUDA_INT_TYPE totalConstantMemory;
int SIMDWidth; int SIMDWidth;
int memPitch; int memPitch;
int regsPerBlock; int regsPerBlock;
@ -362,32 +365,35 @@ UCL_Device::UCL_Device() {
CU_SAFE_CALL_NS(hipDeviceGetName(namecstr,1024,dev)); CU_SAFE_CALL_NS(hipDeviceGetName(namecstr,1024,dev));
prop.name=namecstr; prop.name=namecstr;
CU_SAFE_CALL_NS(hipDeviceTotalMem(&prop.totalGlobalMem,dev)); hipDeviceProp_t hip_prop;
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.multiProcessorCount, hipDeviceAttributeMultiprocessorCount, dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxThreadsPerBlock, hipDeviceAttributeMaxThreadsPerBlock, dev)); CU_SAFE_CALL_NS(hipGetDeviceProperties(&hip_prop,dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxThreadsDim[0], hipDeviceAttributeMaxBlockDimX, dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxThreadsDim[1], hipDeviceAttributeMaxBlockDimY, dev)); prop.totalGlobalMem = hip_prop.totalGlobalMem;
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxThreadsDim[2], hipDeviceAttributeMaxBlockDimZ, dev)); prop.multiProcessorCount = hip_prop.multiProcessorCount;
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxGridSize[0], hipDeviceAttributeMaxGridDimX, dev)); prop.maxThreadsPerBlock = hip_prop.maxThreadsPerBlock;
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxGridSize[1], hipDeviceAttributeMaxGridDimY, dev)); prop.maxThreadsDim[0] = hip_prop.maxThreadsDim[0];
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.maxGridSize[2], hipDeviceAttributeMaxGridDimZ, dev)); prop.maxThreadsDim[1] = hip_prop.maxThreadsDim[1];
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.sharedMemPerBlock, hipDeviceAttributeMaxSharedMemoryPerBlock, dev)); prop.maxThreadsDim[2] = hip_prop.maxThreadsDim[2];
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.totalConstantMemory, hipDeviceAttributeTotalConstantMemory, dev)); prop.maxGridSize[0] = hip_prop.maxGridSize[0];
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.SIMDWidth, hipDeviceAttributeWarpSize, dev)); prop.maxGridSize[1] = hip_prop.maxGridSize[1];
prop.maxGridSize[2] = hip_prop.maxGridSize[2];
prop.sharedMemPerBlock = hip_prop.sharedMemPerBlock;
prop.totalConstantMemory = hip_prop.totalConstMem;
prop.SIMDWidth = hip_prop.warpSize;
prop.regsPerBlock = hip_prop.regsPerBlock;
prop.clockRate = hip_prop.clockRate;
prop.computeMode = hip_prop.computeMode;
//CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.memPitch, CU_DEVICE_ATTRIBUTE_MAX_PITCH, dev)); //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.memPitch, CU_DEVICE_ATTRIBUTE_MAX_PITCH, dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.regsPerBlock, hipDeviceAttributeMaxRegistersPerBlock, dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.clockRate, hipDeviceAttributeClockRate, dev));
//CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.textureAlign, CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, dev)); //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.textureAlign, CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, dev));
//#if CUDA_VERSION >= 2020 //#if CUDA_VERSION >= 2020
//CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.kernelExecTimeoutEnabled, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT,dev)); //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.kernelExecTimeoutEnabled, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT,dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.integrated, hipDeviceAttributeIntegrated, dev)); CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.integrated, hipDeviceAttributeIntegrated, dev));
//CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.canMapHostMemory, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, dev)); //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.canMapHostMemory, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, dev));
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.computeMode, hipDeviceAttributeComputeMode,dev));
//#endif //#endif
//#if CUDA_VERSION >= 3010 //#if CUDA_VERSION >= 3010
CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.concurrentKernels, hipDeviceAttributeConcurrentKernels, dev)); prop.concurrentKernels = hip_prop.concurrentKernels;
//CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.ECCEnabled, CU_DEVICE_ATTRIBUTE_ECC_ENABLED, dev)); //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.ECCEnabled, CU_DEVICE_ATTRIBUTE_ECC_ENABLED, dev));
//#endif //#endif

View File

@ -69,6 +69,9 @@ class UCL_Program {
return _device_ptr->load_module(program, _module, log); return _device_ptr->load_module(program, _module, log);
} }
/// Return the default command queue/stream associated with this data
inline hipStream_t & cq() { return _cq; }
friend class UCL_Kernel; friend class UCL_Kernel;
private: private:
hipModule_t _module; hipModule_t _module;

View File

@ -13,15 +13,14 @@
// email : brownw@ornl.gov // email : brownw@ornl.gov
// ***************************************************************************/ // ***************************************************************************/
#ifdef NV_KERNEL #if defined(NV_KERNEL) || defined(USE_HIP)
#include "lal_aux_fun1.h" #include "lal_aux_fun1.h"
#ifndef _DOUBLE_DOUBLE #ifndef _DOUBLE_DOUBLE
texture<float4> pos_tex; _texture(pos_tex, float4);
texture<float> q_tex; _texture(q_tex, float);
#else #else
texture<int4,1> pos_tex; _texture_2d(pos_tex, int4);
texture<int2> q_tex; _texture(q_tex, int2);
#endif #endif
#else #else

View File

@ -400,6 +400,7 @@ class PyLammps(object):
self.lmp = lammps(name=name,cmdargs=cmdargs,ptr=None,comm=comm) self.lmp = lammps(name=name,cmdargs=cmdargs,ptr=None,comm=comm)
print("LAMMPS output is captured by PyLammps wrapper") print("LAMMPS output is captured by PyLammps wrapper")
self._cmd_history = [] self._cmd_history = []
self._enable_cmd_history = False
self.runs = [] self.runs = []
def __del__(self): def __del__(self):
@ -434,6 +435,24 @@ class PyLammps(object):
""" """
self.lmp.file(file) self.lmp.file(file)
@property
def enable_cmd_history(self):
"""
:getter: Return whether command history is saved
:setter: Set if command history should be saved
:type: bool
"""
return self._enable_cmd_history
@enable_cmd_history.setter
def enable_cmd_history(self, value):
"""
:getter: Return whether command history is saved
:setter: Set if command history should be saved
:type: bool
"""
self._enable_cmd_history = (value == True)
def write_script(self, filepath): def write_script(self, filepath):
""" """
Write LAMMPS script file containing all commands executed up until now Write LAMMPS script file containing all commands executed up until now
@ -445,17 +464,27 @@ class PyLammps(object):
for cmd in self._cmd_history: for cmd in self._cmd_history:
print(cmd, file=f) print(cmd, file=f)
def clear_cmd_history(self):
"""
Clear LAMMPS command history up to this point
"""
self._cmd_history = []
def command(self, cmd): def command(self, cmd):
""" """
Execute LAMMPS command Execute LAMMPS command
All commands executed will be stored in a command history which can be If :py:attr:`PyLammps.enable_cmd_history` is set to ``True``, commands executed
written to a file using :py:meth:`PyLammps.write_script()` will be recorded. The entire command history can be written to a file using
:py:meth:`PyLammps.write_script()`. To clear the command history, use
:py:meth:`PyLammps.clear_cmd_history()`.
:param cmd: command string that should be executed :param cmd: command string that should be executed
:type: cmd: string :type: cmd: string
""" """
self.lmp.command(cmd) self.lmp.command(cmd)
if self.enable_cmd_history:
self._cmd_history.append(cmd) self._cmd_history.append(cmd)
def run(self, *args, **kwargs): def run(self, *args, **kwargs):

98
src/KIM/kim_command.cpp Normal file
View File

@ -0,0 +1,98 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://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 authors: Axel Kohlmeyer (Temple U),
Yaser Afshar (UMN)
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
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 <https://www.gnu.org/licenses>.
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-2.1.0 (and newer) package
------------------------------------------------------------------------- */
#include "kim_command.h"
#include "error.h"
// include KIM sub-command headers here
#include "kim_init.h"
#include "kim_interactions.h"
#include "kim_param.h"
#include "kim_property.h"
#include "kim_query.h"
#include <memory>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
void KimCommand::command(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal kim command");
const std::string subcmd(arg[0]);
narg--;
arg++;
if (subcmd == "init") {
std::unique_ptr<KimInit> cmd(new KimInit(lmp));
cmd->command(narg, arg);
} else if (subcmd == "interactions") {
std::unique_ptr<KimInteractions> cmd(new KimInteractions(lmp));
cmd->command(narg, arg);
} else if (subcmd == "param") {
std::unique_ptr<KimParam> cmd(new KimParam(lmp));
cmd->command(narg, arg);
} else if (subcmd == "property") {
std::unique_ptr<KimProperty> cmd(new KimProperty(lmp));
cmd->command(narg, arg);
} else if (subcmd == "query") {
std::unique_ptr<KimQuery> cmd(new KimQuery(lmp));
cmd->command(narg, arg);
} else error->all(FLERR, fmt::format("Unknown kim subcommand {}", subcmd));
}

83
src/KIM/kim_command.h Normal file
View File

@ -0,0 +1,83 @@
/* -*- 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.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
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 <https://www.gnu.org/licenses>.
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-2.1.0 (and newer) package
------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim,KimCommand)
#else
#ifndef LMP_KIM_COMMAND_H
#define LMP_KIM_COMMAND_H
#include "pointers.h"
namespace LAMMPS_NS {
class KimCommand : protected Pointers {
public:
KimCommand(class LAMMPS *lmp) : Pointers(lmp) {};
void command(int, char **);
};
}
#endif
#endif
/* ERROR/WARNING messages:
*/

View File

@ -81,17 +81,17 @@ using namespace LAMMPS_NS;
void KimInit::command(int narg, char **arg) void KimInit::command(int narg, char **arg)
{ {
if ((narg < 2) || (narg > 3)) error->all(FLERR,"Illegal kim_init command"); if ((narg < 2) || (narg > 3)) error->all(FLERR, "Illegal 'kim init' command");
if (domain->box_exist) if (domain->box_exist)
error->all(FLERR,"Must use 'kim_init' command before " error->all(FLERR, "Must use 'kim init' command before "
"simulation box is defined"); "simulation box is defined");
char *model_name = utils::strdup(arg[0]); char *model_name = utils::strdup(arg[0]);
char *user_units = utils::strdup(arg[1]); char *user_units = utils::strdup(arg[1]);
if (narg == 3) { if (narg == 3) {
if (strcmp(arg[2], "unit_conversion_mode")==0) unit_conversion_mode = true; if (strcmp(arg[2], "unit_conversion_mode")==0) unit_conversion_mode = true;
else { else {
error->all(FLERR,fmt::format("Illegal kim_init command.\nThe argument " error->all(FLERR, fmt::format("Illegal 'kim init' command.\nThe argument "
"followed by unit_style {} is an optional " "followed by unit_style {} is an optional "
"argument and when is used must " "argument and when is used must "
"be unit_conversion_mode", user_units)); "be unit_conversion_mode", user_units));
@ -101,10 +101,8 @@ void KimInit::command(int narg, char **arg)
char *model_units; char *model_units;
KIM_Model *pkim = nullptr; KIM_Model *pkim = nullptr;
if (universe->me == 0) if (universe->me == 0) std::remove("kim.log");
std::remove("kim.log"); if (universe->nprocs > 1) MPI_Barrier(universe->uworld);
if (universe->nprocs > 1)
MPI_Barrier(universe->uworld);
determine_model_type_and_units(model_name, user_units, &model_units, pkim); determine_model_type_and_units(model_name, user_units, &model_units, pkim);
@ -283,7 +281,8 @@ void KimInit::determine_model_type_and_units(char * model_name,
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM_Model *&pkim) void KimInit::do_init(char *model_name, char *user_units, char *model_units,
KIM_Model *&pkim)
{ {
// create storage proxy fix. delete existing fix, if needed. // create storage proxy fix. delete existing fix, if needed.
@ -298,7 +297,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM
fix_store->setptr("model_units", (void *) model_units); fix_store->setptr("model_units", (void *) model_units);
// Begin output to log file // Begin output to log file
input->write_echo("#=== BEGIN kim-init ==========================================\n"); input->write_echo("#=== BEGIN kim init ==================================="
"=======\n");
KIM_SimulatorModel * simulatorModel; KIM_SimulatorModel * simulatorModel;
if (model_type == SM) { if (model_type == SM) {
@ -347,6 +347,24 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM
cmd += model_units; cmd += model_units;
input->one(cmd); input->one(cmd);
// Set the skin and timestep default values as
// 2.0 Angstroms and 1.0 femtosecond
std::string skin_cmd =
(strcmp(model_units, "real") == 0) ? "neighbor 2.0 bin # Angstroms":
(strcmp(model_units, "metal") == 0) ? "neighbor 2.0 bin # Angstroms":
(strcmp(model_units, "si") == 0) ? "neighbor 2e-10 bin # meters":
(strcmp(model_units, "cgs") == 0) ? "neighbor 2e-8 bin # centimeters":
"neighbor 3.77945224 bin # Bohr";
std::string step_cmd =
(strcmp(model_units, "real") == 0) ? "timestep 1.0 # femtoseconds":
(strcmp(model_units, "metal") == 0) ? "timestep 1.0e-3 # picoseconds":
(strcmp(model_units, "si") == 0) ? "timestep 1e-15 # seconds":
(strcmp(model_units, "cgs") == 0) ? "timestep 1e-15 # seconds":
"timestep 1.0 # femtoseconds";
input->one(skin_cmd);
input->one(step_cmd);
if (model_type == SM) { if (model_type == SM) {
int sim_fields, sim_lines; int sim_fields, sim_lines;
char const *sim_field, *sim_value; char const *sim_field, *sim_value;
@ -407,7 +425,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM
} }
// End output to log file // End output to log file
input->write_echo("#=== END kim-init ============================================\n\n"); input->write_echo("#=== END kim init ====================================="
"=======\n\n");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -452,9 +471,7 @@ void KimInit::do_variables(const std::string &from, const std::string &to)
variable->set(var_str + " internal 1.0"); variable->set(var_str + " internal 1.0");
v_unit = variable->find(var_str.c_str()); v_unit = variable->find(var_str.c_str());
} }
ier = lammps_unit_conversion(units[i], ier = lammps_unit_conversion(units[i], from, to,
from,
to,
conversion_factor); conversion_factor);
if (ier != 0) if (ier != 0)
error->all(FLERR, fmt::format("Unable to obtain conversion factor: " error->all(FLERR, fmt::format("Unable to obtain conversion factor: "

View File

@ -56,12 +56,6 @@
Designed for use with the kim-api-2.1.0 (and newer) package Designed for use with the kim-api-2.1.0 (and newer) package
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim_init,KimInit)
#else
#ifndef LMP_KIM_INIT_H #ifndef LMP_KIM_INIT_H
#define LMP_KIM_INIT_H #define LMP_KIM_INIT_H
@ -89,7 +83,6 @@ class KimInit : protected Pointers {
} }
#endif
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:

View File

@ -83,10 +83,10 @@ using namespace LAMMPS_NS;
void KimInteractions::command(int narg, char **arg) void KimInteractions::command(int narg, char **arg)
{ {
if (narg < 1) error->all(FLERR,"Illegal kim_interactions command"); if (narg < 1) error->all(FLERR, "Illegal 'kim interactions' command");
if (!domain->box_exist) if (!domain->box_exist)
error->all(FLERR,"Must use 'kim_interactions' command after " error->all(FLERR, "Must use 'kim interactions' command after "
"simulation box is defined"); "simulation box is defined");
do_setup(narg, arg); do_setup(narg, arg);
@ -100,10 +100,10 @@ void KimInteractions::do_setup(int narg, char **arg)
if ((narg == 1) && (0 == strcmp("fixed_types", arg[0]))) { if ((narg == 1) && (0 == strcmp("fixed_types", arg[0]))) {
fixed_types = true; fixed_types = true;
} else if (narg != atom->ntypes) { } else if (narg != atom->ntypes) {
error->all(FLERR,fmt::format("Illegal kim_interactions command.\nThe " error->all(FLERR, fmt::format("Illegal 'kim interactions' command.\nThe "
"LAMMPS simulation has {} atom type(s), but " "LAMMPS simulation has {} atom type(s), but "
"{} chemical species passed to the " "{} chemical species passed to the "
"kim_interactions command", "'kim interactions' command",
atom->ntypes, narg)); atom->ntypes, narg));
} else { } else {
fixed_types = false; fixed_types = false;
@ -112,7 +112,7 @@ void KimInteractions::do_setup(int narg, char **arg)
char *model_name = nullptr; char *model_name = nullptr;
KIM_SimulatorModel *simulatorModel(nullptr); KIM_SimulatorModel *simulatorModel(nullptr);
// check if we had a kim_init command by finding fix STORE/KIM // check if we had a kim init command by finding fix STORE/KIM
// retrieve model name and pointer to simulator model class instance. // retrieve model name and pointer to simulator model class instance.
// validate model name if not given as null pointer. // validate model name if not given as null pointer.
@ -121,10 +121,11 @@ void KimInteractions::do_setup(int narg, char **arg)
FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix];
model_name = (char *)fix_store->getptr("model_name"); model_name = (char *)fix_store->getptr("model_name");
simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model"); simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model");
} else error->all(FLERR,"Must use 'kim_init' before 'kim_interactions'"); } else error->all(FLERR, "Must use 'kim init' before 'kim interactions'");
// Begin output to log file // Begin output to log file
input->write_echo("#=== BEGIN kim_interactions ==================================\n"); input->write_echo("#=== BEGIN kim interactions ==========================="
"=======\n");
if (simulatorModel) { if (simulatorModel) {
if (!fixed_types) { if (!fixed_types) {
@ -211,7 +212,7 @@ void KimInteractions::do_setup(int narg, char **arg)
// * This is an INTERNAL command. // * This is an INTERNAL command.
// * It is intended for use only by KIM Simulator Models. // * It is intended for use only by KIM Simulator Models.
// * It is not possible to use this command outside of the context // * It is not possible to use this command outside of the context
// of the kim_interactions command and KIM Simulator Models. // of the kim interactions command and KIM Simulator Models.
// * The command performs a transformation from symbolic // * The command performs a transformation from symbolic
// string-based atom types to lammps numeric atom types for // string-based atom types to lammps numeric atom types for
// the pair_coeff and charge settings. // the pair_coeff and charge settings.
@ -250,7 +251,8 @@ void KimInteractions::do_setup(int narg, char **arg)
} }
// End output to log file // End output to log file
input->write_echo("#=== END kim_interactions ====================================\n\n"); input->write_echo("#=== END kim interactions ============================="
"=======\n\n");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -56,12 +56,6 @@
Designed for use with the kim-api-2.1.0 (and newer) package Designed for use with the kim-api-2.1.0 (and newer) package
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim_interactions,KimInteractions)
#else
#ifndef LMP_KIM_INTERACTIONS_H #ifndef LMP_KIM_INTERACTIONS_H
#define LMP_KIM_INTERACTIONS_H #define LMP_KIM_INTERACTIONS_H
@ -81,7 +75,6 @@ class KimInteractions : protected Pointers {
} }
#endif
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:

View File

@ -134,42 +134,30 @@ void get_kim_unit_names(
KimParam::KimParam(LAMMPS *lmp) : Pointers(lmp) {} KimParam::KimParam(LAMMPS *lmp) : Pointers(lmp) {}
KimParam::~KimParam() {}
void KimParam::command(int narg, char **arg) void KimParam::command(int narg, char **arg)
{ {
// kim_param is a command for // kim param is a command for
// getting/setting the value of a %KIM PM parameter // getting/setting the value of a %KIM PM parameter
// //
// kim_param get param_name index_range variables formatarg // kim param get param_name index_range variables formatarg
// kim_param set param_name index_range values // kim param set param_name index_range values
//
// kim param get paramname 1 varname
// kim param get paramname index_range varname_1, ..., varname_N
// kim param get paramname index_range varname_base split
// kim param get paramname index_range varname_base list
// kim param set paramname index_range values
// kim_param get paramname 1 varname if (narg < 4) error->all(FLERR, "Illegal 'kim param' command");
// kim_param get paramname index_range varname_1, ..., varname_N
// kim_param get paramname index_range varname_base split
// kim_param get paramname index_range varname_base list
// kim_param set paramname index_range values
if (narg < 4) std::string kim_param_get_set(arg[0]);
error->all(FLERR, "Illegal kim_param command");
std::string kim_param_get_set = arg[0];
if ((kim_param_get_set != "get") && (kim_param_get_set != "set")) { if ((kim_param_get_set != "get") && (kim_param_get_set != "set")) {
std::string msg("Incorrect arguments in kim_param command.\n"); std::string msg("Incorrect arguments in 'kim param' command.\n");
msg += "'kim_param get/set' is mandatory"; msg += "'kim param get/set' is mandatory";
error->all(FLERR, msg); error->all(FLERR, msg);
} }
// Check if we called a kim_init command
// by finding fix STORE/KIM
// retrieve model name and model units.
char *model_name;
char *model_units;
bool isPortableModel(false);
int const ifix = modify->find_fix("KIM_MODEL_STORE"); int const ifix = modify->find_fix("KIM_MODEL_STORE");
if (ifix >= 0) { if (ifix >= 0) {
FixStoreKIM *fix_store = reinterpret_cast<FixStoreKIM *>(modify->fix[ifix]); FixStoreKIM *fix_store = reinterpret_cast<FixStoreKIM *>(modify->fix[ifix]);
@ -178,31 +166,25 @@ void KimParam::command(int narg, char **arg)
reinterpret_cast<KIM_SimulatorModel *>( reinterpret_cast<KIM_SimulatorModel *>(
fix_store->getptr("simulator_model")); fix_store->getptr("simulator_model"));
isPortableModel = simulatorModel ? false : true; if (simulatorModel)
if (!isPortableModel) error->all(FLERR,
error->all(FLERR, "kim_param can only be used with a KIM Portable Model"); "'kim param' can only be used with a KIM Portable Model");
}
model_name = (char *)fix_store->getptr("model_name"); input->write_echo(fmt::format("#=== BEGIN kim param {} ==================="
model_units = (char *)fix_store->getptr("model_units");
} else
error->all(FLERR, "Must use 'kim_init' before 'kim_param'");
input->write_echo(fmt::format("#=== BEGIN kim-param {} ==================="
"==================\n", kim_param_get_set)); "==================\n", kim_param_get_set));
KIM_Model *pkim = nullptr; KIM_Model *pkim = nullptr;
std::string atom_type_list; std::string atom_type_list;
int kim_error;
bool isPairStyleAssigned = force->pair ? true : false; bool isPairStyleAssigned = force->pair ? true : false;
if (isPairStyleAssigned) { if (isPairStyleAssigned) {
Pair *pair = force->pair_match("kim", 1, 0); Pair *pair = force->pair_match("kim", 1, 0);
if (pair) { if (pair) {
PairKIM *pairKIM = reinterpret_cast<PairKIM *>(pair); PairKIM *pairKIM = reinterpret_cast<PairKIM *>(pair);
pkim = pairKIM->get_KIM_Model(); pkim = pairKIM->get_kim_model();
if (!pkim) if (!pkim)
error->all(FLERR, "Unable to get the KIM Portable Model"); error->all(FLERR, "Unable to get the KIM Portable Model");
@ -215,40 +197,11 @@ void KimParam::command(int narg, char **arg)
error->all(FLERR, "Pair style is defined, but there is " error->all(FLERR, "Pair style is defined, but there is "
"no match for kim style in lammps"); "no match for kim style in lammps");
} else { } else {
if (kim_param_get_set == "set") { auto msg = fmt::format("Illegal 'kim param {0}' command.\nTo {0} the new "
std::string msg("Wrong 'kim_param set' command.\n"); "parameter values, pair style must be assigned.\n"
msg += "To set the new parameter values, pair style must "; "Must use 'kim interactions' or 'pair_style kim' "
msg += "be assigned.\nMust use 'kim_interactions' or"; "before 'kim param {0}'", kim_param_get_set);
msg += "'pair_style kim' before 'kim_param set'";
error->all(FLERR, msg); error->all(FLERR, msg);
} else {
KIM_LengthUnit lengthUnit;
KIM_EnergyUnit energyUnit;
KIM_ChargeUnit chargeUnit;
KIM_TemperatureUnit temperatureUnit;
KIM_TimeUnit timeUnit;
get_kim_unit_names(model_units, lengthUnit, energyUnit,
chargeUnit, temperatureUnit, timeUnit,
error);
int units_accepted;
kim_error = KIM_Model_Create(KIM_NUMBERING_zeroBased,
lengthUnit,
energyUnit,
chargeUnit,
temperatureUnit,
timeUnit,
model_name,
&units_accepted,
&pkim);
if (kim_error)
error->all(FLERR, "Unable to create KIM Portable Model");
auto logID = fmt::format("{}_Model", comm->me);
KIM_Model_SetLogID(pkim, logID.c_str());
}
} }
// Get the number of mutable parameters in the kim model // Get the number of mutable parameters in the kim model
@ -258,6 +211,7 @@ void KimParam::command(int narg, char **arg)
if (numberOfParameters) { if (numberOfParameters) {
// Get the parameters // Get the parameters
if (kim_param_get_set == "get") { if (kim_param_get_set == "get") {
int kim_error;
// Parameter name // Parameter name
char *paramname = nullptr; char *paramname = nullptr;
// Variable name // Variable name
@ -289,7 +243,7 @@ void KimParam::command(int narg, char **arg)
} }
if (param_index >= numberOfParameters) { if (param_index >= numberOfParameters) {
auto msg = fmt::format("Wrong argument in kim_param get command.\n" auto msg = fmt::format("Wrong argument in 'kim param get' command.\n"
"This Model does not have the requested '{}' " "This Model does not have the requested '{}' "
"parameter", paramname); "parameter", paramname);
error->all(FLERR, msg); error->all(FLERR, msg);
@ -338,7 +292,7 @@ void KimParam::command(int narg, char **arg)
nubound = nlbound; nubound = nlbound;
} }
} else { } else {
std::string msg("Wrong number of arguments in 'kim_param get' "); std::string msg("Wrong number of arguments in 'kim param get' ");
msg += "command.\nIndex range after parameter name is mandatory"; msg += "command.\nIndex range after parameter name is mandatory";
error->all(FLERR, msg); error->all(FLERR, msg);
} }
@ -349,8 +303,10 @@ void KimParam::command(int narg, char **arg)
if (i < narg) { if (i < narg) {
// Get the variable/variable_base name // Get the variable/variable_base name
varname = arg[i++]; varname = arg[i++];
if (varname == "split" || varname == "list" || varname == "explicit")
error->all(FLERR, "Illegal variable name in 'kim param get'");
} else { } else {
std::string msg("Wrong number of arguments in 'kim_param get' "); std::string msg("Wrong number of arguments in 'kim param get' ");
msg += "command.\nThe LAMMPS variable name is mandatory"; msg += "command.\nThe LAMMPS variable name is mandatory";
error->all(FLERR, msg); error->all(FLERR, msg);
} }
@ -365,28 +321,35 @@ void KimParam::command(int narg, char **arg)
for (int j = 0, k = nlbound; j < nvars; ++j, ++k) { for (int j = 0, k = nlbound; j < nvars; ++j, ++k) {
varsname[j] = fmt::format("{}_{}", varname, k); varsname[j] = fmt::format("{}_{}", varname, k);
} }
++i;
} else if (strcmp(arg[i], "list") == 0) { } else if (strcmp(arg[i], "list") == 0) {
list_requested = true; list_requested = true;
varsname.resize(1); varsname.resize(1);
varsname[0] = varname; varsname[0] = varname;
++i;
// Default explicit (optional) formatarg // Default explicit (optional) formatarg
} else if (i - 1 + nvars < narg) { } else if (i - 1 + nvars - 1 < narg) {
varsname.resize(nvars); varsname.resize(nvars);
--i; --i;
for (int j = 0; j < nvars; ++j, ++i) varsname[j] = arg[i]; for (int j = 0; j < nvars; ++j, ++i) {
varsname[j] = arg[i];
if (varsname[j] == "split" || varsname[j] == "list" ||
varsname[j] == "explicit")
error->all(FLERR, "Illegal variable name in 'kim param get'");
}
if (i < narg) { if (i < narg) {
if (strcmp(arg[i], "explicit") == 0) ++i; if (strcmp(arg[i], "explicit") == 0) ++i;
} }
} else { } else {
auto msg = auto msg =
fmt::format("Wrong number of arguments in 'kim_param get' " fmt::format("Wrong number of arguments in 'kim param get' "
"command.\nThe LAMMPS '{}' variable names or " "command.\nThe LAMMPS '{}' variable names or "
"'{} split' is mandatory", nvars, varname); "'{} split' is mandatory", nvars, varname);
error->all(FLERR, msg); error->all(FLERR, msg);
} }
} else { } else {
auto msg = auto msg =
fmt::format("Wrong number of arguments in 'kim_param get' " fmt::format("Wrong number of arguments in 'kim param get' "
"command.\nThe LAMMPS '{}' variable names or " "command.\nThe LAMMPS '{}' variable names or "
"'{} split/list' is mandatory", nvars, varname); "'{} split/list' is mandatory", nvars, varname);
error->all(FLERR, msg); error->all(FLERR, msg);
@ -399,8 +362,7 @@ void KimParam::command(int narg, char **arg)
++i; ++i;
} else { } else {
if ((strcmp(arg[i], "list") == 0) || if ((strcmp(arg[i], "list") == 0) ||
(strcmp(arg[i], "explicit") == 0)) (strcmp(arg[i], "explicit") == 0)) ++i;
++i;
varsname[0] = varname; varsname[0] = varname;
} }
@ -430,7 +392,7 @@ void KimParam::command(int narg, char **arg)
str += fmt::format(" {}", V); str += fmt::format(" {}", V);
} }
auto setcmd = fmt::format("{} string {}", varsname[0], str); auto setcmd = fmt::format("{} string \"{}\"", varsname[0], str);
input->variable->set(setcmd); input->variable->set(setcmd);
input->write_echo(fmt::format("variable {}\n", setcmd)); input->write_echo(fmt::format("variable {}\n", setcmd));
@ -468,7 +430,7 @@ void KimParam::command(int narg, char **arg)
str += fmt::format(" {}", V); str += fmt::format(" {}", V);
} }
auto setcmd = fmt::format("{} string {}", varsname[0], str); auto setcmd = fmt::format("{} string \"{}\"", varsname[0], str);
input->variable->set(setcmd); input->variable->set(setcmd);
input->write_echo(fmt::format("variable {}\n", setcmd)); input->write_echo(fmt::format("variable {}\n", setcmd));
@ -497,9 +459,6 @@ void KimParam::command(int narg, char **arg)
} else } else
error->all(FLERR, "This model has No mutable parameters"); error->all(FLERR, "This model has No mutable parameters");
if (!isPairStyleAssigned) input->write_echo(fmt::format("#=== END kim param {} ====================="
KIM_Model_Destroy(&pkim);
input->write_echo(fmt::format("#=== END kim-param {} ====================="
"==================\n", kim_param_get_set)); "==================\n", kim_param_get_set));
} }

View File

@ -55,12 +55,6 @@
Designed for use with the kim-api-2.1.0 (and newer) package Designed for use with the kim-api-2.1.0 (and newer) package
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim_param, KimParam)
#else
#ifndef LMP_KIM_PARAM_H #ifndef LMP_KIM_PARAM_H
#define LMP_KIM_PARAM_H #define LMP_KIM_PARAM_H
@ -73,16 +67,12 @@ class KimParam : protected Pointers
{ {
public: public:
KimParam(class LAMMPS *lmp); KimParam(class LAMMPS *lmp);
~KimParam();
void command(int, char **); void command(int, char **);
}; };
} // namespace LAMMPS_NS }
#endif // LMP_KIM_PARAM_H #endif
#endif // COMMAND_CLASS
/* ERROR/WARNING messages: /* ERROR/WARNING messages:

View File

@ -70,37 +70,33 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
kimProperty::kimProperty(LAMMPS *lmp) : Pointers(lmp) KimProperty::KimProperty(LAMMPS *lmp) : Pointers(lmp)
{ {
// one-time initialization of Python interpreter // one-time initialization of Python interpreter
python->init(); python->init();
if (!python->has_minimum_version(3, 6)) { if (!python->has_minimum_version(3, 6))
error->all(FLERR, "Invalid Python version.\n" error->all(FLERR, "Invalid Python version.\nThe kim-property Python "
"The kim-property Python package requires Python " "package requires Python 3 >= 3.6 support");
"3 >= 3.6 support.");
}
} }
void kimProperty::command(int narg, char **arg) void KimProperty::command(int narg, char **arg)
{ {
#if LMP_PYTHON #if LMP_PYTHON
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
if (narg < 2) if (narg < 2) error->all(FLERR, "Invalid 'kim property' command");
error->all(FLERR, "Invalid kim_property command.");
if (!(strcmp(arg[0], "create") == 0) && if (!(strcmp(arg[0], "create") == 0) &&
!(strcmp(arg[0], "destroy") == 0) && !(strcmp(arg[0], "destroy") == 0) &&
!(strcmp(arg[0], "modify") == 0) && !(strcmp(arg[0], "modify") == 0) &&
!(strcmp(arg[0], "remove") == 0) && !(strcmp(arg[0], "remove") == 0) &&
!(strcmp(arg[0], "dump") == 0)) { !(strcmp(arg[0], "dump") == 0)) {
std::string msg("Incorrect arguments in kim_property command.\n"); std::string msg("Incorrect arguments in 'kim property' command.\n");
msg += "'kim_property create/destroy/modify/remove/dump' "; msg += "'kim property create/destroy/modify/remove/dump' is mandatory";
msg += "is mandatory.";
error->all(FLERR, msg); error->all(FLERR, msg);
} }
input->write_echo("#=== kim-property ===========================================\n"); input->write_echo("#=== kim property ====================================="
"======\n");
// Get the kim_str ptr to the data associated with a kim_property_str // Get the kim_str ptr to the data associated with a kim_property_str
// variable // variable
@ -115,18 +111,18 @@ void kimProperty::command(int narg, char **arg)
PyObject *obj = PyUnicode_FromString("kim_property"); PyObject *obj = PyUnicode_FromString("kim_property");
if (!obj) { if (!obj) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Creating a 'PyObject'!"); error->all(FLERR, "Failed to create a 'PyObject'");
} }
kim_property = PyImport_Import(obj); kim_property = PyImport_Import(obj);
if (!kim_property) { if (!kim_property) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to import Python kim_property module!" std::string msg("Unable to import Python kim_property module!");
"\nkim-property Python package can be installed " msg += "\nkim-property Python package can be installed with pip:\n";
"with pip:\n'pip install kim-property'\n" msg += "'pip install kim-property'\nSee the installation instructions ";
"See the installation instructions at\n" msg += "at\nhttps://github.com/openkim/kim-property#installing-kim-";
"https://github.com/openkim/kim-property#installing-kim-property\n" msg += "property\nfor detailed information";
"for detailed information."); error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -137,7 +133,7 @@ void kimProperty::command(int narg, char **arg)
if (strcmp(arg[0], "create") == 0) { if (strcmp(arg[0], "create") == 0) {
if (narg != 3) { if (narg != 3) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Invalid 'kim_property create' command."); error->all(FLERR, "Invalid 'kim property create' command");
} }
int const ID = utils::inumeric(FLERR, arg[1], true, lmp); int const ID = utils::inumeric(FLERR, arg[1], true, lmp);
@ -151,8 +147,9 @@ void kimProperty::command(int narg, char **arg)
PyObject_GetAttrString(kim_property, "kim_property_create"); PyObject_GetAttrString(kim_property, "kim_property_create");
if (!pFunc) { if (!pFunc) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to get an attribute named " std::string msg("Unable to get an attribute named ");
"'kim_property_create' from a kim_property object!"); msg += "'kim_property_create' from a kim_property object";
error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -162,7 +159,7 @@ void kimProperty::command(int narg, char **arg)
PyObject *pArgs = PyTuple_New(nSize); PyObject *pArgs = PyTuple_New(nSize);
if (!pArgs) { if (!pArgs) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Could not create Python function arguments."); error->all(FLERR, "Could not create Python function arguments");
} }
// Python object to set the tuple // Python object to set the tuple
@ -185,15 +182,16 @@ void kimProperty::command(int narg, char **arg)
if (!pValue) { if (!pValue) {
PyErr_Print(); PyErr_Print();
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->one(FLERR, "Python 'kim_property_create' function " std::string msg("Python 'kim_property_create' function ");
"evaluation failed!"); msg += "evaluation failed";
error->one(FLERR, msg);
} }
// Python function returned a string value // Python function returned a string value
const char *pystr = PyUnicode_AsUTF8(pValue); const char *pystr = PyUnicode_AsUTF8(pValue);
if (kim_str) input->variable->set_string("kim_property_str", pystr); if (kim_str) input->variable->set_string("kim_property_str", pystr);
else input->variable->set(std::string("kim_property_str string '") else
+ pystr + std::string("'")); input->variable->set(fmt::format("kim_property_str string '{}'", pystr));
Py_XDECREF(pArgs); Py_XDECREF(pArgs);
Py_XDECREF(pFunc); Py_XDECREF(pFunc);
@ -201,7 +199,7 @@ void kimProperty::command(int narg, char **arg)
} else if (strcmp(arg[0], "destroy") == 0) { } else if (strcmp(arg[0], "destroy") == 0) {
if (narg != 2) { if (narg != 2) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Invalid 'kim_property destroy' command."); error->all(FLERR, "Invalid 'kim property destroy' command");
} }
if (!kim_str) { if (!kim_str) {
@ -212,13 +210,15 @@ void kimProperty::command(int narg, char **arg)
int const ID = utils::inumeric(FLERR, arg[1], true, lmp); int const ID = utils::inumeric(FLERR, arg[1], true, lmp);
// Python function // Python function
// This is the equivalent of the Python expression kim_property.kim_property_destroy // This is the equivalent of the Python expression
// kim_property.kim_property_destroy
PyObject *pFunc = PyObject *pFunc =
PyObject_GetAttrString(kim_property, "kim_property_destroy"); PyObject_GetAttrString(kim_property, "kim_property_destroy");
if (!pFunc) { if (!pFunc) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to get an attribute named " std::string msg("Unable to get an attribute named ");
"'kim_property_destroy' from a kim_property object!"); msg += "'kim_property_destroy' from a kim_property object";
error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -228,7 +228,7 @@ void kimProperty::command(int narg, char **arg)
PyObject *pArgs = PyTuple_New(2); PyObject *pArgs = PyTuple_New(2);
if (!pArgs) { if (!pArgs) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Could not create Python function arguments."); error->all(FLERR, "Could not create Python function arguments");
} }
// Python object to set the tuple // Python object to set the tuple
@ -244,8 +244,9 @@ void kimProperty::command(int narg, char **arg)
if (!pValue) { if (!pValue) {
PyErr_Print(); PyErr_Print();
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->one(FLERR, "Python 'kim_property_destroy' function " std::string msg("Python 'kim_property_destroy' function ");
"evaluation failed!"); msg += "evaluation failed";
error->one(FLERR, msg);
} }
// Python function returned a string value // Python function returned a string value
@ -258,13 +259,12 @@ void kimProperty::command(int narg, char **arg)
} else if (strcmp(arg[0], "modify") == 0) { } else if (strcmp(arg[0], "modify") == 0) {
if (narg < 6) { if (narg < 6) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Invalid 'kim_property modify' command."); error->all(FLERR, "Invalid 'kim property modify' command");
} }
if (!kim_str) { if (!kim_str) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "There is no property instance to modify " error->all(FLERR, "There is no property instance to modify the content");
"the content.");
} }
int const ID = utils::inumeric(FLERR, arg[1], true, lmp); int const ID = utils::inumeric(FLERR, arg[1], true, lmp);
@ -276,8 +276,9 @@ void kimProperty::command(int narg, char **arg)
PyObject_GetAttrString(kim_property, "kim_property_modify"); PyObject_GetAttrString(kim_property, "kim_property_modify");
if (!pFunc) { if (!pFunc) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to get an attribute named " std::string msg("Unable to get an attribute named ");
"'kim_property_modify' from a kim_property object!"); msg += "'kim_property_modify' from a kim_property object";
error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -287,7 +288,7 @@ void kimProperty::command(int narg, char **arg)
PyObject *pArgs = PyTuple_New(static_cast<Py_ssize_t>(narg)); PyObject *pArgs = PyTuple_New(static_cast<Py_ssize_t>(narg));
if (!pArgs) { if (!pArgs) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Could not create Python function arguments."); error->all(FLERR, "Could not create Python function arguments");
} }
// Python object to set the tuple // Python object to set the tuple
@ -308,8 +309,9 @@ void kimProperty::command(int narg, char **arg)
if (!pValue) { if (!pValue) {
PyErr_Print(); PyErr_Print();
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->one(FLERR, "Python 'kim_property_modify' function " std::string msg("Python 'kim_property_modify' function ");
"evaluation failed!"); msg += "evaluation failed";
error->one(FLERR, msg);
} }
// Python function returned a string value // Python function returned a string value
@ -322,13 +324,12 @@ void kimProperty::command(int narg, char **arg)
} else if (strcmp(arg[0], "remove") == 0) { } else if (strcmp(arg[0], "remove") == 0) {
if (narg < 4) { if (narg < 4) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Invalid 'kim_property remove' command."); error->all(FLERR, "Invalid 'kim property remove' command");
} }
if (!kim_str) { if (!kim_str) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "There is no property instance to remove " error->all(FLERR, "There is no property instance to remove the content");
"the content.");
} }
int const ID = utils::inumeric(FLERR, arg[1], true, lmp); int const ID = utils::inumeric(FLERR, arg[1], true, lmp);
@ -340,8 +341,9 @@ void kimProperty::command(int narg, char **arg)
PyObject_GetAttrString(kim_property, "kim_property_remove"); PyObject_GetAttrString(kim_property, "kim_property_remove");
if (!pFunc) { if (!pFunc) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to get an attribute named " std::string msg("Unable to get an attribute named ");
"'kim_property_remove' from a kim_property object!"); msg += "'kim_property_remove' from a kim_property object";
error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -351,7 +353,7 @@ void kimProperty::command(int narg, char **arg)
PyObject *pArgs = PyTuple_New(static_cast<Py_ssize_t>(narg)); PyObject *pArgs = PyTuple_New(static_cast<Py_ssize_t>(narg));
if (!pArgs) { if (!pArgs) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Could not create Python function arguments."); error->all(FLERR, "Could not create Python function arguments");
} }
// Python object to set the tuple // Python object to set the tuple
@ -372,8 +374,9 @@ void kimProperty::command(int narg, char **arg)
if (!pValue) { if (!pValue) {
PyErr_Print(); PyErr_Print();
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->one(FLERR, "Python 'kim_property_remove' function " std::string msg("Python 'kim_property_remove' function ");
"evaluation failed!"); msg += "evaluation failed";
error->one(FLERR, msg);
} }
// Python function returned a string value // Python function returned a string value
@ -386,13 +389,12 @@ void kimProperty::command(int narg, char **arg)
} else if (strcmp(arg[0], "dump") == 0) { } else if (strcmp(arg[0], "dump") == 0) {
if (narg != 2) { if (narg != 2) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Invalid 'kim_property dump' command."); error->all(FLERR, "Invalid 'kim property dump' command");
} }
if (!kim_str) { if (!kim_str) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "There is no property instance to dump " error->all(FLERR, "There is no property instance to dump the content.");
"the content.");
} }
// Python function // Python function
@ -402,8 +404,9 @@ void kimProperty::command(int narg, char **arg)
PyObject_GetAttrString(kim_property, "kim_property_dump"); PyObject_GetAttrString(kim_property, "kim_property_dump");
if (!pFunc) { if (!pFunc) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Unable to get an attribute named " std::string msg("Unable to get an attribute named ");
"'kim_property_dump' from a kim_property object!"); msg += "'kim_property_dump' from a kim_property object";
error->all(FLERR, msg);
} }
// Decrementing of the reference count // Decrementing of the reference count
@ -413,7 +416,7 @@ void kimProperty::command(int narg, char **arg)
PyObject *pArgs = PyTuple_New(2); PyObject *pArgs = PyTuple_New(2);
if (!pArgs) { if (!pArgs) {
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->all(FLERR, "Could not create Python function arguments."); error->all(FLERR, "Could not create Python function arguments");
} }
// Python object to set the tuple // Python object to set the tuple
@ -430,8 +433,9 @@ void kimProperty::command(int narg, char **arg)
if (!pValue) { if (!pValue) {
PyErr_Print(); PyErr_Print();
PyGILState_Release(gstate); PyGILState_Release(gstate);
error->one(FLERR, "Python 'kim_property_dump' function " std::string msg("Python 'kim_property_dump' function ");
"evaluation failed!"); msg += "evaluation failed";
error->one(FLERR, msg);
} }
} else } else
pValue = nullptr; pValue = nullptr;

View File

@ -53,12 +53,6 @@
Designed for use with the kim-api-2.1.0 (and newer) package Designed for use with the kim-api-2.1.0 (and newer) package
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim_property, kimProperty)
#else
#ifndef LMP_KIM_PROPERTY_H #ifndef LMP_KIM_PROPERTY_H
#define LMP_KIM_PROPERTY_H #define LMP_KIM_PROPERTY_H
@ -67,18 +61,16 @@ CommandStyle(kim_property, kimProperty)
namespace LAMMPS_NS namespace LAMMPS_NS
{ {
class kimProperty : protected Pointers class KimProperty : protected Pointers
{ {
public: public:
kimProperty(class LAMMPS *lmp); KimProperty(class LAMMPS *lmp);
void command(int, char **); void command(int, char **);
}; };
} // namespace LAMMPS_NS }
#endif // LMP_KIM_PROPERTY_H #endif
#endif // COMMAND_CLASS
/* ERROR/WARNING messages: /* ERROR/WARNING messages:

View File

@ -81,123 +81,161 @@
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
#if defined(LMP_KIM_CURL) #if defined(LMP_KIM_CURL)
namespace {
static constexpr int kBufSize{10240};
struct WriteBuf { struct WriteBuf {
char *dataptr; char *dataptr;
size_t sizeleft; size_t sizeleft;
}; };
static char *do_query(char *, char *, int, char **, int, MPI_Comm); static char *do_query(const std::string &, const std::string &,
static size_t write_callback(void *, size_t, size_t, void *); int, char **, int, MPI_Comm);
static size_t write_callback(void *, size_t, size_t, void *);
} // namespace
#endif #endif
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void KimQuery::command(int narg, char **arg) void KimQuery::command(int narg, char **arg)
{ {
if (narg < 2) error->all(FLERR,"Illegal kim_query command"); if (narg < 2) error->all(FLERR, "Illegal 'kim query' command");
// check if we had a kim_init command by finding fix STORE/KIM std::string var_name{arg[0]};
// retrieve model name.
char *model_name;
// format_arg = list, split, or index (optional):
std::string format_arg{arg[1]};
if (format_arg == "split" || format_arg == "list" || format_arg == "index") {
if (narg == 2) {
auto msg = fmt::format("Illegal 'kim query' command.\nThe keyword '{}' "
"must be followed by the name of the query function", format_arg);
error->all(FLERR, msg);
}
++arg;
--narg;
// The “list” is the default setting
// the result is returned as a space-separated list of values in a variable
} else format_arg = "list";
std::string query_function{arg[1]};
if (query_function == "split" || query_function == "list" ||
query_function == "index") {
auto msg = fmt::format("Illegal 'kim query' command.\nThe '{}' keyword "
"can not be used after '{}'", query_function, format_arg);
error->all(FLERR, msg);
}
std::string model_name;
// check the query_args format (a series of keyword=value pairs)
for (int i = 2; i < narg; ++i) {
if (!strchr(arg[i], '=') || !strchr(arg[i], '[') || !strchr(arg[i], ']')) {
auto msg = fmt::format("Illegal query format.\nInput argument "
"of `{}` to 'kim query' is wrong. The query format is the "
"keyword=[value], where value is always an array of one or "
"more comma-separated items", arg[i]);
error->all(FLERR, msg);
}
}
if (query_function != "get_available_models") {
for (int i = 2; i < narg; ++i) {
// check if the model is specified as an argument
if (strncmp("model=", arg[i], 6) == 0) {
ValueTokenizer values(arg[i], "=[]");
std::string key = values.next_string();
model_name = values.next_string();
break;
}
}
// if the model name is not provided by the user
if (model_name.empty()) {
// check if we had a kim init command by finding fix STORE/KIM
const int ifix = modify->find_fix("KIM_MODEL_STORE"); const int ifix = modify->find_fix("KIM_MODEL_STORE");
if (ifix >= 0) { if (ifix >= 0) {
FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix];
model_name = (char *)fix_store->getptr("model_name"); char *model_name_c = (char *) fix_store->getptr("model_name");
} else error->all(FLERR,"Must use 'kim_init' before 'kim_query'"); model_name = fmt::format("{}", model_name_c);
} else {
char *varname = arg[0]; auto msg = fmt::format("Illegal query format.\nMust use 'kim init' "
"before 'kim query' or must provide the model name after query "
bool split = false; "function with the format of 'model=[model_name]'");
if (strcmp("split",arg[1]) == 0) { error->all(FLERR, msg);
if (narg == 2) error->all(FLERR,"Illegal kim_query command.\nThe keyword "
"'split' must be followed by the name of "
"the query function");
if (strcmp("list",arg[2]) == 0)
error->all(FLERR,"Illegal kim_query command.\nThe 'list' keyword "
"can not be used after 'split'");
split = true;
arg++;
narg--;
} }
// The “list” is the default setting
// the result is returned as a space-separated list of values in variable
if (strcmp("list",arg[1]) == 0) {
if (narg == 2) error->all(FLERR,"Illegal kim_query command.\nThe 'list' "
"keyword must be followed by ('split' "
"and) the name of the query function");
arg++;
narg--;
} }
char *function = arg[1];
for (int i = 2; i < narg; ++i) {
if (strncmp("model=",arg[i],6) == 0)
error->all(FLERR,"Illegal 'model' key in kim_query command");
if (!strchr(arg[i], '=') || !strchr(arg[i], '[') || !strchr(arg[i], ']'))
error->all(FLERR,fmt::format("Illegal query format.\nInput argument of "
"`{}` to kim_query is wrong. The query "
"format is the keyword=[value], where value "
"is always an array of one or more "
"comma-separated items", arg[i]));
} }
#if defined(LMP_KIM_CURL) #if defined(LMP_KIM_CURL)
char *value = do_query(query_function, model_name,
char *value = do_query(function, model_name, narg-2, arg+2, comm->me, world); narg - 2, arg + 2, comm->me, world);
// check for valid result // check for valid result
// on error the content of "value" is a '\0' byte // on error the content of "value" is a '\0' byte as the first element,
// as the first element, and then the error message // and then the error message that was returned by the web server
// that was returned by the web server
if (strlen(value) == 0) { if (strlen(value) == 0) {
error->all(FLERR,fmt::format("OpenKIM query failed: {}", value+1)); auto msg = fmt::format("OpenKIM query failed: {}", value + 1);
delete [] value;
error->all(FLERR, msg);
} else if (strcmp(value, "EMPTY") == 0) { } else if (strcmp(value, "EMPTY") == 0) {
delete [] value;
error->all(FLERR, fmt::format("OpenKIM query returned no results")); error->all(FLERR, fmt::format("OpenKIM query returned no results"));
} }
input->write_echo("#=== BEGIN kim-query =========================================\n"); input->write_echo("#=== BEGIN kim-query =================================="
"=======\n");
ValueTokenizer values(value, ","); ValueTokenizer values(value, ",");
if (split) { if (format_arg == "split") {
int counter = 1; int counter = 1;
while (values.has_next()) { while (values.has_next()) {
auto svalue = values.next_string(); auto svalue = values.next_string();
auto setcmd = fmt::format("{}_{} string {}", varname, counter++, svalue); auto setcmd = fmt::format("{}_{} string {}", var_name, counter++, svalue);
input->variable->set(setcmd); input->variable->set(setcmd);
input->write_echo(fmt::format("variable {}\n", setcmd)); input->write_echo(fmt::format("variable {}\n", setcmd));
} }
} else { } else {
auto svalue = values.next_string(); std::string setcmd;
std::string setcmd = fmt::format("{} string \"{}", varname, svalue); auto svalue = utils::trim(values.next_string());
if (format_arg == "list") {
setcmd = fmt::format("{} string \"", var_name);
setcmd += (svalue.front() == '"' && svalue.back() == '"')
? fmt::format("{}", svalue.substr(1, svalue.size() - 2))
: fmt::format("{}", svalue);
while (values.has_next()) {
svalue = utils::trim(values.next_string());
setcmd += (svalue.front() == '"' && svalue.back() == '"')
? fmt::format(" {}", svalue.substr(1, svalue.size() - 2))
: fmt::format(" {}", svalue);
}
setcmd += "\"";
} else {
// format_arg == "index"
setcmd = fmt::format("{} index {}", var_name, svalue);
while (values.has_next()) { while (values.has_next()) {
svalue = values.next_string(); svalue = values.next_string();
setcmd += fmt::format(" {}", svalue); setcmd += fmt::format(" {}", svalue);
} }
setcmd += "\""; }
input->variable->set(setcmd); input->variable->set(setcmd);
input->write_echo(fmt::format("variable {}\n", setcmd)); input->write_echo(fmt::format("variable {}\n", setcmd));
} }
input->write_echo("#=== END kim-query ===========================================\n\n"); input->write_echo("#=== END kim-query ===================================="
"=======\n\n");
delete [] value; delete [] value;
#else #else
error->all(FLERR,"Cannot use 'kim_query' command when KIM package " error->all(FLERR, "Cannot use 'kim query' command when KIM package "
"is compiled without support for libcurl"); "is compiled without support for libcurl");
#endif #endif
} }
#if defined(LMP_KIM_CURL) #if defined(LMP_KIM_CURL)
namespace {
// copy data to the user provided data structure, optionally in increments // copy data to the user provided data structure, optionally in increments
size_t write_callback(void *data, size_t size, size_t nmemb, void *userp) size_t write_callback(void *data, size_t size, size_t nmemb, void *userp)
{ {
struct WriteBuf *buf = (struct WriteBuf *)userp; WriteBuf *buf = (WriteBuf *) userp;
// copy chunks into the buffer for as long as there is space left // copy chunks into the buffer for as long as there is space left
if (buf->sizeleft) { if (buf->sizeleft) {
@ -209,25 +247,23 @@ size_t write_callback(void *data, size_t size, size_t nmemb, void *userp)
buf->dataptr += copy_this_much; buf->dataptr += copy_this_much;
buf->sizeleft -= copy_this_much; buf->sizeleft -= copy_this_much;
return copy_this_much; return copy_this_much;
} }
return 0; // done return 0; // done
} }
char *do_query(char *qfunction, char * model_name, int narg, char **arg, char *do_query(const std::string &qfunction, const std::string &mname,
int rank, MPI_Comm comm) int narg, char **arg, int rank, MPI_Comm comm)
{ {
char value[512]; char value[kBufSize];
// run the web query from rank 0 only // run the web query from rank 0 only
if (rank == 0) { if (rank == 0) {
// set up and clear receive buffer // set up and clear receive buffer
struct WriteBuf buf; WriteBuf buf;
buf.dataptr = value; buf.dataptr = value;
buf.sizeleft = 511; buf.sizeleft = kBufSize - 1;
memset(value,0,512); memset(value, 0, kBufSize);
// create curl web query instance // create curl web query instance
curl_global_init(CURL_GLOBAL_DEFAULT); curl_global_init(CURL_GLOBAL_DEFAULT);
@ -235,17 +271,21 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
if (handle) { if (handle) {
auto url = fmt::format("https://query.openkim.org/api/{}", qfunction); auto url = fmt::format("https://query.openkim.org/api/{}", qfunction);
auto query = fmt::format("model=[\"{}\"]", model_name); auto query = mname.empty()
? fmt::format("")
: (mname.front() == '"' && mname.back() == '"')
? fmt::format("model=[{}]", mname)
: fmt::format("model=[\"{}\"]", mname);
for (int i = 0; i < narg; ++i) { for (int i = 0; i < narg; ++i) {
ValueTokenizer values(arg[i], "=[]"); ValueTokenizer values(arg[i], "=[]");
std::string key = values.next_string(); std::string key = values.next_string();
if (key == "model") continue;
std::string val = values.next_string(); std::string val = values.next_string();
std::string::size_type n = val.find(","); std::string::size_type n = val.find(",");
if (n == std::string::npos) { if (n == std::string::npos) {
if (utils::is_integer(val) || if (utils::is_integer(val) ||
utils::is_double(val) || utils::is_double(val) ||
(val.front() == '"' && (val.front() == '"' && val.back() == '"')) {
val.back() == '"')) {
query += fmt::format("&{}", arg[i]); query += fmt::format("&{}", arg[i]);
} else { } else {
query += fmt::format("&{}=[\"{}\"]", key, val); query += fmt::format("&{}=[\"{}\"]", key, val);
@ -256,8 +296,7 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
std::string sval = val.substr(0, n); std::string sval = val.substr(0, n);
if (utils::is_integer(sval) || if (utils::is_integer(sval) ||
utils::is_double(sval) || utils::is_double(sval) ||
(val.front() == '"' && (sval.front() == '"' && sval.back() == '"')) {
val.back() == '"')) {
query += fmt::format("{},", sval); query += fmt::format("{},", sval);
} else { } else {
query += fmt::format("\"{}\",", sval); query += fmt::format("\"{}\",", sval);
@ -265,8 +304,11 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
val = val.substr(n + 1); val = val.substr(n + 1);
n = val.find(","); n = val.find(",");
} }
if (val.size()) query += fmt::format("\"{}\"]", val); if (val.size()) {
else query[query.size() - 1]=']'; query += (val.front() == '"' && val.back() == '"')
? fmt::format("{}]", val)
: fmt::format("\"{}\"]", val);
} else query.back() = ']';
} }
} }
@ -292,7 +334,7 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
} }
} }
std::string user_agent = fmt::format("kim_query--LAMMPS/{} ({})", auto user_agent = fmt::format("kim query--LAMMPS/{} ({})",
LAMMPS_VERSION, Info::get_os_info()); LAMMPS_VERSION, Info::get_os_info());
curl_easy_setopt(handle, CURLOPT_USERAGENT, user_agent.c_str()); curl_easy_setopt(handle, CURLOPT_USERAGENT, user_agent.c_str());
@ -313,7 +355,7 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
} }
curl_global_cleanup(); curl_global_cleanup();
} }
MPI_Bcast(value, 512, MPI_CHAR, 0, comm); MPI_Bcast(value, kBufSize, MPI_CHAR, 0, comm);
// we must make a proper copy of the query, as the stack allocation // we must make a proper copy of the query, as the stack allocation
// for "value" will go out of scope. a valid query has a '[' as // for "value" will go out of scope. a valid query has a '[' as
@ -351,4 +393,5 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
} }
return retval; return retval;
} }
} // namespace
#endif #endif

View File

@ -55,12 +55,6 @@
Designed for use with the kim-api-2.1.0 (and newer) package Designed for use with the kim-api-2.1.0 (and newer) package
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS
CommandStyle(kim_query,KimQuery)
#else
#ifndef LMP_KIM_QUERY_H #ifndef LMP_KIM_QUERY_H
#define LMP_KIM_QUERY_H #define LMP_KIM_QUERY_H
@ -76,7 +70,6 @@ class KimQuery : protected Pointers {
} }
#endif
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:

View File

@ -309,13 +309,11 @@ void PairKIM::settings(int narg, char **arg)
set_lmps_flags(); set_lmps_flags();
// set KIM Model name // set KIM Model name
int nmlen = strlen(arg[0]);
if (kim_modelname != 0) { if (kim_modelname != 0) {
delete [] kim_modelname; delete [] kim_modelname;
kim_modelname = 0; kim_modelname = 0;
} }
kim_modelname = new char[nmlen+1]; kim_modelname = utils::strdup(arg[0]);
strcpy(kim_modelname, arg[0]);
// initialize KIM Model // initialize KIM Model
kim_init(); kim_init();
@ -330,7 +328,7 @@ void PairKIM::coeff(int narg, char **arg)
// This is called when "pair_coeff ..." is read from input // This is called when "pair_coeff ..." is read from input
// may be called multiple times // may be called multiple times
int i,j,n; int i,j;
if (!allocated) allocate(); if (!allocated) allocate();
@ -373,9 +371,7 @@ void PairKIM::coeff(int narg, char **arg)
if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break; if (strcmp(arg[i],lmps_unique_elements[j]) == 0) break;
lmps_map_species_to_unique[i-1] = j; lmps_map_species_to_unique[i-1] = j;
if (j == lmps_num_unique_elements) { if (j == lmps_num_unique_elements) {
n = strlen(arg[i]) + 1; lmps_unique_elements[j] = utils::strdup(arg[i]);
lmps_unique_elements[j] = new char[n];
strcpy(lmps_unique_elements[j],arg[i]);
lmps_num_unique_elements++; lmps_num_unique_elements++;
} }
} }
@ -601,6 +597,8 @@ void PairKIM::init_style()
// set cutoff // set cutoff
neighbor->requests[irequest]->cut = 1; neighbor->requests[irequest]->cut = 1;
if (kim_cutoff_values[i] <= neighbor->skin)
error->all(FLERR,"Illegal neighbor request (force cutoff <= skin)");
neighbor->requests[irequest]->cutoff neighbor->requests[irequest]->cutoff
= kim_cutoff_values[i] + neighbor->skin; = kim_cutoff_values[i] + neighbor->skin;
} }
@ -1161,6 +1159,6 @@ void PairKIM::set_kim_model_has_flags()
} }
} }
KIM_Model *PairKIM::get_KIM_Model() { return pkim; } KIM_Model *PairKIM::get_kim_model() { return pkim; }
std::string PairKIM::get_atom_type_list() { return atom_type_list; } std::string PairKIM::get_atom_type_list() { return atom_type_list; }

View File

@ -89,8 +89,7 @@ class PairKIM : public Pair {
virtual double memory_usage(); virtual double memory_usage();
// Get the KIM_Model object // Get the KIM_Model object
KIM_Model *get_KIM_Model(); KIM_Model *get_kim_model();
// Get the atom type list // Get the atom type list
std::string get_atom_type_list(); std::string get_atom_type_list();
protected: protected:

View File

@ -50,6 +50,7 @@ struct TagPairSNAPBeta{};
struct TagPairSNAPComputeBi{}; struct TagPairSNAPComputeBi{};
struct TagPairSNAPTransformBi{}; // re-order blist from AoSoA to AoS struct TagPairSNAPTransformBi{}; // re-order blist from AoSoA to AoS
struct TagPairSNAPComputeYi{}; struct TagPairSNAPComputeYi{};
template<int dir>
struct TagPairSNAPComputeFusedDeidrj{}; struct TagPairSNAPComputeFusedDeidrj{};
// CPU backend only // CPU backend only
@ -78,10 +79,31 @@ public:
using real_type = real_type_; using real_type = real_type_;
using complex = SNAComplex<real_type>; using complex = SNAComplex<real_type>;
// type-dependent team sizes // Static team/tile sizes for device offload
static constexpr int team_size_compute_neigh = 4;
static constexpr int tile_size_compute_ck = 4;
static constexpr int tile_size_pre_ui = 4;
static constexpr int team_size_compute_ui = sizeof(real_type) == 4 ? 8 : 4; static constexpr int team_size_compute_ui = sizeof(real_type) == 4 ? 8 : 4;
static constexpr int tile_size_transform_ui = 4;
static constexpr int tile_size_compute_zi = 8;
static constexpr int tile_size_compute_bi = 4;
static constexpr int tile_size_transform_bi = 4;
static constexpr int tile_size_compute_yi = 8;
static constexpr int team_size_compute_fused_deidrj = sizeof(real_type) == 4 ? 4 : 2; static constexpr int team_size_compute_fused_deidrj = sizeof(real_type) == 4 ? 4 : 2;
// Custom MDRangePolicy, Rank3, to reduce verbosity of kernel launches
// This hides the Kokkos::IndexType<int> and Kokkos::Rank<3...>
// and reduces the verbosity of the LaunchBound by hiding the explicit
// multiplication by vector_length
template <class Device, int num_tiles, class TagPairSNAP>
using Snap3DRangePolicy = typename Kokkos::MDRangePolicy<Device, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, Kokkos::LaunchBounds<vector_length * num_tiles>, TagPairSNAP>;
// Custom SnapAoSoATeamPolicy to reduce the verbosity of kernel launches
// This hides the LaunchBounds abstraction by hiding the explicit
// multiplication by vector length
template <class Device, int num_teams, class TagPairSNAP>
using SnapAoSoATeamPolicy = typename Kokkos::TeamPolicy<Device, Kokkos::LaunchBounds<vector_length * num_teams>, TagPairSNAP>;
PairSNAPKokkos(class LAMMPS *); PairSNAPKokkos(class LAMMPS *);
~PairSNAPKokkos(); ~PairSNAPKokkos();
@ -139,8 +161,9 @@ public:
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAPComputeYi,const int iatom_mod, const int idxz, const int iatom_div) const; void operator() (TagPairSNAPComputeYi,const int iatom_mod, const int idxz, const int iatom_div) const;
template<int dir>
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeFusedDeidrj>::member_type& team) const; void operator() (TagPairSNAPComputeFusedDeidrj<dir>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeFusedDeidrj<dir> >::member_type& team) const;
// CPU backend only // CPU backend only
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
@ -252,6 +275,11 @@ inline double dist2(double* x,double* y);
friend void pair_virial_fdotr_compute<PairSNAPKokkos>(PairSNAPKokkos*); friend void pair_virial_fdotr_compute<PairSNAPKokkos>(PairSNAPKokkos*);
// Utility routine which wraps computing per-team scratch size requirements for
// ComputeNeigh, ComputeUi, and ComputeFusedDeidrj
template <typename scratch_type>
int scratch_size_helper(int values_per_team);
}; };

View File

@ -279,7 +279,6 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
int team_size = team_size_default; int team_size = team_size_default;
typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeDuidrjCPU> policy_duidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length); typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeDuidrjCPU> policy_duidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length);
snaKK.set_dir(-1); // technically doesn't do anything
Kokkos::parallel_for("ComputeDuidrjCPU",policy_duidrj_cpu,*this); Kokkos::parallel_for("ComputeDuidrjCPU",policy_duidrj_cpu,*this);
typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeDeidrjCPU> policy_deidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length); typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeDeidrjCPU> policy_deidrj_cpu(((chunk_size+team_size-1)/team_size)*max_neighs,team_size,vector_length);
@ -291,91 +290,84 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
#ifdef LMP_KOKKOS_GPU #ifdef LMP_KOKKOS_GPU
// Pre-compute ceil(chunk_size / vector_length) for code cleanliness
const int chunk_size_div = (chunk_size + vector_length - 1) / vector_length;
//ComputeNeigh //ComputeNeigh
{ {
constexpr int team_size = 4; // team_size_compute_neigh is defined in `pair_snap_kokkos.h`
int scratch_size = scratch_size_helper<int>(team_size_compute_neigh * max_neighs);
// scratch size: max_neighs * sizeof(int) * number of threads per team SnapAoSoATeamPolicy<DeviceType, team_size_compute_neigh, TagPairSNAPComputeNeigh> policy_neigh(chunk_size,team_size_compute_neigh,vector_length);
typedef Kokkos::View< int*,
Kokkos::DefaultExecutionSpace::scratch_memory_space,
Kokkos::MemoryTraits<Kokkos::Unmanaged> >
ScratchViewType;
int scratch_size = ScratchViewType::shmem_size(team_size * max_neighs);
typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeNeigh> policy_neigh(chunk_size,team_size,vector_length);
policy_neigh = policy_neigh.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); policy_neigh = policy_neigh.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
Kokkos::parallel_for("ComputeNeigh",policy_neigh,*this); Kokkos::parallel_for("ComputeNeigh",policy_neigh,*this);
} }
//ComputeCayleyKlein //ComputeCayleyKlein
{ {
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeCayleyKlein> // tile_size_compute_ck is defined in `pair_snap_kokkos.h`
policy_compute_ck({0,0,0},{vector_length,max_neighs,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); Snap3DRangePolicy<DeviceType, tile_size_compute_ck, TagPairSNAPComputeCayleyKlein>
policy_compute_ck({0,0,0},{vector_length,max_neighs,chunk_size_div},{vector_length,tile_size_compute_ck,1});
Kokkos::parallel_for("ComputeCayleyKlein",policy_compute_ck,*this); Kokkos::parallel_for("ComputeCayleyKlein",policy_compute_ck,*this);
} }
//PreUi //PreUi
{ {
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPPreUi> // tile_size_pre_ui is defined in `pair_snap_kokkos.h`
policy_preui({0,0,0},{vector_length,twojmax+1,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); Snap3DRangePolicy<DeviceType, tile_size_pre_ui, TagPairSNAPPreUi>
policy_preui({0,0,0},{vector_length,twojmax+1,chunk_size_div},{vector_length,tile_size_pre_ui,1});
Kokkos::parallel_for("PreUi",policy_preui,*this); Kokkos::parallel_for("PreUi",policy_preui,*this);
} }
// ComputeUi w/vector parallelism, shared memory, direct atomicAdd into ulisttot // ComputeUi w/vector parallelism, shared memory, direct atomicAdd into ulisttot
{ {
// new AoSoA form
// team_size_compute_ui is defined in `pair_snap_kokkos.h` // team_size_compute_ui is defined in `pair_snap_kokkos.h`
constexpr int team_size = team_size_compute_ui;
// scratch size: 32 atoms * (twojmax+1) cached values, no double buffer // scratch size: 32 atoms * (twojmax+1) cached values, no double buffer
const int tile_size = vector_length * (twojmax + 1); const int tile_size = vector_length * (twojmax + 1);
typedef Kokkos::View< complex*, const int scratch_size = scratch_size_helper<complex>(team_size_compute_ui * tile_size);
Kokkos::DefaultExecutionSpace::scratch_memory_space,
Kokkos::MemoryTraits<Kokkos::Unmanaged> >
ScratchViewType;
int scratch_size = ScratchViewType::shmem_size(team_size * tile_size);
// total number of teams needed // total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
int chunk_size_div = (chunk_size + vector_length - 1) / vector_length; const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui;
// (natoms / 32) * (max_neighs) * ("bend" locations) SnapAoSoATeamPolicy<DeviceType, team_size_compute_ui, TagPairSNAPComputeUi> policy_ui(n_teams_div, team_size_compute_ui, vector_length);
int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
int n_teams_div = (n_teams + team_size - 1) / team_size;
typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeUi> policy_ui(n_teams_div, team_size, vector_length);
policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
Kokkos::parallel_for("ComputeUi",policy_ui,*this); Kokkos::parallel_for("ComputeUi",policy_ui,*this);
}
// un-"fold" ulisttot, zero ylist //TransformUi: un-"fold" ulisttot, zero ylist
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); {
// team_size_transform_ui is defined in `pair_snap_kokkos.h`
Snap3DRangePolicy<DeviceType, tile_size_transform_ui, TagPairSNAPTransformUi>
policy_transform_ui({0,0,0},{vector_length,snaKK.idxu_max,chunk_size_div},{vector_length,tile_size_transform_ui,1});
Kokkos::parallel_for("TransformUi",policy_transform_ui,*this); Kokkos::parallel_for("TransformUi",policy_transform_ui,*this);
} }
//Compute bispectrum in AoSoA data layout, transform Bi //Compute bispectrum in AoSoA data layout, transform Bi
if (quadraticflag || eflag) { if (quadraticflag || eflag) {
// team_size_[compute_zi, compute_bi, transform_bi] are defined in `pair_snap_kokkos.h`
//ComputeZi //ComputeZi
int idxz_max = snaKK.idxz_max; const int idxz_max = snaKK.idxz_max;
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeZi> policy_compute_zi({0,0,0},{vector_length,idxz_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); Snap3DRangePolicy<DeviceType, tile_size_compute_zi, TagPairSNAPComputeZi>
policy_compute_zi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_zi,1});
Kokkos::parallel_for("ComputeZi",policy_compute_zi,*this); Kokkos::parallel_for("ComputeZi",policy_compute_zi,*this);
//ComputeBi //ComputeBi
int idxb_max = snaKK.idxb_max; const int idxb_max = snaKK.idxb_max;
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeBi> policy_compute_bi({0,0,0},{vector_length,idxb_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); Snap3DRangePolicy<DeviceType, tile_size_compute_bi, TagPairSNAPComputeBi>
policy_compute_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_compute_bi,1});
Kokkos::parallel_for("ComputeBi",policy_compute_bi,*this); Kokkos::parallel_for("ComputeBi",policy_compute_bi,*this);
//Transform data layout of blist out of AoSoA //Transform data layout of blist out of AoSoA
//We need this b/c `blist` gets used in ComputeForce which doesn't //We need this because `blist` gets used in ComputeForce which doesn't
//take advantage of AoSoA (which at best would only be beneficial //take advantage of AoSoA, which at best would only be beneficial on the margins
//on the margins) Snap3DRangePolicy<DeviceType, tile_size_transform_bi, TagPairSNAPTransformBi>
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformBi> policy_transform_bi({0,0,0},{vector_length,idxb_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); policy_transform_bi({0,0,0},{vector_length,idxb_max,chunk_size_div},{vector_length,tile_size_transform_bi,1});
Kokkos::parallel_for("TransformBi",policy_transform_bi,*this); Kokkos::parallel_for("TransformBi",policy_transform_bi,*this);
} }
//ComputeYi in AoSoA data layout, transform to AoS for ComputeFusedDeidrj
//Note zeroing `ylist` is fused into `TransformUi`. //Note zeroing `ylist` is fused into `TransformUi`.
{ {
//Compute beta = dE_i/dB_i for all i in list //Compute beta = dE_i/dB_i for all i in list
@ -383,41 +375,40 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
Kokkos::parallel_for("ComputeBeta",policy_beta,*this); Kokkos::parallel_for("ComputeBeta",policy_beta,*this);
//ComputeYi //ComputeYi
// team_size_compute_yi is defined in `pair_snap_kokkos.h`
const int idxz_max = snaKK.idxz_max; const int idxz_max = snaKK.idxz_max;
typename Kokkos::MDRangePolicy<DeviceType, Kokkos::IndexType<int>, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPComputeYi> policy_compute_yi({0,0,0},{vector_length,idxz_max,(chunk_size + vector_length - 1) / vector_length},{vector_length,4,1}); Snap3DRangePolicy<DeviceType, tile_size_compute_yi, TagPairSNAPComputeYi>
policy_compute_yi({0,0,0},{vector_length,idxz_max,chunk_size_div},{vector_length,tile_size_compute_yi,1});
Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this); Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this);
} }
// Fused ComputeDuidrj, ComputeDeidrj // Fused ComputeDuidrj, ComputeDeidrj
{ {
// new AoSoA form
// team_size_compute_fused_deidrj is defined in `pair_snap_kokkos.h` // team_size_compute_fused_deidrj is defined in `pair_snap_kokkos.h`
constexpr int team_size = team_size_compute_fused_deidrj;
// scratch size: 32 atoms * (twojmax+1) cached values * 2 for u, du, no double buffer // scratch size: 32 atoms * (twojmax+1) cached values * 2 for u, du, no double buffer
const int tile_size = vector_length * (twojmax + 1); const int tile_size = vector_length * (twojmax + 1);
typedef Kokkos::View< complex*, const int scratch_size = scratch_size_helper<complex>(2 * team_size_compute_fused_deidrj * tile_size);
Kokkos::DefaultExecutionSpace::scratch_memory_space,
Kokkos::MemoryTraits<Kokkos::Unmanaged> >
ScratchViewType;
int scratch_size = ScratchViewType::shmem_size(2 * team_size * tile_size);
// total number of teams needed // total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
int chunk_size_div = (chunk_size + vector_length - 1) / vector_length; const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj;
// (natoms / 32) * (max_neighs) * ("bend" locations) // x direction
int n_teams = chunk_size_div * max_neighs * (twojmax + 1); SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length);
int n_teams_div = (n_teams + team_size - 1) / team_size; policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this);
typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrj> policy_fused_deidrj(n_teams_div,team_size,vector_length); // y direction
policy_fused_deidrj = policy_fused_deidrj.set_scratch_size(0, Kokkos::PerTeam(scratch_size)); SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length);
policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this);
for (int k = 0; k < 3; k++) { // z direction
snaKK.set_dir(k); SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length);
Kokkos::parallel_for("ComputeFusedDeidrj",policy_fused_deidrj,*this); policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
} Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this);
} }
@ -853,8 +844,9 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
} }
template<class DeviceType, typename real_type, int vector_length> template<class DeviceType, typename real_type, int vector_length>
template<int dir>
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeFusedDeidrj,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrj>::member_type& team) const { void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeFusedDeidrj<dir>,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrj<dir> >::member_type& team) const {
SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK; SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK;
// extract flattened atom_div / neighbor number / bend location // extract flattened atom_div / neighbor number / bend location
@ -874,7 +866,7 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
const int ninside = d_ninside(ii); const int ninside = d_ninside(ii);
if (jj >= ninside) return; if (jj >= ninside) return;
my_sna.compute_fused_deidrj(team, iatom_mod, jbend, jj, iatom_div); my_sna.template compute_fused_deidrj<dir>(team, iatom_mod, jbend, jj, iatom_div);
}); });
@ -1338,6 +1330,15 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::check_team_size_reduc
team_size = team_size_max/vector_length; team_size = team_size_max/vector_length;
} }
template<class DeviceType, typename real_type, int vector_length>
template<typename scratch_type>
int PairSNAPKokkos<DeviceType, real_type, vector_length>::scratch_size_helper(int values_per_team) {
typedef Kokkos::View<scratch_type*, Kokkos::DefaultExecutionSpace::scratch_memory_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> > ScratchViewType;
return ScratchViewType::shmem_size(values_per_team);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
routines used by template reference classes routines used by template reference classes

View File

@ -141,6 +141,7 @@ inline
void compute_bi_cpu(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, int); // ForceSNAP void compute_bi_cpu(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, int); // ForceSNAP
// functions for derivatives, GPU only // functions for derivatives, GPU only
template<int dir>
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void compute_fused_deidrj(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); //ForceSNAP void compute_fused_deidrj(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); //ForceSNAP
@ -164,10 +165,6 @@ inline
static KOKKOS_FORCEINLINE_FUNCTION static KOKKOS_FORCEINLINE_FUNCTION
void sincos_wrapper(float x, float* sin_, float *cos_) { sincosf(x, sin_, cos_); } void sincos_wrapper(float x, float* sin_, float *cos_) { sincosf(x, sin_, cos_); }
// Set the direction for split ComputeDuidrj
KOKKOS_INLINE_FUNCTION
void set_dir(int);
#ifdef TIMING_INFO #ifdef TIMING_INFO
double* timers; double* timers;
timespec starttime, endtime; timespec starttime, endtime;
@ -298,9 +295,6 @@ inline
int bzero_flag; // 1 if bzero subtracted from barray int bzero_flag; // 1 if bzero subtracted from barray
Kokkos::View<real_type*, DeviceType> bzero; // array of B values for isolated atoms Kokkos::View<real_type*, DeviceType> bzero; // array of B values for isolated atoms
// for per-direction dulist calculation, specify the direction.
int dir;
}; };
} }

View File

@ -886,6 +886,7 @@ void SNAKokkos<DeviceType, real_type, vector_length>::compute_yi(int iatom_mod,
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
template<class DeviceType, typename real_type, int vector_length> template<class DeviceType, typename real_type, int vector_length>
template<int dir>
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void SNAKokkos<DeviceType, real_type, vector_length>::compute_fused_deidrj(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div) void SNAKokkos<DeviceType, real_type, vector_length>::compute_fused_deidrj(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int iatom_mod, const int j_bend, const int jnbor, const int iatom_div)
{ {
@ -2160,15 +2161,6 @@ void SNAKokkos<DeviceType, real_type, vector_length>::compute_s_dsfac(const real
} else { sfac = zero; dsfac = zero; } } else { sfac = zero; dsfac = zero; }
} }
/* ---------------------------------------------------------------------- */
// set direction of batched Duidrj
template<class DeviceType, typename real_type, int vector_length>
KOKKOS_FORCEINLINE_FUNCTION
void SNAKokkos<DeviceType, real_type, vector_length>::set_dir(int dir_) {
dir = dir_;
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
memory usage of arrays memory usage of arrays
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -537,7 +537,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
nmax = 0; nmax = 0;
partner = finalpartner = nullptr; partner = finalpartner = nullptr;
distsq = nullptr; distsq = nullptr;
probability = nullptr;
maxattempt = 0; maxattempt = 0;
attempt = nullptr; attempt = nullptr;
nattempt = nullptr; nattempt = nullptr;
@ -585,7 +584,6 @@ FixBondReact::~FixBondReact()
memory->destroy(finalpartner); memory->destroy(finalpartner);
memory->destroy(nattempt); memory->destroy(nattempt);
memory->destroy(distsq); memory->destroy(distsq);
memory->destroy(probability);
memory->destroy(attempt); memory->destroy(attempt);
memory->destroy(edge); memory->destroy(edge);
memory->destroy(equivalences); memory->destroy(equivalences);
@ -870,6 +868,9 @@ void FixBondReact::post_integrate()
ghostly_rxn_count[i] = 0; ghostly_rxn_count[i] = 0;
nlocalskips[i] = 0; nlocalskips[i] = 0;
nghostlyskips[i] = 0; nghostlyskips[i] = 0;
// update reaction probability
if (var_flag[PROB][i])
fraction[i] = input->variable->compute_equal(var_id[PROB][i]);
} }
if (nevery_check) { if (nevery_check) {
@ -890,16 +891,14 @@ void FixBondReact::post_integrate()
memory->destroy(finalpartner); memory->destroy(finalpartner);
memory->destroy(distsq); memory->destroy(distsq);
memory->destroy(nattempt); memory->destroy(nattempt);
memory->destroy(probability);
nmax = atom->nmax; nmax = atom->nmax;
memory->create(partner,nmax,"bond/react:partner"); memory->create(partner,nmax,"bond/react:partner");
memory->create(finalpartner,nmax,"bond/react:finalpartner"); memory->create(finalpartner,nmax,"bond/react:finalpartner");
memory->create(distsq,nmax,2,"bond/react:distsq"); memory->create(distsq,nmax,2,"bond/react:distsq");
memory->create(nattempt,nreacts,"bond/react:nattempt"); memory->create(nattempt,nreacts,"bond/react:nattempt");
memory->create(probability,nmax,"bond/react:probability");
} }
// reset create counts // reset 'attempt' counts
for (int i = 0; i < nreacts; i++) { for (int i = 0; i < nreacts; i++) {
nattempt[i] = 0; nattempt[i] = 0;
} }
@ -962,25 +961,14 @@ void FixBondReact::post_integrate()
comm->reverse_comm_fix(this); comm->reverse_comm_fix(this);
} }
// update reaction probability
if (var_flag[PROB][rxnID])
fraction[rxnID] = input->variable->compute_equal(var_id[PROB][rxnID]);
// each atom now knows its winning partner // each atom now knows its winning partner
// for prob check, generate random value for each atom with a bond partner // forward comm of partner, so ghosts have it
// forward comm of partner and random value, so ghosts have it
if (fraction[rxnID] < 1.0) {
for (int i = 0; i < nlocal; i++)
if (partner[i]) probability[i] = random[rxnID]->uniform();
}
commflag = 2; commflag = 2;
comm->forward_comm_fix(this,2); comm->forward_comm_fix(this,2);
// consider for reaction: // consider for reaction:
// only if both atoms list each other as winning bond partner // only if both atoms list each other as winning bond partner
// and probability constraint is satisfied
// if other atom is owned by another proc, it should do same thing // if other atom is owned by another proc, it should do same thing
int temp_nattempt = 0; int temp_nattempt = 0;
@ -994,16 +982,6 @@ void FixBondReact::post_integrate()
continue; continue;
} }
// apply probability constraint using RN for atom with smallest ID
if (fraction[rxnID] < 1.0) {
if (tag[i] < tag[j]) {
if (probability[i] >= fraction[rxnID]) continue;
} else {
if (probability[j] >= fraction[rxnID]) continue;
}
}
// store final bond partners and count the rxn possibility once // store final bond partners and count the rxn possibility once
finalpartner[i] = tag[j]; finalpartner[i] = tag[j];
@ -1345,10 +1323,14 @@ void FixBondReact::superimpose_algorithm()
(nxspecial[local_atom1][0] == 0 || (nxspecial[local_atom1][0] == 0 ||
xspecial[local_atom1][0] == atom->tag[local_atom2]) && xspecial[local_atom1][0] == atom->tag[local_atom2]) &&
check_constraints()) { check_constraints()) {
if (fraction[rxnID] < 1.0 &&
random[rxnID]->uniform() >= fraction[rxnID]) {
status = REJECT;
} else {
status = ACCEPT; status = ACCEPT;
glove_ghostcheck(); glove_ghostcheck();
} else }
status = REJECT; } else status = REJECT;
} }
avail_guesses = 0; avail_guesses = 0;
@ -1385,9 +1367,12 @@ void FixBondReact::superimpose_algorithm()
} }
} }
if (status == ACCEPT && check_constraints()) { // reaction site found successfully! // reaction site found successfully!
glove_ghostcheck(); if (status == ACCEPT)
} if (fraction[rxnID] < 1.0 &&
random[rxnID]->uniform() >= fraction[rxnID]) status = REJECT;
else glove_ghostcheck();
hang_catch++; hang_catch++;
// let's go ahead and catch the simplest of hangs // let's go ahead and catch the simplest of hangs
//if (hang_catch > onemol->natoms*4) //if (hang_catch > onemol->natoms*4)
@ -1627,8 +1612,8 @@ void FixBondReact::check_a_neighbor()
glove_counter++; glove_counter++;
if (glove_counter == onemol->natoms) { if (glove_counter == onemol->natoms) {
status = ACCEPT; if (ring_check() && check_constraints()) status = ACCEPT;
ring_check(); else status = GUESSFAIL;
return; return;
} }
// status should still == PROCEED // status should still == PROCEED
@ -1679,8 +1664,8 @@ void FixBondReact::check_a_neighbor()
glove_counter++; glove_counter++;
if (glove_counter == onemol->natoms) { if (glove_counter == onemol->natoms) {
status = ACCEPT; if (ring_check() && check_constraints()) status = ACCEPT;
ring_check(); else status = GUESSFAIL;
return; return;
// will never complete here when there are edge atoms // will never complete here when there are edge atoms
// ...actually that could be wrong if people get creative...shouldn't affect anything // ...actually that could be wrong if people get creative...shouldn't affect anything
@ -1791,8 +1776,8 @@ void FixBondReact::inner_crosscheck_loop()
} }
glove_counter++; glove_counter++;
if (glove_counter == onemol->natoms) { if (glove_counter == onemol->natoms) {
status = ACCEPT; if (ring_check() && check_constraints()) status = ACCEPT;
ring_check(); else status = GUESSFAIL;
return; return;
} }
status = CONTINUE; status = CONTINUE;
@ -1803,21 +1788,17 @@ void FixBondReact::inner_crosscheck_loop()
Necessary for certain ringed structures Necessary for certain ringed structures
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixBondReact::ring_check() int FixBondReact::ring_check()
{ {
// ring_check can be made more efficient by re-introducing 'frozen' atoms // ring_check can be made more efficient by re-introducing 'frozen' atoms
// 'frozen' atoms have been assigned and also are no longer pioneers // 'frozen' atoms have been assigned and also are no longer pioneers
// double check the number of neighbors match for all non-edge atoms // double check the number of neighbors match for all non-edge atoms
// otherwise, atoms at 'end' of symmetric ring can behave like edge atoms // otherwise, atoms at 'end' of symmetric ring can behave like edge atoms
for (int i = 0; i < onemol->natoms; i++) { for (int i = 0; i < onemol->natoms; i++)
if (edge[i][rxnID] == 0) { if (edge[i][rxnID] == 0 &&
if (onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0]) { onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0])
status = GUESSFAIL; return 0;
return;
}
}
}
for (int i = 0; i < onemol->natoms; i++) { for (int i = 0; i < onemol->natoms; i++) {
for (int j = 0; j < onemol_nxspecial[i][0]; j++) { for (int j = 0; j < onemol_nxspecial[i][0]; j++) {
@ -1829,12 +1810,10 @@ void FixBondReact::ring_check()
break; break;
} }
} }
if (ring_fail == 1) { if (ring_fail == 1) return 0;
status = GUESSFAIL;
return;
}
} }
} }
return 1;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -3952,20 +3931,10 @@ int FixBondReact::pack_forward_comm(int n, int *list, double *buf,
m = 0; m = 0;
if (commflag == 1) {
for (i = 0; i < n; i++) {
j = list[i];
printf("hello you shouldn't be here\n");
//buf[m++] = ubuf(bondcount[j]).d;
}
return m;
}
if (commflag == 2) { if (commflag == 2) {
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
j = list[i]; j = list[i];
buf[m++] = ubuf(partner[j]).d; buf[m++] = ubuf(partner[j]).d;
buf[m++] = probability[j];
} }
return m; return m;
} }
@ -3991,15 +3960,9 @@ void FixBondReact::unpack_forward_comm(int n, int first, double *buf)
m = 0; m = 0;
last = first + n; last = first + n;
if (commflag == 1) { if (commflag == 2) {
for (i = first; i < last; i++) for (i = first; i < last; i++)
printf("hello you shouldn't be here\n");
// bondcount[i] = (int) ubuf(buf[m++]).i;
} else if (commflag == 2) {
for (i = first; i < last; i++) {
partner[i] = (tagint) ubuf(buf[m++]).i; partner[i] = (tagint) ubuf(buf[m++]).i;
probability[i] = buf[m++];
}
} else { } else {
m = 0; m = 0;
last = first + n; last = first + n;
@ -4040,7 +4003,6 @@ void FixBondReact::unpack_reverse_comm(int n, int *list, double *buf)
m = 0; m = 0;
if (commflag != 1) {
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
j = list[i]; j = list[i];
if (closeneigh[rxnID] != 0) { if (closeneigh[rxnID] != 0) {
@ -4056,7 +4018,6 @@ void FixBondReact::unpack_reverse_comm(int n, int *list, double *buf)
} }
} }
} }
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
write Set data to restart file write Set data to restart file

View File

@ -86,7 +86,7 @@ class FixBondReact : public Fix {
int nmax; // max num local atoms int nmax; // max num local atoms
int max_natoms; // max natoms in a molecule template int max_natoms; // max natoms in a molecule template
tagint *partner,*finalpartner; tagint *partner,*finalpartner;
double **distsq,*probability; double **distsq;
int *nattempt; int *nattempt;
int maxattempt; int maxattempt;
int allnattempt; int allnattempt;
@ -171,7 +171,7 @@ class FixBondReact : public Fix {
void check_a_neighbor(); void check_a_neighbor();
void crosscheck_the_neighbor(); void crosscheck_the_neighbor();
void inner_crosscheck_loop(); void inner_crosscheck_loop();
void ring_check(); int ring_check();
int check_constraints(); int check_constraints();
void get_IDcoords(int, int, double *); void get_IDcoords(int, int, double *);
double get_temperature(tagint **, int, int); double get_temperature(tagint **, int, int);

View File

@ -1752,7 +1752,7 @@ void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg)
if (lo < 1 || hi > ntypes) error->all(file,line,"Invalid type for mass set"); if (lo < 1 || hi > ntypes) error->all(file,line,"Invalid type for mass set");
for (int itype = lo; itype <= hi; itype++) { for (int itype = lo; itype <= hi; itype++) {
mass[itype] = atof(arg[1]); mass[itype] = utils::numeric(FLERR,arg[1],false,lmp);
mass_setflag[itype] = 1; mass_setflag[itype] = 1;
if (mass[itype] <= 0.0) error->all(file,line,"Invalid mass value"); if (mass[itype] <= 0.0) error->all(file,line,"Invalid mass value");

View File

@ -118,7 +118,7 @@ void CiteMe::flush()
if (!citefile.empty()) if (!citefile.empty())
logbuffer += fmt::format(cite_file,"file",citefile); logbuffer += fmt::format(cite_file,"file",citefile);
if (screen_flag == VERBOSE) if (screen_flag == VERBOSE)
scrbuffer += fmt::format(cite_file,"screen","output"); logbuffer += fmt::format(cite_file,"screen","output");
logbuffer += cite_separator; logbuffer += cite_separator;
if (logfile) fputs(logbuffer.c_str(),logfile); if (logfile) fputs(logbuffer.c_str(),logfile);
logbuffer.clear(); logbuffer.clear();

View File

@ -148,8 +148,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command"); if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command");
if (mode != MINN && mode != MAXX) if (mode != MINN && mode != MAXX)
error->all(FLERR,"Compute reduce replace requires min or max mode"); error->all(FLERR,"Compute reduce replace requires min or max mode");
int col1 = atoi(arg[iarg+1]) - 1; int col1 = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1;
int col2 = atoi(arg[iarg+2]) - 1; int col2 = utils::inumeric(FLERR,arg[iarg+2],false,lmp) - 1;
if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues) if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues)
error->all(FLERR,"Illegal compute reduce command"); error->all(FLERR,"Illegal compute reduce command");
if (col1 == col2) error->all(FLERR,"Illegal compute reduce command"); if (col1 == col2) error->all(FLERR,"Illegal compute reduce command");

View File

@ -36,6 +36,9 @@ void Deprecated::command(int /* narg */, char ** /* arg */)
} else if (cmd == "reset_ids") { } else if (cmd == "reset_ids") {
if (lmp->comm->me == 0) if (lmp->comm->me == 0)
utils::logmesg(lmp,"\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n"); utils::logmesg(lmp,"\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n");
} else if (utils::strmatch(cmd,"^kim_")) {
if (lmp->comm->me == 0)
utils::logmesg(lmp,"\n'kim_<command>' has been renamed to 'kim <command>'\n\n");
} }
error->all(FLERR,"This command is no longer available"); error->all(FLERR,"This command is no longer available");
} }

View File

@ -15,6 +15,11 @@
CommandStyle(DEPRECATED,Deprecated) CommandStyle(DEPRECATED,Deprecated)
CommandStyle(reset_ids,Deprecated) CommandStyle(reset_ids,Deprecated)
CommandStyle(kim_init,Deprecated)
CommandStyle(kim_interactions,Deprecated)
CommandStyle(kim_param,Deprecated)
CommandStyle(kim_property,Deprecated)
CommandStyle(kim_query,Deprecated)
#else #else

View File

@ -83,7 +83,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg],"every") == 0) { if (strcmp(arg[iarg],"every") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
nevery = atoi(arg[iarg+1]); nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
if (nevery <= 0) error->all(FLERR,"Illegal fix addforce command"); if (nevery <= 0) error->all(FLERR,"Illegal fix addforce command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"region") == 0) { } else if (strcmp(arg[iarg],"region") == 0) {

View File

@ -254,13 +254,19 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf,
if ((m = atom->map(itag)) >= 0) { if ((m = atom->map(itag)) >= 0) {
for (j = 0; j < nvalue; j++) { for (j = 0; j < nvalue; j++) {
if (style[j] == MOLECULE) atom->molecule[m] = ATOTAGINT(values[j+1]); if (style[j] == MOLECULE) {
else if (style[j] == CHARGE) atom->q[m] = atof(values[j+1]); atom->molecule[m] = utils::tnumeric(FLERR,values[j+1],false,lmp);
else if (style[j] == RMASS) atom->rmass[m] = atof(values[j+1]); } else if (style[j] == CHARGE) {
else if (style[j] == INTEGER) atom->q[m] = utils::numeric(FLERR,values[j+1],false,lmp);
atom->ivector[index[j]][m] = atoi(values[j+1]); } else if (style[j] == RMASS) {
else if (style[j] == DOUBLE) atom->rmass[m] = utils::numeric(FLERR,values[j+1],false,lmp);
atom->dvector[index[j]][m] = atof(values[j+1]); } else if (style[j] == INTEGER) {
atom->ivector[index[j]][m] = utils::inumeric(FLERR,values[j+1],
false,lmp);
} else if (style[j] == DOUBLE) {
atom->dvector[index[j]][m] = utils::numeric(FLERR,values[j+1],
true,lmp);
}
} }
} }

View File

@ -564,9 +564,9 @@ void KSpace::modify_params(int narg, char **arg)
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"kmax/ewald") == 0) { } else if (strcmp(arg[iarg],"kmax/ewald") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command");
kx_ewald = atoi(arg[iarg+1]); kx_ewald = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
ky_ewald = atoi(arg[iarg+2]); ky_ewald = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
kz_ewald = atoi(arg[iarg+3]); kz_ewald = utils::inumeric(FLERR,arg[iarg+3],false,lmp);
if (kx_ewald < 0 || ky_ewald < 0 || kz_ewald < 0) if (kx_ewald < 0 || ky_ewald < 0 || kz_ewald < 0)
error->all(FLERR,"Bad kspace_modify kmax/ewald parameter"); error->all(FLERR,"Bad kspace_modify kmax/ewald parameter");
if (kx_ewald > 0 && ky_ewald > 0 && kz_ewald > 0) if (kx_ewald > 0 && ky_ewald > 0 && kz_ewald > 0)
@ -583,15 +583,15 @@ void KSpace::modify_params(int narg, char **arg)
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"force/disp/real") == 0) { } else if (strcmp(arg[iarg],"force/disp/real") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
accuracy_real_6 = atof(arg[iarg+1]); accuracy_real_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"force/disp/kspace") == 0) { } else if (strcmp(arg[iarg],"force/disp/kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
accuracy_kspace_6 = atof(arg[iarg+1]); accuracy_kspace_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"eigtol") == 0) { } else if (strcmp(arg[iarg],"eigtol") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
splittol = atof(arg[iarg+1]); splittol = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (splittol >= 1.0) if (splittol >= 1.0)
error->all(FLERR,"Kspace_modify eigtol must be smaller than one"); error->all(FLERR,"Kspace_modify eigtol must be smaller than one");
iarg += 2; iarg += 2;

View File

@ -38,7 +38,6 @@ const bool have_openmpi = false;
using LAMMPS_NS::utils::split_words; using LAMMPS_NS::utils::split_words;
namespace LAMMPS_NS { namespace LAMMPS_NS {
using ::testing::ExitedWithCode;
using ::testing::MatchesRegex; using ::testing::MatchesRegex;
using ::testing::StrEq; using ::testing::StrEq;
@ -79,31 +78,51 @@ protected:
} }
}; };
TEST_F(KimCommandsTest, kim)
{
if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP();
TEST_FAILURE(".*ERROR: Illegal kim command.*",
lmp->input->one("kim"););
TEST_FAILURE(".*ERROR: Unknown kim subcommand.*",
lmp->input->one("kim unknown"););
TEST_FAILURE(".*kim_init.*has been renamed to.*",
lmp->input->one("kim_init"););
TEST_FAILURE(".*kim_interactions.*has been renamed to.*",
lmp->input->one("kim_interactions"););
TEST_FAILURE(".*kim_param.*has been renamed to.*",
lmp->input->one("kim_param"););
TEST_FAILURE(".*kim_property.*has been renamed to.*",
lmp->input->one("kim_property"););
TEST_FAILURE(".*kim_query.*has been renamed to.*",
lmp->input->one("kim_query"););
}
TEST_F(KimCommandsTest, kim_init) TEST_F(KimCommandsTest, kim_init)
{ {
if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP();
TEST_FAILURE(".*ERROR: Illegal kim_init command.*", TEST_FAILURE(".*ERROR: Illegal 'kim init' command.*",
lmp->input->one("kim_init");); lmp->input->one("kim init"););
TEST_FAILURE(".*ERROR: Illegal kim_init command.*", TEST_FAILURE(".*ERROR: Illegal 'kim init' command.*",
lmp->input->one("kim_init LennardJones_Ar real si");); lmp->input->one("kim init LennardJones_Ar real si"););
TEST_FAILURE(".*ERROR: LAMMPS unit_style lj not supported by KIM models.*", TEST_FAILURE(".*ERROR: LAMMPS unit_style lj not supported by KIM models.*",
lmp->input->one("kim_init LennardJones_Ar lj");); lmp->input->one("kim init LennardJones_Ar lj"););
TEST_FAILURE(".*ERROR: LAMMPS unit_style micro not supported by KIM models.*", TEST_FAILURE(".*ERROR: LAMMPS unit_style micro not supported by KIM models.*",
lmp->input->one("kim_init LennardJones_Ar micro");); lmp->input->one("kim init LennardJones_Ar micro"););
TEST_FAILURE(".*ERROR: LAMMPS unit_style nano not supported by KIM models.*", TEST_FAILURE(".*ERROR: LAMMPS unit_style nano not supported by KIM models.*",
lmp->input->one("kim_init LennardJones_Ar nano");); lmp->input->one("kim init LennardJones_Ar nano"););
TEST_FAILURE(".*ERROR: Unknown unit_style.*", TEST_FAILURE(".*ERROR: Unknown unit_style.*",
lmp->input->one("kim_init LennardJones_Ar new_style");); lmp->input->one("kim init LennardJones_Ar new_style"););
TEST_FAILURE(".*ERROR: KIM Model name not found.*", TEST_FAILURE(".*ERROR: KIM Model name not found.*",
lmp->input->one("kim_init Unknown_Model real");); lmp->input->one("kim init Unknown_Model real"););
TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model, required units = metal.*", TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model, required units = metal.*",
lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu real");); lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu real"););
// TEST_FAILURE(".*ERROR: KIM Model does not support the requested unit system.*", // TEST_FAILURE(".*ERROR: KIM Model does not support the requested unit system.*",
// lmp->input->one("kim_init ex_model_Ar_P_Morse real");); // lmp->input->one("kim init ex_model_Ar_P_Morse real"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
int ifix = lmp->modify->find_fix("KIM_MODEL_STORE"); int ifix = lmp->modify->find_fix("KIM_MODEL_STORE");
@ -114,27 +133,27 @@ TEST_F(KimCommandsTest, kim_interactions)
{ {
if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP();
TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*",
lmp->input->one("kim_interactions");); lmp->input->one("kim interactions"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Must use 'kim_interactions' command " TEST_FAILURE(".*ERROR: Must use 'kim interactions' command "
"after simulation box is defined.*", "after simulation box is defined.*",
lmp->input->one("kim_interactions Ar");); lmp->input->one("kim interactions Ar"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
lmp->input->one("lattice fcc 4.4300"); lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*",
lmp->input->one("kim_interactions Ar Ar");); lmp->input->one("kim interactions Ar Ar"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
@ -144,8 +163,8 @@ TEST_F(KimCommandsTest, kim_interactions)
lmp->input->one("create_atoms 4 box"); lmp->input->one("create_atoms 4 box");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Illegal kim_interactions command.*", TEST_FAILURE(".*ERROR: Illegal 'kim interactions' command.*",
lmp->input->one("kim_interactions Ar Ar");); lmp->input->one("kim interactions Ar Ar"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
@ -155,12 +174,12 @@ TEST_F(KimCommandsTest, kim_interactions)
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_interactions'.*", TEST_FAILURE(".*ERROR: Must use 'kim init' before 'kim interactions'.*",
lmp->input->one("kim_interactions Ar");); lmp->input->one("kim interactions Ar"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
lmp->input->one("lattice fcc 4.4300"); lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
@ -168,7 +187,7 @@ TEST_F(KimCommandsTest, kim_interactions)
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: fixed_types cannot be used with a KIM Portable Model.*", TEST_FAILURE(".*ERROR: fixed_types cannot be used with a KIM Portable Model.*",
lmp->input->one("kim_interactions fixed_types");); lmp->input->one("kim interactions fixed_types"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
@ -181,7 +200,7 @@ TEST_F(KimCommandsTest, kim_interactions)
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal");
lmp->input->one("lattice fcc 4.920"); lmp->input->one("lattice fcc 4.920");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
@ -189,31 +208,31 @@ TEST_F(KimCommandsTest, kim_interactions)
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Species 'Ar' is not supported by this KIM Simulator Model.*", TEST_FAILURE(".*ERROR: Species 'Ar' is not supported by this KIM Simulator Model.*",
lmp->input->one("kim_interactions Ar");); lmp->input->one("kim interactions Ar"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal");
lmp->input->one("lattice fcc 4.08"); lmp->input->one("lattice fcc 4.08");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
lmp->input->one("kim_interactions Au"); lmp->input->one("kim interactions Au");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
// ASSERT_EQ(lmp->output->var_kim_periodic, 1); // ASSERT_EQ(lmp->output->var_kim_periodic, 1);
// TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model.*", // TEST_FAILURE(".*ERROR: Incompatible units for KIM Simulator Model.*",
// lmp->input->one("kim_interactions Au");); // lmp->input->one("kim interactions Au"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
lmp->input->one("lattice fcc 4.4300"); lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
lmp->input->one("kim_interactions Ar"); lmp->input->one("kim interactions Ar");
lmp->input->one("mass 1 39.95"); lmp->input->one("mass 1 39.95");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
@ -222,15 +241,15 @@ TEST_F(KimCommandsTest, kim_interactions)
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones_Ar real"); lmp->input->one("kim init LennardJones_Ar real");
lmp->input->one("lattice fcc 4.4300"); lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
lmp->input->one("kim_interactions Ar"); lmp->input->one("kim interactions Ar");
lmp->input->one("mass 1 39.95"); lmp->input->one("mass 1 39.95");
lmp->input->one("run 1"); lmp->input->one("run 1");
lmp->input->one("kim_interactions Ar"); lmp->input->one("kim interactions Ar");
lmp->input->one("run 1"); lmp->input->one("run 1");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
} }
@ -239,94 +258,189 @@ TEST_F(KimCommandsTest, kim_param)
{ {
if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP();
TEST_FAILURE(".*ERROR: Illegal kim_param command.*", lmp->input->one("kim_param");); TEST_FAILURE(".*ERROR: Illegal 'kim param' command.*",
TEST_FAILURE(".*ERROR: Incorrect arguments in kim_param command.\n" lmp->input->one("kim param"););
"'kim_param get/set' is mandatory.*", TEST_FAILURE(".*ERROR: Incorrect arguments in 'kim param' command.\n"
lmp->input->one("kim_param unknown shift 1 shift");); "'kim param get/set' is mandatory.*",
TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_param'.*", lmp->input->one("kim param unknown shift 1 shift"););
lmp->input->one("kim_param get shift 1 shift"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal"); lmp->input->one("kim init Sim_LAMMPS_LJcut_AkersonElliott_Alchemy_PbAu metal");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: kim_param can only be used with a KIM Portable Model.*", TEST_FAILURE(".*ERROR: 'kim param' can only be used with a KIM Portable Model.*",
lmp->input->one("kim_param get shift 1 shift");); lmp->input->one("kim param get shift 1 shift"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Illegal index '0' for " TEST_FAILURE(".*ERROR: Illegal 'kim param get' command.\nTo get the new "
"'shift' parameter with the extent of '1'.*", "parameter values, pair style must be assigned.\nMust use 'kim"
lmp->input->one("kim_param get shift 0 shift");); " interactions' or 'pair_style kim' before 'kim param get'.*",
TEST_FAILURE(".*ERROR: Illegal index '2' for " lmp->input->one("kim param get shift 1 shift"););
"'shift' parameter with the extent of '1'.*",
lmp->input->one("kim_param get shift 2 shift"););
TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer "
"parameter\\(s\\) instead of '1.' in index_range.*",
lmp->input->one("kim_param get shift 1. shift"););
TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for 'shift' "
"parameter with the extent of '1'.*",
lmp->input->one("kim_param get shift 1:2 shift"););
TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer "
"parameter\\(s\\) instead of '1-2' in index_range.*",
lmp->input->one("kim_param get shift 1-2 shift"););
TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim_param "
"get' command.\nThe LAMMPS '3' variable names or "
"'s1 split' is mandatory.*",
lmp->input->one("kim_param get sigmas 1:3 s1 s2"););
TEST_FAILURE(".*ERROR: Wrong argument in kim_param get command.\nThis "
"Model does not have the requested 'unknown' parameter.*",
lmp->input->one("kim_param get unknown 1 unknown"););
TEST_FAILURE(".*ERROR: Wrong 'kim_param set' command.\n"
"To set the new parameter values, pair style must "
"be assigned.\nMust use 'kim_interactions' or"
"'pair_style kim' before 'kim_param set'.*",
lmp->input->one("kim_param set shift 1 2"););
if (!verbose) ::testing::internal::CaptureStdout(); TEST_FAILURE(".*ERROR: Illegal 'kim param set' command.\nTo set the new "
lmp->input->one("kim_param get shift 1 shift"); "parameter values, pair style must be assigned.\nMust use 'kim"
if (!verbose) ::testing::internal::GetCapturedStdout(); " interactions' or 'pair_style kim' before 'kim param set'.*",
lmp->input->one("kim param set shift 1 2"););
ASSERT_FALSE(lmp->input->variable->find("shift") == -1);
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == std::string("1"));
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real");
lmp->input->one("lattice fcc 4.4300"); lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10"); lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box"); lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box"); lmp->input->one("create_atoms 1 box");
lmp->input->one("kim_interactions Ar"); lmp->input->one("kim interactions Ar");
lmp->input->one("mass 1 39.95"); lmp->input->one("mass 1 39.95");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Illegal index '0' for "
"'shift' parameter with the extent of '1'.*",
lmp->input->one("kim param get shift 0 shift"););
TEST_FAILURE(".*ERROR: Illegal index '2' for " TEST_FAILURE(".*ERROR: Illegal index '2' for "
"'shift' parameter with the extent of '1'.*", "'shift' parameter with the extent of '1'.*",
lmp->input->one("kim_param set shift 2 2");); lmp->input->one("kim param get shift 2 shift"););
TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer " TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer "
"parameter\\(s\\) instead of '1.' in index_range.*", "parameter\\(s\\) instead of '1.' in index_range.*",
lmp->input->one("kim_param set shift 1. shift");); lmp->input->one("kim param get shift 1. shift"););
TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for 'shift' "
"parameter with the extent of '1'.*",
lmp->input->one("kim param get shift 1:2 shift"););
TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer "
"parameter\\(s\\) instead of '1-2' in index_range.*",
lmp->input->one("kim param get shift 1-2 shift"););
TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param "
"get' command.\nThe LAMMPS '3' variable names or "
"'s1 split' is mandatory.*",
lmp->input->one("kim param get sigmas 1:3 s1 s2"););
TEST_FAILURE(".*ERROR: Wrong argument in 'kim param get' command.\nThis "
"Model does not have the requested 'unknown' parameter.*",
lmp->input->one("kim param get unknown 1 unknown"););
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get shift 1 shift");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_FALSE(lmp->input->variable->find("shift") == -1);
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "1");
TEST_FAILURE(".*ERROR: Illegal index '2' for "
"'shift' parameter with the extent of '1'.*",
lmp->input->one("kim param set shift 2 2"););
TEST_FAILURE(".*ERROR: Illegal index_range.\nExpected integer "
"parameter\\(s\\) instead of '1.' in index_range.*",
lmp->input->one("kim param set shift 1. shift"););
TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for " TEST_FAILURE(".*ERROR: Illegal index_range '1-2' for "
"'shift' parameter with the extent of '1'.*", "'shift' parameter with the extent of '1'.*",
lmp->input->one("kim_param set shift 1:2 2");); lmp->input->one("kim param set shift 1:2 2"););
TEST_FAILURE(".*ERROR: Wrong number of variable values for pair coefficients.*", TEST_FAILURE(".*ERROR: Wrong number of variable values for pair coefficients.*",
lmp->input->one("kim_param set sigmas 1:3 0.5523570 0.4989030");); lmp->input->one("kim param set sigmas 1:3 0.5523570 0.4989030"););
TEST_FAILURE(".*ERROR: Wrong argument for pair coefficients.\nThis " TEST_FAILURE(".*ERROR: Wrong argument for pair coefficients.\nThis "
"Model does not have the requested '0.4989030' parameter.*", "Model does not have the requested '0.4989030' parameter.*",
lmp->input->one("kim_param set sigmas 1:1 0.5523570 0.4989030");); lmp->input->one("kim param set sigmas 1:1 0.5523570 0.4989030"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("variable new_shift equal 2"); lmp->input->one("variable new_shift equal 2");
lmp->input->one("kim_param set shift 1 ${new_shift}"); lmp->input->one("kim param set shift 1 ${new_shift}");
lmp->input->one("kim_param get shift 1 shift"); lmp->input->one("kim param get shift 1 shift");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == std::string("2")); ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "2");
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 list"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 list"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 split"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 split"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 explicit"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*",
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 explicit"););
TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' "
"command.\nThe LAMMPS '3' variable names or 'cutoffs "
"split/list' is mandatory.*",
lmp->input->one("kim param get cutoffs 1:3 cutoffs"););
TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' "
"command.\nThe LAMMPS '3' variable names or 'cutoffs_1 "
"split' is mandatory.*",
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2"););
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 cutoffs_3");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 cutoffs_3 explicit");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get cutoffs 1:3 cutoffs split");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_1")) == "2.20943");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_2")) == "2.10252");
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs_3")) == "5.666115");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get cutoffs 1:3 cutoffs list");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.20943 2.10252 5.666115");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param set cutoffs 1 2.21 cutoffs 2 2.11");
lmp->input->one("kim param get cutoffs 1:2 cutoffs list");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.21 2.11");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param set cutoffs 1:3 2.3 2.2 5.7");
lmp->input->one("kim param get cutoffs 1:3 cutoffs list");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("cutoffs")) == "2.3 2.2 5.7");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
lmp->input->one("units real");
lmp->input->one("lattice fcc 4.4300");
lmp->input->one("region box block 0 10 0 10 0 10");
lmp->input->one("create_box 1 box");
lmp->input->one("create_atoms 1 box");
lmp->input->one("mass 1 39.95");
lmp->input->one("pair_style kim LennardJones612_UniversalShifted__MO_959249795837_003");
lmp->input->one("pair_coeff * * Ar");
if (!verbose) ::testing::internal::GetCapturedStdout();
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("kim param get shift 1 shift");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "1");
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("variable new_shift equal 2");
lmp->input->one("kim param set shift 1 ${new_shift}");
lmp->input->one("kim param get shift 1 shift");
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE(std::string(lmp->input->variable->retrieve("shift")) == "2");
} }
TEST_F(KimCommandsTest, kim_property) TEST_F(KimCommandsTest, kim_property)
@ -338,38 +452,38 @@ TEST_F(KimCommandsTest, kim_property)
TEST_FAILURE(".*ERROR: Invalid Python version.\n" TEST_FAILURE(".*ERROR: Invalid Python version.\n"
"The kim-property Python package requires Python " "The kim-property Python package requires Python "
"3 >= 3.6 support.*", "3 >= 3.6 support.*",
lmp->input->one("kim_property");); lmp->input->one("kim property"););
} else { } else {
TEST_FAILURE(".*ERROR: Invalid kim_property command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property' command.*",
lmp->input->one("kim_property");); lmp->input->one("kim property"););
TEST_FAILURE(".*ERROR: Invalid kim_property command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property' command.*",
lmp->input->one("kim_property create");); lmp->input->one("kim property create"););
TEST_FAILURE(".*ERROR: Incorrect arguments in kim_property command.\n" TEST_FAILURE(".*ERROR: Incorrect arguments in 'kim property' command."
"'kim_property create/destroy/modify/remove/dump' " "\n'kim property create/destroy/modify/remove/dump' "
"is mandatory.*", "is mandatory.*",
lmp->input->one("kim_property unknown 1 atomic-mass");); lmp->input->one("kim property unknown 1 atomic-mass"););
} }
#if defined(KIM_EXTRA_UNITTESTS) #if defined(KIM_EXTRA_UNITTESTS)
TEST_FAILURE(".*ERROR: Invalid 'kim_property create' command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property create' command.*",
lmp->input->one("kim_property create 1");); lmp->input->one("kim property create 1"););
TEST_FAILURE(".*ERROR: Invalid 'kim_property destroy' command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property destroy' command.*",
lmp->input->one("kim_property destroy 1 cohesive-potential-energy-cubic-crystal");); lmp->input->one("kim property destroy 1 cohesive-potential-energy-cubic-crystal"););
TEST_FAILURE(".*ERROR: Invalid 'kim_property modify' command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property modify' command.*",
lmp->input->one("kim_property modify 1 key short-name");); lmp->input->one("kim property modify 1 key short-name"););
TEST_FAILURE(".*ERROR: There is no property instance to modify the content.*", TEST_FAILURE(".*ERROR: There is no property instance to modify the content.*",
lmp->input->one("kim_property modify 1 key short-name source-value 1 fcc");); lmp->input->one("kim property modify 1 key short-name source-value 1 fcc"););
TEST_FAILURE(".*ERROR: Invalid 'kim_property remove' command.*", TEST_FAILURE(".*ERROR: Invalid 'kim property remove' command.*",
lmp->input->one("kim_property remove 1 key");); lmp->input->one("kim property remove 1 key"););
TEST_FAILURE(".*ERROR: There is no property instance to remove the content.*", TEST_FAILURE(".*ERROR: There is no property instance to remove the content.*",
lmp->input->one("kim_property remove 1 key short-name");); lmp->input->one("kim property remove 1 key short-name"););
TEST_FAILURE(".*ERROR: There is no property instance to dump the content.*", TEST_FAILURE(".*ERROR: There is no property instance to dump the content.*",
lmp->input->one("kim_property dump results.edn");); lmp->input->one("kim property dump results.edn"););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real"); lmp->input->one("kim init LennardJones612_UniversalShifted__MO_959249795837_003 real");
lmp->input->one("kim_property create 1 cohesive-potential-energy-cubic-crystal"); lmp->input->one("kim property create 1 cohesive-potential-energy-cubic-crystal");
lmp->input->one("kim_property modify 1 key short-name source-value 1 fcc"); lmp->input->one("kim property modify 1 key short-name source-value 1 fcc");
lmp->input->one("kim_property destroy 1"); lmp->input->one("kim property destroy 1");
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
#endif #endif
} }
@ -378,129 +492,233 @@ TEST_F(KimCommandsTest, kim_query)
{ {
if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP(); if (!LAMMPS::is_installed_pkg("KIM")) GTEST_SKIP();
TEST_FAILURE(".*ERROR: Illegal kim_query command.*", TEST_FAILURE(".*ERROR: Illegal 'kim query' command.*",
lmp->input->one("kim_query");); lmp->input->one("kim query"););
TEST_FAILURE(".*ERROR: Must use 'kim_init' before 'kim_query'.*", TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'split' "
lmp->input->one("kim_query a0 get_lattice_constant_cubic"););
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
lmp->input->one("kim_init LennardJones612_UniversalShifted__MO_959249795837_003 real");
if (!verbose) ::testing::internal::GetCapturedStdout();
TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe keyword 'split' "
"must be followed by the name of the query function.*", "must be followed by the name of the query function.*",
lmp->input->one("kim_query a0 split");); lmp->input->one("kim query a0 split"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'list' "
TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe 'list' keyword " "must be followed by the name of the query function.*",
lmp->input->one("kim query a0 list"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe keyword 'index' "
"must be followed by the name of the query function.*",
lmp->input->one("kim query a0 index"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword "
"can not be used after 'split'.*", "can not be used after 'split'.*",
lmp->input->one("kim_query a0 split list");); lmp->input->one("kim query a0 split list"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'index' keyword "
TEST_FAILURE(".*ERROR: Illegal kim_query command.\nThe 'list' keyword " "can not be used after 'split'.*",
"must be followed by \\('split' and\\) the name of the query " lmp->input->one("kim query a0 split index"););
"function.*", lmp->input->one("kim_query a0 list");); TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'split' keyword "
"can not be used after 'list'.*",
TEST_FAILURE(".*ERROR: Illegal 'model' key in kim_query command.*", lmp->input->one("kim query a0 list split"););
lmp->input->one("kim_query a0 get_lattice_constant_cubic " TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'index' keyword "
"model=[MO_959249795837_003]");); "can not be used after 'list'.*",
lmp->input->one("kim query a0 list index"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'list' keyword "
"can not be used after 'index'.*",
lmp->input->one("kim query a0 index list"););
TEST_FAILURE(".*ERROR: Illegal 'kim query' command.\nThe 'split' keyword "
"can not be used after 'index'.*",
lmp->input->one("kim query a0 index split"););
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `crystal` " TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `crystal` "
"to kim_query is wrong. The query format is the " "to 'kim query' is wrong. The query format is the "
"keyword=\\[value\\], where value is always an array of one " "keyword=\\[value\\], where value is always an array of one "
"or more comma-separated items.*", "or more comma-separated items.*",
lmp->input->one("kim_query a0 get_lattice_constant_cubic " lmp->input->one("kim query a0 get_lattice_constant_cubic "
"crystal");); "crystal"););
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `"
"crystal=fcc` to kim_query is wrong. The query format is the " "crystal=fcc` to 'kim query' is wrong. The query format is the "
"keyword=\\[value\\], where value is always an array of one " "keyword=\\[value\\], where value is always an array of one "
"or more comma-separated items.*", "or more comma-separated items.*",
lmp->input->one("kim_query a0 get_lattice_constant_cubic " lmp->input->one("kim query a0 get_lattice_constant_cubic "
"crystal=fcc");); "crystal=fcc"););
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `"
"crystal=\\[fcc` to kim_query is wrong. The query format is " "crystal=\\[fcc` to 'kim query' is wrong. The query format is "
"the keyword=\\[value\\], where value is always an array of " "the keyword=\\[value\\], where value is always an array of "
"one or more comma-separated items.*", "one or more comma-separated items.*",
lmp->input->one("kim_query a0 get_lattice_constant_cubic " lmp->input->one("kim query a0 get_lattice_constant_cubic "
"crystal=[fcc");); "crystal=[fcc"););
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `" TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `"
"crystal=fcc\\]` to kim_query is wrong. The query format is " "crystal=fcc\\]` to 'kim query' is wrong. The query format is "
"the keyword=\\[value\\], where value is always an array of " "the keyword=\\[value\\], where value is always an array of "
"one or more comma-separated items.*", "one or more comma-separated items.*",
lmp->input->one("kim_query a0 get_lattice_constant_cubic " lmp->input->one("kim query a0 get_lattice_constant_cubic "
"crystal=fcc]");); "crystal=fcc]"););
std::string squery("kim_query a0 get_lattice_constant_cubic "); std::string squery("kim query a0 get_lattice_constant_cubic ");
squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\" units=[\"angstrom\"]"; squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\" units=[\"angstrom\"]";
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species="
"\"Al\",\"Ni\"` to kim_query is wrong. The query format is " "\"Al\",\"Ni\"` to 'kim query' is wrong. The query format is "
"the keyword=\\[value\\], where value is always an array of " "the keyword=\\[value\\], where value is always an array of "
"one or more comma-separated items.*", "one or more comma-separated items.*",
lmp->input->one(squery);); lmp->input->one(squery););
squery = "kim_query a0 get_lattice_constant_cubic "; squery = "kim query a0 get_lattice_constant_cubic ";
squery += "crystal=[\"fcc\"] species=\"Al\",\"Ni\", units=[\"angstrom\"]"; squery += "crystal=[fcc] species=Al,Ni units=[angstrom]";
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species=" TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species="
"\"Al\",\"Ni\",` to kim_query is wrong. The query format is " "Al,Ni` to 'kim query' is wrong. The query format is "
"the keyword=\\[value\\], where value is always an array of " "the keyword=\\[value\\], where value is always an array of "
"one or more comma-separated items.*", "one or more comma-separated items.*",
lmp->input->one(squery);); lmp->input->one(squery););
squery = "kim_query a0 get_lattice_constant_cubic crystal=[fcc] " squery = "kim query a0 get_lattice_constant_cubic ";
squery += "crystal=[fcc] species=Al,Ni, units=[angstrom]";
TEST_FAILURE(".*ERROR: Illegal query format.\nInput argument of `species="
"Al,Ni,` to 'kim query' is wrong. The query format is "
"the keyword=\\[value\\], where value is always an array of "
"one or more comma-separated items.*",
lmp->input->one(squery););
squery = "kim query a0 get_lattice_constant_cubic crystal=[\"fcc\"] "
"species=[\"Al\"]";
TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before "
"'kim query' or must provide the model name after query "
"function with the format of 'model=\\[model_name\\]'.*",
lmp->input->one(squery););
squery = "kim query a0 get_lattice_constant_cubic crystal=[fcc] "
"species=[Al]"; "species=[Al]";
TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before "
"'kim query' or must provide the model name after query "
"function with the format of 'model=\\[model_name\\]'.*",
lmp->input->one(squery););
squery = "kim_query a0 get_lattice_constant_cubic crystal=[fcc] " squery = "kim query a0 get_lattice_constant_cubic crystal=[\"fcc\"] "
"units=[\"angstrom\"]"; "species=[Al]";
TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery);); TEST_FAILURE(".*ERROR: Illegal query format.\nMust use 'kim init' before "
"'kim query' or must provide the model name after query "
"function with the format of 'model=\\[model_name\\]'.*",
lmp->input->one(squery););
#if defined(KIM_EXTRA_UNITTESTS) #if defined(KIM_EXTRA_UNITTESTS)
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal");
squery = "kim_query latconst split get_lattice_constant_hexagonal "; squery = "kim query latconst_1 get_lattice_constant_cubic ";
squery += "crystal=[\"hcp\"] species=[\"Zr\"] units=[\"angstrom\"]"; squery += "crystal=[fcc] species=[Al] units=[angstrom] ";
squery += "model=[EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005]";
lmp->input->one(squery); lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) == ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) ==
std::string("3.234055244384789"))); "4.032082033157349"));
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) ==
std::string("5.167650199630013")));
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000 metal"); lmp->input->one("kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal");
squery = "kim_query latconst list get_lattice_constant_hexagonal "; squery = "kim query latconst_1 get_lattice_constant_cubic ";
squery += "crystal=[fcc] species=[Al] units=[angstrom]";
lmp->input->one(squery);
squery = "kim query latconst_2 get_lattice_constant_cubic ";
squery += "crystal=[fcc] species=[Al] units=[angstrom] ";
squery += "model=[LennardJones612_UniversalShifted__MO_959249795837_003]";
lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) ==
"4.032082033157349"));
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) ==
"3.328125931322575"));
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
lmp->input->one("kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal");
squery = "kim query latconst split get_lattice_constant_hexagonal ";
squery += "crystal=[hcp] species=[Zr] units=[angstrom]";
lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_1")) ==
"3.234055244384789"));
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst_2")) ==
"5.167650199630013"));
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
squery = "kim query latconst index get_lattice_constant_hexagonal ";
squery += "crystal=[hcp] species=[Zr] units=[angstrom] ";
squery += "model=[EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000]";
lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) ==
"3.234055244384789"));
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("variable latconst delete");
lmp->input->one("clear");
lmp->input->one("kim init EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000 metal");
squery = "kim query latconst list get_lattice_constant_hexagonal ";
squery += "crystal=[hcp] species=[Zr] units=[angstrom]"; squery += "crystal=[hcp] species=[Zr] units=[angstrom]";
lmp->input->one(squery); lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) == ASSERT_TRUE((std::string(lmp->input->variable->retrieve("latconst")) ==
std::string("3.234055244384789 5.167650199630013"))); "3.234055244384789 5.167650199630013"));
squery = "kim_query latconst list get_lattice_constant_hexagonal ";
squery += "crystal=[bcc] species=[Zr] units=[angstrom]";
TEST_FAILURE(".*ERROR: OpenKIM query failed:.*", lmp->input->one(squery););
if (!verbose) ::testing::internal::CaptureStdout(); if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear"); lmp->input->one("clear");
lmp->input->one("kim_init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal"); lmp->input->one("kim init EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005 metal");
squery = "kim_query alpha get_linear_thermal_expansion_coefficient_cubic "; squery = "kim query alpha get_linear_thermal_expansion_coefficient_cubic ";
squery += "crystal=[fcc] species=[Al] units=[1/K] temperature=[293.15] "; squery += "crystal=[fcc] species=[Al] units=[1/K] temperature=[293.15] ";
squery += "temperature_units=[K]"; squery += "temperature_units=[K]";
lmp->input->one(squery); lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout(); if (!verbose) ::testing::internal::GetCapturedStdout();
ASSERT_TRUE((std::string(lmp->input->variable->retrieve("alpha")) == ASSERT_TRUE((std::string(lmp->input->variable->retrieve("alpha")) ==
std::string("1.654960564704273e-05"))); "1.654960564704273e-05"));
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
squery = "kim query model_list list get_available_models ";
squery += "species=[Al]";
lmp->input->one(squery);
if (!verbose) ::testing::internal::GetCapturedStdout();
std::string model_list = lmp->input->variable->retrieve("model_list");
auto n = model_list.find("EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005");
ASSERT_TRUE(n != std::string::npos);
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
squery = "kim query model_name index get_available_models ";
squery += "species=[Al]";
lmp->input->one(squery);
lmp->input->one("variable model_name delete");
if (!verbose) ::testing::internal::GetCapturedStdout();
if (!verbose) ::testing::internal::CaptureStdout();
lmp->input->one("clear");
squery = "kim query model_name index get_available_models ";
squery += "species=[Al] potential_type=[eam,meam]";
lmp->input->one(squery);
lmp->input->one("variable model_name delete");
squery = "kim query model_name index get_available_models ";
squery += "species=[Al] potential_type=[\"eam\",\"meam\"]";
lmp->input->one(squery);
lmp->input->one("variable model_name delete");
squery = "kim query model_name index get_available_models ";
squery += "species=[Al] potential_type=[eam,\"meam\"]";
lmp->input->one(squery);
lmp->input->one("variable model_name delete");
squery = "kim query model_name index get_available_models ";
squery += "species=[Al] potential_type=[\"eam\",meam]";
lmp->input->one(squery);
lmp->input->one("variable model_name delete");
if (!verbose) ::testing::internal::GetCapturedStdout();
#endif #endif
} }
} // namespace LAMMPS_NS } // namespace LAMMPS_NS