From b3a7a534a99b85c97b863f46c13684bf1422fbf2 Mon Sep 17 00:00:00 2001 From: Donatas Surblys Date: Thu, 14 Feb 2019 18:54:59 +0900 Subject: [PATCH 1/3] make fix langevin correctly account for energy with 'zero yes' --- src/fix_langevin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index d829982274..d49ad61371 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -605,6 +605,11 @@ void FixLangevin::post_force_untemplated f[i][0] -= fsumall[0]; f[i][1] -= fsumall[1]; f[i][2] -= fsumall[2]; + if (Tp_TALLY) { + flangevin[i][0] -= fsumall[0]; + flangevin[i][1] -= fsumall[1]; + flangevin[i][2] -= fsumall[2]; + } } } } From 8020f5b9650f078c8aad2ec0c83cf67a02bd0901 Mon Sep 17 00:00:00 2001 From: Donatas Surblys Date: Thu, 14 Feb 2019 18:54:59 +0900 Subject: [PATCH 2/3] remove warning messages when using 'tally yes zero yes' with fix langevin --- src/fix_langevin.cpp | 2 -- src/fix_langevin.h | 6 ------ 2 files changed, 8 deletions(-) diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index d49ad61371..36ea47daf6 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -177,8 +177,6 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } } - if (tallyflag && zeroflag && comm->me == 0) - error->warning(FLERR,"Energy tally does not account for 'zero yes'"); } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 2883ac9ea2..024e7a9539 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -104,12 +104,6 @@ E: Fix langevin period must be > 0.0 The time window for temperature relaxation must be > 0 -W: Energy tally does not account for 'zero yes' - -The energy removed by using the 'zero yes' flag is not accounted -for in the energy tally and thus energy conservation cannot be -monitored in this case. - E: Fix langevin omega requires atom style sphere Self-explanatory. From d0ed6f2bf54354cbaf8ee6e915542b51eb272fb3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 14 Feb 2019 05:45:52 -0500 Subject: [PATCH 3/3] reflect changes to fix langevin also in the manual --- doc/src/Errors_warnings.txt | 6 ------ doc/src/fix_langevin.txt | 4 ---- 2 files changed, 10 deletions(-) diff --git a/doc/src/Errors_warnings.txt b/doc/src/Errors_warnings.txt index 079688c639..47dd597af8 100644 --- a/doc/src/Errors_warnings.txt +++ b/doc/src/Errors_warnings.txt @@ -178,12 +178,6 @@ When using fixes like box/relax, the potential energy used by the minimizer is augmented by an additional energy provided by the fix. Thus the printed converged energy may be different from the total potential energy. :dd -{Energy tally does not account for 'zero yes'} :dt - -The energy removed by using the 'zero yes' flag is not accounted -for in the energy tally and thus energy conservation cannot be -monitored in this case. :dd - {Estimated error in splitting of dispersion coeffs is %g} :dt Error is greater than 0.0001 percent. :dd diff --git a/doc/src/fix_langevin.txt b/doc/src/fix_langevin.txt index 85c97a3436..861eed4a6f 100644 --- a/doc/src/fix_langevin.txt +++ b/doc/src/fix_langevin.txt @@ -217,10 +217,6 @@ the particles. As described below, this energy can then be printed out or added to the potential energy of the system to monitor energy conservation. -NOTE: this accumulated energy does NOT include kinetic energy removed -by the {zero} flag. LAMMPS will print a warning when both options are -active. - The keyword {zero} can be used to eliminate drift due to the thermostat. Because the random forces on different atoms are independent, they do not sum exactly to zero. As a result, this fix