[lammps-users] About "Fix atoms' position"

Hi,

I need to fix some atoms’ position. The temperature is 0 K. The only way I know is to use “fix setforce” command to set all the force on these atoms to be zero.

However, I have to know the value of the force on those atoms in the mean time. So if I set the force to zero, I cannot get their value.

I want to know if there is some other ways to fix atoms’ position.

Thanks a lot.

Hi,

I need to fix some atoms' position. The temperature is 0 K. The only way I
know is to use "fix setforce" command to set all the force on these atoms to
be zero.

However, I have to know the value of the force on those atoms in the mean
time. So if I set the force to zero, I cannot get their value.

I want to know if there is some other ways to fix atoms' position.

hi,

you can exclude atoms that you don't want to move
from the fix that integrates your equations of motion.
see e.g. the indent example. you could replace

fix 1 all nve

with

fix 1 mobile nve

and then you can remove

fix 2 lower setforce 0.0 0.0 0.0

and the result should do what you want.

cheers,
axel.

In addition to what Axel said, the fix setforce command stores
the force before it sets if to zero (or whatever), so you
can access that value, e.g. with your thermo output. See
the doc page on fix setforce for details.

Steve