Changing the size of simulation box

I have a region named “xyz” inside a simulation box. I want to resize the simulation box to confine only the region “xyz” without altering the atoms (inside xyz) or boundary settings. Can anyone help me with this?

I would create the following groups of atoms and apply the change_box command to the atoms outside the region “XYZ”:

group inside region xyz
group outside subtract all inside
change_box outside x final -30 30 y final -30 30 z final -30 30

Or something similar.

1 Like

How about this?

group none empty
change_box none x final <xlo> <xhi> y final <ylo> <yhi> z final <zlo> <zhi>

with <xlo>, <xhi> the low/high boundary of the xyz region and the the same for y and z.

There must be no atoms outside this region or they need to be deleted first.