From 56ee1b670b3b586ee6741f451eb5630990bceac1 Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Mon, 5 Oct 2015 15:13:56 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14088
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/MANYBODY/pair_bop.cpp             | 34 ++++++---------------------
 src/MANYBODY/pair_comb3.cpp           |  3 ++-
 src/MISC/fix_orient_fcc.cpp           |  2 +-
 src/SNAP/compute_snad_atom.cpp        |  4 ++--
 src/USER-CG-CMM/angle_sdk.cpp         |  2 +-
 src/USER-DIFFRACTION/compute_saed.cpp |  3 ++-
 src/USER-DIFFRACTION/compute_xrd.cpp  |  6 +++--
 src/USER-OMP/thr_data.cpp             |  3 ++-
 src/USER-OMP/thr_omp.cpp              |  4 ++--
 src/info.cpp                          | 24 ++++++-------------
 src/min.cpp                           |  2 +-
 src/minimize.cpp                      |  2 +-
 src/update.cpp                        |  1 -
 13 files changed, 32 insertions(+), 58 deletions(-)

diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp
index 142a265b69..94fbe62a99 100644
--- a/src/MANYBODY/pair_bop.cpp
+++ b/src/MANYBODY/pair_bop.cpp
@@ -913,10 +913,6 @@ void PairBOP::gneigh()
         if(i12>=npairs) {
           error->one(FLERR,"Too many atom pairs for pair bop");
         }
-        ps=rij[temp_ij];
-        ps=rdr[i12];
-        ps=pBetaS1[i12][ks-1];
-        ps=pBetaS[i12][ks-1];
         ps=rij[temp_ij]*rdr[i12]+1.0;
         ks=(int)ps;
         if(nr-1<ks)
@@ -1052,10 +1048,6 @@ void PairBOP::theta()
         neigh_flag3[temp_ij]=1;
       else
         neigh_flag3[temp_ij]=0;
-      ps=rij[temp_ij];
-      ps=rdr[i12];
-      ps=pBetaS1[i12][ks-1];
-      ps=pBetaS[i12][ks-1];
       ps=rij[temp_ij]*rdr[i12]+1.0;
       ks=(int)ps;
       if(nr-1<ks)
@@ -4966,8 +4958,8 @@ double PairBOP::PiBo(int itmp, int jtmp)
           }
         }
       }
-  return(piB);
   destroy_pi();
