diff --git a/src/neighbor.cpp b/src/neighbor.cpp index a8313f3f563a47baec100af534e0c88302444116..d6c77e75c3a196c5681e4d3be90e88f8bf3b9147 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 e20cec041fd080c5c97a9f1167757843598cfecc..0b988f73467959d3f3742691b5cac8d6f6494f1d 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