Modification to the delete_atoms overlap command to delete both the atoms

Dear LAMMPS Community,

I have made a small addition to the delete_atoms command. In the overlap option, I have added a keyword “both”. This keyword can be used to delete both the atoms when they are within the user specified cutoff distance. If the keyword is omitted then the command just deletes the atoms in the first group (as in the original command).
Here is an example of usage:

delete_atoms overlap 0.5 solvent colloid both

I am not sure why this option wasn't added originally. It works great for me. Please add this feature if it can be useful to other LAMMPS users.

Here is my reasoning to do the changes if anyone is interested:

I needed this functionality to simulate de-nitrogenation in graphene nanoribbons. But instead of using a different element (N, which would also have required a specialized potential file), I used the same element C with a different atom type (I call them "FakeNitrogen"). This enabled me to use the airebo potential. I wanted to delete two such "FakeNitrogen" atoms whenever they were within a specific distance of each other.

After searching a lot, I found that delete_atoms should have worked the best only if it deleted both the atoms. Initially I did try to find a work around by using two delete_atoms overlap commands, but the results weren't satisfactory since the two atoms didn't disappear in the same timestep. In the modification, I haven't made any significant changes to the source code, which can be easily verified. Please find the modified source file for delete_atoms.cpp attached.

If there is a problem with my approach, please inform me.

Thanks and Best regards,

delete_atoms.cpp (24 KB)