Use of set dipole/random for the fix deposit particles

I have used the fix deposit command for the spherical particles. Now, I have trouble assigning the dipole moment to the new particles. For that, I am using set dipole/random, but it did not work for newly added particles.
I am also adding the partial script file.
Please, someone, help me to figure out this problem.

############################
units lj
atom_style hybrid sphere dipole
dimension 3
boundary p p p

region my_box block 0.0 18 0.0 18 0.0 18
create_box 2 my_box
create_atoms 1 random 200 18765 my_box
create_atoms 2 random 0 18765 my_box

group oldatoms type 1
group newatoms type 2

fix 1 newatoms deposit 200 2 10 29494 region my_box near 1 units box

mass 1 1.0
mass 2 1.0
set group all mass 1.0
set type 1 dipole/random 98743 2.5
set type 2 dipole/random 98743 2.5
set group all charge 0.0
#######################################

There are no atoms deposited in this script because there is no “run” command, hence the set command applied to type 2 atoms will not make any changes since there are no type 2 atoms.

I have also given the run command. Please find the full script.

############################
units lj
atom_style hybrid sphere dipole
dimension 3
boundary p p p

region my_box block 0.0 18 0.0 18 0.0 18
create_box 2 my_box
create_atoms 1 random 200 18765 my_box
create_atoms 2 random 0 18765 my_box

group oldatoms type 1
group newatoms type 2

fix 1 newatoms deposit 200 2 10 29494 region my_box near 1 units box

mass 1 1.0
mass 2 1.0
set group all mass 1.0
set type 1 dipole/random 98743 2.5
set type 2 dipole/random 98743 2.5
set group all charge 0.0
#######################################

#################################
pair_style lj/cut/dipole/long 2.5 ${halfL}
pair_coeff 1 1 1.0 1.0
kspace_style ewald/disp 1e-05

comm_modify mode single vel yes
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes page 5000000 one 500000

fix 2 all langevin $T $T 5 75175 zero yes omega yes
fix 3 all nve/sphere update dipole

compute gol all temp/sphere dof rotate
compute mytemp all temp/sphere dof all
thermo_style custom step temp c_gol pe ke etotal press density
thermo_modify temp mytemp

thermo 500

dump in_confmc all custom 1 sort/outmc0 id x y z mux muy muz
dump_modify in_confmc append no every 100000000 sort id format line “%d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g”
dump 3 all custom 1 sort/outmc* id x y z mux muy muz
dump_modify 3 append no every 2000 sort id format line “%d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g”

timestep 0.002
restart 50000 den_prod.dat
run 50000
############################################

LAMMPS commands act immediately on the system at the time they are issued. Your “set” commands are before the run command, so they will only apply to the system at the time and not apply to the atoms added by “fix deposit” during the run.

Thank you so much Akohlmey
Now, it’s working fine.