diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d44b3dfb4d..87f3dd1f22 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -45,7 +45,7 @@ src/GPU/pair_vashishta_gpu.* @andeplane src/KOKKOS/pair_vashishta_kokkos.* @andeplane src/MANYBODY/pair_vashishta_table.* @andeplane src/MANYBODY/pair_atm.* @sergeylishchuk -src/USER-MISC/fix_bond_react.* @jrgissing +src/USER-REACTION/fix_bond_react.* @jrgissing src/USER-MISC/*_grem.* @dstelter92 src/USER-MISC/compute_stress_mop*.* @RomainVermorel diff --git a/doc/include-file-conventions.md b/doc/include-file-conventions.md index 132f2ec4eb..1b8e79d71e 100644 --- a/doc/include-file-conventions.md +++ b/doc/include-file-conventions.md @@ -49,22 +49,15 @@ include files provided with LAMMPS are included with double quotes For headers declaring functions of the C-library, the corresponding C++ versions should be included (examples: `#include ` or -`#include `). However, these includes are limited to those defined -in the C++98 standard. Some files thus must use the older style until -the minimum C++ standard requirement of LAMMPS is lifted to C++11 or -even beyond (examples: `#include ` versus `#include ` -or `#include ` versus `#include `). +`#include ` instead of `#include ` or +`#include` ). ### C++ Standard Compliance -LAMMPS core files currently correspond to the C++98 standard. Files -requiring C++11 or later are only permitted in (optional) packages -and particularly packages that are not part of the list of commonly -used packages such as MOLECULE, KSPACE, MANYBODY, or RIGID. - -Also, LAMMPS uses the C-style stdio library for I/O instead of iostreams. -Since using both at the same time can cause problems, iostreams should -be avoided where possible. +LAMMPS core files use standard conforming C++ compatible with the +C++11 standard, unless explicitly noted. Also, LAMMPS uses the C-style +stdio library for I/O instead of iostreams. Since using both at the +same time can cause problems, iostreams should be avoided where possible. ### Lean Header Files diff --git a/doc/src/compute_stress_atom.rst b/doc/src/compute_stress_atom.rst index 48e8b9c69c..b8b3cb0ea1 100644 --- a/doc/src/compute_stress_atom.rst +++ b/doc/src/compute_stress_atom.rst @@ -2,6 +2,7 @@ compute stress/atom command =========================== + compute centroid/stress/atom command ==================================== @@ -223,15 +224,14 @@ The per-atom array values will be in pressure\*volume Restrictions """""""""""" -Currently, compute *centroid/stress/atom* does not support -pair styles with many-body interactions, -such as :doc:`Tersoff `, -and LAMMPS will generate an error in such cases. -In principal, equivalent formulation -to that of angle, dihedral and improper contributions -in the virial :math:`W_{ab}` formula -can also be applied to the many-body pair styles, -and is planned in the future. + +Currently (Spring 2020), compute *centroid/stress/atom* does not support +pair styles with many-body interactions, such as :doc:`Tersoff +`, or pair styles with long-range Coulomb interactions. +LAMMPS will generate an error in such cases. In principal, equivalent +formulation to that of angle, dihedral and improper contributions in the +virial :math:`W_{ab}` formula can also be applied to the many-body pair +styles, and is planned in the future. Related commands """""""""""""""" diff --git a/doc/src/fix_heat.rst b/doc/src/fix_heat.rst index 82a2b6e7f8..5bb6402d46 100644 --- a/doc/src/fix_heat.rst +++ b/doc/src/fix_heat.rst @@ -47,16 +47,22 @@ and the specified geometric :doc:`region ` in order to have energy added or subtracted to it. If not specified, then the atoms in the group are affected wherever they may move to. -Heat addition/subtraction is performed every N timesteps. The *eflux* -parameter can be specified as a numeric constant or as a variable (see -below). If it is a numeric constant or equal-style variable which -evaluates to a scalar value, then the *eflux* determines the change in -aggregate energy of the entire group of atoms per unit time, e.g. in -eV/psec for :doc:`metal units `. In this case it is an -"extensive" quantity, meaning its magnitude should be scaled with the -number of atoms in the group. Note that since *eflux* has per-time -units (i.e. it is a flux), this means that a larger value of N will -add/subtract a larger amount of energy each time the fix is invoked. +Heat addition/subtraction is performed every N timesteps. + +The *eflux* parameter can be specified as a numeric constant or as an +equal- or atom-style :doc:`variable `. If the value is a +variable, it should be specified as v_name, where *name* is the variable +name. In this case, the variable will be evaluated each timestep, and +its current value(s) used to determine the flux. + +If *eflux* is a numeric constant or equal-style variable which evaluates +to a scalar value, then *eflux* determines the change in aggregate energy +of the entire group of atoms per unit time, e.g. in eV/psec for +:doc:`metal units `. In this case it is an "extensive" quantity, +meaning its magnitude should be scaled with the number of atoms in the +group. Note that since *eflux* also has per-time units (i.e. it is a +flux), this means that a larger value of N will add/subtract a larger +amount of energy each time the fix is invoked. .. note:: @@ -71,12 +77,6 @@ the energy flux for a single atom, again in units of energy per unit time. In this case, each value is an "intensive" quantity, which need not be scaled with the number of atoms in the group. -As mentioned above, the *eflux* parameter can be specified as an -equal-style or atom_style :doc:`variable `. If the value is a -variable, it should be specified as v_name, where name is the variable -name. In this case, the variable will be evaluated each timestep, and -its value(s) used to determine the flux. - Equal-style variables can specify formulas with various mathematical functions, and include :doc:`thermo_style ` command keywords for the simulation box parameters and timestep and elapsed diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 6c731b73b3..db01cb8509 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -430,10 +430,17 @@ void PairBuckLongCoulLong::write_data(FILE *fp) void PairBuckLongCoulLong::write_data_all(FILE *fp) { - for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++) - fprintf(fp,"%d %d %g %g %g\n",i,j, - buck_a_read[i][j],buck_rho_read[i][j],buck_c_read[i][j]); + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + if (ewald_order & (1<<6)) { + fprintf(fp,"%d %d %g %g\n",i,j, + buck_a_read[i][j],buck_rho_read[i][j]); + } else { + fprintf(fp,"%d %d %g %g %g\n",i,j, + buck_a_read[i][j],buck_rho_read[i][j],buck_c_read[i][j]); + } + } + } } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 94955d2d6d..ce6b6f57a2 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -427,10 +427,17 @@ void PairLJLongCoulLong::write_data(FILE *fp) void PairLJLongCoulLong::write_data_all(FILE *fp) { - for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++) - fprintf(fp,"%d %d %g %g %g\n",i,j, - epsilon_read[i][j],sigma_read[i][j],cut_lj_read[i][j]); + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + if (ewald_order & (1<<6)) { + fprintf(fp,"%d %d %g %g\n",i,j, + epsilon_read[i][j],sigma_read[i][j]); + } else { + fprintf(fp,"%d %d %g %g %g\n",i,j, + epsilon_read[i][j],sigma_read[i][j],cut_lj_read[i][j]); + } + } + } } /* ---------------------------------------------------------------------- diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index 67d445df92..65ca47c46d 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -300,6 +300,7 @@ double FixHeat::compute_scalar() { double average_scale = scale; if (hstyle == ATOM) { + if (!vscale) return 1.0; double scale_sum = 0.0; int ncount = 0; int *mask = atom->mask; diff --git a/src/hashlittle.h b/src/hashlittle.h index 75380d366b..aafde922b7 100644 --- a/src/hashlittle.h +++ b/src/hashlittle.h @@ -6,7 +6,7 @@ #define LMP_HASHLITTLE_H #include -#include +#include namespace LAMMPS_NS { uint32_t hashlittle(const void *key, size_t length, uint32_t); diff --git a/src/info.cpp b/src/info.cpp index c02a0499fc..9cb6528f7d 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -53,7 +53,7 @@ #ifdef _WIN32 #define PSAPI_VERSION 1 #include -#include // requires C++-11 +#include #include #else #include diff --git a/src/math_special.cpp b/src/math_special.cpp index d4abc36f25..c8aa248910 100644 --- a/src/math_special.cpp +++ b/src/math_special.cpp @@ -1,6 +1,6 @@ #include "math_special.h" #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep using namespace LAMMPS_NS; diff --git a/src/replicate.cpp b/src/replicate.cpp index b3baf47c16..96125d4fe2 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -196,6 +196,12 @@ void Replicate::command(int narg, char **arg) atom->dihedral_per_atom = old->dihedral_per_atom; atom->improper_per_atom = old->improper_per_atom; + atom->extra_bond_per_atom = old->extra_bond_per_atom; + atom->extra_angle_per_atom = old->extra_angle_per_atom; + atom->extra_dihedral_per_atom = old->extra_dihedral_per_atom; + atom->extra_improper_per_atom = old->extra_improper_per_atom; + atom->maxspecial = old->maxspecial; + // store old simulation box int triclinic = domain->triclinic; diff --git a/src/timer.cpp b/src/timer.cpp index 0a5e56ab35..41a0166a89 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -21,7 +21,7 @@ #ifdef _WIN32 #include -#include // requires C++-11 +#include #else #include #include diff --git a/tools/singularity/ubuntu16.04.def b/tools/singularity/ubuntu16.04.def index b6833707a2..ea661cf083 100644 --- a/tools/singularity/ubuntu16.04.def +++ b/tools/singularity/ubuntu16.04.def @@ -8,7 +8,7 @@ From: ubuntu:16.04 apt-get install --no-install-recommends -y \ bc build-essential curl doxygen vim-nox wget \ make cmake cmake-curses-gui ninja-build git \ - rsync ssh \ + rsync ssh less \ ccache gcc g++ gfortran \ mpi-default-bin mpi-default-dev \ libfftw3-dev libjpeg-dev libpng12-dev libblas-dev liblapack-dev \ diff --git a/tools/singularity/ubuntu18.04.def b/tools/singularity/ubuntu18.04.def index 4285f8d3a4..31c14f6830 100644 --- a/tools/singularity/ubuntu18.04.def +++ b/tools/singularity/ubuntu18.04.def @@ -20,15 +20,19 @@ From: ubuntu:18.04 gfortran \ git \ hdf5-tools \ + less \ libblas-dev \ libeigen3-dev \ libenchant-dev \ libfftw3-dev \ libgsl-dev \ libhdf5-serial-dev \ + libhwloc-dev \ libjpeg-dev \ liblapack-dev \ + libomp-dev \ libopenblas-dev \ + libnuma-dev \ libpng-dev \ libproj-dev \ libvtk6-dev \ diff --git a/tools/singularity/ubuntu18.04_amd_rocm.def b/tools/singularity/ubuntu18.04_amd_rocm.def index f653e65130..0338ff3c45 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm.def +++ b/tools/singularity/ubuntu18.04_amd_rocm.def @@ -24,14 +24,18 @@ From: rocm/dev-ubuntu-18.04 gfortran \ git \ hdf5-tools \ + kmod \ + less \ libblas-dev \ libeigen3-dev \ libenchant-dev \ libfftw3-dev \ libgsl-dev \ libhdf5-serial-dev \ + libhwloc-dev \ libjpeg-dev \ liblapack-dev \ + libomp-dev \ libopenblas-dev \ libnuma-dev \ libpng-dev \ @@ -53,6 +57,12 @@ From: rocm/dev-ubuntu-18.04 rocm-libs \ rsync \ ssh \ + texlive \ + texlive-latex-recommended \ + texlive-pictures \ + texlive-publishers \ + texlive-science \ + dvipng \ vim-nox \ virtualenv \ voro++-dev \ diff --git a/tools/singularity/ubuntu18.04_intel_opencl.def b/tools/singularity/ubuntu18.04_intel_opencl.def index 389c75699c..6dabb94cb1 100644 --- a/tools/singularity/ubuntu18.04_intel_opencl.def +++ b/tools/singularity/ubuntu18.04_intel_opencl.def @@ -22,15 +22,19 @@ From: ubuntu:18.04 gfortran \ git \ hdf5-tools \ + less \ libblas-dev \ libeigen3-dev \ libenchant-dev \ libfftw3-dev \ libgsl-dev \ libhdf5-serial-dev \ + libhwloc-dev \ libjpeg-dev \ liblapack-dev \ + libomp-dev \ libopenblas-dev \ + libnuma-dev \ libpng-dev \ libproj-dev \ libvtk6-dev \ @@ -51,6 +55,12 @@ From: ubuntu:18.04 python3-virtualenv \ rsync \ ssh \ + texlive \ + texlive-latex-recommended \ + texlive-pictures \ + texlive-publishers \ + texlive-science \ + dvipng \ vim-nox \ virtualenv \ voro++-dev \ diff --git a/tools/singularity/ubuntu18.04_nvidia.def b/tools/singularity/ubuntu18.04_nvidia.def index 9392821d7e..bec17adf7f 100644 --- a/tools/singularity/ubuntu18.04_nvidia.def +++ b/tools/singularity/ubuntu18.04_nvidia.def @@ -22,15 +22,19 @@ From: nvidia/cuda:10.2-devel-ubuntu18.04 gfortran \ git \ hdf5-tools \ + less \ libblas-dev \ libeigen3-dev \ libenchant-dev \ libfftw3-dev \ libgsl-dev \ libhdf5-serial-dev \ + libhwloc-dev \ libjpeg-dev \ liblapack-dev \ + libomp-dev \ libopenblas-dev \ + libnuma-dev \ libpng-dev \ libproj-dev \ libvtk6-dev \ @@ -51,6 +55,12 @@ From: nvidia/cuda:10.2-devel-ubuntu18.04 python3-virtualenv \ rsync \ ssh \ + texlive \ + texlive-latex-recommended \ + texlive-pictures \ + texlive-publishers \ + texlive-science \ + dvipng \ vim-nox \ virtualenv \ voro++-dev \ diff --git a/tools/singularity/ubuntu20.04.def b/tools/singularity/ubuntu20.04.def index 37c67b9373..028f5a09c7 100644 --- a/tools/singularity/ubuntu20.04.def +++ b/tools/singularity/ubuntu20.04.def @@ -20,16 +20,19 @@ From: ubuntu:20.04 gfortran \ git \ hdf5-tools \ + less \ libblas-dev \ libeigen3-dev \ libenchant-dev \ libfftw3-dev \ libgsl-dev \ libhdf5-serial-dev \ + libhwloc-dev \ libjpeg-dev \ liblapack-dev \ - libopenblas-dev \ libomp-dev \ + libopenblas-dev \ + libnuma-dev \ libpng-dev \ libproj-dev \ libvtk6-dev \