[lammps-users] Fixing atomic positions?

I am interested in fixing the cartesian coordinates of a few atoms in my simulation box. In addition, I would like to compute the force exerted on these fixed atoms. I noticed you can easily do this with the fix_freeze command, but it is limited to granular simulations. Is there a straightforward way I can do this with atomistic simulations (i.e. atom_style full)?


Hi James,

You can use the fix setforce option, setting the force to 0.0 for each
dimension. However, if you want a record of the force on each atom you'll
probably have to change the code so that it will print out the force
before zeroing it.


James, you may also need to zero out the velocities of
the atoms you want to freeze using the setforce fix.
Another option is to simply not include those atoms in
the integration fix --- define a group of just the
atoms you want to be mobile, and then do something

fix 1 mobile nve

This would make it so that only atoms in group mobile