diff --git a/src/domain.cpp b/src/domain.cpp index 54ef21fc02..35d4461864 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -148,9 +148,13 @@ void Domain::init() /* ---------------------------------------------------------------------- set initial global box assumes boxlo/hi and triclinic tilts are already set + expandflag = 1 if need to expand box in shrink-wrapped dims + not invoked by read_restart since box is already expanded + if don't prevent further expansion, restarted triclinic box + with unchanged tilt factors can become a box with atoms outside the box ------------------------------------------------------------------------- */ -void Domain::set_initial_box() +void Domain::set_initial_box(int expandflag) { // error checks for orthogonal and triclinic domains @@ -180,7 +184,9 @@ void Domain::set_initial_box() small[1] = SMALL * (boxhi[1] - boxlo[1]); small[2] = SMALL * (boxhi[2] - boxlo[2]); - // adjust box lo/hi for shrink-wrapped dims + // if expandflag, adjust box lo/hi for shrink-wrapped dims + + if (!expandflag) return; if (boundary[0][0] == 2) boxlo[0] -= small[0]; else if (boundary[0][0] == 3) minxlo = boxlo[0]; diff --git a/src/domain.h b/src/domain.h index da8df3af8d..d9ffb721b0 100644 --- a/src/domain.h +++ b/src/domain.h @@ -93,7 +93,7 @@ class Domain : protected Pointers { Domain(class LAMMPS *); virtual ~Domain(); virtual void init(); - void set_initial_box(); + void set_initial_box(int expandflag=1); virtual void set_global_box(); virtual void set_lamda_box(); virtual void set_local_box(); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 7686d9a846..f49de29d11 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -156,7 +156,7 @@ void ReadRestart::command(int narg, char **arg) n = atom->nmax; domain->print_box(" "); - domain->set_initial_box(); + domain->set_initial_box(0); domain->set_global_box(); comm->set_proc_grid(); domain->set_local_box();