Forum Navigation
You need to log in to create posts and topics.

Find Atom ID

Dear All,


I am new to OVITO.

Sorry if the question is too basic.

Please find attached, the corresponding simulation domain.

I want to find the ID of the atoms on the surface of the nanoparticle.

Manual selection is too time-consuming and not precise somehow.

Is there any way to find the ID of the atoms on the surface of the nanoparticle automatically?


Best Regards,





Uploaded files:
  • np.png

Dear Reza,

the Construct Surface Mesh Modifier has an option "Select particles at the surface" which you can use to select all surface atoms:

Then in a next step, you can look up the Particle ID's of the selected atoms, e.g. with a python script modifier:

from import *

def modify(frame, data):
   print(data.particles["Particle Identifier"][ data.particles["Selection"]  == 1 ])

or you can use the Filter option in the Data inspector, e.g. by inserting Selection == 1 as filter expression.



Dear Constanze,


Thank you so much for your comments.

Since there were lots of other atoms in the simulation box, I have reduced their radius to show the nanoparticle.

Consequently, I can not use the surface mesh since it becomes something like Fig. 1.

Is there any command to remove selected types of atoms from the OVITO without affecting the particle Index of the other atoms?

I have found the "delete selected" modifier but it seems that it deletes all the particles.


I knew that the nanoparticle radius is about 15 Angstrom and it is located in the center of the simulation box.

Therefore, I have used the Filter Option with the following command and it seems that the atoms on the surface are now selected.


Please see Fig. 2.

I have tried to export it to excel to take the particle Index (first column of the data) but as I have copied the data and paste it in excel, the first column of data is not taken there.

Please see Fig. 3.

Is there any output format in OVITO that contains the particle Index?  I just need to have particles Index in a text file no matter the format is.


As the filter option is used and the particle data are shown, as Fig. 2, is there any way to show the selected atoms in another color on the nanoparticle surface?  Something like the "Select in viewports" option.


Best Regards,




Uploaded files:
  • Fig.-1.png
  • Fig.-2.png
  • Fig.-3.png

Hi Reza,

From the screenshot in your first post, it looks like the surrounding atoms have a different particle type than the atoms that are part of the nanoparticle. If that's the case, you can use a Select Type Modifier to select those atoms in conjunction with a Delete Selected Modifier such that only the nanoparticle is left in the scene.
In a next step, you can now use the Construct Surface Mesh Modifier with the option "Select particles at the surface" activated. This will cause all the surface atoms to be colored in red (since they are selected now).
If you don't want to use the python interface, the easiest would be to now add two more modifiers to your pipeline: First, the Invert Selection Modifier and then another Delete Selected Modifier. Now, the surface atoms of the nanoparticle should be the only thing left in the Scene.

Finally, you can use one of the Export-File functions to export only the Particle ID's of the particles left in the Scene (e.g. to the xyz file format). The file dialog during file export lets you choose the particle properties which you want to export.
However, from your second post I'm wondering, if the particle identifiers are part of your input data at all? Or did you mean to export the particle indices instead?

For visualization you can deactivate the last two modifiers again, i.e. the Invert Selection and Delete Selected Modifiers, and add an Assign Color Modifier to the pipeline to change the color of the selected surface atoms.


Hi Constanze,

Thank you so much for your detailed answer.

I have used LAMMPS to create the input file for OVITO. Actually, this is an output of LAMMPS in the format of the dump file.

I have checked that and it seems that it does not contain the particle identifiers.

So, it might be great if I can export the particle indices instead.


Just a general tip, you should consider to also dump the particle identifiers, or otherwise you need to make sure that the particles are sorted by id before exporting your trajectory, otherwise this can cause serious problems during post-processing.

If you delete atoms from the scene in OVITO, the particle indices will be reassigned (as opposed to the particle identifiers), which is not what you want. But if you add an extra Compute property modifier to your pipeline and create the Particle Identifiers with OVITO you can avoid this problem. You can use the following settings:

Output Property: Particle Identifier
Expression: ParticleIndex +1

You will see an extra column labeled "Particle Identifier" appear in the Data Inspector. Now you can repeat the steps described in my last posts.

Let me know if that works for you.


Dear Constanze,

Thank you for your assistance.

It works fine and I have the atom ID now.

I have attached a snapshot of the output.


Uploaded files:
  • Untitled.png