Merge remote-tracking branch 'github/master' into collected-small-changes
This commit is contained in:
@ -143,8 +143,8 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE
|
|||||||
PLUGIN QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
PLUGIN QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK
|
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK
|
||||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
||||||
USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF
|
USER-HDNNP USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESONT USER-MGPT USER-MISC
|
||||||
USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB
|
USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB
|
||||||
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
||||||
USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-PACE USER-BROWNIAN)
|
USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-PACE USER-BROWNIAN)
|
||||||
|
|
||||||
@ -257,6 +257,7 @@ if(BUILD_OMP)
|
|||||||
|
|
||||||
if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
|
if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
|
||||||
(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR
|
(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR
|
||||||
|
((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
||||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
||||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
||||||
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
||||||
@ -347,7 +348,7 @@ else()
|
|||||||
set(CUDA_REQUEST_PIC)
|
set(CUDA_REQUEST_PIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-MDI USER-MOLFILE USER-NETCDF USER-PLUMED
|
foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-HDNNP USER-MDI USER-MOLFILE USER-NETCDF USER-PLUMED
|
||||||
USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS USER-PACE)
|
USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS USER-PACE)
|
||||||
if(PKG_${PKG_WITH_INCL})
|
if(PKG_${PKG_WITH_INCL})
|
||||||
include(Packages/${PKG_WITH_INCL})
|
include(Packages/${PKG_WITH_INCL})
|
||||||
|
|||||||
61
cmake/Modules/FindN2P2.cmake
Normal file
61
cmake/Modules/FindN2P2.cmake
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# Check if N2P2_DIR is set manually.
|
||||||
|
if (DEFINED ENV{N2P2_DIR})
|
||||||
|
set(N2P2_DIR "${N2P2_DIR}")
|
||||||
|
# If not, try if directory "lib/hdnnp/n2p2" exists.
|
||||||
|
else()
|
||||||
|
get_filename_component(_fullpath "${LAMMPS_LIB_SOURCE_DIR}/hdnnp/n2p2" REALPATH)
|
||||||
|
if (EXISTS ${_fullpath})
|
||||||
|
set(N2P2_DIR "${_fullpath}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set path to include directory.
|
||||||
|
find_path(N2P2_INCLUDE_DIR InterfaceLammps.h HINTS "${N2P2_DIR}/include")
|
||||||
|
# Two libraries need to be linked: libnnp and libnnpif.
|
||||||
|
find_library(N2P2_LIBNNP NAMES nnp HINTS "${N2P2_DIR}/lib")
|
||||||
|
find_library(N2P2_LIBNNPIF NAMES nnpif HINTS "${N2P2_DIR}/lib")
|
||||||
|
# Users could compile n2p2 with extra flags which are then also required for
|
||||||
|
# pair_hdnnp.cpp compilation. To forward them to the LAMMPS build process n2p2
|
||||||
|
# writes a file with cmake commands, e.g.
|
||||||
|
#
|
||||||
|
# target_compile_definitions(lammps PRIVATE -DN2P2_NO_SF_GROUPS)
|
||||||
|
#
|
||||||
|
# to "lib/lammps-extra.cmake" which is then included by USER-HDNNP.cmake.
|
||||||
|
find_file(N2P2_CMAKE_EXTRA NAMES lammps-extra.cmake HINTS "${N2P2_DIR}/lib")
|
||||||
|
|
||||||
|
find_package_handle_standard_args(N2P2 DEFAULT_MSG
|
||||||
|
N2P2_DIR
|
||||||
|
N2P2_INCLUDE_DIR
|
||||||
|
N2P2_LIBNNP
|
||||||
|
N2P2_LIBNNPIF
|
||||||
|
N2P2_CMAKE_EXTRA)
|
||||||
|
|
||||||
|
if(N2P2_FOUND)
|
||||||
|
if (NOT TARGET N2P2::N2P2)
|
||||||
|
# n2p2 core library "libnnp"
|
||||||
|
add_library(N2P2::LIBNNP UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(N2P2::LIBNNP PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${N2P2_INCLUDE_DIR}
|
||||||
|
IMPORTED_LOCATION ${N2P2_LIBNNP})
|
||||||
|
# n2p2 interface library "libnnpif"
|
||||||
|
add_library(N2P2::LIBNNPIF UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(N2P2::LIBNNPIF PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${N2P2_INCLUDE_DIR}
|
||||||
|
IMPORTED_LOCATION ${N2P2_LIBNNPIF})
|
||||||
|
# Put libnnp, libnnpif and include directory together.
|
||||||
|
add_library(N2P2::N2P2 INTERFACE IMPORTED)
|
||||||
|
set_property(TARGET N2P2::N2P2 PROPERTY
|
||||||
|
INTERFACE_LINK_LIBRARIES N2P2::LIBNNPIF N2P2::LIBNNP)
|
||||||
|
set(N2P2_CMAKE_EXTRAS ${N2P2_CMAKE_EXTRA})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
N2P2_DIR
|
||||||
|
N2P2_INCLUDE_DIR
|
||||||
|
N2P2_LIBNNP
|
||||||
|
N2P2_LIBNNPIF
|
||||||
|
N2P2_CMAKE_EXTRA
|
||||||
|
)
|
||||||
124
cmake/Modules/Packages/USER-HDNNP.cmake
Normal file
124
cmake/Modules/Packages/USER-HDNNP.cmake
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
find_package(N2P2 QUIET)
|
||||||
|
if(N2P2_FOUND)
|
||||||
|
set(DOWNLOAD_N2P2_DEFAULT OFF)
|
||||||
|
else()
|
||||||
|
set(DOWNLOAD_N2P2_DEFAULT ON)
|
||||||
|
endif()
|
||||||
|
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
|
||||||
|
if(DOWNLOAD_N2P2)
|
||||||
|
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.1.4.tar.gz" CACHE STRING "URL for n2p2 tarball")
|
||||||
|
set(N2P2_MD5 "9595b066636cd6b90b0fef93398297a5" CACHE STRING "MD5 checksum of N2P2 tarball")
|
||||||
|
mark_as_advanced(N2P2_URL)
|
||||||
|
mark_as_advanced(N2P2_MD5)
|
||||||
|
|
||||||
|
# adjust settings from detected compiler to compiler platform in n2p2 library
|
||||||
|
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
|
||||||
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
|
||||||
|
set(N2P2_COMP llvm)
|
||||||
|
set(N2P2_CXX_STD "-std=c++11")
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
|
set(N2P2_COMP intel)
|
||||||
|
set(N2P2_CXX_STD "-std=c++11")
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
set(N2P2_COMP gnu)
|
||||||
|
set(N2P2_CXX_STD "-std=gnu++11")
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
|
||||||
|
set(N2P2_COMP gnu)
|
||||||
|
set(N2P2_CXX_STD "--c++11")
|
||||||
|
else() # default
|
||||||
|
set(N2P2_COMP "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# pass on archive creator command. prefer compiler specific version, if set.
|
||||||
|
# important when using cross compiler.
|
||||||
|
if(CMAKE_CXX_COMPILER_AR)
|
||||||
|
set(N2P2_AR ${CMAKE_CXX_COMPILER_AR})
|
||||||
|
else()
|
||||||
|
set(N2P2_AR ${CMAKE_AR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# adjust compilation of n2p2 library to whether MPI is requested in LAMMPS or not
|
||||||
|
# need special care for compiling for MPICH2 with Linux-to-Windows cross compiler.
|
||||||
|
if(NOT BUILD_MPI)
|
||||||
|
set(N2P2_PROJECT_OPTIONS "-DN2P2_NO_MPI")
|
||||||
|
else()
|
||||||
|
# get path to MPI include directory when cross-compiling to windows
|
||||||
|
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||||
|
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
|
||||||
|
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
|
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
|
||||||
|
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# override compiler (optimization) flags in n2p2 library to flags used for LAMMPS
|
||||||
|
# specifically -march=native can result in problems when compiling on HPC clusters or with a cross compiler
|
||||||
|
# this convoluted way gets correct quoting/escaping when configuring the external project
|
||||||
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
||||||
|
set(N2P2_BUILD_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}} ${N2P2_CXX_STD}")
|
||||||
|
set(N2P2_BUILD_OPTIONS INTERFACES=LAMMPS COMP=${N2P2_COMP} "PROJECT_OPTIONS=${N2P2_PROJECT_OPTIONS}" "PROJECT_DEBUG="
|
||||||
|
"PROJECT_CC=${CMAKE_CXX_COMPILER}" "PROJECT_MPICC=${MPI_CXX_COMPILER}" "PROJECT_CFLAGS=${N2P2_BUILD_FLAGS}"
|
||||||
|
"PROJECT_AR=${N2P2_AR}")
|
||||||
|
# echo final flag for debugging
|
||||||
|
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")
|
||||||
|
|
||||||
|
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(n2p2_build
|
||||||
|
URL ${N2P2_URL}
|
||||||
|
URL_MD5 ${N2P2_MD5}
|
||||||
|
UPDATE_COMMAND ""
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
PATCH_COMMAND sed -i -e "s/\\(MPI_\\(P\\|Unp\\)ack(\\)/\\1(void *) /" src/libnnpif/LAMMPS/InterfaceLammps.cpp
|
||||||
|
BUILD_COMMAND make -f makefile libnnpif ${N2P2_BUILD_OPTIONS}
|
||||||
|
BUILD_ALWAYS YES
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
LOG_BUILD ON
|
||||||
|
SOURCE_SUBDIR src/
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libnnp.a <SOURCE_DIR>/lib/libnnpif.a
|
||||||
|
)
|
||||||
|
|
||||||
|
# create imported target LAMMPS::N2P2 from two libraries nnp and nnpif
|
||||||
|
ExternalProject_get_property(n2p2_build SOURCE_DIR)
|
||||||
|
# n2p2 core library "libnnp"
|
||||||
|
add_library(LAMMPS::N2P2::LIBNNP UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(LAMMPS::N2P2::LIBNNP PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libnnp.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include")
|
||||||
|
# n2p2 interface library "libnnpif"
|
||||||
|
add_library(LAMMPS::N2P2::LIBNNPIF UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(LAMMPS::N2P2::LIBNNPIF PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libnnpif.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include")
|
||||||
|
# nnpif library has MPI calls if MPI is enabled, so we must link with MPI libs
|
||||||
|
if(BUILD_MPI)
|
||||||
|
set_target_properties(LAMMPS::N2P2::LIBNNPIF PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES MPI::MPI_CXX)
|
||||||
|
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||||
|
add_dependencies(LAMMPS::N2P2::LIBNNPIF MPI::MPI_CXX)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# final step to define imported target
|
||||||
|
add_library(LAMMPS::N2P2 INTERFACE IMPORTED)
|
||||||
|
set_property(TARGET LAMMPS::N2P2 PROPERTY
|
||||||
|
INTERFACE_LINK_LIBRARIES LAMMPS::N2P2::LIBNNPIF LAMMPS::N2P2::LIBNNP)
|
||||||
|
target_link_libraries(lammps PRIVATE LAMMPS::N2P2)
|
||||||
|
|
||||||
|
add_dependencies(LAMMPS::N2P2 n2p2_build)
|
||||||
|
# work around issues with older CMake versions
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/lib")
|
||||||
|
else()
|
||||||
|
find_package(N2P2)
|
||||||
|
if(NOT N2P2_FOUND)
|
||||||
|
message(FATAL_ERROR "n2p2 not found, help CMake to find it by setting N2P2_DIR, or set DOWNLOAD_N2P2=ON to download it")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(lammps PRIVATE N2P2::N2P2)
|
||||||
|
include(${N2P2_CMAKE_EXTRAS})
|
||||||
|
endif()
|
||||||
@ -7,11 +7,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
|||||||
SRD VORONOI
|
SRD VORONOI
|
||||||
USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK
|
USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK
|
||||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
||||||
USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD USER-MESONT
|
USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD
|
||||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE
|
USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION
|
USER-PACE USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
|
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
||||||
USER-UEF USER-VTK USER-YAFF)
|
USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||||
|
|
||||||
foreach(PKG ${ALL_PACKAGES})
|
foreach(PKG ${ALL_PACKAGES})
|
||||||
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
|
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
|
||||||
|
|||||||
@ -9,11 +9,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
|||||||
SRD VORONOI
|
SRD VORONOI
|
||||||
USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK
|
USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK
|
||||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
|
||||||
USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD USER-MESONT
|
USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD
|
||||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE
|
USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION
|
USER-PACE USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
|
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
||||||
USER-UEF USER-VTK USER-YAFF)
|
USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||||
|
|
||||||
foreach(PKG ${ALL_PACKAGES})
|
foreach(PKG ${ALL_PACKAGES})
|
||||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||||
|
|||||||
@ -2,8 +2,8 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
|||||||
GRANULAR KSPACE LATTE MANYBODY MC MISC MLIAP MOLECULE OPT
|
GRANULAR KSPACE LATTE MANYBODY MC MISC MLIAP MOLECULE OPT
|
||||||
PERI POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
PERI POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||||
USER-ATC USER-AWPMD USER-BOCS USER-BROWNIAN USER-CGDNA USER-CGSDK
|
USER-ATC USER-AWPMD USER-BOCS USER-BROWNIAN USER-CGDNA USER-CGSDK
|
||||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF
|
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
|
||||||
USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD
|
USER-HDNNP USER-INTEL USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD
|
||||||
USER-MESONT USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP
|
USER-MESONT USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP
|
||||||
USER-PACE USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC
|
USER-PACE USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC
|
||||||
USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
|
USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MESSAGE MPIIO MSCG
|
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MESSAGE MPIIO MSCG
|
||||||
PYTHON VORONOI
|
PYTHON VORONOI
|
||||||
USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB USER-MOLFILE USER-MESONT
|
USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-HDNNP USER-LB USER-MOLFILE
|
||||||
USER-MDI USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP USER-SCAFACOS
|
USER-MESONT USER-MDI USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP
|
||||||
USER-SMD USER-VTK)
|
USER-SCAFACOS USER-SMD USER-VTK)
|
||||||
|
|
||||||
foreach(PKG ${PACKAGES_WITH_LIB})
|
foreach(PKG ${PACKAGES_WITH_LIB})
|
||||||
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
|
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
|
||||||
|
|||||||
@ -48,6 +48,7 @@ This is the list of packages that may require additional steps.
|
|||||||
* :ref:`USER-AWPMD <user-awpmd>`
|
* :ref:`USER-AWPMD <user-awpmd>`
|
||||||
* :ref:`USER-COLVARS <user-colvars>`
|
* :ref:`USER-COLVARS <user-colvars>`
|
||||||
* :ref:`USER-H5MD <user-h5md>`
|
* :ref:`USER-H5MD <user-h5md>`
|
||||||
|
* :ref:`USER-HDNNP <user-hdnnp>`
|
||||||
* :ref:`USER-INTEL <user-intel>`
|
* :ref:`USER-INTEL <user-intel>`
|
||||||
* :ref:`USER-MDI <user-mdi>`
|
* :ref:`USER-MDI <user-mdi>`
|
||||||
* :ref:`USER-MESONT <user-mesont>`
|
* :ref:`USER-MESONT <user-mesont>`
|
||||||
@ -1470,6 +1471,60 @@ the HDF5 library.
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _user-hdnnp:
|
||||||
|
|
||||||
|
USER-HDNNP package
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
To build with the USER-HDNNP package it is required to download and build the
|
||||||
|
external `n2p2 <https://github.com/CompPhysVienna/n2p2>`__ library ``v2.1.4``
|
||||||
|
(or higher). The LAMMPS build process offers an automatic download and
|
||||||
|
compilation of *n2p2* or allows you to choose the installation directory of
|
||||||
|
*n2p2* manually. Please see the boxes below for the CMake and traditional build
|
||||||
|
system for detailed information.
|
||||||
|
|
||||||
|
In case of a manual installation of *n2p2* you only need to build the *n2p2* core
|
||||||
|
library ``libnnp`` and interface library ``libnnpif``. When using GCC it should
|
||||||
|
suffice to execute ``make libnnpif`` in the *n2p2* ``src`` directory. For more
|
||||||
|
details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
|
||||||
|
<https://compphysvienna.github.io/n2p2/topics/build.html>`__.
|
||||||
|
|
||||||
|
.. tabs::
|
||||||
|
|
||||||
|
.. tab:: CMake build
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
-D DOWNLOAD_N2P2=value # download n2p2 for build, value = no (default) or yes
|
||||||
|
-D N2P2_DIR=path # n2p2 base directory (only needed if a custom location)
|
||||||
|
|
||||||
|
If ``DOWNLOAD_N2P2`` is set, the *n2p2* library will be downloaded and
|
||||||
|
built inside the CMake build directory. If the *n2p2* library is already
|
||||||
|
on your system (in a location CMake cannot find it), set the ``N2P2_DIR``
|
||||||
|
to path where *n2p2* is located. If *n2p2* is located directly in
|
||||||
|
``lib/hdnnp/n2p2`` it will be automatically found by CMake.
|
||||||
|
|
||||||
|
.. tab:: Traditional make
|
||||||
|
|
||||||
|
You can download and build the *n2p2* library manually if you prefer;
|
||||||
|
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
||||||
|
one step from the ``lammps/src`` dir, using a command like these, which
|
||||||
|
simply invoke the ``lib/hdnnp/Install.py`` script with the specified args:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make lib-hdnnp # print help message
|
||||||
|
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
||||||
|
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
||||||
|
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
||||||
|
|
||||||
|
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
||||||
|
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
||||||
|
``n2p2/include``, ``n2p2/lib`` and ``n2p2/lib/Makefile.lammps-extra``,
|
||||||
|
respectively. When LAMMPS is built in ``src`` it will use these links.
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _user-intel:
|
.. _user-intel:
|
||||||
|
|
||||||
USER-INTEL package
|
USER-INTEL package
|
||||||
|
|||||||
@ -30,17 +30,17 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
|
|||||||
These links take you to the extra instructions for those select
|
These links take you to the extra instructions for those select
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
| :ref:`COMPRESS <compress>` | :ref:`GPU <gpu>` | :ref:`KIM <kim>` | :ref:`KOKKOS <kokkos>` | :ref:`LATTE <latte>` | :ref:`MESSAGE <message>` |
|
| :ref:`COMPRESS <compress>` | :ref:`GPU <gpu>` | :ref:`KIM <kim>` | :ref:`KOKKOS <kokkos>` | :ref:`LATTE <latte>` | :ref:`MESSAGE <message>` |
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
| :ref:`MSCG <mscg>` | :ref:`OPT <opt>` | :ref:`POEMS <poems>` | :ref:`PYTHON <python>` | :ref:`VORONOI <voronoi>` | :ref:`USER-ADIOS <user-adios>` |
|
| :ref:`MSCG <mscg>` | :ref:`OPT <opt>` | :ref:`POEMS <poems>` | :ref:`PYTHON <python>` | :ref:`VORONOI <voronoi>` | :ref:`USER-ADIOS <user-adios>` |
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
| :ref:`USER-ATC <user-atc>` | :ref:`USER-AWPMD <user-awpmd>` | :ref:`USER-COLVARS <user-colvars>` | :ref:`USER-H5MD <user-h5md>` | :ref:`USER-INTEL <user-intel>` | :ref:`USER-MOLFILE <user-molfile>` |
|
| :ref:`USER-ATC <user-atc>` | :ref:`USER-AWPMD <user-awpmd>` | :ref:`USER-COLVARS <user-colvars>` | :ref:`USER-H5MD <user-h5md>` | :ref:`USER-HDNNP <user-hdnnp>` | :ref:`USER-INTEL <user-intel>` |
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
| :ref:`USER-NETCDF <user-netcdf>` | :ref:`USER-PACE <user-pace>` | :ref:`USER-PLUMED <user-plumed>` | :ref:`USER-OMP <user-omp>` | :ref:`USER-QMMM <user-qmmm>` | :ref:`USER-QUIP <user-quip>` |
|
| :ref:`USER-MOLFILE <user-molfile>` | :ref:`USER-NETCDF <user-netcdf>` | :ref:`USER-PACE <user-pace>` | :ref:`USER-PLUMED <user-plumed>` | :ref:`USER-OMP <user-omp>` | :ref:`USER-QMMM <user-qmmm>` |
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
| :ref:`USER-SCAFACOS <user-scafacos>` | :ref:`USER-SMD <user-smd>` | :ref:`USER-VTK <user-vtk>` | | | |
|
| :ref:`USER-QUIP <user-quip>` | :ref:`USER-SCAFACOS <user-scafacos>` | :ref:`USER-SMD <user-smd>` | :ref:`USER-VTK <user-vtk>` | | |
|
||||||
+--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
+--------------------------------------+--------------------------------------+------------------------------------+----------------------------------+--------------------------------+--------------------------------+
|
||||||
|
|
||||||
The mechanism for including packages is simple but different for CMake
|
The mechanism for including packages is simple but different for CMake
|
||||||
versus make.
|
versus make.
|
||||||
|
|||||||
@ -118,6 +118,7 @@ OPT.
|
|||||||
* :doc:`gw/zbl <pair_gw>`
|
* :doc:`gw/zbl <pair_gw>`
|
||||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||||
|
* :doc:`hdnnp <pair_hdnnp>`
|
||||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
||||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||||
|
|||||||
@ -79,6 +79,7 @@ page gives those details.
|
|||||||
* :ref:`USER-EFF <PKG-USER-EFF>`
|
* :ref:`USER-EFF <PKG-USER-EFF>`
|
||||||
* :ref:`USER-FEP <PKG-USER-FEP>`
|
* :ref:`USER-FEP <PKG-USER-FEP>`
|
||||||
* :ref:`USER-H5MD <PKG-USER-H5MD>`
|
* :ref:`USER-H5MD <PKG-USER-H5MD>`
|
||||||
|
* :ref:`USER-HDNNP <PKG-USER-HDNNP>`
|
||||||
* :ref:`USER-INTEL <PKG-USER-INTEL>`
|
* :ref:`USER-INTEL <PKG-USER-INTEL>`
|
||||||
* :ref:`USER-LB <PKG-USER-LB>`
|
* :ref:`USER-LB <PKG-USER-LB>`
|
||||||
* :ref:`USER-MANIFOLD <PKG-USER-MANIFOLD>`
|
* :ref:`USER-MANIFOLD <PKG-USER-MANIFOLD>`
|
||||||
@ -1639,6 +1640,39 @@ This package has :ref:`specific installation instructions <user-h5md>` on the :d
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _PKG-USER-HDNNP:
|
||||||
|
|
||||||
|
USER-HDNNP package
|
||||||
|
------------------
|
||||||
|
|
||||||
|
**Contents:**
|
||||||
|
|
||||||
|
A :doc:`pair_style hdnnp <pair_hdnnp>` command which allows to use
|
||||||
|
high-dimensional neural network potentials (HDNNPs), a form of machine learning
|
||||||
|
potentials. HDNNPs must be carefully trained prior to their application in a
|
||||||
|
molecular dynamics simulation.
|
||||||
|
|
||||||
|
.. _n2p2: https://github.com/CompPhysVienna/n2p2
|
||||||
|
|
||||||
|
To use this package you must have the `n2p2 <n2p2_>`_ library installed and
|
||||||
|
compiled on your system.
|
||||||
|
|
||||||
|
**Author:** Andreas Singraber
|
||||||
|
|
||||||
|
**Install:**
|
||||||
|
|
||||||
|
This package has :ref:`specific installation instructions <user-hdnnp>` on the :doc:`Build extras <Build_extras>` page.
|
||||||
|
|
||||||
|
**Supporting info:**
|
||||||
|
|
||||||
|
* src/USER-HDNNP: filenames -> commands
|
||||||
|
* src/USER-HDNNP/README
|
||||||
|
* lib/hdnnp/README
|
||||||
|
* :doc:`pair_style hdnnp <pair_hdnnp>`
|
||||||
|
* examples/USER/hdnnp
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _PKG-USER-INTEL:
|
.. _PKG-USER-INTEL:
|
||||||
|
|
||||||
USER-INTEL package
|
USER-INTEL package
|
||||||
|
|||||||
@ -59,6 +59,8 @@ package:
|
|||||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`USER-H5MD <PKG-USER-H5MD>` | dump output via HDF5 | :doc:`dump h5md <dump_h5md>` | n/a | ext |
|
| :ref:`USER-H5MD <PKG-USER-H5MD>` | dump output via HDF5 | :doc:`dump h5md <dump_h5md>` | n/a | ext |
|
||||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||||
|
| :ref:`USER-HDNNP <PKG-USER-HDNNP>` | High-dimensional neural network potentials | :doc:`pair_style hdnnp <pair_hdnnp>` | USER/hdnnp | ext |
|
||||||
|
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`USER-INTEL <PKG-USER-INTEL>` | optimized Intel CPU and KNL styles | :doc:`Speed intel <Speed_intel>` | `Benchmarks <https://www.lammps.org/bench.html>`_ | no |
|
| :ref:`USER-INTEL <PKG-USER-INTEL>` | optimized Intel CPU and KNL styles | :doc:`Speed intel <Speed_intel>` | `Benchmarks <https://www.lammps.org/bench.html>`_ | no |
|
||||||
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
|
||||||
| :ref:`USER-LB <PKG-USER-LB>` | Lattice Boltzmann fluid | :doc:`fix lb/fluid <fix_lb_fluid>` | USER/lb | no |
|
| :ref:`USER-LB <PKG-USER-LB>` | Lattice Boltzmann fluid | :doc:`fix lb/fluid <fix_lb_fluid>` | USER/lb | no |
|
||||||
|
|||||||
230
doc/src/pair_hdnnp.rst
Normal file
230
doc/src/pair_hdnnp.rst
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
.. index:: pair_style hdnnp
|
||||||
|
|
||||||
|
pair_style hdnnp command
|
||||||
|
========================
|
||||||
|
|
||||||
|
Syntax
|
||||||
|
""""""
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
pair_style hdnnp cutoff keyword value ...
|
||||||
|
|
||||||
|
* cutoff = short-range cutoff of HDNNP (maximum symmetry function cutoff radius)
|
||||||
|
* zero or more keyword/value pairs may be appended
|
||||||
|
* keyword = *dir* or *showew* or *showewsum* or *maxew* or *resetew* or *cflength* or *cfenergy*
|
||||||
|
* value depends on the preceding keyword:
|
||||||
|
|
||||||
|
.. parsed-literal::
|
||||||
|
|
||||||
|
*dir* value = directory
|
||||||
|
directory = Path to HDNNP configuration files
|
||||||
|
*showew* value = *yes* or *no*
|
||||||
|
*showewsum* value = summary
|
||||||
|
summary = Write EW summary every this many timesteps (*0* turns summary off)
|
||||||
|
*maxew* value = threshold
|
||||||
|
threshold = Maximum number of EWs allowed
|
||||||
|
*resetew* value = *yes* or *no*
|
||||||
|
*cflength* value = length
|
||||||
|
length = Length unit conversion factor
|
||||||
|
*cfenergy* value = energy
|
||||||
|
energy = Energy unit conversion factor
|
||||||
|
|
||||||
|
Examples
|
||||||
|
""""""""
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
pair_style hdnnp 6.35 showew yes showewsum 100 maxew 1000 resetew yes cflength 1.8897261328 cfenergy 0.0367493254
|
||||||
|
pair_coeff * * H O
|
||||||
|
|
||||||
|
pair_style hdnnp 6.01 dir "./" showewsum 10000
|
||||||
|
pair_coeff * * S Cu NULL Cu
|
||||||
|
|
||||||
|
Description
|
||||||
|
"""""""""""
|
||||||
|
|
||||||
|
This pair style adds an interaction based on the high-dimensional neural network
|
||||||
|
potential (HDNNP) method as presented in :ref:`(Behler and Parrinello 2007)
|
||||||
|
<Behler_Parrinello_2007>`. HDNNPs are machine learning potentials which require
|
||||||
|
careful training of neural networks prior to application in MD simulations. The
|
||||||
|
pair style uses an interface to the *n2p2* library :ref:`(Singraber, Behler and
|
||||||
|
Dellago 2019) <Singraber_Behler_Dellago_2019>` which is available on Github
|
||||||
|
`here <https://github.com/CompPhysVienna/n2p2>`__. Please see the *n2p2*
|
||||||
|
`documentation <https://compphysvienna.github.io/n2p2/>`__ for further details.
|
||||||
|
*n2p2* (and hence this pair style) is compatible with neural network potentials
|
||||||
|
trained with its own tools :ref:`(Singraber et al 2019) <Singraber_et_al_2019>`
|
||||||
|
and with `RuNNer <https://www.uni-goettingen.de/de/560580.html>`__.
|
||||||
|
|
||||||
|
Only a single *pair_coeff* command with two asterisk wild-cards is used with this
|
||||||
|
pair style. Its additional arguments define the mapping of LAMMPS atom types to
|
||||||
|
n2p2 elements.
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
pair_coeff * * H O
|
||||||
|
|
||||||
|
In the above example LAMMPS types 1 and 2 are mapped to the elements "H" and "O"
|
||||||
|
in n2p2, respectively. Multiple types may map to the same element, or some types
|
||||||
|
may not be mapped at all. For example, if the LAMMPS simulation has four atom
|
||||||
|
types, the command
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
pair_coeff * * H H O NULL
|
||||||
|
|
||||||
|
maps atom types 1 and 2 to the element "H", type 3 to "O" and type 4 is not mapped
|
||||||
|
(indicated by NULL). Atoms mapped to NULL are ignored by the HDNNP calculation,
|
||||||
|
i.e. they do not contribute in any way to the evaluation of HDNNP energies and forces.
|
||||||
|
This may be useful in a setup with :doc:`hybrid pair styles <pair_hybrid>`.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
The mandatory pair style argument *cutoff* must match the short-range cutoff radius
|
||||||
|
of the HDNNP. This corresponds to the maximum cutoff radius of all symmetry
|
||||||
|
functions (the atomic environment descriptors of HDNNPs) used.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The cutoff must be given in LAMMPS length units, even if the neural network
|
||||||
|
potential has been trained using a different unit system (see remarks about the
|
||||||
|
*cflength* and *cfenergy* keywords below for details).
|
||||||
|
|
||||||
|
The numeric value may be slightly larger than the actual maximum symmetry
|
||||||
|
function cutoff radius (to account for rounding errors when converting units),
|
||||||
|
but must not be smaller.
|
||||||
|
|
||||||
|
Use the *dir* keyword to specify the directory containing the HDNNP configuration
|
||||||
|
files. The directory must contain ``input.nn`` with neural network and symmetry
|
||||||
|
function setup, ``scaling.data`` with symmetry function scaling data and
|
||||||
|
``weights.???.data`` with weight parameters for each element.
|
||||||
|
|
||||||
|
The keyword *showew* can be used to turn on/off the display of extrapolation
|
||||||
|
warnings (EWs) which are issued whenever a symmetry function value is out of
|
||||||
|
bounds defined by minimum/maximum values in ``scaling.data``. An extrapolation
|
||||||
|
warning may look like this:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
### NNP EXTRAPOLATION WARNING ### STRUCTURE: 0 ATOM: 119 ELEMENT: Cu SYMFUNC: 32 TYPE: 3 VALUE: 2.166E-02 MIN: 2.003E-05 MAX: 1.756E-02
|
||||||
|
|
||||||
|
stating that the value 2.166E-02 of symmetry function 32 of type 3 (Narrow Angular symmetry function), element Cu (see the log file for a symmetry function listing) was out
|
||||||
|
of bounds (maximum in ``scaling.data`` is 1.756E-02) for atom 119. Here, the
|
||||||
|
atom index refers to the LAMMPS tag (global index) and the structure index is
|
||||||
|
used to print out the MPI rank the atom belongs to.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The *showew* keyword should only be set to *yes* for debugging purposes.
|
||||||
|
Extrapolation warnings may add lots of overhead as they are communicated each
|
||||||
|
timestep. Also, if the simulation is run in a region where the HDNNP was not
|
||||||
|
correctly trained, lots of extrapolation warnings may clog log files and the
|
||||||
|
console. In a production run use *showewsum* instead.
|
||||||
|
|
||||||
|
The keyword *showewsum* can be used to get an overview of extrapolation warnings
|
||||||
|
occurring during an MD simulation. The argument specifies the interval at which
|
||||||
|
extrapolation warning summaries are displayed and logged. An EW summary may look
|
||||||
|
like this:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
### NNP EW SUMMARY ### TS: 100 EW 11 EWPERSTEP 1.100E-01
|
||||||
|
|
||||||
|
Here, at timestep 100 the occurrence of 11 extrapolation warnings since the last
|
||||||
|
summary is reported, which corresponds to an EW rate of 0.11 per timestep.
|
||||||
|
Setting *showewsum* to 0 deactivates the EW summaries.
|
||||||
|
|
||||||
|
A maximum number of allowed extrapolation warnings can be specified with the
|
||||||
|
*maxew* keyword. If the number of EWs exceeds the *maxew* argument the
|
||||||
|
simulation is stopped. Note however that this is merely an approximate threshold
|
||||||
|
since the check is only performed at the end of each timestep and each MPI
|
||||||
|
process counts individually to minimize communication overhead.
|
||||||
|
|
||||||
|
The keyword *resetew* alters the behavior of the above mentioned *maxew*
|
||||||
|
threshold. If *resetew* is set to *yes* the threshold is applied on a
|
||||||
|
per-timestep basis and the internal EW counters are reset at the beginning of
|
||||||
|
each timestep. With *resetew* set to *no* the counters accumulate EWs along the
|
||||||
|
whole trajectory.
|
||||||
|
|
||||||
|
If the training of a neural network potential has been performed with different
|
||||||
|
physical units for length and energy than those set in LAMMPS, it is still
|
||||||
|
possible to use the potential when the unit conversion factors are provided via
|
||||||
|
the *cflength* and *cfenergy* keywords. If for example, the HDNNP was
|
||||||
|
parameterized with Bohr and Hartree training data and symmetry function
|
||||||
|
parameters (i.e. distances and energies in "input.nn" are given in Bohr and
|
||||||
|
Hartree) but LAMMPS is set to use *metal* units (Angstrom and eV) the correct
|
||||||
|
conversion factors are:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
|
cflength 1.8897261328
|
||||||
|
|
||||||
|
cfenergy 0.0367493254
|
||||||
|
|
||||||
|
Thus, arguments of *cflength* and *cfenergy* are the multiplicative factors
|
||||||
|
required to convert lengths and energies given in LAMMPS units to respective
|
||||||
|
quantities in native HDNNP units (1 Angstrom = 1.8897261328 Bohr, 1 eV =
|
||||||
|
0.0367493254 Hartree).
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Mixing, shift, table, tail correction, restart, rRESPA info
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
This style does not support mixing. The :doc:`pair_coeff <pair_coeff>` command
|
||||||
|
should only be invoked with asterisk wild cards (see above).
|
||||||
|
|
||||||
|
This style does not support the :doc:`pair_modify <pair_modify>`
|
||||||
|
shift, table, and tail options.
|
||||||
|
|
||||||
|
This style does not write information to :doc:`binary restart files <restart>`.
|
||||||
|
Thus, you need to re-specify the pair_style and pair_coeff commands in an input
|
||||||
|
script that reads a restart file.
|
||||||
|
|
||||||
|
This style can only be used via the *pair* keyword of the :doc:`run_style respa
|
||||||
|
<run_style>` command. It does not support the *inner*\ , *middle*\ , *outer*
|
||||||
|
keywords.
|
||||||
|
|
||||||
|
Restrictions
|
||||||
|
""""""""""""
|
||||||
|
|
||||||
|
This pair style is part of the USER-HDNNP package. It is only enabled if LAMMPS
|
||||||
|
was built with that package. See the :doc:`Build package <Build_package>` doc
|
||||||
|
page for more info.
|
||||||
|
|
||||||
|
Please report bugs and feature requests to the `n2p2 GitHub issue page
|
||||||
|
<https://github.com/CompPhysVienna/n2p2/issues>`__.
|
||||||
|
|
||||||
|
Related commands
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
:doc:`pair_coeff <pair_coeff>`, :doc:`pair_hybrid <pair_hybrid>`, :doc:`units <units>`
|
||||||
|
|
||||||
|
Default
|
||||||
|
^^^^^^^
|
||||||
|
|
||||||
|
The default options are *dir* = "hdnnp/", *showew* = yes, *showewsum* = 0, *maxew*
|
||||||
|
= 0, *resetew* = no, *cflength* = 1.0, *cfenergy* = 1.0.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
.. _Behler_Parrinello_2007:
|
||||||
|
|
||||||
|
**(Behler and Parrinello 2007)** `Behler, J.; Parrinello, M. Generalized
|
||||||
|
Neural-Network Representation of High-Dimensional Potential-Energy Surfaces.
|
||||||
|
Phys. Rev. Lett. 2007, 98 (14), 146401.
|
||||||
|
<https://doi.org/10.1103/PhysRevLett.98.146401>`__
|
||||||
|
|
||||||
|
.. _Singraber_Behler_Dellago_2019:
|
||||||
|
|
||||||
|
**(Singraber, Behler and Dellago 2019)** `Singraber, A.; Behler, J.; Dellago, C.
|
||||||
|
Library-Based LAMMPS Implementation of High-Dimensional Neural Network
|
||||||
|
Potentials. J. Chem. Theory Comput. 2019, 15 (3), 1827-1840
|
||||||
|
<https://doi.org/10.1021/acs.jctc.8b00770>`__
|
||||||
|
|
||||||
|
.. _Singraber_et_al_2019:
|
||||||
|
|
||||||
|
**(Singraber et al 2019)** `Singraber, A.; Morawietz, T.; Behler, J.; Dellago,
|
||||||
|
C. Parallel Multistream Training of High-Dimensional Neural Network Potentials.
|
||||||
|
J. Chem. Theory Comput. 2019, 15 (5), 3075-3092.
|
||||||
|
<https://doi.org/10.1021/acs.jctc.8b01092>`__
|
||||||
@ -182,6 +182,7 @@ accelerated styles exist.
|
|||||||
* :doc:`gw/zbl <pair_gw>` - Gao-Weber potential with a repulsive ZBL core
|
* :doc:`gw/zbl <pair_gw>` - Gao-Weber potential with a repulsive ZBL core
|
||||||
* :doc:`hbond/dreiding/lj <pair_hbond_dreiding>` - DREIDING hydrogen bonding LJ potential
|
* :doc:`hbond/dreiding/lj <pair_hbond_dreiding>` - DREIDING hydrogen bonding LJ potential
|
||||||
* :doc:`hbond/dreiding/morse <pair_hbond_dreiding>` - DREIDING hydrogen bonding Morse potential
|
* :doc:`hbond/dreiding/morse <pair_hbond_dreiding>` - DREIDING hydrogen bonding Morse potential
|
||||||
|
* :doc:`hdnnp <pair_hdnnp>` - High-dimensional neural network potential
|
||||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>` - registry-dependent interlayer potential (ILP)
|
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>` - registry-dependent interlayer potential (ILP)
|
||||||
* :doc:`kim <pair_kim>` - interface to potentials provided by KIM project
|
* :doc:`kim <pair_kim>` - interface to potentials provided by KIM project
|
||||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>` - Kolmogorov-Crespi (KC) potential with no simplifications
|
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>` - Kolmogorov-Crespi (KC) potential with no simplifications
|
||||||
|
|||||||
@ -1229,6 +1229,8 @@ hbn
|
|||||||
hbnewflag
|
hbnewflag
|
||||||
hbond
|
hbond
|
||||||
hcp
|
hcp
|
||||||
|
hdnnp
|
||||||
|
HDNNP
|
||||||
heatconduction
|
heatconduction
|
||||||
Hebbeker
|
Hebbeker
|
||||||
Hebenstreit
|
Hebenstreit
|
||||||
|
|||||||
1096
examples/USER/hdnnp/data.H2O-360mol
Normal file
1096
examples/USER/hdnnp/data.H2O-360mol
Normal file
File diff suppressed because it is too large
Load Diff
120
examples/USER/hdnnp/hdnnp-data/input.nn
Normal file
120
examples/USER/hdnnp/hdnnp-data/input.nn
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
###############################################################################
|
||||||
|
# HDNNP for water H2O
|
||||||
|
###############################################################################
|
||||||
|
# Length unit : Bohr
|
||||||
|
# Energy unit : Ha
|
||||||
|
# Reference method: RPBE-D3
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# DATA SET NORMALIZATION
|
||||||
|
###############################################################################
|
||||||
|
# This section was automatically added by nnp-norm.
|
||||||
|
mean_energy -2.5521343547039809E+01
|
||||||
|
conv_energy 2.4265748255366972E+02
|
||||||
|
conv_length 5.8038448995319847E+00
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# GENERAL NNP SETTINGS
|
||||||
|
###############################################################################
|
||||||
|
# These keywords are (almost) always required.
|
||||||
|
number_of_elements 2 # Number of elements.
|
||||||
|
elements H O # Specification of elements.
|
||||||
|
#atom_energy H -0.45890771 # Free atom reference energy (H).
|
||||||
|
#atom_energy O -74.94518524 # Free atom reference energy (O).
|
||||||
|
cutoff_type 2 # Cutoff type.
|
||||||
|
scale_symmetry_functions # Scale all symmetry functions with min/max values.
|
||||||
|
#scale_symmetry_functions_sigma # Scale all symmetry functions with sigma.
|
||||||
|
scale_min_short 0.0 # Minimum value for scaling.
|
||||||
|
scale_max_short 1.0 # Maximum value for scaling.
|
||||||
|
center_symmetry_functions # Center all symmetry functions, i.e. subtract mean value.
|
||||||
|
global_hidden_layers_short 2 # Number of hidden layers.
|
||||||
|
global_nodes_short 25 25 # Number of nodes in each hidden layer.
|
||||||
|
global_activation_short t t l # Activation function for each hidden layer and output layer.
|
||||||
|
#normalize_nodes # Normalize input of nodes.
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# SYMMETRY FUNCTIONS
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Radial symmetry function (type 2):
|
||||||
|
#symfunction_short <element-central> 2 <element-neighbor> <eta> <rshift> <rcutoff>
|
||||||
|
|
||||||
|
# Narrow Angular symmetry function (type 3):
|
||||||
|
#symfunction_short <element-central> 3 <element-neighbor1> <element-neighbor2> <eta> <lambda> <zeta> <rcutoff>
|
||||||
|
|
||||||
|
# Wide Angular symmetry function (type 9):
|
||||||
|
#symfunction_short <element-central> 9 <element-neighbor1> <element-neighbor2> <eta> <lambda> <zeta> <rcutoff>
|
||||||
|
|
||||||
|
# radial H H
|
||||||
|
symfunction_short H 2 H 0.001 0.0 12.00
|
||||||
|
symfunction_short H 2 H 0.01 0.0 12.00
|
||||||
|
symfunction_short H 2 H 0.03 0.0 12.00
|
||||||
|
symfunction_short H 2 H 0.06 0.0 12.00
|
||||||
|
symfunction_short H 2 H 0.15 1.9 12.00
|
||||||
|
symfunction_short H 2 H 0.30 1.9 12.00
|
||||||
|
symfunction_short H 2 H 0.60 1.9 12.00
|
||||||
|
symfunction_short H 2 H 1.50 1.9 12.00
|
||||||
|
|
||||||
|
# radial H O / O H
|
||||||
|
symfunction_short H 2 O 0.001 0.0 12.00
|
||||||
|
symfunction_short H 2 O 0.01 0.0 12.00
|
||||||
|
symfunction_short H 2 O 0.03 0.0 12.00
|
||||||
|
symfunction_short H 2 O 0.06 0.0 12.00
|
||||||
|
symfunction_short H 2 O 0.15 0.9 12.00
|
||||||
|
symfunction_short H 2 O 0.30 0.9 12.00
|
||||||
|
symfunction_short H 2 O 0.60 0.9 12.00
|
||||||
|
symfunction_short H 2 O 1.50 0.9 12.00
|
||||||
|
|
||||||
|
symfunction_short O 2 H 0.001 0.0 12.00
|
||||||
|
symfunction_short O 2 H 0.01 0.0 12.00
|
||||||
|
symfunction_short O 2 H 0.03 0.0 12.00
|
||||||
|
symfunction_short O 2 H 0.06 0.0 12.00
|
||||||
|
symfunction_short O 2 H 0.15 0.9 12.00
|
||||||
|
symfunction_short O 2 H 0.30 0.9 12.00
|
||||||
|
symfunction_short O 2 H 0.60 0.9 12.00
|
||||||
|
symfunction_short O 2 H 1.50 0.9 12.00
|
||||||
|
|
||||||
|
# radial O O
|
||||||
|
symfunction_short O 2 O 0.001 0.0 12.00
|
||||||
|
symfunction_short O 2 O 0.01 0.0 12.00
|
||||||
|
symfunction_short O 2 O 0.03 0.0 12.00
|
||||||
|
symfunction_short O 2 O 0.06 0.0 12.00
|
||||||
|
symfunction_short O 2 O 0.15 4.0 12.00
|
||||||
|
symfunction_short O 2 O 0.30 4.0 12.00
|
||||||
|
symfunction_short O 2 O 0.60 4.0 12.00
|
||||||
|
symfunction_short O 2 O 1.50 4.0 12.00
|
||||||
|
|
||||||
|
# angular
|
||||||
|
symfunction_short H 3 O H 0.2 1.0 1.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short O 3 H H 0.07 1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.07 1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 H H 0.07 -1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.07 -1.0 1.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short O 3 H H 0.03 1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.03 1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 H H 0.03 -1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.03 -1.0 1.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short O 3 H H 0.01 1.0 4.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.01 1.0 4.0 12.00000
|
||||||
|
symfunction_short O 3 H H 0.01 -1.0 4.0 12.00000
|
||||||
|
symfunction_short H 3 O H 0.01 -1.0 4.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short O 3 O H 0.03 1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 O H 0.03 -1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 O H 0.001 1.0 4.0 12.00000
|
||||||
|
symfunction_short O 3 O H 0.001 -1.0 4.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short H 3 O O 0.03 1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O O 0.03 -1.0 1.0 12.00000
|
||||||
|
symfunction_short H 3 O O 0.001 1.0 4.0 12.00000
|
||||||
|
symfunction_short H 3 O O 0.001 -1.0 4.0 12.00000
|
||||||
|
|
||||||
|
symfunction_short O 3 O O 0.03 1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 O O 0.03 -1.0 1.0 12.00000
|
||||||
|
symfunction_short O 3 O O 0.001 1.0 4.0 12.00000
|
||||||
|
symfunction_short O 3 O O 0.001 -1.0 4.0 12.00000
|
||||||
72
examples/USER/hdnnp/hdnnp-data/scaling.data
Normal file
72
examples/USER/hdnnp/hdnnp-data/scaling.data
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
################################################################################
|
||||||
|
# Symmetry function scaling data.
|
||||||
|
################################################################################
|
||||||
|
# Col Name Description
|
||||||
|
################################################################################
|
||||||
|
# 1 e_index Element index.
|
||||||
|
# 2 sf_index Symmetry function index.
|
||||||
|
# 3 sf_min Symmetry function minimum.
|
||||||
|
# 4 sf_max Symmetry function maximum.
|
||||||
|
# 5 sf_mean Symmetry function mean.
|
||||||
|
# 6 sf_sigma Symmetry function sigma.
|
||||||
|
#########################################################################################################################
|
||||||
|
# 1 2 3 4 5 6
|
||||||
|
# e_index sf_index sf_min sf_max sf_mean sf_sigma
|
||||||
|
#########################################################################################################################
|
||||||
|
1 1 1.0882016636170764E+00 9.6166419119419064E+00 2.2691752247542194E+00 6.7883526611658462E-01
|
||||||
|
1 2 7.3274438904180561E-01 5.0028559321574191E+00 1.3272332317543580E+00 3.3936750181780473E-01
|
||||||
|
1 3 7.6010783783215696E-01 7.1427942966219815E+00 1.6470726712825305E+00 5.0771115927383836E-01
|
||||||
|
1 4 5.4842285884800812E-01 3.7661771168267726E+00 1.0163698211361718E+00 2.5362958053787776E-01
|
||||||
|
1 5 4.0080665126604625E-01 4.1469832401668629E+00 9.0925040981537897E-01 2.9758019277508319E-01
|
||||||
|
1 6 3.6209352253798227E-01 2.2678239402766054E+00 6.4931154122889623E-01 1.4835420345383032E-01
|
||||||
|
1 7 1.8919103878435897E-01 2.2292652677252804E+00 4.5693857051003817E-01 1.5976079618578123E-01
|
||||||
|
1 8 2.6704178695764313E-01 1.3208742362468955E+00 4.2395636902644862E-01 8.0492394978461931E-02
|
||||||
|
1 9 2.4513099752055156E-01 9.4751160662053002E-01 3.6244199023263673E-01 5.2993540556109331E-02
|
||||||
|
1 10 2.2248910067848982E-01 2.7596216013647377E+00 5.3891576898130766E-01 2.0137334230483950E-01
|
||||||
|
1 11 1.4743601726548086E-01 5.5599270746969276E-01 2.6773972195910817E-01 2.6188094566404998E-02
|
||||||
|
1 12 9.9110926426029380E-02 1.7265405335201480E+00 2.9553976311554875E-01 1.1619768775752932E-01
|
||||||
|
1 13 6.5093699123904267E-02 3.4521757733971170E-01 1.8521249136783141E-01 1.9741155185936318E-02
|
||||||
|
1 14 3.1653527247865069E-02 9.1293170125596168E-01 1.5025164684953513E-01 5.3480187368038674E-02
|
||||||
|
1 15 2.9202821602466694E-03 2.6453981776124141E-01 7.6525296616004684E-02 1.8780956137549487E-02
|
||||||
|
1 16 3.2145385719803329E-04 2.8696425565429240E-01 4.5792284631233672E-02 2.3263495133568998E-02
|
||||||
|
1 17 2.4693757528509622E-04 1.3848731138266304E-01 1.7693289653297604E-02 9.7460303038080908E-03
|
||||||
|
1 18 5.0992836797990751E-03 5.8319173651547385E-01 2.3851656540978389E-02 3.7790771891778152E-02
|
||||||
|
1 19 3.2282960174310170E-04 2.1613962298381925E-01 1.7072560754702336E-02 1.4026518665786077E-02
|
||||||
|
1 20 4.9647513277769700E-02 1.6851617426880194E+00 1.4541325969622534E-01 1.0954306125703028E-01
|
||||||
|
1 21 3.4073471604482227E-03 3.1637071808861689E-01 1.8422597685566724E-02 2.0125274191649719E-02
|
||||||
|
1 22 1.3121382132811807E-04 1.0258348935693713E-01 6.3684016949344113E-03 6.6071626858835051E-03
|
||||||
|
1 23 3.3813162813665906E-02 9.1618560879938926E-01 8.1266384503339575E-02 5.7918502576695730E-02
|
||||||
|
1 24 4.1708500446352870E-04 1.5785966980407021E-01 4.6646981268568697E-03 9.8630700614506465E-03
|
||||||
|
1 25 7.3528900917695290E-04 5.9225627251013026E-02 3.7042174075139758E-03 3.3118079036492621E-03
|
||||||
|
1 26 8.9828333062972592E-03 1.9426085555380754E-01 2.4093377110646338E-02 1.0980657457661532E-02
|
||||||
|
1 27 2.1228022180417653E-04 8.7777813240869640E-03 2.0550705761547970E-03 5.8802103858137246E-04
|
||||||
|
2 1 1.5142595331454245E+00 1.0005711988559998E+01 2.6544664635087183E+00 6.7806617585688911E-01
|
||||||
|
2 2 4.4366445360926199E-01 4.6195409357987076E+00 9.6587051599896101E-01 3.3688559575009042E-01
|
||||||
|
2 3 1.1907810568758714E+00 7.5323544094345003E+00 2.0327396422723472E+00 5.0607867531004169E-01
|
||||||
|
2 4 2.7576036468694687E-01 3.3862131032504492E+00 6.5929732667024776E-01 2.5004687333979903E-01
|
||||||
|
2 5 8.0580777590695674E-01 4.5356481255168557E+00 1.2986230824577940E+00 2.9449908325462404E-01
|
||||||
|
2 6 1.0517053799863604E-01 1.8909877539194515E+00 3.0673921331641835E-01 1.4198497108573313E-01
|
||||||
|
2 7 5.6949141690859706E-01 2.6154328621607852E+00 8.4791273805289546E-01 1.5714071578589769E-01
|
||||||
|
2 8 2.3251646720171416E-02 9.3641034200657891E-01 1.1140979781150941E-01 6.9796654369842781E-02
|
||||||
|
2 9 5.1354161698115419E-01 1.8545341781448565E+00 7.2488398046527269E-01 9.8011511620611044E-02
|
||||||
|
2 10 1.1057465545812291E-01 2.9121456897811342E+00 4.7474421797982730E-01 2.3441807910092233E-01
|
||||||
|
2 11 3.5269317308496489E-01 1.0714592032613128E+00 5.3547944391821678E-01 4.5179661104166338E-02
|
||||||
|
2 12 3.0424313539726355E-02 2.5277642768509305E+00 3.1652845366685045E-01 2.1026891409654727E-01
|
||||||
|
2 13 1.5980022688828247E-01 6.6348817066386512E-01 3.7042498273566293E-01 3.0753700953611234E-02
|
||||||
|
2 14 2.7781847150922931E-03 2.3030057819082539E+00 1.7737800292869690E-01 1.8600239464755819E-01
|
||||||
|
2 15 9.5641036809349829E-03 3.9085233064570807E-01 1.5305059323200970E-01 2.7862233984302390E-02
|
||||||
|
2 16 3.7500170432292374E-06 2.0367068825281995E+00 5.4144316535640342E-02 1.4305857218443538E-01
|
||||||
|
2 17 2.4726232100491033E-03 3.4335400617385042E-01 1.6684597803376652E-02 2.1902951351570905E-02
|
||||||
|
2 18 1.7405672406959600E-05 5.6319316766205302E-02 9.5478184601751693E-04 3.3588039002222358E-03
|
||||||
|
2 19 5.4785372164647961E-02 3.0182597583971442E+00 2.0392031625072374E-01 2.0088721011517138E-01
|
||||||
|
2 20 1.3795234987637416E-03 4.9878800454061323E-01 1.2788265359933434E-02 3.1829452602194934E-02
|
||||||
|
2 21 6.6852772684814245E-03 2.6739582842775905E-01 3.0851859894574358E-02 1.7089886758420030E-02
|
||||||
|
2 22 1.7021399438214336E-02 1.4167796508898451E+00 7.6274174813506748E-02 9.2852504206357669E-02
|
||||||
|
2 23 1.9759831791959857E-02 4.0756378297923890E-01 4.8843503112397949E-02 2.5474332458885439E-02
|
||||||
|
2 24 5.2768632746659245E-04 2.3324050667069166E-01 7.2057238727819412E-03 1.4495435261027742E-02
|
||||||
|
2 25 1.1144879740881719E-05 3.5285772934088612E-02 4.2545240948261025E-04 2.0471375111485984E-03
|
||||||
|
2 26 1.6013752685265073E-02 8.2245409953473059E-01 5.0845479076508403E-02 5.2802834522172923E-02
|
||||||
|
2 27 3.9898424495541764E-03 7.8557031440100300E-01 3.6926675414383096E-02 5.0474458307624794E-02
|
||||||
|
2 28 4.0523818189746699E-05 9.8448068666705968E-02 1.2119235889230262E-03 5.7945700128174639E-03
|
||||||
|
2 29 6.0374649986214514E-03 9.9251766407842473E-02 1.6156539248049700E-02 5.5245068674135743E-03
|
||||||
|
2 30 2.9595491075765732E-03 1.5478537567691833E-01 1.1641055270110553E-02 8.9415193910804703E-03
|
||||||
1392
examples/USER/hdnnp/hdnnp-data/weights.001.data
Normal file
1392
examples/USER/hdnnp/hdnnp-data/weights.001.data
Normal file
File diff suppressed because it is too large
Load Diff
1467
examples/USER/hdnnp/hdnnp-data/weights.008.data
Normal file
1467
examples/USER/hdnnp/hdnnp-data/weights.008.data
Normal file
File diff suppressed because it is too large
Load Diff
47
examples/USER/hdnnp/in.hdnnp
Normal file
47
examples/USER/hdnnp/in.hdnnp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
###############################################################################
|
||||||
|
# MD simulation for HDNNP water
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# VARIABLES
|
||||||
|
###############################################################################
|
||||||
|
clear
|
||||||
|
# Configuration files
|
||||||
|
variable cfgFile string "data.H2O-360mol"
|
||||||
|
# Timesteps
|
||||||
|
variable numSteps equal 10
|
||||||
|
variable dt equal 0.0005
|
||||||
|
# HDNNP
|
||||||
|
variable hdnnpCutoff equal 6.36
|
||||||
|
variable hdnnpDir string "hdnnp-data"
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# GENERAL SETUP
|
||||||
|
###############################################################################
|
||||||
|
units metal
|
||||||
|
boundary p p p
|
||||||
|
atom_style atomic
|
||||||
|
read_data ${cfgFile}
|
||||||
|
timestep ${dt}
|
||||||
|
thermo 1
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# HDNNP
|
||||||
|
###############################################################################
|
||||||
|
pair_style hdnnp ${hdnnpCutoff} dir ${hdnnpDir} showew no showewsum 5 resetew no maxew 100 cflength 1.8897261328 cfenergy 0.0367493254
|
||||||
|
pair_coeff * * H O
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# INTEGRATOR
|
||||||
|
###############################################################################
|
||||||
|
fix INT all nve
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OUTPUT
|
||||||
|
###############################################################################
|
||||||
|
dump 1 all atom 1 dump.hdnnp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# SIMULATION
|
||||||
|
###############################################################################
|
||||||
|
run ${numSteps}
|
||||||
@ -27,6 +27,8 @@ gpu general GPU routines, GPU package
|
|||||||
from Mike Brown (ORNL)
|
from Mike Brown (ORNL)
|
||||||
h5md ch5md library for output of MD data in HDF5 format
|
h5md ch5md library for output of MD data in HDF5 format
|
||||||
from Pierre de Buyl (KU Leuven)
|
from Pierre de Buyl (KU Leuven)
|
||||||
|
hdnnp hooks to n2p2, neural network potential package, used by USER-HDNNP
|
||||||
|
from Andreas Singraber
|
||||||
kim hooks to the KIM library, used by KIM package
|
kim hooks to the KIM library, used by KIM package
|
||||||
from Ryan Elliott and Ellad Tadmor (U Minn)
|
from Ryan Elliott and Ellad Tadmor (U Minn)
|
||||||
kokkos Kokkos package for GPU and many-core acceleration
|
kokkos Kokkos package for GPU and many-core acceleration
|
||||||
|
|||||||
122
lib/hdnnp/Install.py
Normal file
122
lib/hdnnp/Install.py
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
"""
|
||||||
|
Install.py tool to download, unpack, build, and link to the n2p2 library
|
||||||
|
used to automate the steps described in the README file in this dir
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
import sys, os, platform, subprocess, shutil
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
sys.path.append('..')
|
||||||
|
from install_helpers import get_cpus, fullpath, geturl, checkmd5sum
|
||||||
|
|
||||||
|
parser = ArgumentParser(prog='Install.py',
|
||||||
|
description="LAMMPS library build wrapper script")
|
||||||
|
|
||||||
|
# settings
|
||||||
|
|
||||||
|
version = "2.1.4"
|
||||||
|
|
||||||
|
# help message
|
||||||
|
|
||||||
|
HELP = """
|
||||||
|
Syntax from src dir: make lib-hdnnp args="-b"
|
||||||
|
or: make lib-hdnnp args="-b -v 2.1.4"
|
||||||
|
or: make lib-hdnnp args="-p /usr/local/n2p2"
|
||||||
|
|
||||||
|
Syntax from lib dir: python Install.py -b -v 2.1.4
|
||||||
|
or: python Install.py -b
|
||||||
|
or: python Install.py -p /usr/local/n2p2
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
make lib-hdnnp args="-b" # download/build in lib/hdnnp/n2p2
|
||||||
|
make lib-hdnnp args="-p $HOME/n2p2" # use existing n2p2 installation in $HOME/n2p2
|
||||||
|
"""
|
||||||
|
|
||||||
|
# known checksums for different n2p2 versions. used to validate the download.
|
||||||
|
checksums = { \
|
||||||
|
'2.1.4' : '9595b066636cd6b90b0fef93398297a5', \
|
||||||
|
}
|
||||||
|
|
||||||
|
# parse and process arguments
|
||||||
|
|
||||||
|
pgroup = parser.add_mutually_exclusive_group()
|
||||||
|
pgroup.add_argument("-b", "--build", action="store_true",
|
||||||
|
help="download and build the n2p2 library")
|
||||||
|
pgroup.add_argument("-p", "--path",
|
||||||
|
help="specify folder of existing n2p2 installation")
|
||||||
|
parser.add_argument("-v", "--version", default=version, choices=checksums.keys(),
|
||||||
|
help="set version of n2p2 to download and build (default: %s)" % version)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# print help message and exit, if neither build nor path options are given
|
||||||
|
if not args.build and not args.path:
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(HELP)
|
||||||
|
|
||||||
|
buildflag = args.build
|
||||||
|
pathflag = args.path is not None
|
||||||
|
n2p2path = args.path
|
||||||
|
|
||||||
|
homepath = fullpath('.')
|
||||||
|
homedir = "%s/n2p2" % (homepath)
|
||||||
|
|
||||||
|
if pathflag:
|
||||||
|
if not os.path.isdir(n2p2path):
|
||||||
|
sys.exit("n2p2 path %s does not exist" % n2p2path)
|
||||||
|
homedir = fullpath(n2p2path)
|
||||||
|
if not os.path.isfile(os.path.join(homedir, 'include', 'InterfaceLammps.h')):
|
||||||
|
sys.exit("No n2p2 installation found at %s" % n2p2path)
|
||||||
|
|
||||||
|
# download and unpack n2p2 tarball
|
||||||
|
|
||||||
|
if buildflag:
|
||||||
|
url = "https://github.com/CompPhysVienna/n2p2/archive/v%s.tar.gz" % (version)
|
||||||
|
filename = "n2p2-%s.tar.gz" %version
|
||||||
|
print("Downloading n2p2 ...")
|
||||||
|
geturl(url, filename)
|
||||||
|
|
||||||
|
# verify downloaded archive integrity via md5 checksum, if known.
|
||||||
|
if version in checksums:
|
||||||
|
if not checkmd5sum(checksums[version], filename):
|
||||||
|
sys.exit("Checksum for n2p2 library does not match")
|
||||||
|
|
||||||
|
print("Unpacking n2p2 source tarball ...")
|
||||||
|
if os.path.exists("%s/n2p2-%s" % (homepath, version)):
|
||||||
|
shutil.rmtree("%s/n2p2-%s" % (homepath, version))
|
||||||
|
if os.path.exists(homedir):
|
||||||
|
shutil.rmtree(homedir)
|
||||||
|
cmd = 'cd "%s"; tar -xzvf %s' % (homepath, filename)
|
||||||
|
subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
|
||||||
|
os.remove(os.path.join(homepath, filename))
|
||||||
|
|
||||||
|
# build n2p2
|
||||||
|
print("Building n2p2 ...")
|
||||||
|
n_cpus = get_cpus()
|
||||||
|
cmd = 'unset MAKEFLAGS MAKELEVEL MAKEOVERRIDES MFLAGS && cd %s/n2p2-%s/src && make -j%d libnnpif' % (homepath, version, n_cpus)
|
||||||
|
try:
|
||||||
|
txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
|
||||||
|
print(txt.decode('UTF-8'))
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print("Make failed with:\n %s" % e.output.decode('UTF-8'))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# set correct homedir for linking step
|
||||||
|
homedir = "%s/n2p2-%s" % (homepath, version)
|
||||||
|
|
||||||
|
# create 2 links in lib/hdnnp to n2p2 installation dir
|
||||||
|
|
||||||
|
print("Creating links to n2p2 include and lib files")
|
||||||
|
if os.path.isfile("includelink") or os.path.islink("includelink"):
|
||||||
|
os.remove("includelink")
|
||||||
|
if os.path.isfile("liblink") or os.path.islink("liblink"):
|
||||||
|
os.remove("liblink")
|
||||||
|
if os.path.isfile("Makefile.lammps") or os.path.islink("Makefile.lammps"):
|
||||||
|
os.remove("Makefile.lammps")
|
||||||
|
os.symlink(os.path.join(homedir, 'include'), 'includelink')
|
||||||
|
os.symlink(os.path.join(homedir, 'lib'), 'liblink')
|
||||||
|
os.symlink(os.path.join(homedir, 'lib', 'Makefile.lammps-extra'), 'Makefile.lammps')
|
||||||
75
lib/hdnnp/README
Normal file
75
lib/hdnnp/README
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
The USER-HDNNP package requires access to pre-compiled libraries of the n2p2
|
||||||
|
package (https://github.com/CompPhysVienna/n2p2). More precisely, the n2p2 core
|
||||||
|
library ("libnnp"), the interface library ("libnnpif"), some headers and extra
|
||||||
|
build helper files are needed. These files will be created automatically during
|
||||||
|
the n2p2 build process.
|
||||||
|
|
||||||
|
This file gives some basic instructions on how to compile n2p2 manually. How to
|
||||||
|
integrate it then in the LAMMPS build process or how to use the automatic
|
||||||
|
download and build option is described in detail on the USER-HDNNP build
|
||||||
|
instructions page of the LAMMPS documentation.
|
||||||
|
|
||||||
|
IMPORTANT: The n2p2 version must be "v2.1.4" or higher.
|
||||||
|
|
||||||
|
Basic build instructions for n2p2
|
||||||
|
=================================
|
||||||
|
|
||||||
|
The n2p2 software package comes with lots of useful tools for creating and
|
||||||
|
applying high-dimensional neural network potentials (HDNNPs). In order to use
|
||||||
|
n2p2 together with LAMMPS only some parts of the n2p2 code need to be compiled.
|
||||||
|
As an example, everything related to HDNNP training is not required and would
|
||||||
|
only add unwanted library dependencies. Hence, the build infrastructure of n2p2
|
||||||
|
is designed to allow a separate build of the LAMMPS interface.
|
||||||
|
|
||||||
|
After downloading n2p2, change to the "src" directory and simply execute
|
||||||
|
|
||||||
|
make libnnpif
|
||||||
|
|
||||||
|
which should create the following files needed by the USER-HDNNP package:
|
||||||
|
|
||||||
|
* "n2p2/lib/libnnp.a"
|
||||||
|
* "n2p2/lib/libnnpif.a"
|
||||||
|
* "n2p2/lib/lammps-extra.cmake"
|
||||||
|
* "n2p2/lib/Makefile.lammps-extra"
|
||||||
|
* "n2p2/include/InterfaceLammps.h" and many other header files.
|
||||||
|
|
||||||
|
If you prefer dynamically linked libraries use
|
||||||
|
|
||||||
|
make MODE=shared libnnpif
|
||||||
|
|
||||||
|
instead (by default MODE=static) which will create *.so versions of the
|
||||||
|
libraries. By default, n2p2 uses the GNU C++ compiler and the corresponding
|
||||||
|
settings can be found in "n2p2/src/makefile.gnu". Other makefile presets are
|
||||||
|
also available (e.g. "makefile.intel") and can be activated by supplying the
|
||||||
|
"COMP" argument:
|
||||||
|
|
||||||
|
make COMP=intel libnnpif
|
||||||
|
|
||||||
|
Please make sure that your compiler settings for n2p2 and LAMMPS are compatible
|
||||||
|
(avoid mixing different compilers).
|
||||||
|
|
||||||
|
If you want to build a serial version of LAMMPS with USER-HDNNP package n2p2 must
|
||||||
|
also be built with MPI disabled. This can be achieved with a preprocessor flag
|
||||||
|
(-DN2P2_NO_MPI) which is (among others) prepared, but commented out, in the
|
||||||
|
provided compiler-specific settings makefiles. For example, if you use the GNU
|
||||||
|
compiler simply remove the comment character '#' in front of the corresponding
|
||||||
|
line (around line 49) in "makefile.gnu". It should then look like this:
|
||||||
|
|
||||||
|
PROJECT_OPTIONS+= -DN2P2_NO_MPI
|
||||||
|
|
||||||
|
After compiling n2p2 with this flag turned on you can build a serial LAMMPS
|
||||||
|
version with "-D BUILD_MPI=off" (CMake) or "make serial" (traditional).
|
||||||
|
|
||||||
|
For more information about the n2p2 build process please visit
|
||||||
|
https://compphysvienna.github.io/n2p2/topics/build.html or ask questions on the
|
||||||
|
Github issue page (https://github.com/CompPhysVienna/n2p2/issues).
|
||||||
|
|
||||||
|
Testing a successful build of LAMMPS with USER-HDNNP
|
||||||
|
====================================================
|
||||||
|
|
||||||
|
An example is provided in the LAMMPS directory "examples/USER/hdnnp" which runs
|
||||||
|
10 timesteps with 360 water molecules. The neural network potential is defined
|
||||||
|
via files in the "hdnnp-data" subdirectory. Use the "in.hdnnp" LAMMPS script file
|
||||||
|
to run the simulation. You should see a large output of the n2p2 library when
|
||||||
|
the pair style "hdnnp" is initialized, followed by the LAMMPS per-timestep
|
||||||
|
output.
|
||||||
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@ -990,6 +990,8 @@
|
|||||||
/pair_hbond_dreiding_lj.h
|
/pair_hbond_dreiding_lj.h
|
||||||
/pair_hbond_dreiding_morse.cpp
|
/pair_hbond_dreiding_morse.cpp
|
||||||
/pair_hbond_dreiding_morse.h
|
/pair_hbond_dreiding_morse.h
|
||||||
|
/pair_hdnnp.cpp
|
||||||
|
/pair_hdnnp.h
|
||||||
/pair_ilp_graphene_hbn.cpp
|
/pair_ilp_graphene_hbn.cpp
|
||||||
/pair_ilp_graphene_hbn.h
|
/pair_ilp_graphene_hbn.h
|
||||||
/pair_kolmogorov_crespi_full.cpp
|
/pair_kolmogorov_crespi_full.cpp
|
||||||
|
|||||||
@ -53,7 +53,7 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \
|
|||||||
|
|
||||||
PACKUSER = user-adios user-atc user-awpmd user-brownian user-bocs user-cgdna \
|
PACKUSER = user-adios user-atc user-awpmd user-brownian user-bocs user-cgdna \
|
||||||
user-cgsdk user-colvars user-diffraction user-dpd user-drude \
|
user-cgsdk user-colvars user-diffraction user-dpd user-drude \
|
||||||
user-eff user-fep user-h5md user-intel user-lb user-manifold \
|
user-eff user-fep user-h5md user-hdnnp user-intel user-lb user-manifold \
|
||||||
user-mdi user-meamc user-mesodpd user-mesont user-mgpt user-misc \
|
user-mdi user-meamc user-mesodpd user-mesont user-mgpt user-misc \
|
||||||
user-mofff \user-molfile user-netcdf user-omp user-phonon \
|
user-mofff \user-molfile user-netcdf user-omp user-phonon \
|
||||||
user-pace user-plumed user-ptm user-qmmm user-qtb user-quip \
|
user-pace user-plumed user-ptm user-qmmm user-qtb user-quip \
|
||||||
@ -61,7 +61,7 @@ PACKUSER = user-adios user-atc user-awpmd user-brownian user-bocs user-cgdna \
|
|||||||
user-sdpd user-sph user-tally user-uef user-vtk user-yaff
|
user-sdpd user-sph user-tally user-uef user-vtk user-yaff
|
||||||
|
|
||||||
PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems python voronoi \
|
PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems python voronoi \
|
||||||
user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-mdi \
|
user-adios user-atc user-awpmd user-colvars user-h5md user-hdnnp user-lb user-mdi \
|
||||||
user-mesont user-molfile user-netcdf user-pace user-plumed user-qmmm user-quip \
|
user-mesont user-molfile user-netcdf user-pace user-plumed user-qmmm user-quip \
|
||||||
user-scafacos user-smd user-vtk
|
user-scafacos user-smd user-vtk
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont
|
|||||||
user-mdi
|
user-mdi
|
||||||
|
|
||||||
PACKEXT = kim latte mscg voronoi \
|
PACKEXT = kim latte mscg voronoi \
|
||||||
user-adios user-h5md user-molfile user-netcdf user-pace user-plumed \
|
user-adios user-h5md user-hdnnp user-molfile user-netcdf user-pace user-plumed \
|
||||||
user-qmmm user-quip user-scafacos user-smd user-vtk
|
user-qmmm user-quip user-scafacos user-smd user-vtk
|
||||||
|
|
||||||
PACKALL = $(PACKAGE) $(PACKUSER)
|
PACKALL = $(PACKAGE) $(PACKUSER)
|
||||||
|
|||||||
66
src/USER-HDNNP/Install.sh
Normal file
66
src/USER-HDNNP/Install.sh
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# Install/unInstall package files in LAMMPS
|
||||||
|
# mode = 0/1/2 for uninstall/install/update
|
||||||
|
|
||||||
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
action () {
|
||||||
|
if (test $mode = 0) then
|
||||||
|
rm -f ../$1
|
||||||
|
elif (! cmp -s $1 ../$1) then
|
||||||
|
if (test -z "$2" || test -e ../$2) then
|
||||||
|
cp $1 ..
|
||||||
|
if (test $mode = 2) then
|
||||||
|
echo " updating src/$1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif (test -n "$2") then
|
||||||
|
if (test ! -e ../$2) then
|
||||||
|
rm -f ../$1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# all package files with no dependencies
|
||||||
|
|
||||||
|
for file in *.cpp *.h; do
|
||||||
|
test -f ${file} && action $file
|
||||||
|
done
|
||||||
|
|
||||||
|
# edit 2 Makefile.package files to include/exclude package info
|
||||||
|
|
||||||
|
if (test $1 = 1) then
|
||||||
|
|
||||||
|
if (test -e ../Makefile.package) then
|
||||||
|
sed -i -e 's/[^ \t]*hdnnp[^ \t]* //g' ../Makefile.package
|
||||||
|
sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/hdnnp/includelink |' ../Makefile.package
|
||||||
|
sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/hdnnp/liblink |' ../Makefile.package
|
||||||
|
sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(hdnnp_SYSINC) |' ../Makefile.package
|
||||||
|
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(hdnnp_SYSLIB) |' ../Makefile.package
|
||||||
|
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(hdnnp_SYSPATH) |' ../Makefile.package
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test -e ../Makefile.package.settings) then
|
||||||
|
sed -i -e '/^include.*hdnnp.*$/d' ../Makefile.package.settings
|
||||||
|
# multiline form needed for BSD sed on Macs
|
||||||
|
sed -i -e '4 i \
|
||||||
|
include ..\/..\/lib\/hdnnp\/Makefile.lammps
|
||||||
|
' ../Makefile.package.settings
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif (test $1 = 0) then
|
||||||
|
|
||||||
|
if (test -e ../Makefile.package) then
|
||||||
|
sed -i -e 's/[^ \t]*hdnnp[^ \t]* //g' ../Makefile.package
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test -e ../Makefile.package.settings) then
|
||||||
|
sed -i -e '/^include.*hdnnp.*$/d' ../Makefile.package.settings
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
26
src/USER-HDNNP/README
Normal file
26
src/USER-HDNNP/README
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
This package implements the "pair_style hdnnp" command which can be used in a
|
||||||
|
LAMMPS input script. This pair style allows to use pre-trained high-dimensional
|
||||||
|
neural network potentials[1] via an interface to the n2p2 library
|
||||||
|
(https://github.com/CompPhysVienna/n2p2)[2].
|
||||||
|
|
||||||
|
Please see the main documentation for the "pair_style hdnnp" command for further
|
||||||
|
details on how the pair style is used. An example is provided in the
|
||||||
|
"examples/USER/hdnnp" directory of LAMMPS.
|
||||||
|
|
||||||
|
The USER-HDNNP package requires the external library n2p2 which must be
|
||||||
|
downloaded and compiled before starting the build process of LAMMPS. A
|
||||||
|
guideline on how to build n2p2 is presented in "lib/hdnnp/README". This package
|
||||||
|
supports the LAMMPS build process via CMake and traditional makefiles, please
|
||||||
|
see the LAMMPS manual section on building with external libraries for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
This package was created by Andreas Singraber, please ask questions/report bugs
|
||||||
|
on the n2p2 Github issues page (https://github.com/CompPhysVienna/n2p2/issues).
|
||||||
|
|
||||||
|
[1] Behler, J.; Parrinello, M. Generalized Neural-Network Representation of
|
||||||
|
High-Dimensional Potential-Energy Surfaces. Phys. Rev. Lett. 2007, 98 (14),
|
||||||
|
146401. https://doi.org/10.1103/PhysRevLett.98.146401
|
||||||
|
|
||||||
|
[2] Singraber, A.; Behler, J.; Dellago, C. Library-Based
|
||||||
|
LAMMPS Implementation of High-Dimensional Neural Network Potentials. J. Chem.
|
||||||
|
Theory Comput. 2019, 15 (3), 1827-1840. https://doi.org/10.1021/acs.jctc.8b00770
|
||||||
400
src/USER-HDNNP/pair_hdnnp.cpp
Normal file
400
src/USER-HDNNP/pair_hdnnp.cpp
Normal file
@ -0,0 +1,400 @@
|
|||||||
|
/* -*- 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.
|
||||||
|
|
||||||
|
This file initially came from n2p2 (https://github.com/CompPhysVienna/n2p2)
|
||||||
|
Copyright (2018) Andreas Singraber (University of Vienna)
|
||||||
|
|
||||||
|
See the README file in the top-level LAMMPS directory.
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
Contributing author: Andreas Singraber
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "pair_hdnnp.h"
|
||||||
|
|
||||||
|
#include "atom.h"
|
||||||
|
#include "citeme.h"
|
||||||
|
#include "comm.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "neighbor.h"
|
||||||
|
#include "neigh_list.h"
|
||||||
|
#include "neigh_request.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
|
#include "InterfaceLammps.h" // n2p2 interface header
|
||||||
|
|
||||||
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
static const char cite_user_hdnnp_package[] =
|
||||||
|
"USER-HDNNP package: 10.1021/acs.jctc.8b00770\n\n"
|
||||||
|
"@Article{Singraber19,\n"
|
||||||
|
" author = {Singraber, Andreas and Behler, J{\"o}rg and Dellago, Christoph},\n"
|
||||||
|
" title = {Library-{{Based LAMMPS Implementation}} of {{High}}-{{Dimensional Neural Network Potentials}}},\n"
|
||||||
|
" year = {2019},\n"
|
||||||
|
" month = mar,\n"
|
||||||
|
" volume = {15},\n"
|
||||||
|
" pages = {1827--1840},\n"
|
||||||
|
" doi = {10.1021/acs.jctc.8b00770},\n"
|
||||||
|
" journal = {J.~Chem.~Theory~Comput.},\n"
|
||||||
|
" number = {3}\n"
|
||||||
|
"}\n\n";
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
PairHDNNP::PairHDNNP(LAMMPS *lmp) : Pair(lmp)
|
||||||
|
{
|
||||||
|
if (lmp->citeme) lmp->citeme->add(cite_user_hdnnp_package);
|
||||||
|
|
||||||
|
single_enable = 0; // 1 if single() routine exists
|
||||||
|
restartinfo = 0; // 1 if pair style writes restart info
|
||||||
|
one_coeff = 1; // 1 if allows only one coeff * * call
|
||||||
|
manybody_flag = 1; // 1 if a manybody potential
|
||||||
|
unit_convert_flag = 0; // TODO: Check possible values. value != 0 indicates support for unit conversion.
|
||||||
|
reinitflag = 0; // 1 if compatible with fix adapt and alike
|
||||||
|
|
||||||
|
interface = new nnp::InterfaceLammps();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
PairHDNNP::~PairHDNNP()
|
||||||
|
{
|
||||||
|
delete interface;
|
||||||
|
memory->destroy(setflag);
|
||||||
|
memory->destroy(cutsq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairHDNNP::compute(int eflag, int vflag)
|
||||||
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
|
// Set number of local atoms and add element.
|
||||||
|
interface->setLocalAtoms(atom->nlocal,atom->type);
|
||||||
|
// Transfer tags separately. Interface::setLocalTags is overloaded internally
|
||||||
|
// to work with both -DLAMMPS_SMALLBIG (tagint = int) and -DLAMMPS_BIGBIG
|
||||||
|
// (tagint = int64_t)
|
||||||
|
interface->setLocalTags(atom->tag);
|
||||||
|
|
||||||
|
// Transfer local neighbor list to n2p2 interface.
|
||||||
|
transferNeighborList();
|
||||||
|
|
||||||
|
// Compute symmetry functions, atomic neural networks and add up energy.
|
||||||
|
interface->process();
|
||||||
|
|
||||||
|
// Do all stuff related to extrapolation warnings.
|
||||||
|
if(showew == true || showewsum > 0 || maxew >= 0) {
|
||||||
|
handleExtrapolationWarnings();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate forces of local and ghost atoms.
|
||||||
|
interface->getForces(atom->f);
|
||||||
|
|
||||||
|
// Add energy contribution to total energy.
|
||||||
|
if (eflag_global)
|
||||||
|
ev_tally(0,0,atom->nlocal,1,interface->getEnergy(),0.0,0.0,0.0,0.0,0.0);
|
||||||
|
|
||||||
|
// Add atomic energy if requested (CAUTION: no physical meaning!).
|
||||||
|
if (eflag_atom)
|
||||||
|
for (int i = 0; i < atom->nlocal; ++i)
|
||||||
|
eatom[i] = interface->getAtomicEnergy(i);
|
||||||
|
|
||||||
|
// If virial needed calculate via F dot r.
|
||||||
|
if (vflag_fdotr) virial_fdotr_compute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
global settings
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairHDNNP::settings(int narg, char **arg)
|
||||||
|
{
|
||||||
|
int iarg = 0;
|
||||||
|
|
||||||
|
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
|
||||||
|
|
||||||
|
maxCutoffRadius = utils::numeric(FLERR,arg[0],false,lmp);
|
||||||
|
iarg++;
|
||||||
|
|
||||||
|
// default settings
|
||||||
|
directory = utils::strdup("hdnnp/");
|
||||||
|
showew = true;
|
||||||
|
showewsum = 0;
|
||||||
|
maxew = 0;
|
||||||
|
resetew = false;
|
||||||
|
cflength = 1.0;
|
||||||
|
cfenergy = 1.0;
|
||||||
|
numExtrapolationWarningsTotal = 0;
|
||||||
|
numExtrapolationWarningsSummary = 0;
|
||||||
|
|
||||||
|
while(iarg < narg) {
|
||||||
|
// set HDNNP directory
|
||||||
|
if (strcmp(arg[iarg],"dir") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
delete[] directory;
|
||||||
|
directory = utils::strdup(arg[iarg+1]);
|
||||||
|
iarg += 2;
|
||||||
|
// show extrapolation warnings
|
||||||
|
} else if (strcmp(arg[iarg],"showew") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
if (strcmp(arg[iarg+1],"yes") == 0)
|
||||||
|
showew = true;
|
||||||
|
else if (strcmp(arg[iarg+1],"no") == 0)
|
||||||
|
showew = false;
|
||||||
|
else
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
iarg += 2;
|
||||||
|
// show extrapolation warning summary
|
||||||
|
} else if (strcmp(arg[iarg],"showewsum") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
showewsum = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
|
iarg += 2;
|
||||||
|
// maximum allowed extrapolation warnings
|
||||||
|
} else if (strcmp(arg[iarg],"maxew") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
maxew = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
|
iarg += 2;
|
||||||
|
// reset extrapolation warning counter
|
||||||
|
} else if (strcmp(arg[iarg],"resetew") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
if (strcmp(arg[iarg+1],"yes") == 0)
|
||||||
|
resetew = true;
|
||||||
|
else if (strcmp(arg[iarg+1],"no") == 0)
|
||||||
|
resetew = false;
|
||||||
|
else
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
iarg += 2;
|
||||||
|
// length unit conversion factor
|
||||||
|
} else if (strcmp(arg[iarg],"cflength") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
cflength = utils::numeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
|
iarg += 2;
|
||||||
|
// energy unit conversion factor
|
||||||
|
} else if (strcmp(arg[iarg],"cfenergy") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->all(FLERR,"Illegal pair_style command");
|
||||||
|
cfenergy = utils::numeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
|
iarg += 2;
|
||||||
|
} else error->all(FLERR,"Illegal pair_style command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
set coeffs for one or more type pairs
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairHDNNP::coeff(int narg, char **arg)
|
||||||
|
{
|
||||||
|
int n = atom->ntypes;
|
||||||
|
|
||||||
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
if (narg != 2 + n)
|
||||||
|
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||||
|
|
||||||
|
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
|
||||||
|
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||||
|
|
||||||
|
int *map = new int[n+1];
|
||||||
|
for (int i = 0; i < n; i++) map[i] = 0;
|
||||||
|
|
||||||
|
emap = "";
|
||||||
|
for (int i = 2; i < narg; i++) {
|
||||||
|
if (strcmp(arg[i],"NULL") != 0) {
|
||||||
|
if (i != 2) emap += ",";
|
||||||
|
emap += std::to_string(i-1) + ":" + arg[i];
|
||||||
|
map[i-1] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
for (int i = 1; i <= n; i++)
|
||||||
|
for (int j = i; j <= n; j++)
|
||||||
|
if (map[i] > 0 && map[j] > 0) {
|
||||||
|
setflag[i][j] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||||
|
|
||||||
|
delete[] map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
init specific to this pair style
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairHDNNP::init_style()
|
||||||
|
{
|
||||||
|
int irequest = neighbor->request((void *) this);
|
||||||
|
neighbor->requests[irequest]->half = 0;
|
||||||
|
neighbor->requests[irequest]->full = 1;
|
||||||
|
|
||||||
|
// Return immediately if HDNNP setup is already completed.
|
||||||
|
if (interface->isInitialized()) return;
|
||||||
|
|
||||||
|
// Activate screen and logfile output only for rank 0.
|
||||||
|
if (comm->me == 0) {
|
||||||
|
if (lmp->screen != nullptr)
|
||||||
|
interface->log.registerCFilePointer(&(lmp->screen));
|
||||||
|
if (lmp->logfile != nullptr)
|
||||||
|
interface->log.registerCFilePointer(&(lmp->logfile));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize interface on all processors.
|
||||||
|
interface->initialize(directory,
|
||||||
|
emap.c_str(),
|
||||||
|
showew,
|
||||||
|
resetew,
|
||||||
|
showewsum,
|
||||||
|
maxew,
|
||||||
|
cflength,
|
||||||
|
cfenergy,
|
||||||
|
maxCutoffRadius,
|
||||||
|
atom->ntypes,
|
||||||
|
comm->me);
|
||||||
|
|
||||||
|
// LAMMPS cutoff radius (given via pair_coeff) should not be smaller than
|
||||||
|
// maximum symmetry function cutoff radius.
|
||||||
|
if (maxCutoffRadius < interface->getMaxCutoffRadius())
|
||||||
|
error->all(FLERR,"Inconsistent cutoff radius");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
init for one type pair i,j and corresponding j,i
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
double PairHDNNP::init_one(int, int)
|
||||||
|
{
|
||||||
|
return maxCutoffRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
allocate all arrays
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void PairHDNNP::allocate()
|
||||||
|
{
|
||||||
|
allocated = 1;
|
||||||
|
int n = atom->ntypes;
|
||||||
|
|
||||||
|
memory->create(setflag,n+1,n+1,"pair:setflag");
|
||||||
|
for (int i = 1; i <= n; i++)
|
||||||
|
for (int j = i; j <= n; j++)
|
||||||
|
setflag[i][j] = 0;
|
||||||
|
|
||||||
|
memory->create(cutsq,n+1,n+1,"pair:cutsq"); // TODO: Is this required?
|
||||||
|
}
|
||||||
|
|
||||||
|
void PairHDNNP::transferNeighborList()
|
||||||
|
{
|
||||||
|
// Transfer neighbor list to n2p2.
|
||||||
|
double rc2 = maxCutoffRadius * maxCutoffRadius;
|
||||||
|
for (int ii = 0; ii < list->inum; ++ii) {
|
||||||
|
int i = list->ilist[ii];
|
||||||
|
for (int jj = 0; jj < list->numneigh[i]; ++jj) {
|
||||||
|
int j = list->firstneigh[i][jj];
|
||||||
|
j &= NEIGHMASK;
|
||||||
|
double dx = atom->x[i][0] - atom->x[j][0];
|
||||||
|
double dy = atom->x[i][1] - atom->x[j][1];
|
||||||
|
double dz = atom->x[i][2] - atom->x[j][2];
|
||||||
|
double d2 = dx * dx + dy * dy + dz * dz;
|
||||||
|
if (d2 <= rc2) {
|
||||||
|
interface->addNeighbor(i,j,atom->tag[j],atom->type[j],dx,dy,dz,d2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PairHDNNP::handleExtrapolationWarnings()
|
||||||
|
{
|
||||||
|
// Get number of extrapolation warnings for local atoms.
|
||||||
|
long numCurrentEW = (long)interface->getNumExtrapolationWarnings();
|
||||||
|
|
||||||
|
// Update (or set, resetew == true) total warnings counter.
|
||||||
|
if (resetew) numExtrapolationWarningsTotal = numCurrentEW;
|
||||||
|
else numExtrapolationWarningsTotal += numCurrentEW;
|
||||||
|
|
||||||
|
// Update warnings summary counter.
|
||||||
|
if(showewsum > 0) {
|
||||||
|
numExtrapolationWarningsSummary += numCurrentEW;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If requested write extrapolation warnings.
|
||||||
|
// Requires communication of all symmetry functions statistics entries to
|
||||||
|
// rank 0.
|
||||||
|
if(showew > 0) {
|
||||||
|
// First collect an overview of extrapolation warnings per process.
|
||||||
|
long *numEWPerProc = nullptr;
|
||||||
|
if(comm->me == 0) numEWPerProc = new long[comm->nprocs];
|
||||||
|
MPI_Gather(&numCurrentEW, 1, MPI_LONG, numEWPerProc, 1, MPI_LONG, 0, world);
|
||||||
|
|
||||||
|
if(comm->me == 0) {
|
||||||
|
for(int i=1;i<comm->nprocs;i++) {
|
||||||
|
if(numEWPerProc[i] > 0) {
|
||||||
|
long bs = 0;
|
||||||
|
MPI_Status ms;
|
||||||
|
// Get buffer size.
|
||||||
|
MPI_Recv(&bs, 1, MPI_LONG, i, 0, world, &ms);
|
||||||
|
char *buf = new char[bs];
|
||||||
|
// Receive buffer.
|
||||||
|
MPI_Recv(buf, bs, MPI_BYTE, i, 0, world, &ms);
|
||||||
|
interface->extractEWBuffer(buf, bs);
|
||||||
|
delete[] buf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
interface->writeExtrapolationWarnings();
|
||||||
|
}
|
||||||
|
else if(numCurrentEW > 0) {
|
||||||
|
// Get desired buffer length for all extrapolation warning entries.
|
||||||
|
long bs = interface->getEWBufferSize();
|
||||||
|
// Allocate and fill buffer.
|
||||||
|
char *buf = new char[bs];
|
||||||
|
interface->fillEWBuffer(buf, bs);
|
||||||
|
// Send buffer size and buffer.
|
||||||
|
MPI_Send(&bs, 1, MPI_LONG, 0, 0, world);
|
||||||
|
MPI_Send(buf, bs, MPI_BYTE, 0, 0, world);
|
||||||
|
delete[] buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(comm->me == 0) delete[] numEWPerProc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If requested gather number of warnings to display summary.
|
||||||
|
if(showewsum > 0 && update->ntimestep % showewsum == 0) {
|
||||||
|
long globalEW = 0;
|
||||||
|
// Communicate the sum over all processors to proc 0.
|
||||||
|
MPI_Reduce(&numExtrapolationWarningsSummary,
|
||||||
|
&globalEW, 1, MPI_LONG, MPI_SUM, 0, world);
|
||||||
|
// Write to screen or logfile.
|
||||||
|
if(comm->me == 0)
|
||||||
|
utils::logmesg(lmp,"### NNP EW SUMMARY ### TS: {:10d} EW {:10d} EWPERSTEP {:10.3e}\n",
|
||||||
|
update->ntimestep, globalEW, double(globalEW) / showewsum);
|
||||||
|
// Reset summary counter.
|
||||||
|
numExtrapolationWarningsSummary = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop if maximum number of extrapolation warnings is exceeded.
|
||||||
|
if (numExtrapolationWarningsTotal > maxew) {
|
||||||
|
error->one(FLERR,"Too many extrapolation warnings");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset internal extrapolation warnings counters.
|
||||||
|
interface->clearExtrapolationWarnings();
|
||||||
|
}
|
||||||
73
src/USER-HDNNP/pair_hdnnp.h
Normal file
73
src/USER-HDNNP/pair_hdnnp.h
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/* -*- 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.
|
||||||
|
|
||||||
|
This file initially came from n2p2 (https://github.com/CompPhysVienna/n2p2)
|
||||||
|
Copyright (2018) Andreas Singraber (University of Vienna)
|
||||||
|
|
||||||
|
See the README file in the top-level LAMMPS directory.
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
Contributing author: Andreas Singraber
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#ifdef PAIR_CLASS
|
||||||
|
|
||||||
|
PairStyle(hdnnp,PairHDNNP)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifndef LMP_PAIR_HDNNP_H
|
||||||
|
#define LMP_PAIR_HDNNP_H
|
||||||
|
|
||||||
|
#include "pair.h"
|
||||||
|
|
||||||
|
namespace nnp {
|
||||||
|
class InterfaceLammps;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
|
class PairHDNNP : public Pair {
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
PairHDNNP(class LAMMPS *);
|
||||||
|
virtual ~PairHDNNP();
|
||||||
|
virtual void compute(int, int);
|
||||||
|
virtual void settings(int, char **);
|
||||||
|
virtual void coeff(int, char **);
|
||||||
|
virtual void init_style();
|
||||||
|
virtual double init_one(int, int);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void allocate();
|
||||||
|
void transferNeighborList();
|
||||||
|
void handleExtrapolationWarnings();
|
||||||
|
|
||||||
|
bool showew;
|
||||||
|
bool resetew;
|
||||||
|
int showewsum;
|
||||||
|
int maxew;
|
||||||
|
long numExtrapolationWarningsTotal;
|
||||||
|
long numExtrapolationWarningsSummary;
|
||||||
|
double cflength;
|
||||||
|
double cfenergy;
|
||||||
|
double maxCutoffRadius;
|
||||||
|
char *directory;
|
||||||
|
std::string emap;
|
||||||
|
nnp::InterfaceLammps *interface;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user