Displace_atoms for Equidistant Box Boundaries

Dear Dr. Axel Kohlmeyer and LAMMPS Users,

Hello Dr. Kohlmeyer and LAMMPS Users. I currently have an equilibrated crosslinked polymer network where the atom coordinates, velocity and bond data are stored in the input data file.

However, in the data file, the simulation box boundaries in the x y and z components are at an offset such that:
-9.979 33.939 xlo xhi
-9.979 33.939 ylo yhi
-9.979 33.939 zlo zhi

I would like to have equidistant box boundaries where xlo, ylo and zlo have the same distance (but opposite sign) as xhi, yhi, and zhi.

I calculated the negative of the center of mass of the entire polymer system and used the displace_atoms command during a short NPT run as shown below:

fix 1 all npt temp 1.0 1.0 2.0 iso 0.0 0.0 10.0

variable xCOM equal -xcm(all,x)
variable yCOM equal -xcm(all,y)
variable zCOM equal -xcm(all,z)

displace_atoms all move v_xCOM v_yCOM v_zCOM units box

After outputting the second data file at the conclusion of this NPT run, I checked the simulation box boundary in this data file, and I am observing that the simulation box boundary is still at an offset.

Is there a way to have the coordinates centered at the center of the simulation box?
I also tried fix recenter command, but still box boundaries are still at an offset.

I would greatly appreciate for any advice.

Thank you and I have attached my short LAMMPS input script.

Sincerely,

Masato Koizumi

Recenter_SimulationBox.in (1.24 KB)

Hello Masato,

A possible route would be to use the change_box command ( https://lammps.sandia.gov/doc/change_box.html) and set directly the xlo & xhi values. An example would be

change_box all x final -21.959 21.959 y final -21.959 21.959 z final -21.959 21.959 boundary p p p remap

I think that you can also supply lammps variables instead of explicit numerical values for the upper and lower limits of the simulation box.

Hope it helps !

Evangelos Voyiatzis

Στις Τετ, 26 Ιουν 2019 στις 8:40 π.μ., ο/η MASATO KOIZUMI <mkoizumi@…3709…> έγραψε:

Dear Mr. Evangelos Voyiatzis,

Hello Mr. Voyiatzis. Thank you so much for your advice. Greatly appreciated!

Sincerely,

Masato Koizumi