From 461a7afc2256fef7e41a6bcf128a7314d21e9efd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 15:18:17 -0400 Subject: [PATCH 01/17] remove PYTHON from "most" cmake preset. The PYTHON package cannot be compiled without the python development support being installed, so it must not be in the "most" preset --- cmake/presets/most.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index eb26b38928..27ce57621c 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -48,7 +48,6 @@ set(ALL_PACKAGES PHONON PLUGIN POEMS - PYTHON QEQ REACTION REAXFF From 825945f7839fdca4d610de9c53ef0b61b02af95c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 15:18:39 -0400 Subject: [PATCH 02/17] mention that dump sorting is limited to less than 2 billion atoms --- doc/src/dump_modify.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 33f7141762..3f0b99ded9 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -710,7 +710,9 @@ default and it can be disabled with the :code:`checksum` keyword. Restrictions """""""""""" - none + +*dump_modify sort* is not supported for dumps of groups containing +more than 2 billion atoms. Related commands """""""""""""""" From 8e89c7c654d28000d4e987ee379db0fd3f334f99 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 15:19:22 -0400 Subject: [PATCH 03/17] correct unit description of eta_n0 parameters. fixes #3016 --- doc/src/pair_granular.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index b7f9da9f8b..6f84b0d9c7 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -205,7 +205,7 @@ For *damping mass_velocity*, the normal damping is given by: \eta_n = \eta_{n0} m_{eff} Here, :math:`\eta_{n0}` is the damping coefficient specified for the normal -contact model, in units of *mass*\ /\ *time* and +contact model, in units of 1/\ *time* and :math:`m_{eff} = m_i m_j/(m_i + m_j)` is the effective mass. Use *damping mass_velocity* to reproduce the damping behavior of *pair gran/hooke/\**. From 2cd862e4a21acfc3c91e5f6d3b6f81e5387f1621 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 15:20:29 -0400 Subject: [PATCH 04/17] Update lebedeva potential file and docs based on email on mailing list https://matsci.org/t/lammps-users-webpage-and-parameter-file-for-the-lebedeva-potential/39059 --- doc/src/pair_lebedeva_z.rst | 51 +++++++++++++++---- doc/utils/sphinx-config/false_positives.txt | 3 ++ potentials/CC.Lebedeva | 11 ++-- .../tests/manybody-pair-lebedeva_z.yaml | 2 +- 4 files changed, 50 insertions(+), 17 deletions(-) diff --git a/doc/src/pair_lebedeva_z.rst b/doc/src/pair_lebedeva_z.rst index 5afd0da92c..5d8d3aa7fd 100644 --- a/doc/src/pair_lebedeva_z.rst +++ b/doc/src/pair_lebedeva_z.rst @@ -26,15 +26,29 @@ Examples Description """"""""""" -The *lebedeva/z* style computes the Lebedeva interaction -potential as described in :ref:`(Lebedeva et al.) `. An important simplification is made, -which is to take all normals along the z-axis. +The *lebedeva/z* pair style computes the Lebedeva interaction potential +as described in :ref:`(Lebedeva1) ` and :ref:`(Lebedeva2) +`. An important simplification is made, which is to take all +normals along the z-axis. + +The Lebedeva potential is intended for the description of the interlayer +interaction between graphene layers. To perform a realistic simulation, +this potential must be used in combination with an intralayer potential +such as :doc:`AIREBO ` or :doc:`Tersoff ` +facilitated by using pair style :doc:`hybrid/overlay `. To +keep the intralayer properties unaffected, the interlayer interaction +within the same layers should be avoided. This can be achieved by +assigning different atom types to atoms of different layers (e.g. 1 and +2 in the examples above). + +Other interactions can be set to zero using pair_style *none*\ . + .. math:: - E = & \frac{1}{2} \sum_i \sum_{i \neq j} V_{ij}\\ + E = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij}\\ V_{ij} = & B e^{-\alpha(r_{ij} - z_0)} \\ - & + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij} e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\ + & + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij}) e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\ & - A \left(\frac{z_0}{r_ij}\right)^6 + A \left( \frac{z_0}{r_c} \right)^6 \\ \rho^2_{ij} = & x^2_{ij} + y^2_{ij} \qquad (\mathbf{n_i} \equiv \mathbf{\hat{z}}) @@ -43,12 +57,15 @@ Energies are shifted so that they go continuously to zero at the cutoff assuming that the exponential part of :math:`V_{ij}` (first term) decays sufficiently fast. This shift is achieved by the last term in the equation for :math:`V_{ij}` above. -The parameter file (e.g. CC.Lebedeva), is intended for use with metal -:doc:`units `, with energies in meV. An additional parameter, *S*, -is available to facilitate scaling of energies. +The provided parameter file (CC.Lebedeva) contains two sets of parameters. -This potential must be used in combination with hybrid/overlay. -Other interactions can be set to zero using pair_style *none*\ . +- The first set (element name "C") is suitable for normal conditions and + is taken from :ref:`(Popov1) ` +- The second set (element name "C1") is suitable for high-pressure + conditions and is taken from :ref:`(Koziol1) ` + +Both sets contain an additional parameter, *S*, that can be used to +facilitate scaling of energies and is set to 1.0 by default. Restrictions """""""""""" @@ -77,4 +94,16 @@ none .. _Leb01: -**(Lebedeva et al.)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011) +**(Lebedeva1)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011) + +.. _Leb02: + +**(Lebedeva2)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Physica E: 44, 949-954 (2012) + +.. _Popov: + +**(Popov1)** A.M. Popov, I. V. Lebedeva, A. A. Knizhnik, Y. E. Lozovik and B. V. Potapkin, Chem. Phys. Lett. 536, 82-86 (2012). + +.. _Koziol: + +**(Koziol1)** Z. Koziol, G. Gawlik and J. Jagielski, Chinese Phys. B 28, 096101 (2019). diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d295767519..826f5a6bd5 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1125,6 +1125,7 @@ gaussian gaussians Gaussians Gavhane +Gawlik gayberne gcc gcmc @@ -1483,6 +1484,7 @@ Izz Jacobsen Jadhao Jadhav +Jagielski jagreat Jahn Jalalvand @@ -1609,6 +1611,7 @@ Koslowski Kosovan Koster Kosztin +Koziol Kp kradius Kraker diff --git a/potentials/CC.Lebedeva b/potentials/CC.Lebedeva index bc2db03f6b..bc70500687 100644 --- a/potentials/CC.Lebedeva +++ b/potentials/CC.Lebedeva @@ -1,12 +1,13 @@ -# DATE: 2018-11-28 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162 +# DATE: 2021-11-04 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162 # -# Lebedeva Potential. https://doi.org/10.1016/j.physe.2011.07.018 +# Lebedeva potential: https://doi.org/10.1039/C0CP02614J and https://doi.org/10.1016/j.physe.2011.07.018 # Parameters must be in this order as here, otherwise their values may be changed. +# Energies here are given in meV. # The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C # A B C z0 alpha D1 D2 lambda1 lambda2 S -# These are values according to Levedeva et al -#C C 10.510 11.6523.34 35.883 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0 +# These are values according to Lebedeva et al.: https://doi.org/10.1016/j.cplett.2012.03.082 +C C 10.510 11.652 29.5 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0 # # These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162 -C C 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0 +C1 C1 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0 diff --git a/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml b/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml index 5caeee3dca..84b44bcb0a 100644 --- a/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml +++ b/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml @@ -14,7 +14,7 @@ post_commands: ! "" input_file: in.bilayer pair_style: hybrid/overlay lebedeva/z 16.0 pair_coeff: ! | - * * lebedeva/z CC.Lebedeva C C C + * * lebedeva/z CC.Lebedeva C1 C1 C1 extract: ! "" natoms: 48 init_vdwl: 2360.887727742073 From 1a940e052e970b065a4c6b44a98aa8b1e8914bf3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 15:55:28 -0400 Subject: [PATCH 05/17] add support for and apply clang-format to lammps-shell code --- tools/lammps-shell/.clang-format | 1 + tools/lammps-shell/lammps-shell.cpp | 35 +++++++++++++---------------- 2 files changed, 16 insertions(+), 20 deletions(-) create mode 120000 tools/lammps-shell/.clang-format diff --git a/tools/lammps-shell/.clang-format b/tools/lammps-shell/.clang-format new file mode 120000 index 0000000000..a20dd6aac4 --- /dev/null +++ b/tools/lammps-shell/.clang-format @@ -0,0 +1 @@ +../../unittest/.clang-format \ No newline at end of file diff --git a/tools/lammps-shell/lammps-shell.cpp b/tools/lammps-shell/lammps-shell.cpp index d03e1da70b..19730b8552 100644 --- a/tools/lammps-shell/lammps-shell.cpp +++ b/tools/lammps-shell/lammps-shell.cpp @@ -10,8 +10,8 @@ #include "utils.h" #include -#include #include +#include #include #include @@ -33,9 +33,9 @@ using namespace LAMMPS_NS; -void *lmp = nullptr; -char *omp_threads = nullptr; -constexpr int BUFLEN = 512; +void *lmp = nullptr; +char *omp_threads = nullptr; +constexpr int BUFLEN = 512; char buf[BUFLEN]; enum { @@ -342,14 +342,13 @@ static char *plugin_generator(const char *text, int state) { const char *subcmd[] = {"load", "unload", "list", "clear", nullptr}; const char *sub; - static std::size_t idx=0, len; + static std::size_t idx = 0, len; if (!state) idx = 0; len = strlen(text); while ((sub = subcmd[idx]) != nullptr) { ++idx; - if (strncmp(text,sub,len) == 0) - return dupstring(sub); + if (strncmp(text, sub, len) == 0) return dupstring(sub); } return nullptr; } @@ -358,13 +357,12 @@ static char *plugin_style_generator(const char *text, int state) { const char *styles[] = {"pair", "fix", "command", nullptr}; const char *s; - static std::size_t idx=0, len; + static std::size_t idx = 0, len; if (!state) idx = 0; len = strlen(text); while ((s = styles[idx]) != nullptr) { ++idx; - if (strncmp(text,s,len) == 0) - return dupstring(s); + if (strncmp(text, s, len) == 0) return dupstring(s); } return nullptr; } @@ -376,7 +374,7 @@ static char *plugin_name_generator(const char *text, int state) static std::size_t idx, len, nmax; if (!state) idx = 0; - len = words[3].size(); + len = words[3].size(); nmax = lammps_plugin_count(); while (idx < nmax) { @@ -384,8 +382,7 @@ static char *plugin_name_generator(const char *text, int state) lammps_plugin_name(idx, style, name, BUFLEN); ++idx; if (words[2] == style) { - if (strncmp(name, words[3].c_str(), len) == 0) - return dupstring(name); + if (strncmp(name, words[3].c_str(), len) == 0) return dupstring(name); } } return nullptr; @@ -527,13 +524,11 @@ static char **cmd_completion(const char *text, int start, int) } else if (words.size() == 2) { // expand third word // these commands have a group name as 3rd word - if ((words[0] == "fix") - || (words[0] == "compute") - || (words[0] == "dump")) { + if ((words[0] == "fix") || (words[0] == "compute") || (words[0] == "dump")) { matches = rl_completion_matches(text, group_generator); } else if (words[0] == "region") { matches = rl_completion_matches(text, region_generator); - // plugin style is the third word + // plugin style is the third word } else if ((words[0] == "plugin") && (words[1] == "unload")) { matches = rl_completion_matches(text, plugin_style_generator); } @@ -546,7 +541,7 @@ static char **cmd_completion(const char *text, int start, int) matches = rl_completion_matches(text, compute_generator); } else if (words[0] == "dump") { matches = rl_completion_matches(text, dump_generator); - // plugin name is the fourth word + // plugin name is the fourth word } else if ((words[0] == "plugin") && (words[1] == "unload")) { matches = rl_completion_matches(rl_line_buffer, plugin_name_generator); } @@ -599,7 +594,7 @@ static void init_commands() // read saved history, but not in test mode. if (!test_mode) read_history(".lammps_history"); - // intercept CTRL-C + // intercept CTRL-C #if defined(_WIN32) SetConsoleCtrlHandler(ctrl_c_handler, TRUE); #else @@ -736,7 +731,7 @@ int main(int argc, char **argv) // switch to the user's documents directory. auto curdir = platform::current_directory(); - if (utils::strmatch(curdir,"[Ss]ystem32")) { + if (utils::strmatch(curdir, "[Ss]ystem32")) { std::string docdir = getenv("HOMEDRIVE"); docdir += getenv("HOMEPATH"); docdir += "\\Documents"; From b3c5f6a4fd0ef45ad1aeca19c5835b4d11a66e08 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 4 Nov 2021 16:48:29 -0400 Subject: [PATCH 06/17] whitespace --- doc/src/pair_lebedeva_z.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/pair_lebedeva_z.rst b/doc/src/pair_lebedeva_z.rst index 5d8d3aa7fd..80fe1c52cb 100644 --- a/doc/src/pair_lebedeva_z.rst +++ b/doc/src/pair_lebedeva_z.rst @@ -102,8 +102,8 @@ none .. _Popov: -**(Popov1)** A.M. Popov, I. V. Lebedeva, A. A. Knizhnik, Y. E. Lozovik and B. V. Potapkin, Chem. Phys. Lett. 536, 82-86 (2012). +**(Popov1)** A.M. Popov, I. V. Lebedeva, A. A. Knizhnik, Y. E. Lozovik and B. V. Potapkin, Chem. Phys. Lett. 536, 82-86 (2012). .. _Koziol: -**(Koziol1)** Z. Koziol, G. Gawlik and J. Jagielski, Chinese Phys. B 28, 096101 (2019). +**(Koziol1)** Z. Koziol, G. Gawlik and J. Jagielski, Chinese Phys. B 28, 096101 (2019). From d1403c62c84e8cd76e2512558734b91c192aaa41 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Nov 2021 10:56:54 -0400 Subject: [PATCH 07/17] update restrictions note for dump_modify --- doc/src/dump_modify.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 3f0b99ded9..da7ccffeb2 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -711,8 +711,8 @@ default and it can be disabled with the :code:`checksum` keyword. Restrictions """""""""""" -*dump_modify sort* is not supported for dumps of groups containing -more than 2 billion atoms. +Not all *dump_modify* options can be applied to all dump styles. +Details are in the discussions of the individual options. Related commands """""""""""""""" From 49258e93017b3f009dbe3625fcaa67b1c3ed6224 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Nov 2021 16:19:19 -0400 Subject: [PATCH 08/17] add missing assignment --- src/verlet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verlet.cpp b/src/verlet.cpp index aa180f5644..342dc3d951 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -54,7 +54,7 @@ void Verlet::init() bool do_time_integrate = false; for (const auto &fix : modify->get_fix_list()) - if (fix->time_integrate) do_time_integrate; + if (fix->time_integrate) do_time_integrate = true; if (!do_time_integrate && (comm->me == 0)) error->warning(FLERR,"No fixes with time integration, atoms won't move"); From 7c5640c1c935e996c08a811b4638d9fd80cf05f2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Nov 2021 16:27:58 -0400 Subject: [PATCH 09/17] we may call ->set_molecule() only in MOLECULE mode --- src/fix_deposit.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index c18a0e23dd..034cecd55a 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -569,10 +569,12 @@ void FixDeposit::pre_exchange() // coord is new position of geometric center of mol, not COM // FixShake::set_molecule stores shake info for molecule - if (rigidflag) - fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); - else if (shakeflag) - fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); + if (mode == MOLECULE) { + if (rigidflag) + fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); + else if (shakeflag) + fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat); + } success = 1; break; From 16c50b3873c1988f9aa70ffd1e29f8c62229fa3c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Nov 2021 08:27:25 -0500 Subject: [PATCH 10/17] whitespace --- unittest/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 46f1865989..f333da1e5c 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -7,7 +7,7 @@ add_test(NAME RunLammps COMMAND $ -log none -echo none -in in.empty WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(RunLammps PROPERTIES - ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" + ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION "LAMMPS \\([0-9]+ [A-Za-z]+ 2[0-9][0-9][0-9]( - Update [0-9]+)?\\)") # check if the compiled executable will print the help message @@ -15,7 +15,7 @@ add_test(NAME HelpMessage COMMAND $ -h WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(HelpMessage PROPERTIES - ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" + ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION ".*Large-scale Atomic/Molecular Massively Parallel Simulator -.*Usage example:.*") # check if the compiled executable will error out on an invalid command line flag @@ -23,7 +23,7 @@ add_test(NAME InvalidFlag COMMAND $ -xxx WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(InvalidFlag PROPERTIES - ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" + ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION "ERROR: Invalid command-line argument.*") if(BUILD_MPI) From ac6654cf0c16f64b22b0da4c6ae2c04ad7b7881d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Nov 2021 08:28:16 -0500 Subject: [PATCH 11/17] skip MPI tests if they would be oversubscribing the available processors --- unittest/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index f333da1e5c..55063d56c8 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -31,6 +31,10 @@ if(BUILD_MPI) set(MPI_TEST_NUM_PROCS 1) set(MPI_TEST_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) cmake_parse_arguments(MPI_TEST "" "NAME;NUM_PROCS;WORKING_DIRECTORY" "COMMAND" ${ARGN}) + # Do not add test when oversubscribing + if(MPI_TEST_NUMPROCS GREATER MPIEXEC_MAX_NUMPROCS) + return() + endif() list(GET MPI_TEST_COMMAND 0 EXECUTABLE) list(REMOVE_AT MPI_TEST_COMMAND 0) set(ARGS ${MPI_TEST_COMMAND}) From 25db8a21bc8c58c7ec50f5acd79828733f421f5d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 7 Nov 2021 08:29:16 -0500 Subject: [PATCH 12/17] account for increased floating point errors when summing numbers to zero --- unittest/commands/test_groups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/commands/test_groups.cpp b/unittest/commands/test_groups.cpp index 0c8a7cd83c..52b93fe742 100644 --- a/unittest/commands/test_groups.cpp +++ b/unittest/commands/test_groups.cpp @@ -246,7 +246,7 @@ TEST_F(GroupTest, Molecular) ASSERT_DOUBLE_EQ(group->mass(group->find("half")), 40); ASSERT_DOUBLE_EQ(group->mass(group->find("half"), domain->find_region("top")), 10); ASSERT_NEAR(group->charge(group->find("top")), 0, 1.0e-14); - ASSERT_DOUBLE_EQ(group->charge(group->find("right"), domain->find_region("top")), 0); + ASSERT_NEAR(group->charge(group->find("right"), domain->find_region("top")), 0, 1.0e-14); TEST_FAILURE(".*ERROR: Illegal group command.*", command("group three include xxx");); } From ed8c86d248a9cecbc811e8f3d52b9b8f05f9187d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Nov 2021 10:46:09 -0500 Subject: [PATCH 13/17] correct uninitialized data access bug due to shadowing of a base class member --- src/EXTRA-COMPUTE/compute_temp_rotate.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_temp_rotate.h b/src/EXTRA-COMPUTE/compute_temp_rotate.h index afa14000b8..af218e756c 100644 --- a/src/EXTRA-COMPUTE/compute_temp_rotate.h +++ b/src/EXTRA-COMPUTE/compute_temp_rotate.h @@ -43,7 +43,6 @@ class ComputeTempRotate : public Compute { double memory_usage(); private: - int fix_dof; double tfactor, masstotal; double **vbiasall; // stored velocity bias for all atoms int maxbias; // size of vbiasall array From d0a4c4467fadd5bf2eece128b8d9db91150de100 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Nov 2021 13:53:52 -0500 Subject: [PATCH 14/17] replace replicated functionality with shared code in base class --- src/DRUDE/compute_temp_drude.cpp | 4 +--- src/DRUDE/compute_temp_drude.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/DRUDE/compute_temp_drude.cpp b/src/DRUDE/compute_temp_drude.cpp index 940a7e5328..96344751a7 100644 --- a/src/DRUDE/compute_temp_drude.cpp +++ b/src/DRUDE/compute_temp_drude.cpp @@ -89,9 +89,7 @@ void ComputeTempDrude::dof_compute() int dim = domain->dimension; int *drudetype = fix_drude->drudetype; - fix_dof = 0; - for (int i = 0; i < modify->nfix; i++) - fix_dof += modify->fix[i]->dof(igroup); + adjust_dof_fix(); bigint dof_core_loc = 0, dof_drude_loc = 0; for (int i = 0; i < nlocal; i++) { diff --git a/src/DRUDE/compute_temp_drude.h b/src/DRUDE/compute_temp_drude.h index cef5d8664e..e1cd54edc8 100644 --- a/src/DRUDE/compute_temp_drude.h +++ b/src/DRUDE/compute_temp_drude.h @@ -35,7 +35,6 @@ class ComputeTempDrude : public Compute { int modify_param(int, char **); private: - int fix_dof; class FixDrude *fix_drude; char *id_temp; class Compute *temperature; From d576b69dbce405cf16958ad3775ef122607144c1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Nov 2021 21:41:08 -0500 Subject: [PATCH 15/17] plug memory leaks --- src/MACHDYN/compute_smd_triangle_vertices.cpp | 2 +- src/MACHDYN/pair_smd_ulsph.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MACHDYN/compute_smd_triangle_vertices.cpp b/src/MACHDYN/compute_smd_triangle_vertices.cpp index 016ae3e85f..89a2a24b89 100644 --- a/src/MACHDYN/compute_smd_triangle_vertices.cpp +++ b/src/MACHDYN/compute_smd_triangle_vertices.cpp @@ -53,7 +53,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch /* ---------------------------------------------------------------------- */ ComputeSMDTriangleVertices::~ComputeSMDTriangleVertices() { - memory->sfree(outputVector); + memory->destroy(outputVector); } /* ---------------------------------------------------------------------- */ diff --git a/src/MACHDYN/pair_smd_ulsph.cpp b/src/MACHDYN/pair_smd_ulsph.cpp index 0958cbc7c3..e9eac13126 100644 --- a/src/MACHDYN/pair_smd_ulsph.cpp +++ b/src/MACHDYN/pair_smd_ulsph.cpp @@ -85,7 +85,8 @@ PairULSPH::PairULSPH(LAMMPS *lmp) : PairULSPH::~PairULSPH() { if (allocated) { - //printf("... deallocating\n"); + memory->destroy(setflag); + memory->destroy(cutsq); memory->destroy(Q1); memory->destroy(rho0); memory->destroy(eos); From 2b480f87f1a548267a8adacc69864a591cab40ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Nov 2021 21:48:33 -0500 Subject: [PATCH 16/17] fix segfault when using atom style smd as part of a hybrid style also remove redundant for clearing --- src/MACHDYN/atom_vec_smd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/MACHDYN/atom_vec_smd.cpp b/src/MACHDYN/atom_vec_smd.cpp index b798425e19..81f32ca0a2 100644 --- a/src/MACHDYN/atom_vec_smd.cpp +++ b/src/MACHDYN/atom_vec_smd.cpp @@ -115,6 +115,7 @@ void AtomVecSMD::grow_pointers() vfrac = atom->vfrac; rmass = atom->rmass; x0 = atom->x0; + x = atom->x; radius = atom->radius; contact_radius = atom->contact_radius; molecule = atom->molecule; @@ -129,13 +130,11 @@ void AtomVecSMD::grow_pointers() /* ---------------------------------------------------------------------- clear extra forces starting at atom N nbytes = # of bytes to clear for a per-atom vector - NOTE: does f need to be re-cleared? ------------------------------------------------------------------------- */ void AtomVecSMD::force_clear(int n, size_t nbytes) { memset(&desph[n],0,nbytes); - memset(&f[n][0],0,3*nbytes); } /* ---------------------------------------------------------------------- From ef30e3bd35b0fd6268ed3427cdd42edac0db5b60 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Nov 2021 06:58:44 -0500 Subject: [PATCH 17/17] clarifications and corrections for the discussion of the main git branches --- doc/src/Howto_github.rst | 3 ++- doc/src/Install_git.rst | 29 ++++++++++++++++------------- doc/src/Manual_version.rst | 24 ++++++++++++++++-------- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/doc/src/Howto_github.rst b/doc/src/Howto_github.rst index 278b9e4bfd..315bacac69 100644 --- a/doc/src/Howto_github.rst +++ b/doc/src/Howto_github.rst @@ -141,7 +141,8 @@ unrelated feature, you should switch branches! Committing changes to the *develop*, *release*, or *stable* branches is strongly discouraged. While it may be convenient initially, it will create more work in the long run. Various texts and tutorials - on using git effectively discuss the motivation for this. + on using git effectively discuss the motivation for using feature + branches instead. **After changes are made** diff --git a/doc/src/Install_git.rst b/doc/src/Install_git.rst index 7ad6ca18c1..a5dc19fe79 100644 --- a/doc/src/Install_git.rst +++ b/doc/src/Install_git.rst @@ -28,8 +28,9 @@ provides `limited support for subversion clients `_. You can follow the LAMMPS development on 3 different git branches: -* **stable** : this branch is updated with every stable release; - updates are always "fast forward" merges from *develop* +* **stable** : this branch is updated from the *release* branch with + every stable release version and also has selected bug fixes and updates + back-ported from the *develop* branch * **release** : this branch is updated with every patch release; updates are always "fast forward" merges from *develop* * **develop** : this branch follows the ongoing development and @@ -47,20 +48,22 @@ your machine and "release" is one of the 3 branches listed above. (Note that you actually download all 3 branches; you can switch between them at any time using "git checkout ".) -.. note:: +.. admonition:: Saving time and disk space when using ``git clone`` The complete git history of the LAMMPS project is quite large because it contains the entire commit history of the project since fall 2006, - which includes the time when LAMMPS was managed with subversion. This - also includes commits that have added and removed some large files - (mostly by accident). If you do not need access to the entire commit - history, you can speed up the "cloning" process and reduce local disk - space requirements by using the *--depth* git command line flag thus - create a "shallow clone" of the repository that contains only a - subset of the git history. Using a depth of 1000 is usually sufficient - to include the head commits of the *develop* and the *release* branches. - To include the head commit of the *stable* branch you may need a depth - of up to 10000. + which includes the time when LAMMPS was managed with subversion. + This includes a few commits that have added and removed some large + files (mostly by accident). If you do not need access to the entire + commit history (most people don't), you can speed up the "cloning" + process and reduce local disk space requirements by using the + *--depth* git command line flag. That will create a "shallow clone" + of the repository containing only a subset of the git history. Using + a depth of 1000 is usually sufficient to include the head commits of + the *develop* and the *release* branches. To include the head commit + of the *stable* branch you may need a depth of up to 10000. If you + later need more of the git history, you can always convert the + shallow clone into a "full clone". Once the command completes, your directory will contain the same files as if you unpacked a current LAMMPS tarball, with the exception, that diff --git a/doc/src/Manual_version.rst b/doc/src/Manual_version.rst index b705ce8c4a..78ed61cd7c 100644 --- a/doc/src/Manual_version.rst +++ b/doc/src/Manual_version.rst @@ -10,23 +10,31 @@ Whenever we fix a bug or update or add a feature, it will be merged into the *develop* branch of the git repository. When a sufficient number of changes have accumulated *and* the software passes a set of automated tests, we release it in the next *patch* release, which are made every -few weeks. Info on patch releases are on `this website page +few weeks. The *release* branch of the git repository is updated with +every such release. Info on patch releases are on `this website page `_. -Once or twice a year, only bug fixes and small, non-intrusive changes are -included for a period of time, and the code is subjected to more detailed +Once or twice a year, we apply only bug fixes and small, non-intrusive +changes to the *develop* branch and the code is subjected to more detailed and thorough testing than the default automated testing. The latest -patch release after such a period is then labeled as a *stable* version. +patch release after such a period is then also labeled as a *stable* version +and the *stable* branch is updated with it. Between stable releases +we occasionally release some updates to the stable release containing +only bug fixes and updates back-ported from *develop* but no new features +and update the *stable* branch accordingly. -Each version of LAMMPS contains all the features and bug-fixes up to -and including its version date. +Each version of LAMMPS contains all the documented features up to and +including its version date. The version date is printed to the screen and logfile every time you run LAMMPS. It is also in the file src/version.h and in the LAMMPS directory name created when you unpack a tarball. And it is on the first page of the :doc:`manual `. -* If you browse the HTML pages on the LAMMPS WWW site, they always - describe the most current patch release of LAMMPS. +* If you browse the HTML pages on the LAMMPS WWW site, they will by + default describe the most current patch release version of LAMMPS. + In the navigation bar on the bottom left, there is the option to + view instead the documentation for the most recent *stable* version + or the latest version from the current development branch. * If you browse the HTML pages included in your tarball, they describe the version you have, which may be older.