To restrict motion of a group of atoms along a particular axis

Hello Everyone,

I have recently started using LAMMPS. My system consists two single wall carbon nanotubes in aqueous dispersion.
I am carrying out Umbrella Sampling simulations (using fix spring) at varying separations along x-axis between the two tubes.
I am using CHARMM force field. Simulation time is 10 ns.
So far, in all the cases, the tubes are moving out of the simulation box. Especially along z-axis, the separation between the tubes becomes very large. I am using periodic boundary conditions.

I want to know if there is a way to restrict the movement of the two tubes along y and z-axis as I want to vary the distance between the two tubes only along the x-axis.

I would really appreciate if any one can help me on this.

Thank you in advance, for your time and consideration in answering my query.


Please post the form of the fix spring command you are using.
If the spring is strong enough should not be possible for the 2 CNTs
to move too far apart.


I am using the following command:

fix 1 cnt1 spring couple cnt2 0.5 1.0 0.0 0.0 14

where cnt1 and cnt2 are the two groups of atoms and separation between them is 14 angstrom
and spring constant = 0.5

But I want to know that even if I don’t attach the spring or say, I use only 1 nanotube, I want to know if there is a way to restrict the movement along some specific axis.


My guess would be that your spring constant K
is too small to have much effect. From the fix spring
doc page:

Note that K thus represents the total force on the group of atoms, not a per-atom force.

Try cranking up K and see if it works more like you expect.