How to apply force from the top and bottom of the box

GROMACS version:
GROMACS modification: Yes/No
Here post your question

I would like to apply force from the top and bottom in the z direction in a system that includes two bilayers. I want to compress the system from the top and bottom toward the center of the z-axis. What are the possible methods for doing this?

I considered using umbrella sampling, but this method involves selecting a specific substance and applying force to it, which is different from the approach I have in mind of applying force to the entire system.

I appreciate your input.
Thank you.

If you want a constant force, set a higher value for the z,z pressure component in the barostat.

If you want constant strain, the simplest way is using the deform option with a negative value for element z,z. You should use the 2024 release, as the deform code is improved there.