# [lammps-users] Questions about holding atoms stationary

Dear all,

According to the note from https://docs.lammps.org/fix_rigid.html:
These fixes are overkill if you simply want to hold a collection of atoms stationary or have them move with a constant velocity. A simpler way to hold atoms stationary is to not include those atoms in your time integration fix. E.g. use “fix 1 mobile nve” instead of “fix 1 all nve”, where “mobile” is the group of atoms that you want to move. You can move atoms with a constant velocity by assigning them an initial velocity (via the velocity command), setting the force on them to 0.0 (via the fix setforce command), and integrating them as usual (e.g. via the fix nve command).

I used ‘fix npt’ to update the position of the mobile part in my model excluding the atoms which are supposed to be stationary. But atoms excluded from the time integration still change their positions, rigidly. Is LAMMPS just rescalling their positions according to the simulation box or actually they do move? Theoretically, what’s the difference between the method mentioned above and ‘fix mobile setforce 0 0 0’ ?

Thanks,

Li

If you want to keep atoms immobile and use fix npt, i.e. have periodic boundary conditions you are between a rock and a hard place.
As you have discovered, fix npt will scale the entire system. However, you can change that behavior with the “dilate” keyword to apply the scaling only to a subset of atoms.
However that causes problems of its own, since now the immobile atoms can be forced into unphysically overlapping with atoms that are mobile (i.e. part of the dilate group) or you can have unphysical gaps forming across periodic boundaries.

To illustrate, assume you have a system where your box is completely filled with atoms on a lattice and the lattice constant used is not the one that is consistent with the potential in use. now you would run fix npt on it while holding all atoms immobile. depending on the sign of the resulting pressure you system either wants to expand or to shrink leading to either a gap or overlapping atoms at the box boundary in all three directions. if you stick with the default, you would have all positions scaled, but atoms are no longer immobile. Things get obviously even more complicated if only part of the system is kept immobile.

I would say that if you want to keep atoms immobile you would be better off using fix nvt instead.

Deal Axel,

With the method I used, can I consider the atoms in a periodic box, which are not included in the time integration, mobile rigid bodies?

" To illustrate, assume you have a system where your box is completely filled with atoms on a lattice and the lattice constant used is not the one that is consistent with the potential in use. now you would run fix npt on it while holding all atoms immobile. "
Sorry I don’t quite understand this sentence. Can I assume a lattice whose lattice constant is much larger than the one used in the potential file such that the overlapping between atoms doesn’t cause problems in potential?

Thanks,

Li

Using fix rigid (or rigid/npt) doesn’t make a difference. The principal issue does not change. If you have a variable size periodic box and an rigid/immobile object plus mobile atoms you will always have a problem that either mobile and immobile/rigid atoms have unphysical relative motion due due to the growing/shrinking of the system or that atoms are not immobile because of the same reason.

Dear Axel,

I understand your statement and I’m afraid I misled you. To understand LAMMPS better as a beginner, my question is more about how to understand the motion of atoms excluded from the time integration using the NPT ensemble, if I don’t care about the fact that they move. I’m trying to link this behavior to something I’m familiar with. Say, consider them mobile rigid bodies. Just for thinking rather than developing a method to conduct simulations with immobile and mobile parts.

Thanks,

Li

the behavior is very simple: if they are part of the dilate group (default is all so yes) then their positions will be rescaled. this happens by converting the entire system to fractional coordinates, then changing the cell and converting the fractional coordinates back to regular. if they are not part of the dilate group, their position in space will remain unchanged but their relative position to the dilate group atoms will change due to the scaling of the box.

Dear Axel,