From 6d849fea0e361c349098e9d5b747b903ac8e9e45 Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Mon, 10 Oct 2011 16:26:58 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7061
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/MOLECULE/pair_hbond_dreiding_lj.cpp    |  7 ++++---
 src/MOLECULE/pair_hbond_dreiding_morse.cpp |  7 ++++---
 src/fix_addforce.cpp                       | 15 ++++++++++-----
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
index cb5429b3f4..eae9e4aa83 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
@@ -76,7 +76,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
 {
   int i,j,k,m,ii,jj,kk,inum,jnum,knum,itype,jtype,ktype;
   double delx,dely,delz,rsq,rsq1,rsq2,r1,r2;
-  double factor_hb,force_angle,force_kernel,evdwl,eng_lj;
+  double factor_hb,force_angle,force_kernel,evdwl,eng_lj,ehbond;
   double c,s,a,b,ac,a11,a12,a22,vx1,vx2,vy1,vy2,vz1,vz2;
   double fi[3],fj[3],delr1[3],delr2[3];
   double r2inv,r10inv;
@@ -84,7 +84,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
   int *ilist,*jlist,*klist,*numneigh,**firstneigh;
   Param *pm;
 
-  evdwl = 0.0;
+  evdwl = ehbond = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
   
@@ -186,6 +186,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
 	    if (eflag) {
 	      evdwl = eng_lj * pow(c,pm->ap);
 	      evdwl *= factor_hb;
+	      ehbond += evdwl;
 	    }
 
 	    a = factor_hb*force_angle/s;
@@ -234,7 +235,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
   
   if (eflag_global) {
     pvector[0] = hbcount;
-    pvector[1] = evdwl;
+    pvector[1] = ehbond;
   }
 }
 
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
index 2e70d928d1..ebd3b27ef0 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
@@ -46,14 +46,14 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
 {
   int i,j,k,m,ii,jj,kk,inum,jnum,knum,itype,jtype,ktype;
   double delx,dely,delz,rsq,rsq1,rsq2,r1,r2;
-  double factor_hb,force_angle,force_kernel,evdwl;
+  double factor_hb,force_angle,force_kernel,evdwl,ehbond;
   double c,s,a,b,ac,a11,a12,a22,vx1,vx2,vy1,vy2,vz1,vz2;
   double fi[3],fj[3],delr1[3],delr2[3];
   double r,dr,dexp,eng_morse,switch1,switch2;
   int *ilist,*jlist,*klist,*numneigh,**firstneigh;
   Param *pm;
 
-  evdwl = 0.0;
+  evdwl = ehbond = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
   
@@ -154,6 +154,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
 	    if (eflag) {
 	      evdwl = eng_morse * pow(c,params[m].ap);
 	      evdwl *= factor_hb;
+	      ehbond += evdwl;
 	    }
 
 	    a = factor_hb*force_angle/s;
@@ -202,7 +203,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
 
   if (eflag_global) {
     pvector[0] = hbcount;
-    pvector[1] = evdwl;
+    pvector[1] = ehbond;
   }
 }
 
diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp
index 16a3c1feab..fee57525d8 100644
--- a/src/fix_addforce.cpp
+++ b/src/fix_addforce.cpp
@@ -137,28 +137,32 @@ void FixAddForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
+    if (xvar < 0) 
+      error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
     else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
+    if (yvar < 0) 
+      error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
     else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
+    if (zvar < 0) 
+      error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
     else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (estr) {
     evar = input->variable->find(estr);
-    if (evar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
+    if (evar < 0) 
+      error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->atomstyle(evar)) estyle = ATOM;
     else error->all(FLERR,"Variable for fix addforce is invalid style");
   } else estyle = NONE;
@@ -167,7 +171,8 @@ void FixAddForce::init()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all(FLERR,"Region ID for fix addforce does not exist");
+    if (iregion == -1)
+      error->all(FLERR,"Region ID for fix addforce does not exist");
   }
 
   if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) 
-- 
GitLab