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 ... 19 20 [21] 22
Support Forum / Re: Compile error
« on: February 17, 2017, 03:02:29 PM »
It looks like there is another user facing the same issue described in this forum thread. He created an issue on GitLab:

@krege: Can you please describe your solution. Which changes to the source code did you exactly make to fix the compilation error?


Support Forum / Re: connection error reading from remote HPC
« on: February 17, 2017, 02:57:42 PM »

The error message suggests that the SSH client of OVITO does not reach the SSH server at all. I assume you already double checked that the hostname is correct. (It might be a good idea though to also use the 'ping' command in the terminal to check if the server is responding).

What about the port? Does the SSH server listen on the default port 22?

Which Windows software do you normally use to connect to the HPC machine?

And do you have any firewall software installed on your local PC that may be blocking OVITO from connecting to the remote host?

Support Forum / Re: Building docs
« on: February 16, 2017, 08:09:00 AM »
I'm glad it worked. Thanks for letting us know.

Support Forum / Re: Building docs
« on: February 15, 2017, 10:22:30 AM »

Normally, the CMake build script takes care of building the Python documentation using Sphinx. It should be sufficient to run "make scripting_documentation" in the build directory. Is this what you were doing? The console output you posted suggests that you run Sphinx manually. But that being said, the way you ran Sphinx looks okay to me.

I haven't see this type of error before. To me it looks like an internal error in the Sphinx machinery which is not really related to OVITO. All I can say is that I didn't have any problems generating the docs with the same version of Sphinx (1.4.8 ) as you.

I'm sorry that I could not provide any real help here.

Support Forum / Re: regarding ovito use on HPC
« on: February 15, 2017, 10:10:03 AM »

I'm not sure what this error message means, I haven't encountered it before. However, I have seen a very similar type of message in the terminal: "setNativeLocks failed: Resource temporarily unavailable". It is due to a bug in an older version of the Qt library used by OVITO ( It occurs every time OVITO writes to its program configuration file in the user's home directory if it is located on a network drive. In this case locking the configuration file to prevent shared access fails due to the Qt bug. However, this warning message can be safely ignored in my experience.

This being said, let me ask you:

1) Does OVITO work normally despite the message, or is it terminating right after printing that message?
2) Did you build OVITO from source, or are you using the official binaries?


Support Forum / Re: Unit of D^2
« on: February 09, 2017, 09:46:44 PM »

Yes, this is correct. The unit of this quantity is length squared in whatever units of length your input data is.

Support Forum / Re: How to hide background atom in OVITO
« on: February 07, 2017, 09:34:16 AM »
In the reference picture you posted the hexagonal rings have been filled with semitransparent polygons. Currently, OVITO doesn't provide a function to do exactly this. You may be lucky by using OVITO's "Construct surface mesh" modifier function though. It creates a surface mesh around atomistic structures. However, it has originally been designed for solid structures, not sheet-like objects like your nanotube. I'm pretty sure it would work for a straight nanotube, but for the helical tube I'm not so sure. You probably have to play around with the "probe sphere radius" parameter.

Support Forum / Re: GSD File Format Type Issues
« on: January 29, 2017, 02:22:30 PM »
I have fixed the loading of GSD files now. Please check out the newest development version available here.

Loading of GSD files with static data like the particle types was not correctly implemented, mainly because I didn't have appropriate test data available. Thanks for providing a file. Let me know if you notice any remaining problems with the new program version.

Support Forum / Re: Temperature in Lammps
« on: January 28, 2017, 06:33:25 PM »
OVITO cannot directly import global thermo data from LAMMPS simulations.

But you could use OVITO's Python script overlay feature for this. That means you have to write a small Python script that reads in the temperature data from a text file (or directly from the LAMMPS log file). In your user-defined viewport overlay function you then print the temperature value for the current simulation frame onto the rendered viewport image.

Support Forum / Re: GSD File Format Type Issues
« on: January 27, 2017, 09:09:59 AM »
I just want to leave a short notice here that I am currently traveling and I will look into this issue as soon as possible.
In the meantime: If you have a small example GSD file to demonstrate/reproduce this issue, it would be great.

Support Forum / Re: Including CAT in OVITO
« on: January 27, 2017, 08:59:32 AM »
Hi Iyad,

