Is it possible to apply npt in only x and y direction?

GROMACS version:2021.2
GROMACS modification: Yes/No
Dear Developers and Users,
Is it possible to apply npt in only x and y directions but not in z-direction?

I was thinking if I will change the compressibility to zero, will it
solve the purpose?

That is exactly how you accomplish what you’re trying to do.

Thank you very much Prof. J. Lemkul for your response, I am already
implementing it.

Thanks and Regards
Sipra Mohapatra
PhD scholar
Dept. of Physics,IIT jodhpur

Yes, it is. It depends on your system. You can control it using isotropic, semi-isotropic and an-isotropic conditions.