Fix an atom while performing NPT Simulation

I am simulating a membrene of x thickness and the permeability of the other particles through this membrane, I only allowing to expand or contracts in y and z to reach the pressure desired but then when I output the position in x, it is not fixed. How I can solve this, this are the commands I am using to achieve

Apply forces

fix 1 all npt temp 1.0 1.0 0.01 x 0.30 0.30 0.1
fix c group-c addforce v_forcex 0 0 every 1

Thermodynamic properties

thermo_style custom step temp pe ke etotal press density v_forcex v_forcey v_forcez v_posx v_posy v_posz
thermo 100

Please do not use the word “fixed” in this context since it is ambiguous in LAMMPS. It is not correct english, anyway, since what you want to express is actually that atoms are “immobilized”.

There is nothing in your input that immobilizes the x-position of atoms. Your fix npt command will always perform time integration for all atoms in the fix group based on their velocities and forces.

Also, what you are saying is in conflict with the documentation. Your fix npt command allows the box to expand or shrink in x direction only. Which is the exact opposite of what you have said.
Thus, please have a closer look at the documentation and think everything over.