Table of Contents
The aim of this introductory tutorial is to make you familiar with OVITO.
To let you repeat the steps described in this text an example data file is provided, which can be found
in the directory share/ovito/examples/tutorial1/
of your OVITO installation (which is usually located in /usr/local/
).
Usually, the first step when using OVITO is to import the data you want to visualize. OVITO can import a number of file formats produced by popular simulation packages. For details see Section 4.2.
We begin to import atoms by selecting main menu, using the corresponding button in the toolbar, or pressing Ctrl+i on the keyboard. This will open the file selector dialog shown in Figure 3.1.
→ from the
Change to the folder share/ovito/examples/tutorial1/
containing the example file NanocrystallinePd.dump.gz
. The example file is
a compressed LAMMPS dump file in text format. OVITO will automatically detect the file format.
Now 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 for all 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 given example file 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 new feature of LAMMPS, which now produces self-describing dump files. Dump files written by older versions do not provide the naming of the data columns. Then you would 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
, and 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 atomic system, leave the option
selected and press to import the data.You are now back in the main window as shown in Figure 3.3. You find the the usual menu and tool bars at the top and the bottom of the window. It is divided into two main 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 display a three-dimensional view of the atomic data that we just imported. Each of the default viewports,
which are called Top, Front, Left, and Perspective, shows the same scene from different viewing directions. Sometimes you might want to see everything as large as possible, then you can first select one of the viewports by right-clicking into it, and then press the () button to enlarge it. Press this button again to restore the old viewport layout.
At the bottom of the main window you find more buttons for controlling 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 to leave the selected navigation mode and return to the default input mode as indicated by the pressed arrow button
(
) in the upper main toolbar.
As a shortcut you can navigate in the viewports by holding down the shift key on your keyboard while using the middle mouse button in one of the viewports. 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 is the command panel. It is organized into tabs located at the top: the
Modify , Render
and Utilities
tab. The Modify tab lets you build up the processing pipeline that is applied to your atomistic data (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 render
the scene to an output image and the Utilities tab provides access to several additional tools that you might find useful.
Further information on the user interface of OVITO can be found in Section 5.1.
Before you continue you should have read Section 4.1 of the manual to learn more about the terms modifier and processing pipeline. These concepts might sound quite theoretical at first, so let's now start with an example.
In the first step of this tutorial we have loaded the atoms from the input file and during import we have 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. We now insert a first modifier into that pipeline.
The set 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 example cube.
The slicing plane is defined by means of its normal vector and its distance from the origin of the coordinate system. These parameters can be adjusted in the panel
labeled "Slicing Plane" below the pipeline listbox. Note that this panel always displays the parameters of the currently selected modifier in 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 Slice modifier deletes 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 that 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 named 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 value range to the minimum and maximum atomic energies found in the input file. The Color Coding modifier maps the atomic energy values in the range specified by the Start value and End value parameters 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 may want to select atoms with certain properties.
OVITO has a powerful mechanism to achive this: the Select By
Expression modifier.
Select it from the modifier list to add it to the pipeline. In the properties panel of the newly added modifier you will see a text field
where you can enter a Boolean expression. This expression will be evaluated by OVITO for each atom. If it is TRUE
then the atom is selected; otherwise
it is deselected. For the syntax of Boolean expressions see Section 5.5.2.
Now enter the text “PotentialEnergy > -3.85” into the expression field and press Enter to select all atoms with a potential energy greater than -3.85 eV. The variables you can use in the expression are listed in the command panel in the “Variables” section.
Now we have selected a certain subset of the atoms. We can go on by adding more modifiers to the pipeline, which will now act on only the selected atoms. So let's assign a special 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 finally happy with the
visualization. So let's create an image from what we see in the viewports so we can use it for publishing our simulation results.
This process is called rendering an image of the virtual scene. First, select the viewport that you want to render by right-clicking into
it. The selected viewport is marked with a yellow border. Then activate the Render tab
() in the command panel on the right.
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. If you didn't specify an output filename before rendering you can now use the
or buttons to save your image. When saving the image file, specify a file extension (e.g. .png, .jpg) to let OVITO know which file format it should use.
OVITO not only visualizes your data, it also provides several
analysis tools. One of them is the Common Neighbor Analysis
(CNA) modifier. It analyzes the neighborhood of each atom to recognize ordered crystal structures, as for exmaple FCC or BCC.
It creates a new data channel, in which the lattice type of the atoms are stored. This data channel can then be used to further
process certain types of atoms or to just visualize the crystallographic types of the atoms.