diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2efd36b1f4..94f419bd37 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -116,8 +116,8 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE 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-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF - USER-MOLFILE USER-NETCDF USER-NNP USER-PHONON USER-PLUMED USER-PTM USER-QTB + USER-HDNNP USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC + 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-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF) @@ -381,8 +381,7 @@ else() set(CUDA_REQUEST_PIC) endif() -foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-MOLFILE - USER-NETCDF USER-NNP USER-PLUMED USER-QMMM +foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-HDNNP USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS) if(PKG_${PKG_WITH_INCL}) include(Packages/${PKG_WITH_INCL}) diff --git a/cmake/Modules/FindN2P2.cmake b/cmake/Modules/FindN2P2.cmake index a06850f07f..cae5de5342 100644 --- a/cmake/Modules/FindN2P2.cmake +++ b/cmake/Modules/FindN2P2.cmake @@ -3,9 +3,9 @@ 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/nnp/n2p2" exists. +# If not, try if directory "lib/hdnnp/n2p2" exists. else() - get_filename_component(_fullpath "${LAMMPS_LIB_SOURCE_DIR}/nnp/n2p2" REALPATH) + get_filename_component(_fullpath "${LAMMPS_LIB_SOURCE_DIR}/hdnnp/n2p2" REALPATH) if (EXISTS ${_fullpath}) set(N2P2_DIR "${_fullpath}") endif() @@ -17,12 +17,12 @@ find_path(N2P2_INCLUDE_DIR InterfaceLammps.h PATHS "${N2P2_DIR}/include") find_library(N2P2_LIBNNP NAMES nnp PATHS "${N2P2_DIR}/lib") find_library(N2P2_LIBNNPIF NAMES nnpif PATHS "${N2P2_DIR}/lib") # Users could compile n2p2 with extra flags which are then also required for -# pair_nnp.cpp compilation. To forward them to the LAMMPS build process n2p2 +# 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 -DNNP_NO_SF_GROUPS) +# target_compile_definitions(lammps PRIVATE -DN2P2_NO_SF_GROUPS) # -# to "lib/lammps-extra.cmake" which is then included by USER-NNP.cmake. +# to "lib/lammps-extra.cmake" which is then included by USER-HDNNP.cmake. find_file(N2P2_CMAKE_EXTRA NAMES lammps-extra.cmake PATHS "${N2P2_DIR}/lib") find_package_handle_standard_args(N2P2 DEFAULT_MSG diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index d567b141bf..7f3caebf8c 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -7,11 +7,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU SNAP SPIN SRD VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP - USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD - USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-NNP - USER-OMP USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP - USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ - USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF) + USER-H5MD USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC + USER-MESODPD 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-REAXC USER-SCAFACOS USER-SDPD USER-SMD + USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 2b879e9ecf..fbc78ededf 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -9,11 +9,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU SNAP SPIN SRD VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP - USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD - USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-NNP - USER-OMP USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP - USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ - USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF) + USER-H5MD USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC + USER-MESODPD 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-REAXC USER-SCAFACOS USER-SDPD USER-SMD + USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) diff --git a/cmake/presets/nolib.cmake b/cmake/presets/nolib.cmake index c0236347cb..a819e6a347 100644 --- a/cmake/presets/nolib.cmake +++ b/cmake/presets/nolib.cmake @@ -2,9 +2,9 @@ # library or special compiler (fortran or cuda) or equivalent. set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MPIIO MSCG PYTHON - VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB - USER-MOLFILE USER-MESONT USER-NETCDF USER-NNP USER-PLUMED USER-QMMM - USER-QUIP USER-SCAFACOS USER-SMD USER-VTK) + VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-HDNNP USER-LB + USER-MOLFILE USER-MESONT USER-NETCDF USER-PLUMED USER-QMMM + USER-QUIP USER-SCAFACOS USER-SMD USER-VTK) foreach(PKG ${PACKAGES_WITH_LIB}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 545a86c04e..30f4bb711d 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -48,11 +48,11 @@ This is the list of packages that may require additional steps. * :ref:`USER-AWPMD ` * :ref:`USER-COLVARS ` * :ref:`USER-H5MD ` + * :ref:`USER-HDNNP ` * :ref:`USER-INTEL ` * :ref:`USER-MESONT ` * :ref:`USER-MOLFILE ` * :ref:`USER-NETCDF ` - * :ref:`USER-NNP ` * :ref:`USER-PLUMED ` * :ref:`USER-OMP ` * :ref:`USER-QMMM ` @@ -1416,6 +1416,47 @@ 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 `__ library ``v2.2.0`` +(or higher) before starting the LAMMPS build process. More specifically, only +the *n2p2* core library ``libnnp`` and interface library ``libnnpif`` are +actually needed: 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 +`__. If *n2p2* is +downloaded and compiled in the LAMMPS directory ``lib/hdnnp/n2p2`` no special +flags need to be set besides the usual package activation. If you prefer to +install *n2p2* somewhere else on your system you must specify the path via the +``N2P2_DIR`` variable. + +.. tabs:: + + .. tab:: CMake build + + There is one additional setting besides ``-D PKG_USER-HDNNP=yes`` in case + *n2p2* is not installed in the ``lib/hdnnp/n2p2`` directory: + + .. code-block:: bash + + -D N2P2_DIR=path # path ... n2p2 installation path + + .. tab:: Traditional make + + There is one additional variable that needs to be set besides ``make + yes-user-hdnnp`` in case *n2p2* is not installed in the ``lib/hdnnp/n2p2`` + directory: + + .. code-block:: bash + + make N2P2_DIR=path ... + +---------- + .. _user-intel: USER-INTEL package @@ -1597,47 +1638,6 @@ on your system. ---------- -.. _user-nnp: - -USER-NNP package ---------------------------------- - -To build with the USER-NNP package it is required to download and build the -external `n2p2 `__ library ``v2.2.0`` -(or higher) before starting the LAMMPS build process. More specifically, only -the *n2p2* core library ``libnnp`` and interface library ``libnnpif`` are -actually needed: when using GCC it should suffice to execute ``make libnnpif`` -in the *n2p2* ``src`` directory. For more details please see ``lib/nnp/README`` -and the `n2p2 build documentation -`__. If *n2p2* is -downloaded and compiled in the LAMMPS directory ``lib/nnp/n2p2`` no special -flags need to be set besides the usual package activation. If you prefer to -install *n2p2* somewhere else on your system you must specify the path via the -``N2P2_DIR`` variable. - -.. tabs:: - - .. tab:: CMake build - - There is one additional setting besides ``-D PKG_USER-NNP=yes`` in case - *n2p2* is not installed in the ``lib/nnp/n2p2`` directory: - - .. code-block:: bash - - -D N2P2_DIR=path # path ... n2p2 installation path - - .. tab:: Traditional make - - There is one additional variable that needs to be set besides ``make - yes-user-nnp`` in case *n2p2* is not installed in the ``lib/nnp/n2p2`` - directory: - - .. code-block:: bash - - make N2P2_DIR=path ... - ----------- - .. _user-omp: USER-OMP package diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index 36a7bce482..d069dc8a84 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -35,9 +35,9 @@ packages: +--------------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ | :ref:`MSCG ` | :ref:`OPT ` | :ref:`POEMS ` | :ref:`PYTHON ` | :ref:`VORONOI ` | :ref:`USER-ADIOS ` | +--------------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`USER-ATC ` | :ref:`USER-AWPMD ` | :ref:`USER-COLVARS ` | :ref:`USER-H5MD ` | :ref:`USER-INTEL ` | :ref:`USER-MOLFILE ` | +| :ref:`USER-ATC ` | :ref:`USER-AWPMD ` | :ref:`USER-COLVARS ` | :ref:`USER-H5MD ` | :ref:`USER-HDNNP ` | :ref:`USER-INTEL ` | +--------------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`USER-NETCDF ` | :ref:`USER-NNP ` | :ref:`USER-PLUMED ` | :ref:`USER-OMP ` | :ref:`USER-QMMM ` | :ref:`USER-QUIP ` | +| :ref:`USER-MOLFILE ` | :ref:`USER-NETCDF ` | :ref:`USER-PLUMED ` | :ref:`USER-OMP ` | :ref:`USER-QMMM ` | :ref:`USER-QUIP ` | +--------------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ | :ref:`USER-SCAFACOS ` | :ref:`USER-SMD ` | :ref:`USER-VTK ` | | | | +--------------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index b074c2f8c3..d17f81f411 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -115,6 +115,7 @@ OPT. * :doc:`gw/zbl ` * :doc:`hbond/dreiding/lj (o) ` * :doc:`hbond/dreiding/morse (o) ` + * :doc:`hdnnp ` * :doc:`ilp/graphene/hbn ` * :doc:`kolmogorov/crespi/full ` * :doc:`kolmogorov/crespi/z ` @@ -198,7 +199,6 @@ OPT. * :doc:`nm/cut (o) ` * :doc:`nm/cut/coul/cut (o) ` * :doc:`nm/cut/coul/long (o) ` - * :doc:`nnp ` * :doc:`oxdna/coaxstk ` * :doc:`oxdna/excv ` * :doc:`oxdna/hbond ` diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index ed89341d0c..df57ff63a0 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -77,6 +77,7 @@ page gives those details. * :ref:`USER-EFF ` * :ref:`USER-FEP ` * :ref:`USER-H5MD ` + * :ref:`USER-HDNNP ` * :ref:`USER-INTEL ` * :ref:`USER-LB ` * :ref:`USER-MANIFOLD ` @@ -88,7 +89,6 @@ page gives those details. * :ref:`USER-MOFFF ` * :ref:`USER-MOLFILE ` * :ref:`USER-NETCDF ` - * :ref:`USER-NNP ` * :ref:`USER-OMP ` * :ref:`USER-PHONON ` * :ref:`USER-PLUMED ` @@ -1550,6 +1550,39 @@ This package has :ref:`specific installation instructions ` on the :d ---------- +.. _PKG-USER-HDNNP: + +USER-HDNNP package +------------------ + +**Contents:** + +A :doc:`pair_style 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 `_ library installed and +compiled on your system. + +**Author:** Andreas Singraber + +**Install:** + +This package has :ref:`specific installation instructions ` on the :doc:`Build extras ` page. + +**Supporting info:** + +* src/USER-HDNNP: filenames -> commands +* src/USER-HDNNP/README +* lib/hdnnp/README +* :doc:`pair_style hdnnp ` +* examples/USER/hdnnp + +---------- + .. _PKG-USER-INTEL: USER-INTEL package @@ -1924,39 +1957,6 @@ This package has :ref:`specific installation instructions ` on the ---------- -.. _PKG-USER-NNP: - -USER-NNP package ----------------- - -**Contents:** - -A :doc:`pair_style nnp ` 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 `_ library installed and -compiled on your system. - -**Author:** Andreas Singraber - -**Install:** - -This package has :ref:`specific installation instructions ` on the :doc:`Build extras ` page. - -**Supporting info:** - -* src/USER-NNP: filenames -> commands -* src/USER-NNP/README -* lib/nnp/README -* :doc:`pair_style nnp ` -* examples/USER/nnp - ----------- - .. _PKG-USER-OMP: USER-OMP package diff --git a/doc/src/Packages_user.rst b/doc/src/Packages_user.rst index 77bf13cde6..0b25389032 100644 --- a/doc/src/Packages_user.rst +++ b/doc/src/Packages_user.rst @@ -57,6 +57,8 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-H5MD ` | dump output via HDF5 | :doc:`dump h5md ` | n/a | ext | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ +| :ref:`USER-HDNNP ` | High-dimensional neural network potentials | :doc:`pair_style hdnnp ` | USER/hdnnp | ext | ++------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-INTEL ` | optimized Intel CPU and KNL styles | :doc:`Speed intel ` | `Benchmarks `_ | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-LB ` | Lattice Boltzmann fluid | :doc:`fix lb/fluid ` | USER/lb | no | @@ -79,8 +81,6 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-NETCDF ` | dump output via NetCDF | :doc:`dump netcdf ` | n/a | ext | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`USER-NNP ` | High-dimensional neural network potentials | :doc:`pair_style nnp ` | USER/nnp | ext | -+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-OMP ` | OpenMP-enabled styles | :doc:`Speed omp ` | `Benchmarks `_ | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-PHONON ` | phonon dynamical matrix | :doc:`fix phonon ` | USER/phonon | no | diff --git a/doc/src/pair_nnp.rst b/doc/src/pair_hdnnp.rst similarity index 90% rename from doc/src/pair_nnp.rst rename to doc/src/pair_hdnnp.rst index 3141dce317..b34c00f982 100644 --- a/doc/src/pair_nnp.rst +++ b/doc/src/pair_hdnnp.rst @@ -1,14 +1,14 @@ -.. index:: pair_style nnp +.. index:: pair_style hdnnp -pair_style nnp command -====================== +pair_style hdnnp command +======================== Syntax """""" .. code-block:: LAMMPS - pair_style nnp keyword value ... + pair_style hdnnp keyword value ... * zero or more keyword/value pairs may be appended * keyword = *dir* or *showew* or *showewsum* or *maxew* or *resetew* or *cflength* or *cfenergy* @@ -19,7 +19,7 @@ Syntax *emap* value = mapping mapping = Element mapping from LAMMPS atom types to n2p2 elements *dir* value = directory - directory = Path to NNP configuration files + 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) @@ -36,10 +36,10 @@ Examples .. code-block:: LAMMPS - pair_style nnp showew yes showewsum 100 maxew 1000 resetew yes cflength 1.8897261328 cfenergy 0.0367493254 emap "1:H,2:O" + pair_style hdnnp showew yes showewsum 100 maxew 1000 resetew yes cflength 1.8897261328 cfenergy 0.0367493254 emap "1:H,2:O" pair_coeff * * 6.35 - pair_style nnp dir "./" showewsum 10000 + pair_style hdnnp dir "./" showewsum 10000 pair_coeff * * 6.01 Description @@ -81,15 +81,15 @@ If provided, the keyword *emap* determines the mapping from LAMMPS atom types to n2p2 elements. The format is a comma-separated list of ``atom type:element`` pairs, e.g. ``"1:Cu,2:Zn"`` will map atom types 1 and 2 to elements Cu and Zn, respectively. Atom types not present in the list will be completely ignored by -the NNP. The keyword *emap* is mandatory in a "hybrid" setup (see +the HDNNP. The keyword *emap* is mandatory in a "hybrid" setup (see :doc:`pair_hybrid `) with "extra" atom types in the simulation -which are not handled by the NNP. +which are not handled by the HDNNP. .. warning:: Without an explicit mapping it is by default assumed that the atom type specifications in LAMMPS configuration files are consistent with the ordering - of elements in the NNP library. Thus, without the *emap* keyword present + of elements in the *n2p2* library. Thus, without the *emap* keyword present atom types must be sorted in order of ascending atomic number, e.g. the only correct mapping for a configuration containing hydrogen, oxygen and zinc atoms would be: @@ -104,7 +104,7 @@ which are not handled by the NNP. | Zn | 30 | 3 | +---------+---------------+-------------+ -Use the *dir* keyword to specify the directory containing the NNP configuration +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. @@ -128,7 +128,7 @@ used to print out the MPI rank the atom belongs to. 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 NNP was not + 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. @@ -160,7 +160,7 @@ 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 NNP was +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 @@ -174,7 +174,7 @@ conversion factors are: 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 NNP units (1 Angstrom = 1.8897261328 Bohr, 1 eV = +quantities in native HDNNP units (1 Angstrom = 1.8897261328 Bohr, 1 eV = 0.0367493254 Hartree). ---- @@ -199,7 +199,7 @@ keywords. Restrictions """""""""""" -This pair style is part of the USER-NNP package. It is only enabled if LAMMPS +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 ` doc page for more info. @@ -214,7 +214,7 @@ Related commands Default ^^^^^^^ -The default options are *dir* = "nnp/", *showew* = yes, *showewsum* = 0, *maxew* +The default options are *dir* = "hdnnp/", *showew* = yes, *showewsum* = 0, *maxew* = 0, *resetew* = no, *cflength* = 1.0, *cfenergy* = 1.0. The default atom type mapping is determined automatically according to ascending atomic number of present elements (see above). diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 4872f2328a..f3a59fd8bc 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -178,6 +178,7 @@ accelerated styles exist. * :doc:`gw/zbl ` - Gao-Weber potential with a repulsive ZBL core * :doc:`hbond/dreiding/lj ` - DREIDING hydrogen bonding LJ potential * :doc:`hbond/dreiding/morse ` - DREIDING hydrogen bonding Morse potential +* :doc:`hdnnp ` - High-dimensional neural network potential * :doc:`ilp/graphene/hbn ` - registry-dependent interlayer potential (ILP) * :doc:`kim ` - interface to potentials provided by KIM project * :doc:`kolmogorov/crespi/full ` - Kolmogorov-Crespi (KC) potential with no simplifications @@ -261,7 +262,6 @@ accelerated styles exist. * :doc:`nm/cut ` - N-M potential * :doc:`nm/cut/coul/cut ` - N-M potential with cutoff Coulomb * :doc:`nm/cut/coul/long ` - N-M potential with long-range Coulomb -* :doc:`nnp ` - High-dimensional neural network potential * :doc:`oxdna/coaxstk ` - * :doc:`oxdna/excv ` - * :doc:`oxdna/hbond ` - diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index e2900468fa..7d49568c55 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1211,6 +1211,8 @@ hbn hbnewflag hbond hcp +hdnnp +HDNNP heatconduction Hebenstreit Hecht @@ -2178,8 +2180,6 @@ nmin Nmols nn nnodes -nnp -NNP Nocedal nocite nocoeff diff --git a/examples/USER/nnp/data.H2O-360mol b/examples/USER/hdnnp/data.H2O-360mol similarity index 100% rename from examples/USER/nnp/data.H2O-360mol rename to examples/USER/hdnnp/data.H2O-360mol diff --git a/examples/USER/nnp/nnp-data/input.nn b/examples/USER/hdnnp/hdnnp-data/input.nn similarity index 100% rename from examples/USER/nnp/nnp-data/input.nn rename to examples/USER/hdnnp/hdnnp-data/input.nn diff --git a/examples/USER/nnp/nnp-data/scaling.data b/examples/USER/hdnnp/hdnnp-data/scaling.data similarity index 100% rename from examples/USER/nnp/nnp-data/scaling.data rename to examples/USER/hdnnp/hdnnp-data/scaling.data diff --git a/examples/USER/nnp/nnp-data/weights.001.data b/examples/USER/hdnnp/hdnnp-data/weights.001.data similarity index 100% rename from examples/USER/nnp/nnp-data/weights.001.data rename to examples/USER/hdnnp/hdnnp-data/weights.001.data diff --git a/examples/USER/nnp/nnp-data/weights.008.data b/examples/USER/hdnnp/hdnnp-data/weights.008.data similarity index 100% rename from examples/USER/nnp/nnp-data/weights.008.data rename to examples/USER/hdnnp/hdnnp-data/weights.008.data diff --git a/examples/USER/nnp/in.nnp b/examples/USER/hdnnp/in.hdnnp similarity index 81% rename from examples/USER/nnp/in.nnp rename to examples/USER/hdnnp/in.hdnnp index d4664d1c83..112fb24515 100644 --- a/examples/USER/nnp/in.nnp +++ b/examples/USER/hdnnp/in.hdnnp @@ -1,5 +1,5 @@ ############################################################################### -# MD simulation for NN water +# MD simulation for HDNNP water ############################################################################### ############################################################################### @@ -11,9 +11,9 @@ variable cfgFile string "data.H2O-360mol" # Timesteps variable numSteps equal 10 variable dt equal 0.0005 -# NN -variable nnpCutoff equal 6.36 -variable nnpDir string "nnp-data" +# HDNNP +variable hdnnpCutoff equal 6.36 +variable hdnnpDir string "hdnnp-data" ############################################################################### # GENERAL SETUP @@ -26,10 +26,10 @@ timestep ${dt} thermo 1 ############################################################################### -# NN +# HDNNP ############################################################################### -pair_style nnp dir ${nnpDir} showew no showewsum 5 resetew no maxew 100 cflength 1.8897261328 cfenergy 0.0367493254 emap "1:H,2:O" -pair_coeff * * ${nnpCutoff} +pair_style hdnnp dir ${hdnnpDir} showew no showewsum 5 resetew no maxew 100 cflength 1.8897261328 cfenergy 0.0367493254 emap "1:H,2:O" +pair_coeff * * ${hdnnpCutoff} ############################################################################### # INTEGRATOR @@ -39,7 +39,7 @@ fix INT all nve ############################################################################### # OUTPUT ############################################################################### -dump 1 all atom 1 dump.nnp +dump 1 all atom 1 dump.hdnnp ############################################################################### # SIMULATION diff --git a/lib/README b/lib/README index 535f2b228e..8709c7784c 100644 --- a/lib/README +++ b/lib/README @@ -27,6 +27,8 @@ gpu general GPU routines, GPU package from Mike Brown (ORNL) h5md ch5md library for output of MD data in HDF5 format 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 from Ryan Elliott and Ellad Tadmor (U Minn) kokkos Kokkos package for GPU and many-core acceleration @@ -41,8 +43,6 @@ mscg hooks to the MSCG library, used by fix_mscg command from Jacob Wagner and Greg Voth group (U Chicago) netcdf hooks to a NetCDF library installed on your system from Lars Pastewka (Karlsruhe Institute of Technology) -nnp hooks to n2p2, neural network potential package, used by USER-NNP - from Andreas Singraber poems POEMS rigid-body integration package, POEMS package from Rudranarayan Mukherjee (RPI) python hooks to the system Python library, used by the PYTHON package diff --git a/lib/nnp/Makefile.lammps b/lib/hdnnp/Makefile.lammps similarity index 62% rename from lib/nnp/Makefile.lammps rename to lib/hdnnp/Makefile.lammps index fb5b939541..3b5ce3ab42 100644 --- a/lib/nnp/Makefile.lammps +++ b/lib/hdnnp/Makefile.lammps @@ -2,7 +2,7 @@ # Normally, you do NOT need to edit this file! # Check out if n2p2 or a link is right here. -N2P2_LOCALDIR=$(realpath ../../lib/nnp/n2p2) +N2P2_LOCALDIR=$(realpath ../../lib/hdnnp/n2p2) ifeq ($(N2P2_DIR),) N2P2_DIR=$(shell test -d $(N2P2_LOCALDIR) && echo $(N2P2_LOCALDIR)) else @@ -12,13 +12,13 @@ endif # Give up if n2p2 not found yet. ifeq ($(N2P2_DIR),) -$(error Cannot find library for USER-NNP package, please set environment or make variable N2P2_DIR manually.) +$(error Cannot find library for USER-HDNNP package, please set environment or make variable N2P2_DIR manually.) endif -# Read extra NNP_ compilation flags from makefile provided by n2p2: +# Read extra N2P2_ compilation flags from makefile provided by n2p2: include $(N2P2_DIR)/lib/Makefile.lammps-extra # Next, add general info to include/lib/path variables. -nnp_SYSINC += -I$(N2P2_DIR)/include -nnp_SYSLIB += -L$(N2P2_DIR)/lib -lnnpif -lnnp -nnp_SYSPATH += +hdnnp_SYSINC += -I$(N2P2_DIR)/include +hdnnp_SYSLIB += -L$(N2P2_DIR)/lib -lnnpif -lnnp +hdnnp_SYSPATH += diff --git a/lib/nnp/README b/lib/hdnnp/README similarity index 68% rename from lib/nnp/README rename to lib/hdnnp/README index 004d60df0b..d92fac5301 100644 --- a/lib/nnp/README +++ b/lib/hdnnp/README @@ -1,4 +1,4 @@ -The USER-NNP package requires access to pre-compiled libraries of the n2p2 +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 @@ -10,17 +10,17 @@ Basic build instructions for n2p2 ================================= The n2p2 software package comes with lots of useful tools for creating and -applying neural network potentials (NNPs). 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 NNP 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. +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-NNP package: +which should create the following files needed by the USER-HDNNP package: * "n2p2/lib/libnnp.a" * "n2p2/lib/libnnpif.a" @@ -43,7 +43,7 @@ also available (e.g. "makefile.intel") and can be activated by supplying the 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-NNP package n2p2 must +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 @@ -65,12 +65,12 @@ Installation directory of n2p2 You can install n2p2 either in this folder (1) or somewhere else on your system (2): (1) If n2p2 is installed here, please make sure that the directory is also named - "n2p2", i.e. within "lib/nnp/n2p2" you can see the n2p2 folder structure, in + "n2p2", i.e. within "lib/hdnnp/n2p2" you can see the n2p2 folder structure, in particular "lib" and "include": lib | - nnp + hdnnp | n2p2 | @@ -79,27 +79,27 @@ You can install n2p2 either in this folder (1) or somewhere else on your system include lib src ... In this case LAMMPS will automatically find n2p2 during the build process - and you only need to enable the USER-NNP package via CMake (-D PKG_USER-NNP=yes) - or the traditional makefile approach (make yes-user-nnp). It is also valid to - create a link here named "n2p2" which points to the n2p2 installation - directory. + and you only need to enable the USER-HDNNP package via CMake (-D + PKG_USER-HDNNP=yes) or the traditional makefile approach (make yes-user-hdnnp). + It is also valid to create a link here named "n2p2" which points to the n2p2 + installation directory. (2) If n2p2 is installed somewhere else the path must be given as an additional setting (variable N2P2_DIR) to the build tool. For example, with CMake use - cmake -D PKG_USER-NNP=yes -D N2P2_DIR= ../cmake/ + cmake -D PKG_USER-HDNNP=yes -D N2P2_DIR= ../cmake/ and for the traditional makefiles use - make yes-user-nnp + make yes-user-hdnnp make N2P2_DIR= mpi -Testing a successful build of LAMMPS with USER-NNP -================================================== +Testing a successful build of LAMMPS with USER-HDNNP +==================================================== -An example is provided in the LAMMPS directory "examples/USER/nnp" which runs +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 "nnp-data" subdirectory. Use the "in.nnp" LAMMPS script file +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 "nnp" is initialized, followed by the LAMMPS per-timestep +the pair style "hdnnp" is initialized, followed by the LAMMPS per-timestep output. diff --git a/src/.gitignore b/src/.gitignore index 9e37dc316c..b02a44705c 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -971,6 +971,8 @@ /pair_hbond_dreiding_lj.h /pair_hbond_dreiding_morse.cpp /pair_hbond_dreiding_morse.h +/pair_hdnnp.cpp +/pair_hdnnp.h /pair_ilp_graphene_hbn.cpp /pair_ilp_graphene_hbn.h /pair_kolmogorov_crespi_full.cpp @@ -1079,8 +1081,6 @@ /pair_nm_cut_coul_cut.h /pair_nm_cut_coul_long.cpp /pair_nm_cut_coul_long.h -/pair_nnp.cpp -/pair_nnp.h /pair_oxdna_*.cpp /pair_oxdna_*.h /pair_oxdna2_*.cpp diff --git a/src/Makefile b/src/Makefile index 3afe821db7..7fce8e5354 100644 --- a/src/Makefile +++ b/src/Makefile @@ -52,17 +52,17 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \ python qeq replica rigid shock snap spin srd voronoi PACKUSER = user-adios user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ - user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ + user-diffraction user-dpd user-drude user-eff user-fep user-h5md user-hdnnp \ user-intel user-lb user-manifold user-meamc user-mesodpd user-mesont \ user-mgpt user-misc user-mofff user-molfile \ - user-netcdf user-nnp user-omp user-phonon user-plumed user-ptm user-qmmm \ + user-netcdf user-omp user-phonon user-plumed user-ptm user-qmmm \ user-qtb user-quip user-reaction user-reaxc user-scafacos user-smd user-smtbq \ user-sdpd user-sph user-tally user-uef user-vtk user-yaff 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-molfile \ - user-netcdf user-nnp user-plumed user-qmmm user-quip user-scafacos \ + user-adios user-atc user-awpmd user-colvars user-h5md user-hdnnp user-lb user-molfile \ + user-netcdf user-plumed user-qmmm user-quip user-scafacos \ user-smd user-vtk user-mesont PACKSYS = compress mpiio python user-lb @@ -70,7 +70,7 @@ PACKSYS = compress mpiio python user-lb PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont PACKEXT = kim latte mscg voronoi \ - user-adios user-h5md user-molfile user-netcdf user-nnp user-plumed user-qmmm \ + user-adios user-h5md user-hdnnp user-molfile user-netcdf user-plumed user-qmmm \ user-quip user-smd user-vtk PACKALL = $(PACKAGE) $(PACKUSER) diff --git a/src/USER-NNP/Install.sh b/src/USER-HDNNP/Install.sh similarity index 66% rename from src/USER-NNP/Install.sh rename to src/USER-HDNNP/Install.sh index cd60ba1598..8ee16c53ca 100644 --- a/src/USER-NNP/Install.sh +++ b/src/USER-HDNNP/Install.sh @@ -37,17 +37,17 @@ done if (test $1 = 1) then if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*nnp[^ \t]* //g' ../Makefile.package - sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(nnp_SYSINC) |' ../Makefile.package - sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(nnp_SYSLIB) |' ../Makefile.package - sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(nnp_SYSPATH) |' ../Makefile.package + sed -i -e 's/[^ \t]*hdnnp[^ \t]* //g' ../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.*nnp.*$/d' ../Makefile.package.settings + sed -i -e '/^include.*hdnnp.*$/d' ../Makefile.package.settings # multiline form needed for BSD sed on Macs sed -i -e '4 i \ -include ..\/..\/lib\/nnp\/Makefile.lammps\ +include ..\/..\/lib\/hdnnp\/Makefile.lammps\ ' ../Makefile.package.settings fi @@ -55,11 +55,11 @@ include ..\/..\/lib\/nnp\/Makefile.lammps\ elif (test $1 = 0) then if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*nnp[^ \t]* //g' ../Makefile.package + sed -i -e 's/[^ \t]*hdnnp[^ \t]* //g' ../Makefile.package fi if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*nnp.*$/d' ../Makefile.package.settings + sed -i -e '/^include.*hdnnp.*$/d' ../Makefile.package.settings fi fi diff --git a/src/USER-NNP/README b/src/USER-HDNNP/README similarity index 75% rename from src/USER-NNP/README rename to src/USER-HDNNP/README index a8eae3d865..690db8a714 100644 --- a/src/USER-NNP/README +++ b/src/USER-HDNNP/README @@ -1,15 +1,15 @@ -This package implements the "pair_style nnp" command which can be used in a +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 nnp" command for further +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/nnp" directory of LAMMPS. +"examples/USER/hdnnp" directory of LAMMPS. -The USER-NNP package requires the external library n2p2 which must be +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/nnp/README". This package +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. diff --git a/src/USER-NNP/pair_nnp.cpp b/src/USER-HDNNP/pair_hdnnp.cpp similarity index 94% rename from src/USER-NNP/pair_nnp.cpp rename to src/USER-HDNNP/pair_hdnnp.cpp index b2dae5a969..213574327c 100644 --- a/src/USER-NNP/pair_nnp.cpp +++ b/src/USER-HDNNP/pair_hdnnp.cpp @@ -18,7 +18,7 @@ Contributing author: Andreas Singraber ------------------------------------------------------------------------- */ -#include "pair_nnp.h" +#include "pair_hdnnp.h" #include #include "atom.h" #include "citeme.h" @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; -static const char cite_user_nnp_package[] = - "USER-NNP package:\n\n" +static const char cite_user_hdnnp_package[] = + "USER-HDNNP package:\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" @@ -50,23 +50,23 @@ static const char cite_user_nnp_package[] = /* ---------------------------------------------------------------------- */ -PairNNP::PairNNP(LAMMPS *lmp) : Pair(lmp) +PairHDNNP::PairHDNNP(LAMMPS *lmp) : Pair(lmp) { - if (lmp->citeme) lmp->citeme->add(cite_user_nnp_package); + if (lmp->citeme) lmp->citeme->add(cite_user_hdnnp_package); interface = new nnp::InterfaceLammps(); } /* ---------------------------------------------------------------------- */ -PairNNP::~PairNNP() +PairHDNNP::~PairHDNNP() { delete interface; } /* ---------------------------------------------------------------------- */ -void PairNNP::compute(int eflag, int vflag) +void PairHDNNP::compute(int eflag, int vflag) { if(eflag || vflag) ev_setup(eflag,vflag); else evflag = vflag_fdotr = eflag_global = eflag_atom = 0; @@ -78,7 +78,7 @@ void PairNNP::compute(int eflag, int vflag) // (tagint = int64_t) interface->setLocalTags(atom->tag); - // Transfer local neighbor list to NNP interface. + // Transfer local neighbor list to n2p2 interface. transferNeighborList(); // Compute symmetry functions, atomic neural networks and add up energy. @@ -109,7 +109,7 @@ void PairNNP::compute(int eflag, int vflag) global settings ------------------------------------------------------------------------- */ -void PairNNP::settings(int narg, char **arg) +void PairHDNNP::settings(int narg, char **arg) { single_enable = 0; // 1 if single() routine exists single_hessian_enable = 0; // 1 if single_hessian() routine exists @@ -128,9 +128,9 @@ void PairNNP::settings(int narg, char **arg) if (narg == 0) error->all(FLERR,"Illegal pair_style command"); // default settings - int len = strlen("nnp/") + 1; + int len = strlen("hdnnp/") + 1; directory = new char[len]; - strcpy(directory,"nnp/"); + strcpy(directory,"hdnnp/"); showew = true; showewsum = 0; maxew = 0; @@ -144,7 +144,7 @@ void PairNNP::settings(int narg, char **arg) numExtrapolationWarningsSummary = 0; while(iarg < narg) { - // set NNP directory + // set HDNNP directory if (strcmp(arg[iarg],"dir") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style command"); @@ -216,7 +216,7 @@ void PairNNP::settings(int narg, char **arg) set coeffs for one or more type pairs ------------------------------------------------------------------------- */ -void PairNNP::coeff(int narg, char **arg) +void PairHDNNP::coeff(int narg, char **arg) { if (!allocated) allocate(); @@ -244,14 +244,14 @@ void PairNNP::coeff(int narg, char **arg) init specific to this pair style ------------------------------------------------------------------------- */ -void PairNNP::init_style() +void PairHDNNP::init_style() { int irequest = neighbor->request((void *) this); neighbor->requests[irequest]->pair = 1; neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; - // Return immediately if NNP setup is already completed. + // Return immediately if HDNNP setup is already completed. if (interface->isInitialized()) return; // Activate screen and logfile output only for rank 0. @@ -285,7 +285,7 @@ void PairNNP::init_style() init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ -double PairNNP::init_one(int i, int j) +double PairHDNNP::init_one(int i, int j) { return maxCutoffRadius; } @@ -294,7 +294,7 @@ double PairNNP::init_one(int i, int j) allocate all arrays ------------------------------------------------------------------------- */ -void PairNNP::allocate() +void PairHDNNP::allocate() { allocated = 1; int n = atom->ntypes; @@ -307,9 +307,9 @@ void PairNNP::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); } -void PairNNP::transferNeighborList() +void PairHDNNP::transferNeighborList() { - // Transfer neighbor list to NNP. + // Transfer neighbor list to n2p2. double rc2 = maxCutoffRadius * maxCutoffRadius; for (int ii = 0; ii < list->inum; ++ii) { int i = list->ilist[ii]; @@ -327,7 +327,7 @@ void PairNNP::transferNeighborList() } } -void PairNNP::handleExtrapolationWarnings() +void PairHDNNP::handleExtrapolationWarnings() { // Get number of extrapolation warnings for local atoms. long numCurrentEW = (long)interface->getNumExtrapolationWarnings(); diff --git a/src/USER-NNP/pair_nnp.h b/src/USER-HDNNP/pair_hdnnp.h similarity index 91% rename from src/USER-NNP/pair_nnp.h rename to src/USER-HDNNP/pair_hdnnp.h index 8a41d1a5d6..a3488bbad4 100644 --- a/src/USER-NNP/pair_nnp.h +++ b/src/USER-HDNNP/pair_hdnnp.h @@ -20,12 +20,12 @@ #ifdef PAIR_CLASS -PairStyle(nnp,PairNNP) +PairStyle(hdnnp,PairHDNNP) #else -#ifndef LMP_PAIR_NNP_H -#define LMP_PAIR_NNP_H +#ifndef LMP_PAIR_HDNNP_H +#define LMP_PAIR_HDNNP_H #include "pair.h" @@ -35,12 +35,12 @@ namespace nnp { namespace LAMMPS_NS { -class PairNNP : public Pair { +class PairHDNNP : public Pair { public: - PairNNP(class LAMMPS *); - virtual ~PairNNP(); + PairHDNNP(class LAMMPS *); + virtual ~PairHDNNP(); virtual void compute(int, int); virtual void settings(int, char **); virtual void coeff(int, char **);