[lammps-users] Repeatedly chose atoms in the box center


I am trying to model radiation damage in an FCC alloy. What I have to do is to run several cascades in the same box preventing them to get to the box boundaries (boundaries are thermostated). To do that I need to start each cascade from the box center. So, is there a way to either:

  1. Pick an atom that is in the center of the box no matter what? (I mean, I can’t know the atom ID as each cascade would mix atoms in the center of the box, so an atom that at cascade #1 is in the center could be at the boundary at cascade #600)


  1. Pick a random atom ID and remap all atoms IDs so that the atom with my ID is where I need it to be (in the box center)?

Thank you.

Best regards,

Stefano Segantin

it is highly unlikely to find an atom at exactly the center.
so it would be better to define a region around the center and then try to identify which atoms are in it and pick one of those.

this will push the internal LAMMPS scripting to the limits of its capabilities (it was not designed to be a general purpose scripting language but to give a certain degree of flexibility to LAMMPS scripts), so you may need to experiment and be creative or do this via the python command which in turn will load the LAMMPS python module and then does more complex processing internally. there will be additional challenges to do this efficiently and in parallel.

another option would be to write your own post processing script to analyse the final state after a run (e.g. from a dump or data file) and then write a custom LAMMPS script input fragment for your purpose that can then be read in using the include command when starting the next run.


BTW: isn’t it going to bias the outcome of your simulation results when you are hitting atoms always in the same spot?

Yes it is. But I’ve been asked to exactly reproduce the results of a paper and in such paper the model description about that is exactly as follows:

“An atom is randomly chosen

as the primary knock-on atom (PKA), and we shift the entire cell to

move the PKA to the center”

So I guess I have to do so. Or there is something else that I don’t get in that “we shift the entire cell”, is there a command to shift a cell of atoms?

Thank you.



How about displace_atoms?