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

Plotting length dislocation lines for the whole simulation time

Hello Dr. Stukowski/Kalcher,

I want to plot length of dislocation lines with respect to different dislocation types (perfect, shockley, etc.) as a function of N time frame. Is there a way to do it? Now, I can have dislocation line results at each time frame (i) from the structure analysis results. But I want to plot the variation of length of dislocation lines over the whole simulation period. I want to the same thing for structure count/dislocation count also.

Baig

 

Hi,

At the moment, this is possible by (1) exporting the results of the DXA modifier to a text-file (use File->Export->DataTableTextFile in the GUI) and then using your preferred plotting program or (2) writing a python batch script. Let me know if you need further help with any of those options.

You may be happy to hear that we plan to include a function in a future release of OVITO that can directly calculate and plot time series.

-Constanze

Dr. Kalcher,

I tried that already. It asks for Export Frame Sequence. If I select Current Frame, it saves the content in one file. If I select Range, the content is saved in different files (just like the files that are attached). I want to save all of the dislocation types in one file as time series. Is there any way to do that in the current version?

Uploaded files:
  • You need to login to have access to uploads.

Option 1:

Yes, if you use the python scripting interface, you have more freedom on how to format the results you want to export. If you like, you can try the following batch script. Note that this is meant to be executed from the terminal using ovitos.

from ovito.io import *
from ovito.modifiers import *
from ovito.pipeline import *
import numpy as np     

# Data import:
pipeline = import_file('your-input-file')

# Dislocation analysis (DXA):
pipeline.modifiers.append(DislocationAnalysisModifier(input_crystal_structure = DislocationAnalysisModifier.Lattice.BCC))

f=open('disl-lengths.txt','ab')

for i in range(pipeline.source.num_frames):
    data = pipeline.compute(i)
    table = data.tables['disloc-lengths']
    column_names = [table.x.type_by_id(i).name for i in range(table.count)]
    np.savetxt(f, np.column_stack((column_names, table.y)))
       
f.close()

Option 2:

However, since you already have exported all these files, it's probably easiest to merge your files?
If you're using Windows, e.g., you could open the terminal, go to the folder that contains your exported results and then use the type command to merge your files.

type your-file-name-pattern*.txt > merged_files.txt

(works similarly to UNIX cat)