Table of Contents
The aim of this tutorial is to make you familiar with OVITO. To let you repeat the steps described in this introduction, the example data file is included in the directory share/ovito/examples/tutorial1/
of your OVITO installation.
The first step when using OVITO is to import the simulation data you want to visualize. OVITO can import a number of file formats produced by popular simulation packages.
We import atoms into OVITO with the main menu, the corresponding button in the toolbar, or by pressing the Ctrl+i keyboard shortcut. This will open the file selector dialog shown in Figure 3.1.
→ command from the
Go to the folder share/ovito/examples/tutorial1/
containing the example file (NanocrystallinePd.dump.gz
). The file is
a compressed LAMMPS dump file obtained from an MD simulation. By default, OVITO will try to detect the format of the file automatically.
After opening the file, another dialog (Figure 3.2) pops up that lets you assign the data columns contained in the file to OVITO's internal data channels.
OVITO's internal data model consists of so-called data channels that store the atomic properties read from the input file.
Each data channel holds the values of a single property of the atoms, e.g. their positions or their velocity vectors. OVITO provides a set of standard data channels
for often-used properties like the atomic position, atom type, energy, etc. Beyond that, you are free to define your own data channels in OVITO and feed them with custom data generated by your simulation software.
Since dump files produced by the LAMMPS simulation code can contain an arbitrary number of columns it is necessary to tell OVITO which columns contain, for example, the atomic positions (X, Y, and Z coordinates). That is, we need to map columns in the input file to OVITO's internal data channels. The header of the given example file, however, already contains auxiliary information describing the contents of the file columns. Therefore you just have to press the
button to tell OVITO to use this information for the mapping. Note that this is a rather new feature of LAMMPS, which now produces self-describing dump files. Dump files written by older versions, or for instance XYZ files, do not store the meaning of the data columns. Then you have to specify the appropriate data channels in the table manually.
As you can see in Figure 3.2 there are five data columns in the example
file (id
, x
, y
, z
, c_epot
), each one being represented by a row in the table. The first file column contains the atomic index, which is a unique identifier for every atom, followed by the three coordinates, and finally the atomic potential energy in the fifth column. These five columns are mapped to three internal data channels
in OVITO called Atom Index, Position, and Potential Energy. The Position data channel is a so-called vector data channel composed of three sub-components, one for each coordinate X, Y, and Z.
Since the example file contains only a single snapshot of the simulation, leave the option
selected and press to import the data.After importing the simulation snapshot, you are now back in the main window as shown in Figure 3.3. You can find the usual menu and tool bars at the top and the bottom of the window. The central part of the main window is divided into two areas: The large viewport area on the left (which itself is sub-divided into four viewports) and the command panel on the right.
The viewports each display a three-dimensional view of the simulation cell that we just imported. Note how the four viewports,
which are called Top, Front, Left, and Perspective, show the same scene from different viewing directions.
Sometimes you might prefer a single large viewport. Then you can first select one of the viewports by right-clicking into it, and then press the () button in the lower right corner of the main window to enlarge it. Press the button again to restore the old viewport layout.
At the bottom of the main window you find additional buttons to control the viewports. The three navigation buttons (,
,
) allow you to
navigate in the three-dimensional scene, i.e., to move the virtual camera associated with each viewport. First activate one of the buttons, then click and drag the
mouse in one of the viewport windows. Finally, right-click in the viewport to exit the navigation mode and return to the default input mode.
However, it is highly recommended to use the keyboard shortcuts to navigate in the viewports, because this is much faster than using the tool button. For instance, by holding down the shift key on your keyboard while using the middle mouse button in one of the viewports you can rotate the camera at any time. To learn more on how to navigate in the viewports without explicitely activating the input modes, see this section of the reference manual.
To the right of the viewport area zou find the command panel. It is organized into tabs located at the top: the
Modify , Render
and Utilities
tabs. The Modify tab lets you modify your simulation data and control its visualization (as described in the next
section). This is where you will spend most of the time while working with OVITO. The Render tab lets you create images for publication and the Utilities tab provides access to additional tools that you might find useful.
Further information on the user interface of OVITO can be found in Section 5.1 of the manual.
Before you continue you should read Section 4.1 of the manual to learn more about modifier and processing pipeline. These theoretical concepts will be demonstrated with the following example.
In the first step of this tutorial we loaded the atoms from a file, and during import we told OVITO to read in three data channels: Position, Atom Index, and Potential Energy. These channels are fed into the processing pipeline - which is initially empty - by OVITO. So let us now insert a first modifier into that pipeline.
The list of available modifiers can be found in the drop-down listbox labeled "Modifier list" at the top of the Modify tab in the command panel. Select the entry named Slice from
the list to insert a Slice modifier into the pipeline. The current pipeline is displayed in the listbox below the drop-down field.
It should now contain two entries: The Slice modifier you just inserted and an entry denoting the import operation that you performed earlier. The import operation is always displayed as Input File - ...
in the pipeline listbox and can be thought of as the data source of the pipeline. The modifiers are applied in bottom-up order.
The Slice modifier cuts away all atoms on one side of a plane in three-dimensional space. That is, it can be used to look inside a solid structure like our cubic specimen.
The slicing plane is defined by its normal vector and its distance from the origin of the coordinate system. These parameters can be adjusted in the panel
"Slicing Plane" found below the pipeline listbox. Note that this panel always displays the parameters of the currently selected modifier from the pipeline.
You can enter a new numerical value into the input box for each parameter or adjust the value interactively with the mouse by clicking on one of the small up/down arrow buttons
next to an input field and drag the mouse vertically while holding down the left mouse button. Whenever you change a modifier's parameters,
OVITO automatically recomputes the effect of the modifier and updates the viewports in realtime.
Now try to adjust the slicing plane such that it becomes parallel to the [110] plane by setting the parameter Normal (Y)
to 1 as shown in Figure 3.5. Since the coordinate system's origin is
located in the center of the simulation box a value of zero for the Distance
parameter will let the slicing plane go diagonally through the box center. More detailed
information on the other parameters of the Slice modifier can be found in Section 5.5.15 of the reference manual.
The function of the Slice modifier is to remove some of the atoms before the system is rendered in the viewports by OVITO. Other modifiers change the values stored in the data channels instead. One example for this class of modifiers is the Color Coding modifier. It assigns a color to each atom based on the value of another property of the atom. We are going use this modifier now to visualize the local potential energies of the atoms, which have been computed by the MD simulation code.
From the modifier drop-down list select the entry Color Coding to add this modifier to the pipeline. In the parameter panel of the newly added modifier, select Potential Energy from the data channel list and click the button. This will adjust the color range to the minimum and maximum energies occurring in the input file. The Color Coding modifier maps the atomic energies in the range specified by Start value and End value to the color gradient displayed in the panel. You can play with the start and end values to see how the colors of the atoms change.
Sometimes you might want to select atoms with specific properties. OVITO provides a powerful mechanism for this: the Select By Expression modifier.
Now add this modifier to the pipeline. In the properties panel of the newly inserted modifier you will find a text field
where you can enter a Boolean expression. This expression will be evaluated by OVITO for each atom. If it evaluates to TRUE
then the atom is selected; otherwise
it is deselected. For the syntax of Boolean expressions see Section 5.5.2.
Enter the text PotentialEnergy > -3.85 into the expression field and press the Enter key to select all atoms with a potential energy greater than -3.85 eV. The variables you can use in the expression are listed the “Variables” panel.
Now that we have selected a certain subset of the atoms we can go on by adding more modifiers to the pipeline, which will act only on the selected atoms. So let's assign a specific color to the selected atoms to highlight atoms having a high energy: Select the Assign Color modifier from the modifier list and choose a color of your choice.
After we have put together the modifier pipeline we are now happy with the
visualization results. So let's create a static image from what we see in the viewports, that we can share with our collaborators or put into our newest paper.
Generating a static image of the scene is called rendering an image in OVITO. First select the viewport that you want to render by right-clicking into
it. The active viewport is always marked with a yellow border. Then activate the Render tab
() in the command panel.
This tab provides controls to adjust the output image size, the background color, and output filename.
Press the (
) button to produce an image of the selected viewport.
The rendered image is displayed in a new window. Use the
or buttons to save your image.
OVITO was not only made to visualize your simulation data, it also provides several
analysis functions. One of them is the Common Neighbor Analysis
(CNA) modifier. It analyzes the neighborhood of each atom, and recognizes ordered crystal structures such as FCC or BCC.
In addition to coloring the atoms according to the assigned crystal structure type, it stores its results in a new data channel. This data channel might then be used to further
select, delete, or process certain types of atoms with additional modifiers.