how to make pxx and pyy zero with non periodic bc

Dear lammps users,
i want to compress a single metal pillar with periodic boundary condition in only one direction making other two directions non pbc.nvt/npt can not be used on non pbc dimension. how to make pxx and pyy zero?
i am using lammps 23oct 11 version

thanks in advance

If those dimensions are non-periodic (free surfaces), then
the atoms will relax to whatever pressure they want to be
at, e.g. 0.0. Conceptually there is no way to "make" them
be something when there is no constraint being applied.