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

Mutable Dislocation Network and Coloring Dislocation

Dear Ovito Staff,

Hi, I'm currently using Ovito=3.1.0 Python Module and I have a question regarding Dislocation Network.

1.Can I make Dislocation data object mutable? Ex. I want to change the data of the dislocation segment such as data.dislocations.segments[1].points =[...] or data.dislocations.segments[1].true_burgers_vector=(...)


2. Can I assign different color for the Shockley dislocations of different Burgers vector? Ex. green for 1/6<1 1 2> and orange for 1/6<-1 1 2> and so on.  I know I can display dislocation by it's Burgers vector by DislocationVis.ColoringMode.ByBurgersVector but the question is whether I can assign the color on my taste.



Up to now, OVITO's Python API does not support modifying dislocation line data in any way. A reason for this limitation is that the underlying C++ data structures for dislocations will likely be replaced in a future version of OVITO, and with them the Python interfaces may need to be completely redesigned as well. You are the also first user to ask for this specific functionality.

Nevertheless, I've now made some transitory additions to the Python interface, which should allow you to do what you asked for. Specifically, a new method DislocationNetwork.set_segment() has been added, which lets you change data fields of individual dislocation lines from Python. Furthermore, the visual element, which renders the lines, now supports a way for you to control the color of individual dislocations (in case the mode DislocationVis.indicate_character==ByBurgersVector doesn't already do the job for you).

Here are some preview builds of OVITO Pro containing the described API extension. It will also be part of the next official release.

Thank you very much for quick reply.

I have an error regarding 'Loading the native module with core bindings' in when use "import ovito". It seems it's having a conflict when using python38.dll but I'm not sure.


But regarding DXA, I have another question.

Would you mind if I ask the reason behind using Common Neighbor Analysis for structure identification in DXA algorithm? Can I use another structure identification code, e.g., PolyhedralTemplateMatching, and use that data for dislocation extraction?

I've now tested the program build on a Windows machine by running ovitos.exe, but it seems to load without any problems. Please extract the .zip file to a new folder. These kinds of problems typically occur when copying a newer installation over an existing older installation. Let me know if the problem persists.

In principle it would be possible to base the DXA algorithm on the Polyhedral Template Matching method instead of CNA. But the DXA implementation found in OVITO had been developed in 2011/2012, at a time when PTM was not invented yet. When I am going to develop a new, improved dislocation identification tool for OVITO, which I hope to do at some point in the future, it will likely make use of PTM.