Hi lammps users,
I’m working on the electron irradiation of a single walled carbon nanotube.
The aim of this piece of my script is to select a random atom from within a group (called target), find its velocity and use that to calculate and modify kinetic energy of that atom.
I have two issues at the moment:
(1) choosing the random atom from within the target group
Axel suggested using fix deposit - this command adds a new atom to the group which is not something I aiming to do.
My idea at the moment is to link the output from compute property/atom id to variable index i.e.
Link
compute c target property/atom id
with
variable randomID index
I thought this could start the link
compute c target property/atom id
variable c1 atom c_contents
print ${c1}
but my simulation stops & i don’t know how to link this to variable index anyway…
I’ve looked through the output options mentioned in the manual:
fix/ave: not an option because I need the individual atom ids
compute reduce: same issue as fix averages
dump: output for post processing
variable atom style (as above)
fix store/state + fix print: restart files involved, i don’t if that’s a good idea
thermo: c_contents is not a thermo quantity or global scalar
Any ideas?
(2) variable calculation of velocity
Option one:
variable v equal vy[i]
If I insert the atom id into [i], either manually or through the variable name (randomID) there is no error but it doesn’t seem to calculate - when I try to use variable v in other calculations my script stops running. I tried doing an absolute value of vy - since equal style doesn’t do vectors - but nothing changes.
Option two: grouping the randomly selected atom into a group by itself then using compute to find the velocity of that group, compute reduce to scalar quantity, then variable equal style but that didn’t work either…
i.e.
group randatom id ${randomID} # As per Axels suggestion I delete this group later on to make sure nothing is in it for the next atom in the loop
compute v1 randomatom property/atom vy
compute v2 randomatom reduce min vy
variable v3 equal $v2
Any thoughts?
Thanks in advance!
KATE McDONELL | PhD Candidate
School of Civil Engineering | Faculty of Engineering and IT
THE UNIVERSITY OF SYDNEY