From 4442884a52858a8e1f83809a8b4a2c6d6156c92d Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Sat, 26 Mar 2011 21:24:17 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5848
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/neighbor.cpp | 8 +++++---
 src/velocity.cpp | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index 1a38685fb0..65243a8e0e 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -1217,12 +1217,14 @@ void Neighbor::build_one(int i)
     memory->create(bins,maxbin,"bins");
   }
 
-  // this condition can cause LAMMPS to crash
+  // when occasional list built, LAMMPS can crash if atoms have moved too far
+  // why is this?, give warning if this is the case
   // no easy workaround b/c all neighbor lists really need to be rebuilt
-  // solution is for input script to check more often for rebuild, so warn
+  // solution is for input script to check more often for rebuild
+  // only check_distance if running a simulation, not between simulations
 
   int flag = 0;
-  if (dist_check) flag = check_distance();
+  if (dist_check && update->whichflag) flag = check_distance();
   if (flag && me == 0)
     error->warning("Building an occasional neighobr list when "
 		   "atoms may have moved too far");
diff --git a/src/velocity.cpp b/src/velocity.cpp
index 7a8505faa7..c590ece9db 100644
--- a/src/velocity.cpp
+++ b/src/velocity.cpp
@@ -432,7 +432,7 @@ void Velocity::set(int narg, char **arg)
     if (zstyle == CONSTANT && vz != 0.0)
       error->all("Cannot set non-zero z velocity for 2d simulation");
     if (zstyle == EQUAL || zstyle == ATOM)
-      error->all("Cannot set varaible z velocity for 2d simulation");
+      error->all("Cannot set variable z velocity for 2d simulation");
   }
 
   // allocate vfield array if necessary
-- 
GitLab