Thank you for your suggestion. Yes, in principle it is possible to integrate the more advanced structure identification algorithms of CAT into OVITO, but it would require several weeks of development work. I currently don't have the time to do it myself. Let's see, hopefully I can obtain more manpower to do this in the future.

Support Forum / Re: Compile error
« on: January 19, 2017, 12:32:25 PM »
Sorry, I'm not sure if I understand.

After my change, ViewportMenu.h now includes <gui/GUI.h>, which includes <core/Core.h>, which includes <QtGlobal>. Why does GCC 6 still not see the macros defined in <QtGlobal>?

If you can, and if you find that my solution is insufficient please open an issue or a merge request on GitLab:


Support Forum / Re: OVITO WS Python Script
« on: January 19, 2017, 09:08:37 AM »

The problem is that Ovito only allows one particle selection to exist at a time. More specifically, a DataCollection can only hold one particle property named "Selection". Particles cannot have multiple selection properties associated with them. So if you do

Code: [Select]
    # Set up a particle selection by creating the Selection property:
    selection1 = output.create_particle_property(ParticleProperty.Type.Selection).marray
    selection2 = output.create_particle_property(ParticleProperty.Type.Selection).marray
    selection3 = output.create_particle_property(ParticleProperty.Type.Selection).marray
    selection4 = output.create_particle_property(ParticleProperty.Type.Selection).marray
    selection5 = output.create_particle_property(ParticleProperty.Type.Selection).marray
    selection6 = output.create_particle_property(ParticleProperty.Type.Selection).marray

then the repeated call to create_particle_property() will always return the same particle property and all variables selection1 though selection6 will refer to the same Numpy data array and the following code will lead to wrong results.

Since your are mainly interested in the defect counts, I recommend that you do not create particle selections at all. Instead, just create temporary Numpy arrays and count non-zero entries:

Code: [Select]
selection1 = (site_type == 1) & (occupancies[:,0] == 0) & (occupancies[:,1] == 0)
selection2 = (site_type == 1) & (occupancies[:,0] == 0) & (occupancies[:,1] == 1)
output.attributes['O_Vac'] = np.count_nonzero(selection1)
output.attributes['O_Anti'] = np.count_nonzero(selection2)

If you want, however, you can still let the modifier function generate a particle selection, but only one!

