OVITO > Support Forum

combine ovito python script with lammps


Dear All:
I want to know is there any simple method to incorporate ovito python script in lammps simulations? Specifically, I want to use WS analysis to output defect coordinates at every step. I can output all the atomic configurations but it is too big and useless for me. All I want is only the defect position. I have tried python command in lammps but it seems too slow. So is there a easy way to do this? Thank you very much!


Dear Shijun,

As explained in the webpage of OVITO you can use python scripting through ovitos command. It allows you using the same analysers than in the graphical interface.
You can write a script in which you use the WS analyser to find the position of interstitials and vacancies after a cascade, using LAMMPS files.

Here you have an example given on the web page:

To do so, you need to output the initial (before cascade) and the final (after cascade) crystal configurations with LAMMPS.

Hope it helps.
Best regards,

Constanze Kalcher:
Dear Shijun,

since it's possible to call python from within lammps it should in principle be possible to use ovitos, but it seems like you have already tried that and I doubt it would be very efficient.

I don't think there is an easy way to calculate defects "on the fly" with ovitos. However something similar seems to already exist in lammps. Have a look at the lammps documentation of the
compute voronoi/atom command, more specifically the keyword "occupation".
Maybe this way you can avoid post-processing after all.

Hope that helps,

Actually, now I remember that you can use the Voronoi package in LAMMPS to calculate the defects at each time step. No need of Python for that.

Alternative way: dump your files at each N steps in LAMMPS and then use the Python scripting of ovitos to calculate the defects.

Constanze Kalcher:
Hi Christophe,

Yes, that's what I was hinting at. Since Shijun tries to avoid having to dump a large amount of snapshots, this seems to be the preferred way.



[0] Message Index

Go to full version