[lammps-users] addforce command

I'm not sure what you're asking. You can compress the box with displace_box
or fix deform. You can compress the atoms using fix addforce.

Steve