Support Forum / Re: Compile error
« on: January 19, 2017, 08:50:36 AM »
Okay, great that you found out what caused this error. I now added <QtGlobal> to the list of headers that are included in every source file (

Thanks for describing your experience. I will look into this when I find some time. But it's likely a bug in the Qt library itself, which is responsible for this, and there is not much I can do about it.

Previously, another Ovito user also reported a program crash after choosing "Load File". This one turned out to be a compatibility problem between Qt and the Dell backup and Recovery software installed on his system (see Again, switching to the alternative File Selection dialog solved the problem.

Support Forum / Re: Compile error
« on: January 18, 2017, 12:16:32 PM »

I'm not familiar with Fedora Linux, but I assume Fedora 25 is rather old and may come with an old version of the Qt library. My hypothesis is that you are building Ovito against Qt 5.2 or 5.3. That is something I haven't tested for some time now (current version of Qt is 5.8 ). So perhaps the error is due to an undiscovered backward incompatibility. It could be that the MOC compiler of Qt 5.2/5.3 cannot handle the #if directive found in line 53 of src/gui/viewport/ViewportMenu.h. Try to comment out this line (and the corresponding #endif) to work around the issue:

Code: [Select]
void onWindowFocusChanged() {
if(QGuiApplication::focusWindow() && QGuiApplication::focusWindow()->flags().testFlag(Qt::Popup) == false) {
// #endif


Yes, Ovito keeps a list of recently accessed directories and the most recently accessed directory will automatically be opened in the file selection dialog. This list is stored in the application settings file or registry branch, depending on the type of operating system. The location of that file/registry entry is displayed at the bottom of Ovito's application settings dialog.

You can delete the settings file or registry tree to reset Ovito to its default settings. If you are specifically, interested in the directory list, look for an entry named 'import\history' under the '[filedialog]' group.

I don't have an explanation for the program crash. If the non-existing path is the reason, then it's a bug in the Qt library, which is responsible for the file selection dialog. Ovito itself does not try to access the path.

The Qt library provides two versions of the file selection dialog: the native dialog of the operating system and a platform-independent one. As a workaround, you can try to switch to the other type. Ovito provides a corresponding option in the application settings dialog ("Use alternative file selection dialog"). Try this first before resetting Ovito completely, and let me know if it solves the problem.

Best regards.

Support Forum / Re: Bond properties in Histogram modifier
« on: January 12, 2017, 04:56:43 PM »
A good idea.

I have extended the Histogram modifier accordingly. Please check out the latest development build.

Support Forum / Re: Graphic card and type of rendering pictures
« on: January 09, 2017, 01:25:08 PM »
1. Yes, I would think that the integrated Intel graphics should be sufficient to work with a one-million atoms dataset. The graphics hardware is only used for displaying the atoms. It's not used by Ovito to accelerate other computations.

2. I am not aware of any technique or freely available programming framework that would allow to render the three-dimensional scene including atoms and bonds to a 2d vector graphics format, at least not with the visual quality we get from pixel-based renderers. If you know one, please tell. However, I'm not sure how much benefit this would bring anyway. For the following reason: Ovito is designed for large datasets with millions of atoms. The key advantage of bitmap-based output is that the resulting file size is independent of the number of visual elements in the three-dimensional scene (i.e. atoms, bonds, etc.). Furthermore, unlike with lines and flat surfaces, vector graphics formats often have difficulties to properly describe shaded spheres.

Support Forum / Re: Adaptive CNA for 2D binary systems
« on: January 08, 2017, 11:29:29 AM »
The adaptive mode of the CNA is currently only implemented for certain three-dimensional crystal structures like FCC and BCC. In principle, it would be possible to extend this approach to two-dimensional structures, but that would require modifying the C++ code of the CNA modifier. The point is that the adaptive mode, which is responsible for picking the optimal neighbor cutoff for each atom, always requires some a priori knowledge on the specific structure to search for. It is not a general method that is independent of the structure you are trying to identify.

But maybe it is possible to stick to the conventional bond-based CNA mode and instead change the way bonds are created. This could improve the identification of the crystalline 2D structure your are looking for in a similar manner as the adaptive CNA mode.

For example, writing a custom PythonScriptModifier, which can be used in place of a CreateBondsModifier, might be an idea. Instead of creating bonds up to a certain cutoff radius, the custom modifier could create exactly N bonds on each atom using the NearestNeighborFinder class.

Support Forum / Re: Global parameters defination
« on: January 07, 2017, 07:35:28 PM »
Dear Leal,

Yes, it is possible to define global values that are accessible by modifiers in the data pipeline and which can be referenced in expressions of the SelectExpressionModifier. They can be defined by adding entries to the attributes dictionary of the node.source object.

However, this doesn't seem to be the right strategy for the problem at hand, because the global attributes are static across the entire pipeline. If I understand you correctly, you want to create several SelectExpressionModifiers, each with different values for L and M. In this case I suggest you simply replace the variables L and M in the selection expression with their numeric values, i.e.

Code: [Select]
for i in ...
    L  = i*5
    M  = (i+1)*5
    Select=SelectExpressionModifier(expression='Position.Y*Position.Y+Position.Z*Position.Z>{L}*{L} && Position.Y*Position.Y+Position.Z*Position.Z<{M}*{M}'.format(L=L, M=M))

Another alternative is to use a PythonScriptModifier instead of a SelectExpressionModifier. Unlike the latter, the user-defined Python modifier function has direct access to variables defined in the Python script.

Let me know if you have further questions. The best solution to this scripting problem probably depends on what exactly you want to do with these ring-shaped particle selections.

Hi Leal,

I'm not sure if I can tell you much more than what is already said in the documentation.

Your code is sufficient to set up the modifier. Next you need to call node.compute(). Subsequently, you can access the computed data through the modifier's bin_data property. In this specific case, it refers to a one-dimensional array with 100 entries, holding the mean coordination number of particles within the 100 slices along the x-axis of the simulation cell.

Code: [Select]

mean_coordination = modifier.bin_data
assert(len(mean_coordination) == modifier.bin_count_x)

Let me know if you need further help with this.

Support Forum / Re: Graphic card and type of rendering pictures
« on: January 03, 2017, 11:24:12 AM »
1. OVITO requires graphics hardware that supports version 2.1 or later of the OpenGL standard. Virtually all graphics cards and integrated graphics units that you can buy today do this. The rendering quality does not depend on the hardware's capabilities, only the interactive performance does. If you work a lot with datasets containing tens of millions of atoms, a dedicated graphics chip or card are recommended.

2. Note that OVITO can only produce bitmap images. But if your question is whether it is possible to include user-defined vector graphics in the images rendered by OVITO, then I suggest you take a look at the Python script viewport overlay. This feature allows you to paint graphics on top of rendered images, and it might even be possible to load an external SVG vector graphics file and overlay it on the output image.

Support Forum / Re: colour atoms by index
« on: December 28, 2016, 05:00:37 PM »

One way to do this is to first select a group of particles based on their indices and then use the Assign Color modifier to assign a color of your choice to the selected particles. To select the particles, first use the Expression Select modifier with an expression like this:

     ParticleIndex>100 && ParticleIndex<=200

These steps can be repeated to assign colors to more ranges of particles.

Loading a VTK file works the same way as loading a simulation data file (Select "Load File" from the menu). Pick "Add to scene" when being asked how to import the data from the VTK file into Ovito. This will create a second object in the three-dimensional scene in addition to the simulation dataset that is already loaded.

I see, you want to run the script from within Ovito. This requires a different approach, because Ovito has already called QApplication::exec() and the script is executed within the running event loop. However, Qt allows you to start a local event loop. The loop can be stopped again by some signal (in this case: the window being closed by the user). Here is a demo script:

Code: [Select]
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import sys
if __name__ == '__main__':
    app = QApplication.instance()
    window1 = QWidget()
    window1.setWindowTitle("Hello World!")

    event_loop = QEventLoop()
    window1.setAttribute(Qt.WA_DeleteOnClose)      # Make sure window is destroyed when user closes it.
    window1.destroyed.connect(event_loop.quit)     # Quit local event loop when window is destroyed.
    QTimer.singleShot(100, lambda: window1.activateWindow())     # Wait for a short time, then bring window in front of all other windows.
    event_loop.exec()     # Start local event loop.

One problem I noticed with this approach: If you abort the script execution by pressing "Cancel" instead of closing the window, the local event loop is never orderly terminated. This seems to cause a program crash when Ovito is quit.

Hmm, the minimal code example that you posted works for me when I run it with the ovitos interpreter (Ovito version 2.8.1, Linux). It shows a window, and the script waits until I manually close the window. Please let me know if you are trying this on a platform other than Linux. Maybe it is a platform-specific issue.

Here is also a link to the corresponding page of the user manual, which describes the viewport overlay feature:

Regarding the second question:

In the current program version, the plane of the Slice modifier will only be visible in the interactive viewports, not in rendered images. The only way to add arbitrary geometry to the three-dimensional scene (e.g. a plane) is to import a VTK file into Ovito that contains a triangle mesh. I have attached an example VTK file containing a tetrahedron made of four triangular faces. The file format is documented here.

Unfortunately, this approach requires that you write the VTK file by hand or use some other tool like ParaView to prepare it. There is no way to generate the plane geometry within Ovito (but you can use the Move tool found in the toolbar to reposition the imported geometry).


Note that Ovito already creates its own QApplication object. The same is true for the ovitos script interpreter. The internal QApplication object exists while the script is being executed.

It is therefore not a good idea to create a second QApplication from the script (Qt only allows a single QApplication instance). The segmentation fault results from Ovito trying to delete its QApplication object after script execution. However, this object has already been auto-deleted by Qt, because the script created a second QApplication object.

The solution to this problem is to not create a second QApplication instance. Instead, simply access the existing one from the script:

Code: [Select]
if __name__ == '__main__':
    app = QApplication.instance()

(Older Ovito versions didn't try to delete the QApplication object upon program exit. Thus, creating a second QApplication object from the script, even though wrong, didn't result in a segfault.)

Support Forum / Re: LAMMPS sphere data format
« on: December 14, 2016, 04:20:05 PM »
I added the option to load and write LAMMPS data files with atom_style=sphere for you (Commit 5e4ba252).

The particle diameters read from the data file are automatically mapped to the "Radius" particle property in OVITO (after dividing by 2) and the density values are mapped to the "Mass" particle property (after multiplying with the particle volume).

Particles with radius=0 in the data file will be rendered using the default radius, which can be set in the particle display panel of OVITO.
Please download the latest development build from the website.

Pages: 1 ... 19 20 [21] 22