Author Topic: How can we get a bond angle distribution in ovito?  (Read 780 times)

sbista

  • Newbie
  • *
  • Posts: 2
How can we get a bond angle distribution in ovito?
« on: February 16, 2018, 05:32:37 AM »
Hi,
I would like to know if we could write a python script to get a bond angle distribution for a selected particle types in ovito. I am interested in creating a histogram of bond angle distribution between certain particle types in my simulations.
Thanks

Alexander Stukowski

  • Administrator
  • Sr. Member
  • *****
  • Posts: 499
Re: How can we get a bond angle distribution in ovito?
« Reply #1 on: February 16, 2018, 04:17:41 PM »
Hi there,

Here is a script I wrote some time ago for Ovito 2.9.0 to calculate the bond-angle distribution for a system (for demonstration purposes). It may serve you as a starting point to develop a solution for your specific problem. Disclaimer: I never used the script for real-word analyses and I never verified that it is working correctly. So use with caution.

-Alex

SC

  • Newbie
  • *
  • Posts: 5
Re: How can we get a bond angle distribution in ovito?
« Reply #2 on: October 24, 2018, 03:58:20 PM »
Dear Dr. Stukowski,

I used your script to calculate bond angle distribution. I get the following:

Bond angle cosine histogram:
[4423220       0       0       0      93    6950  147557  998011 2604010
 2946143 1606165  457026   73560    6972     416      13       0       0
      17     612   12790  140796  844062 2757451 4967918 5003619 2852902
  945803  261040  284857  629331 1145734 1616595 1763957 1499768  995794
  515809  211497   68083   17656    3582     580     560    4518   30945
  162271  646447 1931808 4161468 6223576 6294421 4273684 1978276  647640
  153969   27062    3385     308      14       3       0       0       0
       0       0       0       0       0       0       8     689   22868
  343535 2270218 6146446 6336389 2299107  264943    8670      72       0
       0       0       0       0       0       5     979   55577 1012293
 4272345 3194279  309097    2341       0       0       0       0       0
       0]
Invalid Python script. It does not define the function modify().

However, I am not sure how this can be interpreted. Would you please give some explanation about this?

Bets wishes,

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 110
Re: How can we get a bond angle distribution in ovito?
« Reply #3 on: October 24, 2018, 04:50:13 PM »
Dear SC,

concerning the error message: did you just copy that code in a python script modifier in the GUI of OVITO? Note that this is a bash-script which is meant to be executed from the command line like this:
Code: [Select]
ovitos <name-of-script.py>
See the documentation about running scripts.

-Constanze
« Last Edit: October 24, 2018, 04:51:50 PM by Constanze Kalcher »