From 121f55748c50898afc4833cf8478d47fa336216c Mon Sep 17 00:00:00 2001
From: athomps <athomps@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Tue, 17 Feb 2009 18:49:46 +0000
Subject: [PATCH] Added once option to neigh_modify

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2594 f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
 src/neighbor.cpp | 10 ++++++++++
 src/neighbor.h   |  1 +
 2 files changed, 11 insertions(+)

diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index a8313f3f56..d6c77e75c3 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -70,6 +70,7 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
   pgsize = 100000;
   oneatom = 2000;
   binsizeflag = 0;
+  build_once = 0;
 
   cutneighsq = NULL;
   cuttype = NULL;
@@ -967,6 +968,9 @@ void Neighbor::print_lists_of_lists()
 
 int Neighbor::decide()
 {
+
+  if (build_once) return 0;
+
   if (must_check) {
     int n = update->ntimestep;
     if (restart_check && n == output->next_restart) return 1;
@@ -1345,6 +1349,12 @@ void Neighbor::modify_params(int narg, char **arg)
       else if (strcmp(arg[iarg+1],"no") == 0) dist_check = 0;
       else error->all("Illegal neigh_modify command");
       iarg += 2;
+    } else if (strcmp(arg[iarg],"once") == 0) {
+      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (strcmp(arg[iarg+1],"yes") == 0) build_once = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) build_once = 0;
+      else error->all("Illegal neigh_modify command");
+      iarg += 2;
     } else if (strcmp(arg[iarg],"page") == 0) {
       if (iarg+2 > narg) error->all("Illegal neigh_modify command");
       pgsize = atoi(arg[iarg+1]);
diff --git a/src/neighbor.h b/src/neighbor.h
index e20cec041f..0b988f7346 100644
--- a/src/neighbor.h
+++ b/src/neighbor.h
@@ -78,6 +78,7 @@ class Neighbor : protected Pointers {
   int maxbond,maxangle,maxdihedral,maximproper;   // size of bond lists
 
   int must_check;                  // 1 if must check other classes to reneigh
+  int build_once;                  // 1 if never rebuild
   int restart_check;               // 1 if restart enabled, 0 if no
   int fix_check;                   // # of fixes that induce reneigh
   int *fixchecklist;               // which fixes to check
-- 
GitLab