+  return(piB);
 }
 
 /* ----------------------------------------------------------------------
@@ -5403,14 +5395,8 @@ void PairBOP::read_table(char *filename)
               gfunc6[j][i][k][n]=gfunc6[k][i][j][n];
             }
           } else {
-            if(nws==3) {
-              for(n=0;n<npower+1;n++) {
-                gpara[j][i][k][n]=gpara[k][i][j][n];
-              } 
-            } else {
-              for(n=0;n<npower+1;n++) {
-                gpara[j][i][k][n]=gpara[k][i][j][n];
-              } 
+            for(n=0;n<npower+1;n++) {
+              gpara[j][i][k][n]=gpara[k][i][j][n];
             } 
           } 
         } 
@@ -5762,11 +5748,8 @@ double PairBOP::memory_usage()
 
 void PairBOP::memory_theta_create()
 {
-  if(maxneigh<8)
-    neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
-  else
-    neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
-  if(neigh_ct<0) neigh_ct=0;
+  neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
+  if(neigh_ct<1) neigh_ct=1;
   memory->create(itypeSigBk,neigh_ct,"itypeSigBk");
   memory->create(itypePiBk,neigh_ct,"itypePiBk");
   memory->create(neigh_flag,neigh_total,"neigh_flag");
@@ -5792,11 +5775,8 @@ void PairBOP::memory_theta_create()
 
 void PairBOP::memory_theta_grow()
 {
-  if(maxneigh<8)
-    neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
-  else
-    neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
-  if(neigh_ct<0) neigh_ct=0;
+  neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
+  if(neigh_ct<1) neigh_ct=1;
   memory->grow(itypeSigBk,neigh_ct,"itypeSigBk");
   memory->grow(itypePiBk,neigh_ct,"itypePiBk");
   memory->grow(neigh_flag,neigh_total,"neigh_flag");
diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp
index 43c8f16a2b..95e6239bce 100644
--- a/src/MANYBODY/pair_comb3.cpp
+++ b/src/MANYBODY/pair_comb3.cpp
@@ -3292,9 +3292,10 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
   qf = qf_fix;
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
-    if (mask[i] & groupbit)
+    if (mask[i] & groupbit) {
       qf[i] = 0.0;
       dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
+    }
   }
   // communicating charge force to all nodes, first forward then reverse
 
diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp
index b636af290d..efcffdd1e5 100644
--- a/src/MISC/fix_orient_fcc.cpp
+++ b/src/MISC/fix_orient_fcc.cpp
@@ -435,7 +435,7 @@ void FixOrientFCC::post_force(int vflag)
   if (nstats && update->ntimestep % nstats == 0) {
     int total;
     MPI_Allreduce(&count,&total,1,MPI_INT,MPI_SUM,world);
-    double ave = total/atom->natoms;
+    double ave = static_cast<double>(total)/atom->natoms;
 
     int min,max;
     MPI_Allreduce(&mincount,&min,1,MPI_INT,MPI_MIN,world);
diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp
index 51b0d5842a..5b5d4728ed 100644
--- a/src/SNAP/compute_snad_atom.cpp
+++ b/src/SNAP/compute_snad_atom.cpp
@@ -85,8 +85,8 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"rmin0") == 0) {
       if (iarg+2 > narg)
         error->all(FLERR,"Illegal compute snad/atom command");
-        rmin0 = atof(arg[iarg+1]);
-        iarg += 2;
+      rmin0 = atof(arg[iarg+1]);
+      iarg += 2;
     } else if (strcmp(arg[iarg],"switchflag") == 0) {
       if (iarg+2 > narg) 
 	error->all(FLERR,"Illegal compute snad/atom command");
diff --git a/src/USER-CG-CMM/angle_sdk.cpp b/src/USER-CG-CMM/angle_sdk.cpp
index 9b76fcacdd..87fd7f5439 100644
--- a/src/USER-CG-CMM/angle_sdk.cpp
+++ b/src/USER-CG-CMM/angle_sdk.cpp
@@ -374,7 +374,7 @@ void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond,
     }
     if (eflag_atom) {
       if (newton_bond || i < nlocal) eatom[i] += 0.5*evdwl;
-      if (newton_bond || j < nlocal) eatom[i] += 0.5*evdwl;
+      if (newton_bond || j < nlocal) eatom[j] += 0.5*evdwl;
     }
   }
 
diff --git a/src/USER-DIFFRACTION/compute_saed.cpp b/src/USER-DIFFRACTION/compute_saed.cpp
index 6dc46cd841..e275b5eb1a 100644
--- a/src/USER-DIFFRACTION/compute_saed.cpp
+++ b/src/USER-DIFFRACTION/compute_saed.cpp
@@ -249,10 +249,11 @@ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) :
   }
 
   if (me == 0) {
-    if (screen &&  echo)
+    if (screen && echo) {
       fprintf(screen,"-----\nCompute SAED id:%s, # of atoms:%d, # of relp:%d\n",id,natoms,n);
       fprintf(screen,"Reciprocal point spacing in k1,k2,k3 = %g %g %g\n-----\n",
               dK[0], dK[1], dK[2]);
+    }
   }  
 
   nRows = n;
diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp
index 3650e59629..ffd1f1c9dd 100644
--- a/src/USER-DIFFRACTION/compute_xrd.cpp
+++ b/src/USER-DIFFRACTION/compute_xrd.cpp
@@ -230,10 +230,11 @@ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) :
   size_array_cols = 2;
   
   if (me == 0) {
-    if (screen &&  echo)
+    if (screen && echo) {
       fprintf(screen,"-----\nCompute XRD id:%s, # of atoms:%d, # of relp:%d\n",id,natoms,nRows);
       fprintf(screen,"Reciprocal point spacing in k1,k2,k3 = %g %g %g\n-----\n",
               dK[0], dK[1], dK[2]);
+    }
   }  
    
   memory->create(array,size_array_rows,size_array_cols,"xrd:array");
@@ -343,10 +344,11 @@ void ComputeXRD::compute_array()
 #endif
 
   if (me == 0 && echo) {
-    if (screen)
+    if (screen) {
       fprintf(screen,"\n");
       if (LP == 1)
         fprintf(screen,"Applying Lorentz-Polarization Factor During XRD Calculation 2\n");
+    }
   }
   int m = 0;
   double frac = 0.1;
diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp
index 1984fd71c4..cc184d9d67 100644
--- a/src/USER-OMP/thr_data.cpp
+++ b/src/USER-OMP/thr_data.cpp
@@ -156,9 +156,10 @@ void ThrData::init_eim(int nall, double *rho, double *fp)
 {
   init_eam(nall, rho);
 
-  if (nall >= 0 && fp)
+  if (nall >= 0 && fp) {
     _fp = fp + _tid*nall;
     memset(_fp,0,nall*sizeof(double));
+  }
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp
index 713e7fdf5d..7e03cdff97 100644
--- a/src/USER-OMP/thr_omp.cpp
+++ b/src/USER-OMP/thr_omp.cpp
@@ -782,7 +782,7 @@ void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int
         v_tally(thr->vatom_bond[i],v);
         v_tally(thr->vatom_bond[j],v);
       } else {
-        if (j < nlocal)
+        if (i < nlocal)
           v_tally(thr->vatom_bond[i],v);
         if (j < nlocal)
           v_tally(thr->vatom_bond[j],v);
@@ -862,7 +862,7 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i
         v_tally(thr->vatom_angle[j],v);
         v_tally(thr->vatom_angle[k],v);
       } else {
-        if (j < nlocal) v_tally(thr->vatom_angle[i],v);
+        if (i < nlocal) v_tally(thr->vatom_angle[i],v);
         if (j < nlocal) v_tally(thr->vatom_angle[j],v);
         if (k < nlocal) v_tally(thr->vatom_angle[k],v);
       }
diff --git a/src/info.cpp b/src/info.cpp
index 0c2e6b9d41..7b6117acb8 100644
--- a/src/info.cpp
+++ b/src/info.cpp
@@ -544,13 +544,13 @@ bool Info::is_available(const char *category, const char *name)
 {
   if ((category == NULL) || (name == NULL)) return false;
   const int len = strlen(name);
+  int match = 0;
 
   if (strcmp(category,"command") == 0) {
-    int match = 0;
-    return (input->command_map->find(name) != input->command_map->end());
+    if (input->command_map->find(name) != input->command_map->end());
+      match = 1;
 
   } else if (strcmp(category,"compute") == 0) {
-    int match = 0;
     if (modify->compute_map->find(name) != modify->compute_map->end())
       match = 1;
 
@@ -570,10 +570,7 @@ bool Info::is_available(const char *category, const char *name)
         delete[] name_w_suffix;
       }
     }
-    return match ? true : false;
-
   } else if (strcmp(category,"fix") == 0) {
-    int match = 0;
     if (modify->fix_map->find(name) != modify->fix_map->end())
       match = 1;
 
@@ -593,10 +590,7 @@ bool Info::is_available(const char *category, const char *name)
         delete[] name_w_suffix;
       }
     }
-    return match ? true : false;
-
   } else if (strcmp(category,"pair_style") == 0) {
-    int match = 0;
     if (force->pair_map->find(name) != force->pair_map->end())
       match = 1;
 
@@ -616,9 +610,9 @@ bool Info::is_available(const char *category, const char *name)
         delete[] name_w_suffix;
       }
     }
-    return match ? true : false;
-
   } else error->all(FLERR,"Unknown category for is_available()");
+
+  return match ? true : false;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -639,7 +633,6 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(compute[i]->id,name) == 0)
         return true;
     }
-    return false;
   } else if (strcmp(category,"dump") == 0) {
     int ndump = output->ndump;
     Dump **dump = output->dump;
@@ -647,7 +640,6 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(dump[i]->id,name) == 0)
         return true;
     }
-    return false;
   } else if (strcmp(category,"fix") == 0) {
     int nfix = modify->nfix;
     Fix **fix = modify->fix;
@@ -655,7 +647,6 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(fix[i]->id,name) == 0)
         return true;
     }
-    return false;
   } else if (strcmp(category,"group") == 0) {
     int ngroup = group->ngroup;
     char **names = group->names;
@@ -663,7 +654,6 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(names[i],name) == 0)
         return true;
     }
-    return false;
   } else if (strcmp(category,"region") == 0) {
     int nreg = domain->nregion;
     Region **regs = domain->regions;
@@ -671,7 +661,6 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(regs[i]->id,name) == 0)
         return true;
     }
-    return false;
   } else if (strcmp(category,"variable") == 0) {
     int nvar = input->variable->nvar;
     char **names = input->variable->names;
@@ -679,6 +668,7 @@ bool Info::is_defined(const char *category, const char *name)
       if (strcmp(names[i],name) == 0)
         return true;
     }
-    return false;
   } else error->all(FLERR,"Unknown category for is_defined()");
+
+  return false;
 }
diff --git a/src/min.cpp b/src/min.cpp
index b06ccfc638..7588211a8c 100644
--- a/src/min.cpp
+++ b/src/min.cpp
@@ -211,7 +211,7 @@ void Min::setup()
   // ndoftotal = total dof for entire minimization problem
   // dof for atoms, extra per-atom, extra global
 
-  bigint ndofme = 3*atom->nlocal;
+  bigint ndofme = 3 * static_cast<bigint>(atom->nlocal);
   for (int m = 0; m < nextra_atom; m++)
     ndofme += extra_peratom[m]*atom->nlocal;
   MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
diff --git a/src/minimize.cpp b/src/minimize.cpp
index b927ee9270..6483e100bf 100644
--- a/src/minimize.cpp
+++ b/src/minimize.cpp
@@ -47,7 +47,7 @@ void Minimize::command(int narg, char **arg)
   update->whichflag = 2;
   update->beginstep = update->firststep = update->ntimestep;
   update->endstep = update->laststep = update->firststep + update->nsteps;
-  if (update->laststep < 0 || update->laststep > MAXBIGINT)
+  if (update->laststep < 0)
     error->all(FLERR,"Too many iterations");
 
   lmp->init();
diff --git a/src/update.cpp b/src/update.cpp
index e012449b9c..78f4fe73a3 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -421,7 +421,6 @@ void Update::reset_timestep(bigint newstep)
 {
   ntimestep = newstep;
   if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
-  if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
 
   // set atimestep to new timestep
   // so future update_time() calls will be correct
-- 
GitLab