diff --git a/src/fix.cpp b/src/fix.cpp index babdf51316..c33d1431be 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -48,6 +48,8 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) restart_peratom = 0; force_reneighbor = 0; box_change = 0; + box_change_size = 0; + box_change_shape = 0; thermo_energy = 0; rigid_flag = 0; virial_flag = 0; diff --git a/src/fix.h b/src/fix.h index 41fe83a0cc..19cb95a10e 100644 --- a/src/fix.h +++ b/src/fix.h @@ -26,7 +26,9 @@ class Fix : protected Pointers { int restart_global; // 1 if Fix saves global state, 0 if not int restart_peratom; // 1 if Fix saves peratom state, 0 if not int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not - int box_change; // 1 if Fix changes box size, 0 if not + int box_change; // 1 if Fix changes box, 0 if not + int box_change_size; // 1 if Fix changes box size, 0 if not + int box_change_shape; // 1 if Fix changes box shape, 0 if not int next_reneighbor; // next timestep to force a reneighboring int thermo_energy; // 1 if fix_modify enabled ThEng, 0 if not int nevery; // how often to call an end_of_step fix diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 7f1794cfd1..e2983cd115 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -178,6 +178,9 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else error->all("Illegal fix box/relax command"); } + if (p_flag[0] || p_flag[1] || p_flag[2]) box_change_size = 1; + if (p_flag[3] || p_flag[4] || p_flag[5]) box_change_shape = 1; + // error checks if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4])) diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index 09a6a001bc..652100b16b 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -176,6 +176,9 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (set[i].style == NONE) dimflag[i] = 0; else dimflag[i] = 1; + if (dimflag[0] || dimflag[1] || dimflag[2]) box_change_size = 1; + if (dimflag[3] || dimflag[4] || dimflag[5]) box_change_shape = 1; + // check periodicity if ((set[0].style && domain->xperiodic == 0) || diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 7582e00589..cca8dc94ba 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -326,6 +326,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (pstat_flag) { box_change = 1; + if (p_flag[0] || p_flag[1] || p_flag[2]) box_change_size = 1; + if (p_flag[3] || p_flag[4] || p_flag[5]) box_change_shape = 1; no_change_box = 1; } diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index 6c101fdaea..adda65d276 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -44,6 +44,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : if (narg < 5) error->all("Illegal fix press/berendsen command"); box_change = 1; + box_change_size = 1; // Berendsen barostat applied every step