How can I fix a "bi-layer" during an NPT simulation?

GROMACS version: 2025.3

Dear all,
My name is Aurora Fatiga, and I work at CNR-ITM (Rende, Cosenza, Italy).
I’m having some issues with GROMACS; I’ll explain my question.

I would like to simulate, using GROMACS, a system consisting of two layers (AB) of g-C3N4 (periodic-molecules) and solvent.
This is a semi-isotropic (in the Z direction) NPT (300K, 1 bar, 1 ns) on a triclinic simulation cell with the following dimensions: (8.10000 7.01480 10.00000 0.00000 0.00000 -4.05000 0.00000 0.00000 0.00000).
After running a few simulations, I encountered a problem that I would prefer not to have:
the g-C3N4 layer at Z-min (approximately 0 nm) is shifted to Z-max due to the 3D PBC.

Is it possible to fix the g-C3N4 layers in place during the NPT simulation?

Thank you for your attention,

Aurora

But this shift is irrelevant for the physics. What is the issue?

Thank you for your reply.

For the analyses I will be doing, I would prefer that the gC3N4 stay in its initial position.

If your analysis cannot take into account periodic boundary conditions, the easiest solution is to move your layer up by a fraction of a nanometer.