Question on fix atom/swap

Is it correct that the atom ID will not be swapped after a successful switch?
For example, atom A (type 1 and id 1) and atom B (type 2 and id 2) are swapped, and new atom A (at the original atom A position) becomes type 2 and id 1, and new atom B (at the original atom B position) becomes type 1 and id 2?
I was trying to trace the redistribution of atoms after this simulation, and this cannot work if the atom ID stays the same after swaps. Any suggestions?

Have you tried testing such a 2-atom simulation? That would be the easiest way to check.

Hi, Could you explain why you need the atom Ids for that? Isn’t the atom type enough? Simon

I think I am 99% confidence that the atom ID is not changed after the switch. But a 2-atom test can be a quick check.

Thank you for the question. Atom type can only tell there is a redistribution of different types of atoms, but it is difficult to know what is the origin for this redistribution. For example, if there are grain boundaries and defects, it would be interesting to know if the segregation on the grain boundaries is mainly from atoms near defects or not.

For such subtle space-dependent analysis, I would turn to post-processing tools such as Python/MDAnalysis. For instance, from a dump file containing atom ids, types, and positions, it must be possible to identify the location of each successful atom swap.

I actually attempt to use a post-processing tool (Matlab) to identify switched atoms. However, this information cannot be obtained since the atom ID is not changed, and there could be thousand possibilities depending on the size of the system.

Sorry, I cannot follow the logic here. If atom with ID X has the type A in one trajectory frame and type B in the next trajectory frame, then it was swapped. Where is the problem?

If the atom ID was changing together with the atom type, it would be a nightmare to track swaps using postprocessing analysis.

My purpose is to find out where is the original position of type B atom in the old trajectory frame. If the atom ID is not changed, then it is impossible to locate its position if there are multiple type B atoms in the old trajectory frame.

From a statistical mechanics perspective, it is irrelevant which atom from where has switched its type to which atom elsewhere. All that matters is to know which atoms have changed from A to B and which atoms have changed from B to A. That you can do already.

If you want something else, you must modify the source code to obtain a log of the individual swap transactions and post-process that. I don’t see the value in this, but if you believe there is one, then you are free to do so, but you will have to do it yourself. That is why we make LAMMPS available as open source, so that people can do whatever they think they need and are not limited by the opinions or choices of others.