Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Alexander Stukowski

Pages: 1 ... 14 15 [16] 17 18 ... 22
Support Forum / Re: Ovito
« on: June 07, 2017, 08:15:57 PM »
Sorry, I no longer provide current program packages for 32-bit Windows. It would mean a lot of extra work and the demand is quite small. The last program version available for 32-bit Windows was Ovito 2.7.1. You can still download it here:

Ovito internally uses the Voro++ library to compute the Voronoi tessellation. This library only supports 3d tessellation, not 2d.
Note that it should still work if the input cell is 3d, has a finite height, and all points are positioned on the same plane. Of course, you will have to divide the computed atomic volumes by the cell height to get the 2d Voronoi cell areas.

Apparently, Ovito doesn't produce a helpful message. I have created an issue in our issue tracking system here with the aim to improve the situation in the future:

Hi Alex,

I couldn't spot any problem in your code. I suggest you use the -g command line option when running this script with ovitos. This will start up the graphical program version while executing your script and your can check if everything was performed as intended and inspect the computation results. Note that you have to add a line 'node.add_to_scene()' to your script to make this work. Ovito's particle inspection utility will allow you to check the assigned 'Atomic Volume' values of individual particles.


Support Forum / Re: GSD file error
« on: June 06, 2017, 09:56:57 PM »
It would be great if you could post an example GSD file that leads to the error message that you describe. I will then check what is going on. Thanks.


(If the file is too big for this forum, please send it directly to my email address, or post a link to a share hosting service.)

The Viewport.render() method return an image object, which may be manipulated before saving it to a file with the save() method. But this shortcut is not meant for movies, only single frames.

For movies, you have to add a Python viewport overlay to the viewport being rendered. This is basically a custom Python function that gets called by OVITO every time a movie frame from the sequence is rendered. It allows you to draw on top of the rendered images before they are appended to the encoded movie file.

As you have already figured out yourself, you can use '*' in the filename passed to import_file() to load a sequence of data files. However, concatenating multiple sequences (with different base names or in different directories) is currently not supported. You will have to rename the files and put them all into a single directory to produce a single movie from them. Alternatively, you could render three sequences of image files with OVITO and then encode them all to a single video file using some external tool.

Hi Alex,
here is a simple example:

Code: [Select]
import ovito
from import *
from ovito.vis import *

node = import_file("animation.dump.gz", multiple_frames = True)

vp = ovito.dataset.viewports.active_vp

settings = RenderSettings(
    filename = "movie.avi",
    size = (640, 480),
    range = RenderSettings.Range.ANIMATION       

Support Forum / Re: Time (ps) of each frame in a movie
« on: June 02, 2017, 09:08:35 PM »
I don't think so. The LAMMPS dump file format only stores the timestep number. So that's the only information available to OVITO.

If, however, you have a lookup table available, perhaps a text or log file with the tilmestep numbers and corresponding simulation times, you could load it as part of the Python viewport overlay script and do the conversion yourself.

Support Forum / Re: Problem with ovito stopping suddenly
« on: June 01, 2017, 10:26:23 PM »
Thanks, I have downloaded the LAMMPS file. I am currently on a vacation trip, but when I return, I will check if I notice anything unusual when applying the Coordination Analysis modifier to this dataset under Windows.

Can you please confirm that the problem occurred as soon as you inserted the Coordination Analysis modifier after loading the dataset without any other operation being performed before? You did not even have the chance to change the cutoff distance parameter of the cluster analysis?

Furthermore, I noticed that the dump file contains multiple simulation frames. Did you look at frame 0?

Support Forum / Re: Time (ps) of each frame in a movie
« on: June 01, 2017, 05:21:51 PM »
Hi Christophe,

Printing the timestep number in the rendered frames can be done using the Text Label viewport overlay.

However, if you need to convert the timestep to a simulation time in picoseconds first, like in your case, then the Python Script viewport overlay is your friend.

Alternatively, you can insert a Python Script modifier into the data pipeline that performs the numeric conversion of the global "Timestep" attribute (requires just a single line of Python code). Then you can use the  Text Label viewport overlay to print the value of the new attribute. Let me know if you need help with that.



Yes, the binary LAMMPS dump format is generally hard to parse, because one needs to know the exact compile settings, code version and hardware platform LAMMPS was built on. All this information is not stored in the dump file and not available to OVITO. It has to guess it -something which is not guaranteed to work.

When I'm back from vacation (2-3 weeks from now), I will see if I can improve OVITO's heuristic for parsing binary dump files. For that I will need a sample file from you for analysis and testing. Hope you can provide one.

I am moving this discussion to the OVITO issue tracking system, which makes it easier to manage future changes to the source code in response to your request. Please post the sample file there, or send it to my email address directly, thanks.

Excuse me, I am on a holiday trip right now and couldn't test the code I posted. After taking a second look, I spotted at least one mistake:['Shear Strain'].array)

This should be "input.particle_properties", not particle_attributes.

Hi Mike,

Yes, Ovito allows you to do this. You simply have to use the File/Export File function. Pick "Calculation Results Text File" as output format. The Dislocation Analysis modifier outputs an attribute with the name "DislocationAnalysis.length.1/6<112>", which you can export to a text file as a function of simulation time.



You can insert a PythonScriptModifier into the data pipeline in between the shear strain calculation and your SelectExpressionModifier. The Python function determines maximum value of the atomic shear strain property and stores it as a global attribute that is injected into the pipeline. This attribute can then be referenced by the SelectExpressionModifier down the pipeline.

Code: [Select]
import numpy as np


def determine_max_strain(time, input, output):
    output.attributes['MaxShearStrain'] = np.max(input.particle_attributes['Shear Strain'].array)

node.modifiers.append(PythonScriptModifier(function = determine_max_strain))


Note that the Compute Property modifier, unlike the Coordination Analysis modifier, does not compute the radial distribution function (RDF). The RDF is displayed in the Coordination Analysis panel.

However, because you specifically asked for coordination numbers, I assumed you are not interested in the RDF.

The coordination number computed by the Coordination Analysis modifier for each particle is stored in the "Coordination" output particle property. You can inspect all properties a particle has using the Particle Inspection utility of OVITO. Or you can use the Color Coding modifier, for example, to assign a color to each particle based on one of their property values (in your case the Coordination property).

The Compute Property modifier also outputs the computed values as new particle properties that are attached to each particle. This output data is stored but not immediately visible. You have to make it visible, e.g. using the Color Coding modifier.

In the math expression "ParticleType==2 ? 1 : 0" the ?: denotes a so-called ternary operator. The first table on the documentation page of the Compute Property modifier explains what it does:

A ? B : C   
If A differs from 0 (i.e. is true), the resulting value of this expression is B, else C.

In other words, the expression evaluate to the value 1 if the ParticleType property has the value 2. Otherwise it evaluates to 0. Thus, neighbours of types other than "2" do not contribute to the computed sum.

Support Forum / Re: Problem with ovito stopping suddenly
« on: May 25, 2017, 09:22:56 AM »
Dear Rangsiman,

This sounds like a bug in Ovito's cluster analysis routine, but let's see, I will need some more information to find out what is going wrong. It would be best if you could send me the dump file that is causing the program crash. I will then try to reproduce the problem and hopefully find a quick way to fix it.

It's best if you report this kind of bug report directly to me (mail [at] or, even better, create an issue in our bug tracking system on GitLab in the future (

Anyway, can you send me the dump file via email? Or, if it is too big, put it on a share hosting service and send me a link?


Pages: 1 ... 14 15 [16] 17 18 ... 22