Changing atom type depending on region

Dear LAMMPs developers and users,

I was trying to change the type of atom I have depending on the region. So what I want is to change atom type from say 2 to 3 if it enters region 3, and make it stay this type, even if it goes back out of region 3. When the atom is changed to type 3, I want it to not interact with any other atoms in the system and not time-integrate the atom type...

I have tried the following command, which does indeed change the type of the atom,

Run 100 every 1 &
"group dead region 3" &
"set group dead type 3" &

But now I would like to know if it is possible to stop integrating these type 3 atoms as well?

Thanks a lot in advanced,
Anna

I was trying to change the type of atom I have depending on the region. So what I want is to change atom type from say 2 to 3 if it enters region 3, and make it stay this type, even if it goes back out of region 3. When the atom is changed to type 3, I want it to not interact with any other atoms in the system and not time-integrate the atom type…

If the new type 3 atoms are not time integrated, they will not go back out of region 3.

Another conceptual thing is that if atom type 2 change to atom type 3 and freeze once entering region 3, what you would expect is these new atom type 3 piling up on the region boundaries - making up a layer of frozen atoms. Also, if these frozen atoms do not interact with any atom, you may see overlapping atom type 3. Is this really what you want?

Back to your question. You may use fix setforce to freeze the atoms - no force, no movement. You may use neigh_modify exclude to exclude atom type 3 in neighbor lists - no neighbor, no interaction.

Cheers,
Ray

Dear Ray,

Thank you for your suggestions! However, having tried everything, I still see atom movement in my output files. Strangely, even after I exclude interactions like this:

run 100 every 1 &
“group dead region 3” &
“set group dead type 3” &

“set neigh_modify exclude type 1 3” &
“set neigh_modify exclude type 2 3” &
“set neigh_modify exclude type 3 3”

And I have also tried fix set force and set forces to zero which didn’t help either… I am sure I am missing something important…

Thanks. With best wishes,
Anna

Apologies, also forgot to add; I don’t really care about type 3 atoms, I just let them accumulate as they wish… The only thing I want is for them not to interact with other atoms

Please provide an example input demonstrating your problem. It is near impossible to discuss these things hypothetically. Axel.

neigh_modify commands do not have a set at the front. Please read the neigh_modify doc page, thanks.

Ray

Dear Axel,

please find the input below. So I have particles that i insert of type 2 which change into type 3 when they go into region 3, and I do not want to delete them, just not time integrate. Thank you very much in advanced.

units lj
atom_style full
dimension 3
neighbor 0.5 bin
neigh_modify every 1 delay 1 check yes
atom_modify sort 0 0
boundary p p p
read_data particle.dat
thermo 1
group alive type 2
group dead type 3
timestep 0.01
region 1 cylinder z 0.0 0.0 1.0 -11 50 side in units box
fix wall alive wall/region 1 lj126 1 1 2.5
region 2 block 0 0 0 0 -9 -9 units box
region 3 block -1 1 -1 1 2 50 units box
set group dead type 3
pair_style lj/cut 1.12
pair_coeff 1 1 1.0 1.0
pair_coeff 1 2 1.0 1.0
pair_coeff 2 2 1.0 1.0
pair_coeff 1 3 0.0 0.0
pair_coeff 2 3 0.0 0.0
pair_coeff 3 3 0.0 0.0
compute 2 alive property/atom z
variable ts equal step
variable a equal c_2[2]
variable b equal c_2[3]
variable c equal c_2[4]
variable d equal c_2[5]
variable e equal c_2[6]
variable f equal c_2[7]
variable g equal c_2[8]
variable h equal c_2[9]
variable i equal c_2[10]
variable j equal c_2[11]
variable k equal c_2[12]
variable l equal c_2[13]

dump 1 all custom 1 particle_deposit_d1.dump id type z
dump_modify 1 format "%d d .2f"

fix 1 alive langevin 1.0 1.0 1.0 12345
fix 2 alive nve

fix 4 alive deposit 100000 2 1 12345 region 2 near 1 attempt 1 target 0 0 -9 units box
thermo_style custom step atoms
fix 5 alive print 1 "${ts} $a $b $c d" file data1\_position\.xyz screen no fix 6 alive print 1 "{ts} $e $f $g h" file data2\_position\.xyz screen no fix 7 alive print 1 "{ts} $i $j $k $l" file data3_position.xyz screen no

run 1000000 every 1 &
"group dead region 3" &
"set group dead type 3" &
"neigh_modify exclude type 1 3" &
"neigh_modify exclude type 2 3" &
"neigh_modify exclude type 3 3"