# Increasing density in LAMMPS

Hello,

I am trying to slightly increase the density of my system every 2000 time steps (1000 fs) by using the following line in my input script:

fix compress all deform 2000 x scale 0.9999 y scale 0.9999 z scale 0.9999 remap x remap v

There are two problems that I am having with this that I was hoping someone could help me with. The first one is that it doesn’t seem to compress the box by 0.01 in each direction. Rather, it seems to be under by two orders of magnitude (0.0001 ). I can fix this simply by changing the factors to 0.99 (I have done this and it works), but I was wondering why the scaling factor doesn’t correspond to the number inserted.

The second problem (the more important of the two) is that the compression happens equally in both directions. So for example, say I wanted to compress the box in the x direction by 2 units and chose the appropriate scaling factor. LAMMPS automatically scales it so that the bottoms gets pushed up and the top gets pushed down by 1 unit each. This shifts the corner of the box away from the origin. This is problematic because I have a network of python scripts that all depend on the box being positive everywhere with a point at the origin. Is there any way that I can use “fix compress” so that it only compresses the box in one direction per dimension and stays locked onto the origin and Cartesian axes?

-Keith

The fix deform options final,delta,scale all refer

to the box change over the entire run. Thus scale 0.9999 does

not mean a 0.0001 change every N steps, but some

fraction of that each N steps so that the total scaling

over a longer run is 0.9999.

If you want to make the change non-symmetrically (not around the center),

then don’t use scale. Use final or delta instead.

If the lo or dlo settings are 0.0, then all the change

will be at the high-end of the box.

Steve