Author Topic: combine ovito python script with lammps  (Read 68 times)

zsjan

  • Newbie
  • *
  • Posts: 1
combine ovito python script with lammps
« on: January 10, 2019, 04:49:33 AM »
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!

Shijun

Xtof

  • Jr. Member
  • **
  • Posts: 66
Re: combine ovito python script with lammps
« Reply #1 on: January 10, 2019, 09:48:36 AM »
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:
https://ovito.org/manual/python/modules/ovito_modifiers.html#ovito.modifiers.WignerSeitzAnalysisModifier

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,
Christophe

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 159
Re: combine ovito python script with lammps
« Reply #2 on: January 11, 2019, 12:19:00 PM »
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".
https://lammps.sandia.gov/doc/compute_voronoi_atom.html
Maybe this way you can avoid post-processing after all.

Hope that helps,
Constanze

Xtof

  • Jr. Member
  • **
  • Posts: 66
Re: combine ovito python script with lammps
« Reply #3 on: January 11, 2019, 12:22:01 PM »
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

  • Administrator
  • Full Member
  • *****
  • Posts: 159
Re: combine ovito python script with lammps
« Reply #4 on: January 11, 2019, 01:47:18 PM »
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.

-Constanze
« Last Edit: January 11, 2019, 02:51:10 PM by Constanze Kalcher »