Regarding dynamic group

Dear LAMMPS users,
I want to create a dynamic group of atoms with kinetic energy larger than 1 eV. To do this task, I was used following code:

compute 2 all ke/atom
compute 3 all reduce sum c_2
thermo_style custom step temp pe c_3
run 0
variable kinetic atom “c_2 > 1.0”
group cascade variable kinetic
group cascade dynamic all var kinetic every 1

Group cascade, which was created by these codes, contains the total number of atoms with kinetic energy > 1 eV at current timestep. Some atoms used to be in this group, but during simulation they lost energy by interaction with other atoms, therefore they are removed from group cascade. To keep all the atoms, which used to have a KE>1 eV during simulation, I created a group, namely cascade0:

group cascade0 union cascade
group cascade0 all dynamic every 1

But I got error message: can not use union with dynamic group. I tried to set group cascade to static, but after that the number of atoms in two groups remain unchanged. I wonder if there are any group command in LAMMPS, which can help to define the group cascade0 as described above? Thank you for your time and help!

Best regards,
Trung

Dear LAMMPS users,
I want to create a dynamic group of atoms with kinetic energy larger than
1 eV. To do this task, I was used following code:

compute 2 all ke/atom

compute 3 all reduce sum c_2
thermo_style custom step temp pe c_3
run 0
variable kinetic atom "c_2 > 1.0"
​​
group cascade variable kinetic
group cascade dynamic all var kinetic every 1

Group cascade, which was created by these codes, contains the total number
of atoms with kinetic energy > 1 eV at* current timestep*.

​the first of your two group commands is pointless.​

Some atoms used to be in this group, but during simulation they lost
energy by interaction with other atoms, therefore they are removed from
group cascade. To keep all the atoms, which used to have a KE>1 eV during
simulation, I created a group, namely cascade0:

group cascade0 union cascade

group cascade0 all dynamic every 1

But I got error message: *can not use union with dynamic group*. I tried
to set group cascade to static, but after that the number of atoms in two
groups remain unchanged. I wonder if there are any group command in LAMMPS,
which can help to define the group cascade0 as described above? Thank you
for your time and help!

​these commands don't make any sense. a simple:


group cascade0 variable kinetic ​

​will create a static group ​as you desire.

axel.

Dear Axel,
Thank you for your answer, but in my case, the command:

group cascade0 variable kinetic

do not create a group as I desire. I am sorry for not describing more detail about my simulation. I want to do a simulation of cascade displacement in metal. After system equilibrated, an atom (PKA) was given a kinetic energy of 1 keV. During cascade simulation, this PKA will collide with other atoms and transfer its energy to other atoms. The simulation will be finished after about 20 ps when the number of Frenkel pairs are stable and there is no atom with kinetic energy larger 1 keV. Therefore cascade0 should be a dynamic group, a group command as above only assigned an atom (PKA) to group cascade0 at timestep =0, and not assigned all atom, which used to have kinetic energy > 1 keV during cascade displacement.

Thank you for your time and help!
Best regards,
Trung

I have some typos errors in last message, the corrected one should be “there is no atom with kinetic energy larger than 1 eV” and “which used to have kinetic energy > 1eV”. I’m sorry for the inconvenience.

I have some typos errors in last message, the corrected one should be
"there is no atom with kinetic energy larger than 1 eV" and "which used to
have kinetic energy > 1eV". I'm sorry for the inconvenience.

Dear Axel,
Thank you for your answer, but in my case, the command:

group cascade0 variable kinetic

do not create a group as I desire. I am sorry for not describing more
detail about my simulation. I want to do a simulation of cascade
displacement in metal. After system equilibrated, an atom (PKA) was given
a kinetic energy of 1 keV. During cascade simulation, this PKA will collide
with other atoms and transfer its energy to other atoms. The simulation
will be finished after about 20 ps when the number of Frenkel pairs are
stable and there is no atom with kinetic energy larger 1 keV. Therefore
cascade0 should be a dynamic group, a group command as above only assigned
an atom (PKA) to group cascade0 at timestep =0, and not assigned all atom,
which used to have kinetic energy > 1 keV during cascade displacement.

​your description is confusing and does not make sense. i suspect you may
be misunderstanding completely how dynamic groups work.
i suggest you carefully re-read the documentation for the group command and
if you still have problems, perhaps create a minimal demo input, that
breaks down the simulation into several short pieces, do a set of static
group commands at each "intermission" that represent what you would like to
see in each of them.

axel.

Thank you Axel, I will follow your advice and try to solve this problem.

Have a nice day,
Trung