Table Of Contents

Previous topic

Curriculum Vitae

Next topic


This Page

Enhancements to AtomEye

I have made some modifications to AtomEye which allow it to read libAtoms format NetCDF and Extended XYZ files.


Statically linked binaries are available for Mac OS X 10.6, 10.7, and 10.8 and for Linux x86_32 and x86_64. The modified source code is available on GitHub

Major new features

NetCDF and Extended XYZ Support

NetCDF files with a ”.nc” extension and Extended XYZ files with a ”.xyz” extension are detected automatially, so you should just be able to invoke AtomEye as:

A [|]

The NetCDF format works well with huge files and cooperates well with SSH FS, allowing a simulation running on a remote computer to be examined while it is running.

The atom species is inferred from either a “species” property if this is present, or from “Z” if not. Masses are read from the “mass” property if it exists, otherwise they default to the periodic table values. Real and integer properties are loaded as auxiliary properties. Currently the libAtoms netcdf module only supports properties with either one or three values associated with each atom (e.g. scalar and vector fields). Since AtomEye auxiliary properties are scalars, vector fields are mapped to a triplet of auxiliary properties with names like force0, force1 and force2.

You can step through the frames in the trajectory file as normal (insert/delete for forward/backward, ctrl+insert/ctrl+delete for first/last frame), or got to a particular frame by appending :frame_number to the filename:

load_config               # go to frame 45
load_config  # go forward 10 frames
set n->glob_advance 100         # change default increment to 100

These options also work from the command line, e.g.:

A  # open in AtomEye and display the last frame
A # show frame 340

Reloading the configuration (reload_config, or press F10) will close and reopen the file, so if the simulation is currently running this will give access to the new frames.

Since XYZ files are text-based, it’s hard to efficiently seek to a particular frame. We create an index file (with extension .xyz.idx) the first time you load an XYZ file into AtomEye. This takes a little while to generate as we have to go through the whole file and identify where each new frame starts. If the XYZ file later gets bigger (e.g. because the simulation is still running), then the .idx file is updated without having to rebuild it from scratch.

Python interface

AtomEye can also be compiled as a Python extension module which is useful with the quippy package. See the quippy documentation for further details.

New command draw_arrows

I’ve added a draw_arrows command to AtomEye which can be used to visualise a vector field, e.g. force, velocity or a displacement field.

The syntax of the draw_arrows command is:

draw_arrows off | number|name [scale factor] [head height] [head width] [up vector]
  • number/name - aux prop index to use for drawing arrows. vector is taken as (arrow_idx,arrow_idx+1,arrow_idx+2). if aux prop names end in numbers (which they will if loaded from xyz or netcdf), e.g. force0 force1 force2, then the trailing number can be omitted, i.e. “draw_arrows force” will work.
  • scale factor - multiplicative scale factor for arrow length. Default is zero which autoscales.
  • head height - arrow head height, as fraction of arrow length. Default 0.1
  • head width - arrow head half-width, as fraction of arrow length. Default 0.05
  • up - up vector for arrow heads. arrow heads are drawn in the plane defined by their direction and this vector. Default is (0,1,0).

It’s also possible to overlay multiple vector fields:

set n->arrow_overlay 1
draw_arrows first_vector_field [OPTIONS...]
draw_arrows second_vector_field [OPTIONS...]

You can remove all the arrows with draw_arrows off.

Minor New Features

Auxiliary Properties

I’ve made a minor enhancement to the AtomEye syntax for specifying which auxiliary property to show. The Alt+ keyboard shortcuts still work as before, but now you can also type the name of a property:

aux_property_coloring 2 # old style, lookup by number
aux_property_coloring velocities0 # new style, lookup by name as well

I’ve increased the maximum number of auxiliary properties from 32 to 48, for NetCDF, XYZ and CFG input files.

New command xtal_origin_half

I’ve added a new command, xtal_origin_half, which centres the cell on the point with fractional coordinates (0.5,0.5,0.5). This is useful with libAtoms where our cells typically have fractional coordinates in the range 0 < s < 1 rather than the -0.5 < s < 0.5 which AtomEye expects. By default this command is bound to Shift+z.

Small unit cells

The behaviour for small cells can now be changed in any of the following ways:

  1. Setting n->small_cell_err_handler. The current value of this setting determines the action to take when loading future configurations; i.e. if you change it you won’t see any effect unless you reload (type reload_config or press F10). The following values are permitted:

    • 0 -> quit - a small cell generates an error which quits AtomEye
    • 1 -> multiply - the cell is replicated so that size > 2*cutoff
    • 2 -> nocheck - the error is ignored. Some bonds will not be drawn.
  2. Command toggle_small_cell_mode: convenience command to toggle between the “multiply” and “nocheck” behaviours, and then reload the current configuration and redraw the cell. This command has also been added to the Python interface.

  3. Command line arugment -small-cell=[quit|multiply|nocheck] overrides the default value of the n->small_cell_err_handler setting, e.g.:

    $ A -small-cell=multiply

The default value of n->small_cell_err_handler is currently 2 ("nocheck").

Absolute rcut_patch

There is now a new absolute option to the rcut_patch command, which allows the cutoff distance for a particular species pair to be set to an absolute value, e.g.:

rcut_patch start Si Si
rcut_patch 2.4 absolute
rcut_patch finish

will set the cutoff for Si–Si bonds to 2.4 A.

Mac OS X Tips

An AtomEye startup script can be used to set up appropriate key mappings for Macs that lack an “insert” key. Here’s mine:

$ cat ~jrk33/.A
set n->atom_r_ratio 0.5
set n->bond_mode 1
resize 800 600
set key->BackSpace+C load_config_first
set key->BackSpace load_config_backward
xtal_origin_goto 0.5 0.5 0.5