From 5b842f0010a7e930a716c59b3c1c81ef17285057 Mon Sep 17 00:00:00 2001
From: dstelter92 <dstelter@bu.edu>
Date: Mon, 20 Mar 2017 09:15:48 -0400
Subject: [PATCH] Teff and exchange bugfix, as per Greg Dignon to match python
 examples

---
 src/USER-MISC/temper_grem.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp
index 28fea49689..6ce7da8d6a 100644
--- a/src/USER-MISC/temper_grem.cpp
+++ b/src/USER-MISC/temper_grem.cpp
@@ -283,8 +283,8 @@ void TemperGrem::command(int narg, char **arg)
       // compute weights
       volume = domain->xprd * domain->yprd * domain->zprd;
       enth = pe + (pressref * volume);
-      weight = log(set_lambda[my_set_lambda] + (eta*(enth + h0)));
-      weight_cross = log(set_lambda[partner_set_lambda] + (eta*(enth + h0)));
+      weight = log(set_lambda[my_set_lambda] + (eta*(enth - h0)));
+      weight_cross = log(set_lambda[partner_set_lambda] + (eta*(enth - h0)));
 
       if (me_universe > partner) {
         MPI_Send(&weight,1,MPI_DOUBLE,partner,0,universe->uworld);
@@ -296,7 +296,7 @@ void TemperGrem::command(int narg, char **arg)
       }
 
       if (me_universe < partner) {
-        boltz_factor = (weight - weight_partner + weight_cross - weight_cross_partner) *
+        boltz_factor = (weight + weight_partner - weight_cross - weight_cross_partner) *
             (1 / (boltz * eta));
         if (boltz_factor >= 0.0) swap = 1;
         else if (ranboltz->uniform() < exp(boltz_factor)) swap = 1;
-- 
GitLab