From 036647c10257a635991cdf3ecb00eafce04c663b Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Tue, 19 Jun 2018 16:19:37 -0400
Subject: [PATCH] correct sign of virial tally in fix smd. issue reported by
 Dinesh SD on lammps-users

---
 src/USER-MISC/fix_smd.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp
index fb22483a07..a42690c280 100644
--- a/src/USER-MISC/fix_smd.cpp
+++ b/src/USER-MISC/fix_smd.cpp
@@ -270,12 +270,12 @@ void FixSMD::smd_tether()
         ftotal[2] -= fz*massfrac;
         if (evflag) {
           domain->unmap(x[i],image[i],unwrap);
-          v[0] = fx*massfrac*unwrap[0];
-          v[1] = fy*massfrac*unwrap[1];
-          v[2] = fz*massfrac*unwrap[2];
-          v[3] = fx*massfrac*unwrap[1];
-          v[4] = fx*massfrac*unwrap[2];
-          v[5] = fy*massfrac*unwrap[2];
+          v[0] = -fx*massfrac*unwrap[0];
+          v[1] = -fy*massfrac*unwrap[1];
+          v[2] = -fz*massfrac*unwrap[2];
+          v[3] = -fx*massfrac*unwrap[1];
+          v[4] = -fx*massfrac*unwrap[2];
+          v[5] = -fy*massfrac*unwrap[2];
           v_tally(i, v);
         }
       }
@@ -291,12 +291,12 @@ void FixSMD::smd_tether()
         ftotal[2] -= fz*massfrac;
         if (evflag) {
           domain->unmap(x[i],image[i],unwrap);
-          v[0] = fx*massfrac*unwrap[0];
-          v[1] = fy*massfrac*unwrap[1];
-          v[2] = fz*massfrac*unwrap[2];
-          v[3] = fx*massfrac*unwrap[1];
-          v[4] = fx*massfrac*unwrap[2];
-          v[5] = fy*massfrac*unwrap[2];
+          v[0] = -fx*massfrac*unwrap[0];
+          v[1] = -fy*massfrac*unwrap[1];
+          v[2] = -fz*massfrac*unwrap[2];
+          v[3] = -fx*massfrac*unwrap[1];
+          v[4] = -fx*massfrac*unwrap[2];
+          v[5] = -fy*massfrac*unwrap[2];
           v_tally(i, v);
         }
       }
-- 
GitLab