From d0ba8e1dcbe7527914a6f5bb1dc74bf4fda8c5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Trnka?= Date: Wed, 6 Jun 2018 17:24:26 +0200 Subject: [PATCH] Make omega_mass proportional to (N+1)kT According to papers like Martyna, Tobias, Klein (JCP 1994, doi:10.1063/1.467468 section II.F) and Martyna, Tuckerman, Tobias, Klein (Mol. Phys. 1996, doi:10.1080/00268979600100761 section 2.5), the mass of the cell parameters should be proportional to (Ndof + dim) / dim, or in other words, Natoms + 1. --- src/fix_nh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 186376d952..170fd9db16 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -798,7 +798,7 @@ void FixNH::setup(int vflag) if (pstat_flag) { double kt = boltz * t_target; - double nkt = atom->natoms * kt; + double nkt = (atom->natoms + 1) * kt; for (int i = 0; i < 3; i++) if (p_flag[i]) @@ -1826,7 +1826,7 @@ void FixNH::nhc_press_integrate() // Update masses, to preserve initial freq, if flag set if (omega_mass_flag) { - double nkt = atom->natoms * kt; + double nkt = (atom->natoms + 1) * kt; for (int i = 0; i < 3; i++) if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);