diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 8c5b69b260..c572d6f27a 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -87,7 +87,8 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
# this is fast, so check for it all the time
message(STATUS "Running check for auto-generated files from make-based build system")
file(GLOB SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/style_*.h)
-list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h ${LAMMPS_SOURCE_DIR}/lmpgitversion.h)
+file(GLOB SRC_AUTOGEN_PACKAGES ${LAMMPS_SOURCE_DIR}/packages_*.h)
+list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h ${LAMMPS_SOURCE_DIR}/lmpgitversion.h)
foreach(_SRC ${SRC_AUTOGEN_FILES})
get_filename_component(FILENAME "${_SRC}" NAME)
if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME})
@@ -172,21 +173,17 @@ set(LAMMPS_LINK_LIBS)
set(LAMMPS_DEPS)
set(LAMMPS_API_DEFINES)
-set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR
- KSPACE MANYBODY MC MESSAGE MISC MOLECULE PERI REPLICA RIGID SHOCK
- SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE USER-ATC USER-AWPMD
- USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION
- USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD
- USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF
- USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS
- USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK
- USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
+set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE
+ GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MOLECULE PERI POEMS QEQ
+ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
+ USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS
+ USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB
+ USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
+ USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC
+ USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
+ USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
-set(OTHER_PACKAGES CORESHELL QEQ)
-foreach(PKG ${DEFAULT_PACKAGES})
- option(PKG_${PKG} "Build ${PKG} Package" OFF)
-endforeach()
-foreach(PKG ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
+foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES})
option(PKG_${PKG} "Build ${PKG} Package" OFF)
endforeach()
@@ -203,7 +200,6 @@ endif()
include_directories(${LAMMPS_SOURCE_DIR})
-
if(PKG_USER-ADIOS)
# The search for ADIOS2 must come before MPI because
# it includes its own MPI search with the latest FindMPI.cmake
@@ -213,7 +209,6 @@ if(PKG_USER-ADIOS)
list(APPEND LAMMPS_LINK_LIBS adios2::adios2)
endif()
-
# do MPI detection after language activation, if MPI for these language is required
find_package(MPI QUIET)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
@@ -233,7 +228,6 @@ else()
list(APPEND LAMMPS_LINK_LIBS mpi_stubs)
endif()
-
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
@@ -322,7 +316,18 @@ pkg_depends(USER-SCAFACOS MPI)
include(CheckIncludeFileCXX)
find_package(OpenMP QUIET)
-option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND})
+
+# TODO: this is a temporary workaround until a better solution is found. AK 2019-05-30
+# GNU GCC 9.x uses settings incompatible with our use of 'default(none)' in OpenMP pragmas
+# where we assume older GCC semantics. For the time being, we disable OpenMP by default
+# for GCC 9.x and beyond. People may manually turn it on, but need to run the script
+# src/USER-OMP/hack_openmp_for_pgi_gcc9.sh on all sources to make it compatible with gcc 9.
+if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0.0))
+ option(BUILD_OMP "Build with OpenMP support" OFF)
+else()
+ option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND})
+endif()
+
if(BUILD_OMP)
find_package(OpenMP REQUIRED)
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
@@ -446,7 +451,6 @@ else()
set(CUDA_REQUEST_PIC)
endif()
-
if(PKG_VORONOI)
find_package(VORO)
if(VORO_FOUND)
@@ -895,6 +899,8 @@ foreach(PKG ${DEFAULT_PACKAGES})
list(APPEND LIB_SOURCES ${${PKG}_SOURCES})
include_directories(${${PKG}_SOURCES_DIR})
endif()
+
+ RegisterPackages(${${PKG}_SOURCES_DIR})
endforeach()
# packages that need defines set
@@ -913,6 +919,8 @@ foreach(PKG ${ACCEL_PACKAGES})
# check for package files in src directory due to old make system
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
+
+ RegisterPackages(${${PKG}_SOURCES_DIR})
endforeach()
##############################################
@@ -961,7 +969,6 @@ if(PKG_USER-H5MD)
include_directories(${HDF5_INCLUDE_DIRS})
endif()
-
######################################################################
# packages which selectively include variants based on enabled styles
# e.g. accelerator packages
@@ -1438,10 +1445,12 @@ endif()
######################################################
# Generate style headers based on global list of
# styles registered during package selection
+# Generate packages headers from all packages
######################################################
set(LAMMPS_STYLE_HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/styles)
GenerateStyleHeaders(${LAMMPS_STYLE_HEADERS_DIR})
+GeneratePackagesHeaders(${LAMMPS_STYLE_HEADERS_DIR})
include_directories(${LAMMPS_STYLE_HEADERS_DIR})
@@ -1450,7 +1459,7 @@ include_directories(${LAMMPS_STYLE_HEADERS_DIR})
######################################
set(temp "#ifndef LMP_INSTALLED_PKGS_H\n#define LMP_INSTALLED_PKGS_H\n")
set(temp "${temp}const char * LAMMPS_NS::LAMMPS::installed_packages[] = {\n")
-set(temp_PKG_LIST ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
+set(temp_PKG_LIST ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES})
list(SORT temp_PKG_LIST)
foreach(PKG ${temp_PKG_LIST})
if(PKG_${PKG})
@@ -1529,8 +1538,6 @@ if(BUILD_EXE)
endif()
-
-
###############################################################################
# Build documentation
###############################################################################
@@ -1683,7 +1690,7 @@ endif()
###############################################################################
# Print package summary
###############################################################################
-foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
+foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES})
if(PKG_${PKG})
message(STATUS "Building package: ${PKG}")
endif()
diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake
index ebaa5dae8e..04883d0292 100644
--- a/cmake/Modules/StyleHeaderUtils.cmake
+++ b/cmake/Modules/StyleHeaderUtils.cmake
@@ -181,3 +181,88 @@ function(DetectBuildSystemConflict lammps_src_dir)
endforeach()
endif()
endfunction(DetectBuildSystemConflict)
+
+
+function(FindPackagesHeaders path style_class file_pattern headers)
+ file(GLOB files "${path}/${file_pattern}*.h")
+ get_property(plist GLOBAL PROPERTY ${headers})
+
+ foreach(file_name ${files})
+ file(STRINGS ${file_name} is_style LIMIT_COUNT 1 REGEX ${style_class})
+ if(is_style)
+ list(APPEND plist ${file_name})
+ endif()
+ endforeach()
+ set_property(GLOBAL PROPERTY ${headers} "${plist}")
+endfunction(FindPackagesHeaders)
+
+function(RegisterPackages search_path)
+ FindPackagesHeaders(${search_path} ANGLE_CLASS angle_ PKGANGLE ) # angle ) # force
+ FindPackagesHeaders(${search_path} ATOM_CLASS atom_vec_ PKGATOM_VEC ) # atom ) # atom atom_vec_hybrid
+ FindPackagesHeaders(${search_path} BODY_CLASS body_ PKGBODY ) # body ) # atom_vec_body
+ FindPackagesHeaders(${search_path} BOND_CLASS bond_ PKGBOND ) # bond ) # force
+ FindPackagesHeaders(${search_path} COMMAND_CLASS "[^.]" PKGCOMMAND ) # command ) # input
+ FindPackagesHeaders(${search_path} COMPUTE_CLASS compute_ PKGCOMPUTE ) # compute ) # modify
+ FindPackagesHeaders(${search_path} DIHEDRAL_CLASS dihedral_ PKGDIHEDRAL ) # dihedral ) # force
+ FindPackagesHeaders(${search_path} DUMP_CLASS dump_ PKGDUMP ) # dump ) # output write_dump
+ FindPackagesHeaders(${search_path} FIX_CLASS fix_ PKGFIX ) # fix ) # modify
+ FindPackagesHeaders(${search_path} IMPROPER_CLASS improper_ PKGIMPROPER ) # improper ) # force
+ FindPackagesHeaders(${search_path} INTEGRATE_CLASS "[^.]" PKGINTEGRATE ) # integrate ) # update
+ FindPackagesHeaders(${search_path} KSPACE_CLASS "[^.]" PKGKSPACE ) # kspace ) # force
+ FindPackagesHeaders(${search_path} MINIMIZE_CLASS min_ PKGMINIMIZE ) # minimize ) # update
+ FindPackagesHeaders(${search_path} NBIN_CLASS nbin_ PKGNBIN ) # nbin ) # neighbor
+ FindPackagesHeaders(${search_path} NPAIR_CLASS npair_ PKGNPAIR ) # npair ) # neighbor
+ FindPackagesHeaders(${search_path} NSTENCIL_CLASS nstencil_ PKGNSTENCIL ) # nstencil ) # neighbor
+ FindPackagesHeaders(${search_path} NTOPO_CLASS ntopo_ PKGNTOPO ) # ntopo ) # neighbor
+ FindPackagesHeaders(${search_path} PAIR_CLASS pair_ PKGPAIR ) # pair ) # force
+ FindPackagesHeaders(${search_path} READER_CLASS reader_ PKGREADER ) # reader ) # read_dump
+ FindPackagesHeaders(${search_path} REGION_CLASS region_ PKGREGION ) # region ) # domain
+endfunction(RegisterPackages)
+
+function(CreatePackagesHeader path filename)
+ set(temp "")
+ if(ARGC GREATER 2)
+ list(REMOVE_AT ARGV 0 1)
+ foreach(FNAME ${ARGV})
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${FNAME}")
+ get_filename_component(DNAME ${FNAME} DIRECTORY)
+ get_filename_component(DNAME ${DNAME} NAME)
+ get_filename_component(FNAME ${FNAME} NAME)
+ set(temp "${temp}#undef PACKAGE\n#define PACKAGE \"${DNAME}\"\n")
+ set(temp "${temp}#include \"${DNAME}/${FNAME}\"\n")
+ endforeach()
+ endif()
+ message(STATUS "Generating ${filename}...")
+ file(WRITE "${path}/${filename}.tmp" "${temp}" )
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${path}/${filename}.tmp" "${path}/${filename}")
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${path}/${filename}")
+endfunction(CreatePackagesHeader)
+
+function(GeneratePackagesHeader path property style)
+ get_property(files GLOBAL PROPERTY ${property})
+ CreatePackagesHeader("${path}" "packages_${style}.h" ${files})
+endfunction(GeneratePackagesHeader)
+
+function(GeneratePackagesHeaders output_path)
+ GeneratePackagesHeader(${output_path} PKGANGLE angle ) # force
+ GeneratePackagesHeader(${output_path} PKGATOM_VEC atom ) # atom atom_vec_hybrid
+ GeneratePackagesHeader(${output_path} PKGBODY body ) # atom_vec_body
+ GeneratePackagesHeader(${output_path} PKGBOND bond ) # force
+ GeneratePackagesHeader(${output_path} PKGCOMMAND command ) # input
+ GeneratePackagesHeader(${output_path} PKGCOMPUTE compute ) # modify
+ GeneratePackagesHeader(${output_path} PKGDIHEDRAL dihedral ) # force
+ GeneratePackagesHeader(${output_path} PKGDUMP dump ) # output write_dump
+ GeneratePackagesHeader(${output_path} PKGFIX fix ) # modify
+ GeneratePackagesHeader(${output_path} PKGIMPROPER improper ) # force
+ GeneratePackagesHeader(${output_path} PKGINTEGRATE integrate ) # update
+ GeneratePackagesHeader(${output_path} PKGKSPACE kspace ) # force
+ GeneratePackagesHeader(${output_path} PKGMINIMIZE minimize ) # update
+ GeneratePackagesHeader(${output_path} PKGNBIN nbin ) # neighbor
+ GeneratePackagesHeader(${output_path} PKGNPAIR npair ) # neighbor
+ GeneratePackagesHeader(${output_path} PKGNSTENCIL nstencil ) # neighbor
+ GeneratePackagesHeader(${output_path} PKGNTOPO ntopo ) # neighbor
+ GeneratePackagesHeader(${output_path} PKGPAIR pair ) # force
+ GeneratePackagesHeader(${output_path} PKGREADER reader ) # read_dump
+ GeneratePackagesHeader(${output_path} PKGREGION region ) # domain
+endfunction(GeneratePackagesHeaders)
+
diff --git a/doc/lammps.1 b/doc/lammps.1
index ac23e7abf8..8517abcdd5 100644
--- a/doc/lammps.1
+++ b/doc/lammps.1
@@ -1,4 +1,4 @@
-.TH LAMMPS "15 May 2019" "2019-05-15"
+.TH LAMMPS "31 May 2019" "2019-05-31"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator.
diff --git a/doc/src/Errors_messages.txt b/doc/src/Errors_messages.txt
index 4f3bbe8c24..28bf3ab9b9 100644
--- a/doc/src/Errors_messages.txt
+++ b/doc/src/Errors_messages.txt
@@ -5828,6 +5828,12 @@ Must have periodic x,y dimensions and non-periodic z dimension to use
Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with pppm/disp. :dd
+{Incorrect conversion in format string} :dt
+
+A format style variable was not using either a %f, a %g, or a %e conversion.
+Or an immediate variable with format suffix was not using either
+a %f, a %g or a %e conversion in the format suffix. :dd
+
{Incorrect element names in ADP potential file} :dt
The element names in the ADP file do not match those requested. :dd
@@ -7448,6 +7454,11 @@ The Atoms section of a data file must come before a Triangles section. :dd
The Atoms section of a data file must come before a Velocities
section. :dd
+{Must re-specify non-restarted pair style (xxx) after read_restart} :dt
+
+For pair styles, that do not store their settings in a restart file,
+it must be defined with a new 'pair_style' command after read_restart. :dd
+
{Must set both respa inner and outer} :dt
Cannot use just the inner or outer option with respa without using the
@@ -10049,19 +10060,19 @@ create_box command. :dd
A universe or uloop style variable must specify a number of values >= to the
number of processor partitions. :dd
-{Unknown angle style} :dt
+{Unrecognized angle style} :dt
The choice of angle style is unknown. :dd
-{Unknown atom style} :dt
+{Unrecognized atom style} :dt
The choice of atom style is unknown. :dd
-{Unknown body style} :dt
+{Unrecognized body style} :dt
The choice of body style is unknown. :dd
-{Unknown bond style} :dt
+{Unrecognized bond style} :dt
The choice of bond style is unknown. :dd
@@ -10077,23 +10088,23 @@ Self-explanatory. :dd
Self-explanatory. :dd
-{Unknown command: %s} :dt
+{Unrecognized command: %s} :dt
The command is not known to LAMMPS. Check the input script. :dd
-{Unknown compute style} :dt
+{Unrecognized compute style} :dt
The choice of compute style is unknown. :dd
-{Unknown dihedral style} :dt
+{Unrecognized dihedral style} :dt
The choice of dihedral style is unknown. :dd
-{Unknown dump reader style} :dt
+{Unrecognized dump reader style} :dt
The choice of dump reader style via the format keyword is unknown. :dd
-{Unknown dump style} :dt
+{Unrecognized dump style} :dt
The choice of dump style is unknown. :dd
@@ -10101,7 +10112,7 @@ The choice of dump style is unknown. :dd
Self-explanatory. :dd
-{Unknown fix style} :dt
+{Unrecognized fix style} :dt
The choice of fix style is unknown. :dd
@@ -10109,7 +10120,7 @@ The choice of fix style is unknown. :dd
A section of the data file cannot be read by LAMMPS. :dd
-{Unknown improper style} :dt
+{Unrecognized improper style} :dt
The choice of improper style is unknown. :dd
@@ -10117,7 +10128,7 @@ The choice of improper style is unknown. :dd
One or more specified keywords are not recognized. :dd
-{Unknown kspace style} :dt
+{Unrecognized kspace style} :dt
The choice of kspace style is unknown. :dd
@@ -10133,7 +10144,7 @@ Self-explanatory. :dd
Self-explanatory. :dd
-{Unknown pair style} :dt
+{Unrecognized pair style} :dt
The choice of pair style is unknown. :dd
@@ -10141,7 +10152,7 @@ The choice of pair style is unknown. :dd
The choice of sub-style is unknown. :dd
-{Unknown region style} :dt
+{Unrecognized region style} :dt
The choice of region style is unknown. :dd
diff --git a/doc/src/Manual.txt b/doc/src/Manual.txt
index 396155cc45..0fb707746c 100644
--- a/doc/src/Manual.txt
+++ b/doc/src/Manual.txt
@@ -1,7 +1,7 @@
LAMMPS Users Manual
-
+
@@ -21,7 +21,7 @@
:line
LAMMPS Documentation :c,h1
-15 May 2019 version :c,h2
+31 May 2019 version :c,h2
"What is a LAMMPS version?"_Manual_version.html
diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt
index 4f9bcc1910..1528adc420 100644
--- a/doc/src/Packages_details.txt
+++ b/doc/src/Packages_details.txt
@@ -208,7 +208,7 @@ available on your system.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#compress on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -358,7 +358,7 @@ developed the pair style.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#kim on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -404,7 +404,7 @@ lib/kokkos.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#kokkos on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -477,7 +477,7 @@ Cawkwell, Anders Niklasson, and Christian Negre.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#latte on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -654,7 +654,7 @@ University of Chicago.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#mscg on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -686,7 +686,7 @@ and Vincent Natoli (Stone Ridge Technolgy).
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#opt on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -743,7 +743,7 @@ connections at hinge points.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#poems on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -775,7 +775,7 @@ lib/python/README for more details.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#python on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -965,7 +965,7 @@ and LBNL.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#voronoi on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1017,7 +1017,7 @@ atomic information to continuum fields.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-atc on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1044,7 +1044,7 @@ model.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-awpmd on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1184,7 +1184,7 @@ Tribello.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-plumed on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1362,7 +1362,7 @@ H5MD format.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-h5md on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1400,7 +1400,7 @@ NOTE: the USER-INTEL package contains styles that require using the
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-intel on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1620,7 +1620,7 @@ at
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-molfile on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1660,7 +1660,7 @@ tools:
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-netcdf on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1704,7 +1704,7 @@ install/un-install the package and build LAMMPS in the usual manner:
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-omp on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1788,7 +1788,7 @@ without changes to LAMMPS itself.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-qmmm on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1846,7 +1846,7 @@ on your system.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-quip on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -1964,7 +1964,7 @@ Dynamics, Ernst Mach Institute, Germany).
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-smd on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
@@ -2090,7 +2090,7 @@ system.
[Install:]
This package has "specific installation
-instructions"_Build_extras.html#gpu on the "Build
+instructions"_Build_extras.html#user-vtk on the "Build
extras"_Build_extras.html doc page.
[Supporting info:]
diff --git a/doc/src/fix_atom_swap.txt b/doc/src/fix_atom_swap.txt
index 22091eca00..cb6bc26aa1 100644
--- a/doc/src/fix_atom_swap.txt
+++ b/doc/src/fix_atom_swap.txt
@@ -141,11 +141,16 @@ specify if this should be done.
This fix writes the state of the fix to "binary restart
files"_restart.html. This includes information about the random
-number generator seed, the next timestep for MC exchanges, etc. See
+number generator seed, the next timestep for MC exchanges, the number
+of exchange attempts and successes etc. See
the "read_restart"_read_restart.html command for info on how to
re-specify a fix in an input script that reads a restart file, so that
the operation of the fix continues in an uninterrupted fashion.
+NOTE: For this to work correctly, the timestep must [not] be changed
+after reading the restart with "reset_timestep"_reset_timestep.html.
+The fix will try to detect it and stop with an error.
+
None of the "fix_modify"_fix_modify.html options are relevant to this
fix.
diff --git a/doc/src/fix_deposit.txt b/doc/src/fix_deposit.txt
index fd12d4bb45..9ab125a55f 100644
--- a/doc/src/fix_deposit.txt
+++ b/doc/src/fix_deposit.txt
@@ -261,6 +261,10 @@ next timestep for deposition, etc. See the
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.
+NOTE: For this to work correctly, the timestep must [not] be changed
+after reading the restart with "reset_timestep"_reset_timestep.html.
+The fix will try to detect it and stop with an error.
+
None of the "fix_modify"_fix_modify.html options are relevant to this
fix. No global or per-atom quantities are stored by this fix for
access by various "output commands"_Howto_output.html. No parameter
diff --git a/doc/src/fix_gcmc.txt b/doc/src/fix_gcmc.txt
index 8a66a007a3..3c0f2c2f17 100644
--- a/doc/src/fix_gcmc.txt
+++ b/doc/src/fix_gcmc.txt
@@ -373,11 +373,16 @@ adds all inserted atoms of the specified type to the
This fix writes the state of the fix to "binary restart
files"_restart.html. This includes information about the random
-number generator seed, the next timestep for MC exchanges, etc. See
+number generator seed, the next timestep for MC exchanges, the number
+of MC step attempts and successes etc. See
the "read_restart"_read_restart.html command for info on how to
re-specify a fix in an input script that reads a restart file, so that
the operation of the fix continues in an uninterrupted fashion.
+NOTE: For this to work correctly, the timestep must [not] be changed
+after reading the restart with "reset_timestep"_reset_timestep.html.
+The fix will try to detect it and stop with an error.
+
None of the "fix_modify"_fix_modify.html options are relevant to this
fix.
diff --git a/doc/src/pair_quip.txt b/doc/src/pair_quip.txt
index 30f1d80450..e6b01b8853 100644
--- a/doc/src/pair_quip.txt
+++ b/doc/src/pair_quip.txt
@@ -92,10 +92,6 @@ pairs from the neighbor list. This needs to be very carefully tested,
because it may remove pairs from the neighbor list that are still
required.
-Pair style {quip} cannot be used with pair style {hybrid}, only
-with {hybrid/overlay} and only the {quip} sub-style is applied to
-all atom types.
-
[Related commands:]
"pair_coeff"_pair_coeff.html
diff --git a/src/.gitignore b/src/.gitignore
index 1e073bb657..82af337f3a 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -5,6 +5,7 @@
/lmp_*
/style_*.h
+/packages_*.h
/lmpinstalledpkgs.h
/lmpgitversion.h
diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp
index 05a6fd605c..34858ff1e1 100644
--- a/src/KOKKOS/neigh_bond_kokkos.cpp
+++ b/src/KOKKOS/neigh_bond_kokkos.cpp
@@ -200,6 +200,7 @@ void NeighBondKokkos::build_topology_kk()
{
atomKK->sync(execution_space, X_MASK | TAG_MASK);
int nall = atom->nlocal + atom->nghost;
+ int nmax = atom->nmax;
nlocal = atom->nlocal;
x = atomKK->k_x.view();
@@ -215,7 +216,9 @@ void NeighBondKokkos::build_topology_kk()
int* map_array_host = atom->get_map_array();
int map_size = atom->get_map_size();
- k_map_array = DAT::tdual_int_1d("NeighBond:map_array",map_size);
+ int map_maxarray = atom->get_map_maxarray();
+ if (map_maxarray > k_map_array.extent(0))
+ k_map_array = DAT::tdual_int_1d("NeighBond:map_array",map_maxarray);
for (int i=0; i();
@@ -223,7 +226,8 @@ void NeighBondKokkos::build_topology_kk()
map_array = k_map_array.view();
int* sametag_host = atomKK->sametag;
- k_sametag = DAT::tdual_int_1d("NeighBond:sametag",nall);
+ if (nmax > k_sametag.extent(0))
+ k_sametag = DAT::tdual_int_1d("NeighBond:sametag",nmax);
for (int i=0; i();
diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp
index 12b5d65f4a..7d817ffbb1 100644
--- a/src/MC/fix_atom_swap.cpp
+++ b/src/MC/fix_atom_swap.cpp
@@ -771,10 +771,13 @@ double FixAtomSwap::memory_usage()
void FixAtomSwap::write_restart(FILE *fp)
{
int n = 0;
- double list[4];
+ double list[6];
list[n++] = random_equal->state();
list[n++] = random_unequal->state();
- list[n++] = next_reneighbor;
+ list[n++] = ubuf(next_reneighbor).d;
+ list[n++] = nswap_attempts;
+ list[n++] = nswap_successes;
+ list[n++] = ubuf(update->ntimestep).d;
if (comm->me == 0) {
int size = n * sizeof(double);
@@ -798,5 +801,12 @@ void FixAtomSwap::restart(char *buf)
seed = static_cast (list[n++]);
random_unequal->reset(seed);
- next_reneighbor = static_cast (list[n++]);
+ next_reneighbor = (bigint) ubuf(list[n++]).i;
+
+ nswap_attempts = static_cast(list[n++]);
+ nswap_successes = static_cast(list[n++]);
+
+ bigint ntimestep_restart = (bigint) ubuf(list[n++]).i;
+ if (ntimestep_restart != update->ntimestep)
+ error->all(FLERR,"Must not reset timestep when restarting fix atom/swap");
}
diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp
index f1664e3540..7ab0879335 100644
--- a/src/MC/fix_gcmc.cpp
+++ b/src/MC/fix_gcmc.cpp
@@ -2531,10 +2531,19 @@ double FixGCMC::memory_usage()
void FixGCMC::write_restart(FILE *fp)
{
int n = 0;
- double list[4];
+ double list[12];
list[n++] = random_equal->state();
list[n++] = random_unequal->state();
- list[n++] = next_reneighbor;
+ list[n++] = ubuf(next_reneighbor).d;
+ list[n++] = ntranslation_attempts;
+ list[n++] = ntranslation_successes;
+ list[n++] = nrotation_attempts;
+ list[n++] = nrotation_successes;
+ list[n++] = ndeletion_attempts;
+ list[n++] = ndeletion_successes;
+ list[n++] = ninsertion_attempts;
+ list[n++] = ninsertion_successes;
+ list[n++] = ubuf(update->ntimestep).d;
if (comm->me == 0) {
int size = n * sizeof(double);
@@ -2558,7 +2567,20 @@ void FixGCMC::restart(char *buf)
seed = static_cast (list[n++]);
random_unequal->reset(seed);
- next_reneighbor = static_cast (list[n++]);
+ next_reneighbor = (bigint) ubuf(list[n++]).i;
+
+ ntranslation_attempts = list[n++];
+ ntranslation_successes = list[n++];
+ nrotation_attempts = list[n++];
+ nrotation_successes = list[n++];
+ ndeletion_attempts = list[n++];
+ ndeletion_successes = list[n++];
+ ninsertion_attempts = list[n++];
+ ninsertion_successes = list[n++];
+
+ bigint ntimestep_restart = (bigint) ubuf(list[n++]).i;
+ if (ntimestep_restart != update->ntimestep)
+ error->all(FLERR,"Must not reset timestep when restarting fix gcmc");
}
void FixGCMC::grow_molecule_arrays(int nmolatoms) {
diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp
index 1428299eb7..66aed34846 100644
--- a/src/MISC/fix_deposit.cpp
+++ b/src/MISC/fix_deposit.cpp
@@ -798,11 +798,12 @@ void FixDeposit::options(int narg, char **arg)
void FixDeposit::write_restart(FILE *fp)
{
int n = 0;
- double list[4];
+ double list[5];
list[n++] = random->state();
list[n++] = ninserted;
list[n++] = nfirst;
- list[n++] = next_reneighbor;
+ list[n++] = ubuf(next_reneighbor).d;
+ list[n++] = ubuf(update->ntimestep).d;
if (comm->me == 0) {
int size = n * sizeof(double);
@@ -823,7 +824,11 @@ void FixDeposit::restart(char *buf)
seed = static_cast (list[n++]);
ninserted = static_cast (list[n++]);
nfirst = static_cast (list[n++]);
- next_reneighbor = static_cast (list[n++]);
+ next_reneighbor = (bigint) ubuf(list[n++]).i;
+
+ bigint ntimestep_restart = (bigint) ubuf(list[n++]).i;
+ if (ntimestep_restart != update->ntimestep)
+ error->all(FLERR,"Must not reset timestep when restarting this fix");
random->reset(seed);
}
diff --git a/src/Make.sh b/src/Make.sh
index 83880780ec..49a673d8ee 100755
--- a/src/Make.sh
+++ b/src/Make.sh
@@ -55,6 +55,34 @@ style () {
fi
}
+packages () {
+ list=`grep -sl $1 */$2*.h`
+ if (test -e packages_$3.tmp) then
+ rm -f packages_$3.tmp
+ fi
+ for file in $list; do
+ dir="\"`dirname $file`\""
+ echo "#undef PACKAGE" >> packages_$3.tmp
+ echo "#define PACKAGE $dir" >> packages_$3.tmp
+ qfile="\"$file\""
+ echo "#include $qfile" >> packages_$3.tmp
+ done
+ if (test ! -e packages_$3.tmp) then
+ if (test ! -e packages_$3.h) then
+ touch packages_$3.h
+ elif (test "`cat packages_$3.h`" != "") then
+ rm -f packages_$3.h
+ touch packages_$3.h
+ fi
+ elif (test ! -e packages_$3.h) then
+ mv packages_$3.tmp packages_$3.h
+ elif (test "`diff --brief packages_$3.h packages_$3.tmp`" != "") then
+ mv packages_$3.tmp packages_$3.h
+ else
+ rm -f packages_$3.tmp
+ fi
+}
+
# create individual style files
# called by "make machine"
# col 1 = string to search for
@@ -63,28 +91,30 @@ style () {
# col 4 = file that includes the style file
# col 5 = optional 2nd file that includes the style file
-if (test $1 = "style") then
+cmd=$1
- style ANGLE_CLASS angle_ angle force
- style ATOM_CLASS atom_vec_ atom atom atom_vec_hybrid
- style BODY_CLASS body_ body atom_vec_body
- style BOND_CLASS bond_ bond force
- style COMMAND_CLASS "" command input
- style COMPUTE_CLASS compute_ compute modify
- style DIHEDRAL_CLASS dihedral_ dihedral force
- style DUMP_CLASS dump_ dump output write_dump
- style FIX_CLASS fix_ fix modify
- style IMPROPER_CLASS improper_ improper force
- style INTEGRATE_CLASS "" integrate update
- style KSPACE_CLASS "" kspace force
- style MINIMIZE_CLASS min_ minimize update
- style NBIN_CLASS nbin_ nbin neighbor
- style NPAIR_CLASS npair_ npair neighbor
- style NSTENCIL_CLASS nstencil_ nstencil neighbor
- style NTOPO_CLASS ntopo_ ntopo neighbor
- style PAIR_CLASS pair_ pair force
- style READER_CLASS reader_ reader read_dump
- style REGION_CLASS region_ region domain
+if (test $cmd = "style") || (test $cmd = "packages") then
+
+ $cmd ANGLE_CLASS angle_ angle force
+ $cmd ATOM_CLASS atom_vec_ atom atom atom_vec_hybrid
+ $cmd BODY_CLASS body_ body atom_vec_body
+ $cmd BOND_CLASS bond_ bond force
+ $cmd COMMAND_CLASS "" command input
+ $cmd COMPUTE_CLASS compute_ compute modify
+ $cmd DIHEDRAL_CLASS dihedral_ dihedral force
+ $cmd DUMP_CLASS dump_ dump output write_dump
+ $cmd FIX_CLASS fix_ fix modify
+ $cmd IMPROPER_CLASS improper_ improper force
+ $cmd INTEGRATE_CLASS "" integrate update
+ $cmd KSPACE_CLASS "" kspace force
+ $cmd MINIMIZE_CLASS min_ minimize update
+ $cmd NBIN_CLASS nbin_ nbin neighbor
+ $cmd NPAIR_CLASS npair_ npair neighbor
+ $cmd NSTENCIL_CLASS nstencil_ nstencil neighbor
+ $cmd NTOPO_CLASS ntopo_ ntopo neighbor
+ $cmd PAIR_CLASS pair_ pair force
+ $cmd READER_CLASS reader_ reader read_dump
+ $cmd REGION_CLASS region_ region domain
# edit Makefile.lib, for creating non-shared lib
# called by "make makelib"
diff --git a/src/Makefile b/src/Makefile
index 3be4e3e78f..2e6ad9a89f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -205,6 +205,7 @@ gitversion:
-f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@
@if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
@$(SHELL) Make.sh style
+ @$(SHELL) Make.sh packages
@$(MAKE) $(MFLAGS) lmpinstalledpkgs.h gitversion
@echo 'Compiling LAMMPS for machine $@'
@if [ -f MAKE/MACHINES/Makefile.$@ ]; \
diff --git a/src/Purge.list b/src/Purge.list
index a02697d2bf..634c38c58d 100644
--- a/src/Purge.list
+++ b/src/Purge.list
@@ -22,6 +22,30 @@ style_nbin.h
style_npair.h
style_nstencil.h
style_ntopo.h
+# auto-generated packages files
+packages_angle.h
+packages_atom.h
+packages_body.h
+packages_bond.h
+packages_command.h
+packages_compute.h
+packages_dihedral.h
+packages_dump.h
+packages_fix.h
+packages_improper.h
+packages_integrate.h
+packages_kspace.h
+packages_minimize.h
+packages_pair.h
+packages_reader.h
+packages_region.h
+packages_neigh_bin.h
+packages_neigh_pair.h
+packages_neigh_stencil.h
+packages_nbin.h
+packages_npair.h
+packages_nstencil.h
+packages_ntopo.h
# other auto-generated files
lmpinstalledpkgs.h
lmpgitversion.h
diff --git a/src/STUBS/mpi.c b/src/STUBS/mpi.c
index 09bb48ecdc..af7a489bb1 100644
--- a/src/STUBS/mpi.c
+++ b/src/STUBS/mpi.c
@@ -148,12 +148,20 @@ int MPI_Finalize()
double MPI_Wtime()
{
+#if defined(_MSC_VER)
+ double t;
+
+ t = GetTickCount();
+ t /= 1000.0;
+ return t;
+#else
double time;
struct timeval tv;
gettimeofday(&tv,NULL);
time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec;
return time;
+#endif
}
/* ---------------------------------------------------------------------- */
diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp
index c3b03bc5e0..ffc6ac1c70 100644
--- a/src/USER-QUIP/pair_quip.cpp
+++ b/src/USER-QUIP/pair_quip.cpp
@@ -39,11 +39,16 @@ using namespace LAMMPS_NS;
PairQUIP::PairQUIP(LAMMPS *lmp) : Pair(lmp)
{
- single_enable = 0;
- restartinfo = 0;
- one_coeff = 1;
- no_virial_fdotr_compute = 1;
- manybody_flag = 1;
+ single_enable = 0;
+ restartinfo = 0;
+ one_coeff = 1;
+ no_virial_fdotr_compute = 1;
+ manybody_flag = 1;
+
+ map = NULL;
+ quip_potential = NULL;
+ quip_file = NULL;
+ quip_string = NULL;
}
PairQUIP::~PairQUIP()
@@ -52,8 +57,10 @@ PairQUIP::~PairQUIP()
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
- delete [] quip_potential;
}
+ delete [] quip_potential;
+ delete [] quip_file;
+ delete [] quip_string;
}
void PairQUIP::compute(int eflag, int vflag)
@@ -100,14 +107,14 @@ void PairQUIP::compute(int eflag, int vflag)
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
- quip_neigh[iquip] = (jlist[jj] & NEIGHMASK) + 1;
- iquip++;
+ quip_neigh[iquip] = (jlist[jj] & NEIGHMASK) + 1;
+ iquip++;
}
}
atomic_numbers = new int[ntotal];
for (ii = 0; ii < ntotal; ii++)
- atomic_numbers[ii] = map[type[ii]-1];
+ atomic_numbers[ii] = map[type[ii]];
quip_local_e = new double [ntotal];
quip_force = new double [ntotal*3];
@@ -211,17 +218,20 @@ void PairQUIP::compute(int eflag, int vflag)
global settings
------------------------------------------------------------------------- */
-void PairQUIP::settings(int narg, char **/*arg*/)
+void PairQUIP::settings(int narg, char ** /* arg */)
{
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
- if (strcmp(force->pair_style,"hybrid") == 0)
- error->all(FLERR,"Pair style quip is only compatible with hybrid/overlay");
// check if linked to the correct QUIP library API version
// as of 2017-07-19 this is API_VERSION 1
if (quip_lammps_api_version() != 1)
error->all(FLERR,"QUIP LAMMPS wrapper API version is not compatible "
"with this version of LAMMPS");
+
+ // QUIP potentials are parameterized in metal units
+
+ if (strcmp("metal",update->unit_style) != 0)
+ error->all(FLERR,"QUIP potentials require 'metal' units");
}
/* ----------------------------------------------------------------------
@@ -234,48 +244,58 @@ void PairQUIP::allocate()
setflag = memory->create(setflag,n+1,n+1,"pair:setflag");
cutsq = memory->create(cutsq,n+1,n+1,"pair:cutsq");
- map = new int[n];
+ map = new int[n+1];
}
void PairQUIP::coeff(int narg, char **arg)
{
- if (!allocated) allocate();
+ if (!allocated) allocate();
- int n = atom->ntypes;
+ int n = atom->ntypes;
+ if (narg != (4+n)) {
+ char str[1024];
+ sprintf(str,"Number of arguments %d is not correct, it should be %d", narg, 4+n);
+ error->all(FLERR,str);
+ }
// ensure I,J args are * *
- for (int i = 1; i <= n; i++){
- for (int j = 1; j <= n; j++) {
- setflag[i][j] = 1;
+ if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
+ error->all(FLERR,"Incorrect args for pair coefficients");
+
+ n_quip_file = strlen(arg[2]);
+ quip_file = new char[n_quip_file+1];
+ strcpy(quip_file,arg[2]);
+
+ n_quip_string = strlen(arg[3]);
+ quip_string = new char[n_quip_string+1];
+ strcpy(quip_string,arg[3]);
+
+ for (int i = 4; i < narg; i++) {
+ if (strcmp(arg[i],"NULL") == 0)
+ map[i-3] = -1;
+ else
+ map[i-3] = force->inumeric(FLERR,arg[i]);
+ }
+
+ // clear setflag since coeff() called once with I,J = * *
+
+ n = atom->ntypes;
+ for (int i = 1; i <= n; i++)
+ for (int j = i; j <= n; j++)
+ setflag[i][j] = 0;
+
+ // set setflag i,j for type pairs where both are mapped to elements
+
+ 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 (narg != (4+n)) {
- char str[1024];
- sprintf(str,"Number of arguments %d is not correct, it should be %d", narg, 4+n);
- error->all(FLERR,str);
- }
-
- if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
- error->all(FLERR,"Incorrect args for pair coefficients");
-
- n_quip_file = strlen(arg[2]);
- quip_file = new char[n_quip_file+1];
- strcpy(quip_file,arg[2]);
-
- n_quip_string = strlen(arg[3]);
- quip_string = new char[n_quip_string+1];
- strcpy(quip_string,arg[3]);
-
- for (int i = 4; i < narg; i++) {
-
- if (0 == sscanf(arg[i],"%d",&map[i-4])) {
- char str[1024];
- sprintf(str,"Incorrect atomic number %s at position %d",arg[i],i);
- error->all(FLERR,str);
- }
- }
+ if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
// Initialise potential
// First call initialises potential via the fortran code in memory, and returns the necessary size
diff --git a/src/USER-QUIP/pair_quip.h b/src/USER-QUIP/pair_quip.h
index debdc2cb83..216bf0dc28 100644
--- a/src/USER-QUIP/pair_quip.h
+++ b/src/USER-QUIP/pair_quip.h
@@ -26,10 +26,10 @@ extern "C"
{
int quip_lammps_api_version();
void quip_lammps_wrapper(int*, int*, int*, int*,
- int*, int*, int*,
- int*, int*, double*,
- int*, int*, double*,
- double*, double*, double*, double*, double*);
+ int*, int*, int*,
+ int*, int*, double*,
+ int*, int*, double*,
+ double*, double*, double*, double*, double*);
void quip_lammps_potential_initialise(int*, int*, double*, char*, int*, char*, int*);
}
diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp
index b6058b2516..ffe42e37bb 100644
--- a/src/USER-REAXC/reaxc_tool_box.cpp
+++ b/src/USER-REAXC/reaxc_tool_box.cpp
@@ -34,8 +34,16 @@ double t_end;
double Get_Time( )
{
+#if defined(_MSC_VER)
+ double t;
+
+ t = GetTickCount();
+ t /= 1000.0;
+ return t;
+#else
gettimeofday(&tim, NULL );
return( tim.tv_sec + (tim.tv_usec / 1000000.0) );
+#endif
}
int Tokenize( char* s, char*** tok )
diff --git a/src/atom.cpp b/src/atom.cpp
index 34ea253751..dfea9348c9 100644
--- a/src/atom.cpp
+++ b/src/atom.cpp
@@ -39,6 +39,7 @@
#include "math_const.h"
#include "memory.h"
#include "error.h"
+#include "utils.h"
#ifdef LMP_USER_INTEL
#include "neigh_request.h"
@@ -509,7 +510,7 @@ AtomVec *Atom::new_avec(const char *style, int trysuffix, int &sflag)
return avec_creator(lmp);
}
- error->all(FLERR,"Unknown atom style");
+ error->all(FLERR,utils::check_packages_for_style("atom",style,lmp).c_str());
return NULL;
}
diff --git a/src/atom.h b/src/atom.h
index b2a657cf1a..e7c4137959 100644
--- a/src/atom.h
+++ b/src/atom.h
@@ -286,6 +286,7 @@ class Atom : protected Pointers {
inline int* get_map_array() {return map_array;};
inline int get_map_size() {return map_tag_max+1;};
+ inline int get_map_maxarray() {return map_maxarray+1;};
bigint memory_usage();
int memcheck(const char *);
@@ -361,7 +362,7 @@ E: Atom IDs must be used for molecular systems
Atom IDs are used to identify and find partner atoms in bonds.
-E: Unknown atom style
+E: Unrecognized atom style
The choice of atom style is unknown.
diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp
index 893a4c7dc4..d5f286c077 100644
--- a/src/atom_vec_body.cpp
+++ b/src/atom_vec_body.cpp
@@ -25,6 +25,7 @@
#include "fix.h"
#include "memory.h"
#include "error.h"
+#include "utils.h"
using namespace LAMMPS_NS;
@@ -96,7 +97,7 @@ void AtomVecBody::process_args(int narg, char **arg)
#undef BodyStyle
#undef BODY_CLASS
- else error->all(FLERR,"Unknown body style");
+ else error->all(FLERR,utils::check_packages_for_style("body",arg[0],lmp).c_str());
bptr->avec = this;
icp = bptr->icp;
diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h
index 7cc052b6c5..4d02c4b3e0 100644
--- a/src/atom_vec_body.h
+++ b/src/atom_vec_body.h
@@ -130,7 +130,7 @@ E: Invalid atom_style body command
No body style argument was provided.
-E: Unknown body style
+E: Unrecognized body style
The choice of body style is unknown.
diff --git a/src/domain.cpp b/src/domain.cpp
index 4f23423ae8..2e7652a434 100644
--- a/src/domain.cpp
+++ b/src/domain.cpp
@@ -40,6 +40,7 @@
#include "math_const.h"
#include "memory.h"
#include "error.h"
+#include "utils.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@@ -1715,6 +1716,9 @@ void Domain::add_region(int narg, char **arg)
return;
}
+ if (strcmp(arg[1],"none") == 0)
+ error->all(FLERR,"Unrecognized region style 'none'");
+
if (find_region(arg[0]) >= 0) error->all(FLERR,"Reuse of region ID");
// extend Region list if necessary
@@ -1753,12 +1757,10 @@ void Domain::add_region(int narg, char **arg)
}
}
- if (strcmp(arg[1],"none") == 0) error->all(FLERR,"Unknown region style");
if (region_map->find(arg[1]) != region_map->end()) {
RegionCreator region_creator = (*region_map)[arg[1]];
regions[nregion] = region_creator(lmp, narg, arg);
- }
- else error->all(FLERR,"Unknown region style");
+ } else error->all(FLERR,utils::check_packages_for_style("region",arg[1],lmp).c_str());
// initialize any region variables via init()
// in case region is used between runs, e.g. to print a variable
diff --git a/src/domain.h b/src/domain.h
index 9ebdd6ae94..e131d07a1b 100644
--- a/src/domain.h
+++ b/src/domain.h
@@ -269,7 +269,7 @@ E: Reuse of region ID
A region ID cannot be used twice.
-E: Unknown region style
+E: Unrecognized region style
The choice of region style is unknown.
diff --git a/src/force.cpp b/src/force.cpp
index 7ff5096ee4..2691cb3fd8 100644
--- a/src/force.cpp
+++ b/src/force.cpp
@@ -258,9 +258,7 @@ Pair *Force::new_pair(const char *style, int trysuffix, int &sflag)
return pair_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown pair style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("pair",style,lmp).c_str());
return NULL;
}
@@ -373,9 +371,7 @@ Bond *Force::new_bond(const char *style, int trysuffix, int &sflag)
return bond_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown bond style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("bond",style,lmp).c_str());
return NULL;
}
@@ -454,9 +450,7 @@ Angle *Force::new_angle(const char *style, int trysuffix, int &sflag)
return angle_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown angle style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("angle",style,lmp).c_str());
return NULL;
}
@@ -536,9 +530,7 @@ Dihedral *Force::new_dihedral(const char *style, int trysuffix, int &sflag)
return dihedral_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown dihedral style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("dihedral",style,lmp).c_str());
return NULL;
}
@@ -617,9 +609,7 @@ Improper *Force::new_improper(const char *style, int trysuffix, int &sflag)
return improper_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown improper style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("improper",style,lmp).c_str());
return NULL;
}
@@ -702,9 +692,7 @@ KSpace *Force::new_kspace(const char *style, int trysuffix, int &sflag)
return kspace_creator(lmp);
}
- char str[128];
- sprintf(str,"Unknown kspace style %s",style);
- error->all(FLERR,str);
+ error->all(FLERR,utils::check_packages_for_style("kspace",style,lmp).c_str());
return NULL;
}
diff --git a/src/force.h b/src/force.h
index e4bb0f990e..2b4298d049 100644
--- a/src/force.h
+++ b/src/force.h
@@ -159,35 +159,36 @@ class Force : protected Pointers {
E: Must re-specify non-restarted pair style (%s) after read_restart
-UNDOCUMENTED
+For pair styles, that do not store their settings in a restart file,
+it must be defined with a new 'pair_style' command after read_restart.
-E: Unknown pair style %s
+E: Unrecognized pair style %s
-UNDOCUMENTED
+The choice of pair style is unknown.
-E: Unknown bond style %s
+E: Unrecognized bond style %s
-UNDOCUMENTED
+The choice of bond style is unknown.
-E: Unknown angle style %s
+E: Unrecognized angle style %s
-UNDOCUMENTED
+The choice of angle style is unknown.
-E: Unknown dihedral style %s
+E: Unrecognized dihedral style %s
-UNDOCUMENTED
+The choice of dihedral style is unknown.
-E: Unknown improper style %s
+E: Unrecognized improper style %s
-UNDOCUMENTED
+The choice of improper style is unknown.
E: Cannot yet use KSpace solver with grid with comm style tiled
This is current restriction in LAMMPS.
-E: Unknown kspace style %s
+E: Unrecognized kspace style %s
-UNDOCUMENTED
+The choice of kspace style is unknown.
E: Illegal ... command
diff --git a/src/input.cpp b/src/input.cpp
index f88c8ca0c0..0111cb5738 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -50,6 +50,7 @@
#include "accelerator_kokkos.h"
#include "error.h"
#include "memory.h"
+#include "utils.h"
#ifdef _OPENMP
#include
@@ -526,6 +527,11 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
*fmtflag='\0';
}
+ // quick check for proper format string
+
+ if (!utils::strmatch(fmtstr,"%[0-9 ]*\\.[0-9]+[efgEFG]"))
+ error->all(FLERR,"Incorrect conversion in format string");
+
snprintf(immediate,256,fmtstr,variable->compute_equal(var));
value = immediate;
diff --git a/src/input.h b/src/input.h
index 47ad7779f1..33e83bfb06 100644
--- a/src/input.h
+++ b/src/input.h
@@ -173,6 +173,11 @@ E: Unbalanced quotes in input line
No matching end double quote was found following a leading double
quote.
+E: Incorrect conversion in format string
+
+An immediate variable with format suffix was not using
+either a %f, a %g, or a %e conversion in the format suffix.
+
E: Input line quote not followed by white-space
An end quote must be followed by white-space.
diff --git a/src/lammps.cpp b/src/lammps.cpp
index 2b3f001b09..24012c0f18 100644
--- a/src/lammps.cpp
+++ b/src/lammps.cpp
@@ -14,6 +14,8 @@
#include
#include
#include
+#include