Atom still moves with fix setforce 0.0 0.0 0.0

Hi,

I have been trying for a while to use setforce to freeze an atom in a position with the minimize command. The atom still seems to move when I run the simulation. Changed many things in the script without any luck. Here’s a copy of the script:

Input file for Formation Energy

--------------- INITIALIZATION ------------------

clear
units metal
dimension 3
boundary p p p
atom_style atomic

------------------ ATOM DEFINITION -------------------

variable a equal 2.855324
lattice bcc $a
region simbox block -10 10 -10 10 -10 10

create_box 2 simbox
lattice bcc $a 2

create_atoms 1 region simbox

group Fe type 1
group He type 2
mass 1 55.845
mass 2 4.00

------------------------ FORCE FIELDS -----------------------

pair_style hybrid/overlay eam/fs yuri beck 4.4
pair_coeff * * eam/fs Fe_mm.eam.fs Fe NULL
pair_coeff * * yuri FeHe.yuri Fe He
pair_coeff 2 2 beck 398.7 0.869 0.675 4.390 3.746E-04 4.4
#---------------------------Settings----------------------------
compute csym all centro/atom bcc
compute eng all pe/atom
compute eatoms all reduce sum c_eng
compute Heatoms He reduce sum c_eng

#----------------------Run Minimization-------------------------
reset_timestep 0

thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms

displace_atoms all random 0.1 0.1 0.1 123456
dump 1 all custom 10 dump.relax.1.* id type x y z c_csym c_eng
min_style cg
minimize 1.0e-20 1.0e-20 5000 5000
write_data data.perfectfe
run 0
undump 1

variable N equal count(Fe)
variable No equal N print {No}
variable E equal “c_eatoms”
variable Epure equal $E
print $E

Hi,

I have been trying for a while to use setforce to freeze an atom in a
position with the minimize command. The atom still seems to move when I run
the simulation. Changed many things in the script without any luck. Here's a
copy of the script:

it is not 100% clear what you are talking about, since your input is
quite convoluted.
am i guessing right that you refer to the additional atom of type 2
that is created after the first minimization.
please note that this atom is free to move, since it doesn't belong to
the group He that is subject to fix setforce.

group assignments in LAMMPS are static unless defined otherwise and
apply to the atoms and their state at the time when the group is
defined. if you add atoms later they are by default not automatically
included in already existing groups (except into group "all").

axel.

Hi Axel,

Yes I am talking about the additional atom of type 2. Defining the group after the atom is created, as you said, has resolved the issue.

Thanks

Luke