Basic question regarding Box Bounds

Hey all,

Just wondering about the following:

Why do the box bounds in lammps not start with (0,0,0) as the origin, when box shape is allowed to change in a simulation?

Is there a way to keep the origin fixed, at least for an orthogonal box?


The answer to the first question might be on these lines:

Since the COM of the system is fixed, after scaling the coordinates of the atoms to new ones, the new COM of the system is shifted back to the old position, and the box bounds are recreated with respect to the COM (the old one).

Am I correct?

Hi @chaitu,

The absolute box bounds coordinates are arbitrary and only the atoms relative coordinates are important. Depending on the commands you use to control for the box shape or the pressure there can be some commands to maintain a given point fixed during box transformations (such as the fixedpoint keyword when using fix npt when monitoring the pressure).

That said you can always change the box to have the origin in its corner using a command like:

change_box all x final 0 ${lx} y final 0 ${ly} z final 0 ${lz} units box

with variables ${lx} and so one defined as your current box length (see the variable page to do that).

1 Like

Thanks @Germain for clarifying.