RDF_caculation for specific atom

Dears LAMMPS support and community,

I am looking for a way to calculate the RDF for a specific atom.

Currently, I am using the compute RDF command as follow:
compute myRDF all rdf 100 407 212 407 740 407 91 # :(407 212) (407 740) (407 91) atom types pairs

fix myRDF all ave/time 100 1 100 c_myRDF[*] file tmp.rdf mode vector # to save the RDF

i.e. compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 … keyword/value …
Since the numbers in the first line refer to the atom type, one way to compute RDF for a specific atom is by assigning a new atom type for the atom of interest and copy all the potentials for it. However, I was wondering if there is another way to do so especially that the method I knew requires to start my simulation from the beginning OR run a python script to replace the old type with a new one (with the risk of having mistakes).

So is there a way to fix that in this stage using lamps commands or variables to calculate the RDF between two atom-ID rather atom-types.

I hope I was clear :slightly_smiling_face: and describe my problem properly.

I would be very thankful for your help.

Regards,
Moulham
PhD student At University of Strathclyde

The RDF between 2 atom IDs doesn’t make sense to me.
If you just want the distance between one specific pair of atoms
you can define an equal-style to compute it and output
it with thermo output or the print command.

Steve