AtomEye
I have made some modifications to AtomEye which allow it to read libAtoms format NetCDF and ExtendedXYZ files.
Binaries and Source Code
Statically linked binaries, most recent at top:
Python extension module:
The modified source code is available in the libAtoms/QUIP repository in the AtomEye module, and is also mirrored on GitHub
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 [traj.nc|traj.xyz]
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 traj.nc:first load_config traj.nc:last load_config traj.nc:forward load_config traj.nc:backward load_config traj.nc:45 # go to frame 45 load_config traj.nc:forward:10 # 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 traj.nc:last # open traj.nc in AtomEye and display the last frame A traj.nc:340 # 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.
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 crack loading 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 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 Changes
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.
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.
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:
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.
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.
Command line arugment -small-cell=[quit|multiply|nocheck] overrides the default value of the n->small_cell_err_handler setting, e.g.
$ A small.xyz -small-cell=multiply
The default value of n->small_cell_err_handler is currently 2 ("nocheck").
If you have suggestions for further improvements, send them to me.
Mac OS X Tips
Here's a page with suggestions on getting the alt key to work correctly in X11 under Mac OS X.
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 toggle_parallel_projection set n->atom_r_ratio 0.5 set n->bond_mode 1 resize 800 600 redraw set key->BackSpace+C load_config_first set key->BackSpace load_config_backward xtal_origin_goto 0.5 0.5 0.5
This page is mirrored here
