Box size affects the simulation on the axis with no PBC

GROMACS version: 2021
GROMACS modification: Yes


During running an NVT simulation with xy-axes PBC box with two solid walls I came across an issue. I once got a different result when I accidentally set an incorrect size of the box in the gro file on the z-axis. Here are the snapshots which I got for my NVT simulations:

With the correct box size:

With an incorrect box size (you can see the boundary with the white border):

Is this an expected behavior? Is this because gromacs uses the box coordinates for the thermostat or there is another reason? Do you consider writing a warning message to the log file if in the input gro file there are atoms outside of the box? I hope you find this helpful as well. Thank you!

NVT.mdp (1.5 KB)


this behavior does seem unexpected to me. Since you have walls of type Wr and Wl at the z-boundaries I can see why certain atoms are contained to that smaller size in your incorrectly sized box if those are the only ones with non-zero interaction terms with the walls. But the wall typically yields an error when atoms are beyond it, unless you set wall-r-linpot to a positive value which you don’t seem to.

Perhaps this is related to how you have set the cross interaction terms between the wall atom types and your species? If they are 0 maybe the position isn’t checked? Just a thought, I really do not know.