Moving wall

GROMACS version: 2021.3
GROMACS modification: Yes/No

While using “walls” in gromacs, is it possible to move one of the walls? Are the walls naturally frozen when they are set with nwall?

The walls are at the z=0 and z at the top of the box. You can use pressure scaling or deform to move the top wall.

Thank you so much! Just to clarify that I am interpreting the deform command for the box walls correctly, would the following stretch the z plane at the top of the box and keep the z=0 plane constant? It is not clear to me from the documentation whether or not the z=0 plane is truly frozen or if both the top and bottom sides of the box are stretched/compressed if the value is negative.

pbc = xy
nwall = 2
deform = 0 0 1 0 0 0

I missed your question.

The walls are always at the bottom and top of the box. With only the zz component of the compressibility non-zero, only the z dimension of the box will change. Note that a rate of 1 nm/ps is insanely high.

Thank you for your clarification. Right now I have been seeing deformation of the box with these parameters, but if what I am really trying to achieve is situation B where only one of the walls changes, should I also freeze the atoms close to one of the walls to “fix” that wall? My understanding of the deform function is that it achieves situation A (where both sides of the box along the z axis will change rather than just one).

The only difference between one and two walls moving is what the center off mass of the system does. The center of mass motion of the system along z is not removed when you have walls, so there two situations are completely equivalent. The only exception is when you also have position restraints.

Thank you for your response. I am not sure if I understand completely how the situations are equivalent if the center of mass motion along z is not removed. Wouldn’t case B shift the center of mass of the system to the right whereas case A would keep the center of mass in the same location? If I do have position restraints, then is deform in gromacs generating case A rather than case B? Thank you for your patience with my questions!

The physics is translation invariant. Therefore A and B are equivalent, unless you have some absolute reference. If you use position restraints without refcoord-scaling, then A and B are not longer equivalent and it matter than GROMACS implements situation B. If you have refcoord-scaling on then A and B are equivalent.

Thank you for your explanation about refcoord-scaling! That makes sense.