Aten v1.5 (r1197)

Aten v1.5 (r1197)

User Manual

Tristan Youngs


Table of Contents

1. Disclaimer
2. Acknowledgements
3. Getting Started
Using Aten
Compilation From Source
Linux
Installation
Filters
User Filters
The ~/.aten Directory
Referencing Aten
The Command Line
Switch Order
Switches
4. Import / Export
Supported File Formats
Model Formats
Trejactory Formats
Gridded Data Formats
Expression Data Formats
Filters
Filter Contents
Filter Locations
Overriding Existing Filters
Filter Definitions
Trajectory Files
Trajectories in Separate Files
Reading and Writing
Formatted Output
Printing Data
Formatted Input
Specifiers
Extra Specifiers Within Aten
Escaped Characters
Delimited Reading and Writing
Unformatted Reading and Writing
5. The GUI
GUI Overview
Mouse Control
Toolbars
Bonding
Build
Draw Style
Edit
File
Forcefields
Measure
Mouse
Select
Tool Stack
Trajectory
Tool Windows
Atom List Window
Build Window
Cell Definition Window
Cell Transform Window
Command Window
Disordered Builder Window
Forcefield Window
Fragment Library Window
Geometry Window
Grids Window
Minimiser Window
Atom Position Window
Atom Transform Window
6. Command Language
Command Language Overview
General Input Style
Variables
Arrays
Predefined Constants
Blocks, Scope, and Variable Hiding
Functions
User Defined Functions
Return Values
Arithmetic Expressions and Operators
Variable Types
Overview
Aten
Atom
Bond
Bound
Element
FFAtom
FFBound
Forcefield
Glyph
GlyphData
Measurement
Model
Pattern
Prefs
Region
UnitCell
Vector
Command Reference
Atom Commands
Bond Commands
Building Commands
Cell Commands
Charges Commands
ColourScales Commands
Disordered Commands
Edit Commands
Energy Commands
Flow Commands
Forcefield Commands
Forces Commands
Glyph Commands
Grid Commands
Image Commands
Labeling Commands
Math Commands
Measuring Commands
Messaging Commands
Minimiser Commands
Model Commands
Monte Carlo Commands
Pattern Commands
Read / Write Commands
Script Commands
Selection Commands
Site Commands
String Commands
System Commands
Trajectory Commands
Transform Commands
View Commands
7. Topics of Interest
Colourscales
Patterns
Determination of Patterns
Pattern Granularity
8. Forcefields and Typing
Overview
File Format
Example - SPC Water
Supplied Forcefields
Canongia-Lopes & Padua Ionic Liquids (cldp-il.ff)
Youngs, Kohanoff, & Del Pópolo [dmim]Cl (dmimcl-fm.ff)
Youngs & Hardacre [dmim]Cl (dmimcl-fm2.ff)
Jorgensen at al. OPLS-AA (oplsaa.ff)
Berensen et al.s Simple Point Charge Water (spc.ff)
Berensen et al.s Extended Simple Point Charge Water (spce.ff)
Rappe et al.s Universal Forcefield (testing/uff.ff)
Mayo, Olafson & Goddard II's Generic Forcefield (testing/dreiding.ff)
General Amber Forcefield (testing/gaff.ff)
Liu, Wu & Wang's United-Atom Ionic Liquids Forcefield (lww-il.ff)
Keyword Reference
General Keywords
Block Keywords
Wildcards
Rule-Based Forcefields
Typing
Language Examples
Description Depth
Type Scores
Reusing Types
NETA Reference
~X (any bond to X)
-X (single bond to X)
-X (double bond to X)
bond
chain
n
nbonds
nh
aromatic
noring
planar
ring
size
Geometries
VDW Functional Forms
Bond Functional Forms
Angle Functional Forms
Torsion Functional Forms
9. Methods
Custom Algorithms
NETA
Augment
Autoellipsoids
Autopolyhedra
Rebond
Literature Methods
10. Enumerations
Bond Types
Cell Types
Colour Schemes
Combination Rules
Drawing Styles
Energy Units
Glyph Types
Grid Styles
Label Types
Output Types
Parse Options
Read Success Integers
Region Shapes
View Objects
ZMapping Types
11. Changelogs
Version 1.1
Version 1.2
Version 1.3
Index

List of Tables

4.1. Supported Model Formats
4.2. Supported Trajectory Formats
4.3. Supported Grid Data Formats
4.4. Supported Expression Data Formats
4.5. Filter properties
4.6. Filter types
4.7. Formatted output commands
4.8. Formatted input commands
4.9. Extra read/write specifiers
4.10. Escaped characters in format strings
4.11. Delimited read/write commands
5.1. Mouse Button Actions
5.2. Bonding Toolbar Icons
5.3. Build Toolbar Icons
5.4. Draw Style Toolbar Icons
5.5. Edit Toolbar Icons
5.6. File Toolbar Icons
5.7. Forcefield Toolbar Icons
5.8. Mouse Toolbar Icons
5.9. Mouse Toolbar Icons
5.10. Select Toolbar Icons
5.11. Tool Window Toolbar Icons
5.12. Trajectory Toolbar Icons
5.13.
5.14.
5.15.
5.16.
5.17.
5.18.
5.19.
5.20.
5.21.
6.1. Built-in Constants
6.2. Aten type members
6.3. Bond type functions
6.4. Atom type members
6.5. Bond type members
6.6. Bond type functions
6.7. Bound type members
6.8. Element type members
6.9. FFAtom type members
6.10. FFAtom type functions
6.11. FFBound type members
6.12. Forcefield type members
6.13. Glyph type members
6.14. Glyph type functions
6.15. GlyphData type members
6.16. Measurement type members
6.17. Model type members
6.18. Pattern type members
6.19. Prefs type members
6.20. Region type members
6.21. UnitCell type members
6.22. Vector type members
6.23. Test Operators
6.24. Autopolyhedra options
6.25. Newglyph options
6.26. Bitmap image formats
7.1. Pattern Examples
8.1. NETA keyword '~X' examples
8.2. NETA keyword '~X' examples
8.3. NETA keyword '-X' examples
8.4. NETA keyword '=X' examples
8.5. NETA keyword 'bond' examples
8.6. NETA keyword 'chain' examples
8.7. NETA keyword 'n' examples
8.8. NETA keyword 'nbonds' examples
8.9. NETA keyword 'nh' examples
8.10. NETA keyword 'aromatic' examples
8.11. NETA keyword 'noring' examples
8.12. NETA keyword 'planar' examples
8.13. NETA keyword 'ring' examples
8.14. NETA keyword 'size' examples
8.15. NETA geometry keywords
8.16. VDW Functional Forms
8.17. Bond Functional Forms
8.18. Angle Functional Forms
8.19. Torsion Functional Forms
9.1. Literature Methods
10.1. Bond type keywords
10.2. Cell type keywords
10.3. Colour scheme keywords
10.4. Combination Rules
10.5. Draw style keywords
10.6. Energy unit keywords
10.7. Glyph type keywords
10.8. Grid style keywords
10.9. Label type keywords
10.10. Output type keywords
10.11. Parse option keywords
10.12. Read/write return values
10.13. Region Shapes
10.14. View object keywords
10.15. Map type keywords

Chapter 1. Disclaimer

Aten comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it under certain conditions. For more details read the GPL at [http://www.gnu.org/copyleft/gpl.html].

Aten is under continual development and tweaking. If you have a feature suggestion, a feature request, or have found a bug or an idiosyncrasy, please contact me at .

Aten uses Space Group Info (c) 1994-96 Ralf W. Grosse-Kunstleve, the Qt toolkit (C) Trolltech, and the readline library.

Some general notes:

  • First off, if you find that Aten doesn't support the format you want, consider writing a filter to do so. And if you need help, please ask!

  • More so, if you find that Aten does support the format you want, but doesn't appear to write it out correctly, please let me know.

  • For forcefield expression files written with Aten, I recommend that you check that the correct atom types get assigned to your molecule(s). Blind trust that this has actually occurred should only be employed once you are confident that the forcefield types are consistently correct! Larger forcefields, e.g. OPLS-AA by Jorgensen et al., do not have a complete set of type descriptions implemented in Aten. Once more, if your add some in, please send them to me so they can be included in a future revision of the code.

tris@projectaten.net

Chapter 2. Acknowledgements

Aten is maintained entirely by T. Youngs. However, many people have contributed useful thoughts, ideas, bugfixes, and motivation to the project over its lifetime. These people are, in no particular order:

A. K. Croft and crew (Mac afficionado, supreme fault-finder)

S. Cromie (algebraic guidance)

A. Elena (bug-finder extraordinaire, 'pathological case'-locator, Windows / Mac building and packaging)

D. Pashov (Windows / Mac building and packaging)

S. Norman (icon judgment)

Chapter 3. Getting Started

Using Aten

Aten will let you generate and edit coordinates for your simulations, and view any trajectories you might have generated. A set of tools in the GUI (and also accessible from the command line) enables you to change the geometry of bonds, angles, and torsions, translate atoms, create atoms, rotate groups of atoms, and cut, copy, and paste them around the place. All this can be done in the context of loading and saving in the format that you need - if the file format you need isn't currently a part of Aten, you yourself can write a filter to cover it.

Periodic systems are supported, be they crystals, liquids, gases, or a heady mixture. All editing functions that are possible for simple molecules apply to periodic systems as well. Moreover, given a basic unit cell a whole crystal or a larger supercell can be constructed. For any periodic system, a random ensemble of molecules can be added, allowing the facile creation of coordinates with which to begin your molecular dynamics simulations.

As well as coordinates, Aten has support for forcefields (in its own, plain-text format) and can automatically apply these forcefields to your system if correct type descriptions are present for the atom types in the forcefield. Then, in the same way as with coordinates, you may write out a forcefield description of your system in the format that you require it with a different filter. Please don't use Aten as a literal 'black box', though, and blindly write out forcefield files without checking them. While it will certainly make the process of generating your forcefield descriptions easier, the art of determining the correct types in the first place (and hence the correct forcefield terms) is not definite for larger forcefields that cover many atom types. Check the output - a cursory glance of the selected forcefield types is an excellent idea, and a good habit to get in to.

Compilation From Source

If you want to compile Aten by hand (e.g. if you're keeping your own copy of the source and updating it via subversion) then these guides may help.

Linux

Very few Linux distributions have guides in this section - if you wish to contribute details of your own experience for the benefit of others, get in touch.

SuSE

Installing Subversion and obtaining the source

TODO

Ubuntu (9.04)

Installing Subversion and obtaining the source

Run the following commands to install subversion (if you don't already have it) and download the latest source to a directory names 'aten-latest' in the current directory:

bob@pc:~> sudo apt-get install subversion
bob@pc:~> svn co http://aten.googlecode.com/svn/trunk ./aten-latest
bob@pc:~> cd aten-latest
				
Installing all necessary pre-requisites

The following command should install all necessary packages needed to compile Aten, including the Qt4 development libraries, C++ (g++) compiler, and the automake/libtool packages.

bob@pc:~> sudo apt-get install autotools-dev libtool autoconf automake g++ libreadline5-dev \
	libqt4-gui libqt4-opengl libqt4-core libqt4-dev
Configure and compile

Configure the source with the following commands, run from the 'aten-latest' directory:

bob@pc:~> ./autogen.sh
bob@pc:~> ./configure
				

All being well, no errors should be encountered by the configure script. If there are any and you have problems, please email me!

Once succesfully configured, build the source with:

bob@pc:~> make
				

Mac

Prerequisites

GNU Autotools >=2.6 or CMake >=2.4.8 - the choice is yours, really. CMake tends to be easier because it handles all the Qt-related elements explicitly, but a pretty recent version is required. Follow the relevant sections below.

Qt4 >=4.2 - again, two choices. Trolltech offer an installable disk image, providing Qt4 as a proper Framework (see http://trolltech.com/products/appdev/platform/qt-for-mac ). Alternatively, Qt4 is available on Fink (qt4-x11).

OpenGL - This should be installed as standard.

pkg-config - If you're using the Fink installation of Qt4, then you'll also need the pkg-config package from the same source (package name?).

A C++ compiler (e.g. GNU g++, Intel's icc)

Autotools

If you obtained the source via SVN, at the top of the source tree run:

bob@pc~	> ./autogen.sh
				

This creates the necessary files needed to properly configure the build. If you unpacked the source from a tarball, it shouldn't be necessary to run autogen.sh, but you could if unexpected other errors occur in a last ditch attempt to remedy the situation.

Run ./configure to set up the build. The default installation location can be overridden by specifying ./configure --prefix=<path>. It will be necessary to specify which Qt4 installation you have (Framework or Fink).

If using the installed Framework from Trolltech, run:

bob@pc~> ./configure --with-qt=framework
				

If using the Fink installation, run:

bob@pc~> ./configure --with-qt=fink
				

With the Fink installation you may also need to direct ./configure.ac to the correct Qt4 development binaries either by setting your $PATH to '/sw/lib/qt4-x11/bin:${PATH}' or by running:

bob@pc~> ./configure --with-qt=fink --with-qtdir=path
				

...where 'path' is the path where the development binaries can be found.

Once configured successfully, run 'make' to compile the source and build the program. Then, go make some tea or brew some coffee.

CMake

An out-of-tree build is best. Make a directory somewhere, enter in to it, and run:

bob@pc~> cmake /path/to/source/for/aten
				

For example:

bob@pc:> mkdir aten-build
bob@pc:> cd aten-build
bob@pc:~/aten-build> cmake /home/bob/aten-0.99-713
				

Once configured successfully, run 'make' to compile the source and build the program. Then, go make some tea or brew some coffee.

Installation

Whether installing from a pre-built package or running 'make install' (or not) after building it yourself, there are several resources which Aten needs or expects to find. The most important of these is the default library of filters without which nothing can be loaded or saved (but note that this does not prevent Aten from running). Then there's the optional user preferences file, and finally the optional user filter library. If Aten was installed from a package or built and 'make install'ed yourself then the default filters should be located correctly when Aten runs withour further intervention (if not, read on). No user preferences file is created or installed, and must be created either through the GUI or edited by hand.

Filters

As already mentioned, Aten comes with a selection of filters ready to import and export a fair number of file formats (you can write your own - see the chapter on Filters). These filters should be found automatically, but if they are not Aten can be given their location in one of two ways:

Through the environment variable ATENDATA

On all systems, the environment variable ATENDATA can be set with the full path to the 'data' directory which contains the filters directory.

With the command-line argument --atendata

In a similar manner, the --atendata command-line argument can be used to provide the full path to the 'data' directory which contains the filters directory.

User Filters

Any filters written or obtained by the used can be placed in their ~/.aten/filters directory. See the next section.

The ~/.aten Directory

User filters and preferences files should be placed in a .aten directory in your home directory (it must be created by hand). Within this directory can exist the user preferences file prefs.dat exists, along with another directory named filters which is used to store custom filters, or those currently under development by the user.

Referencing Aten

Aten has been published in the Journal of Computational Chemistry, and the article can be found online here. The full reference is:

"Aten - An application for the creation, editing, and visualization of coordinates for glasses, liquids, crystals, and molecules", T. G. A. Youngs, J. Comp. Chem., 31, 639-648, (2009).

It is not a requirement to cite Aten in your work, but if you feel that a citation is deserved because it has been particularly helpful, then please feel free!

The Command Line

From a shell, running Aten with no arguments will start up the code in GUI mode and patiently wait for something nice to happen. If model files are provided on the command line, these will be loaded in so that, when the GUI starts, they may be hacked apart according to your desired tastes. The command-line is also a powerful way of editing without using the GUI at all. What follows is a description of the usage of command-line arguments, and a list of all recognised arguments.

Switch Order

Two important things. Firstly, short options (e.g. '-b', '-d', etc.) may not be concatenated into one long specification of a short option (i.e. '-bd') - they must be given separately as '-b -d' or they will not be recognised. Secondly, the order of the given switches is important! Commonly, the actions of command-line switches and arguments do not depend on order, however in Aten this is not the case. For example:

bob@pc:~> aten --nobond test1.xyz test2.xyz
		

will load the models 'test1.xyz' and 'test2.xyz', preventing recalculation of bonds between atoms in both. However:

bob@pc:~> aten test1.xyz --nobond test2.xyz
		

will only prevent recalculation of bonds for the second model. The reason for acting on switches and arguments in the order they are encountered on the command line is to allow for flexibility, especially when using Aten as a non-graphical processor (for examples of this type of usage, see the resources section of the website).

Note: The position of debug switches or those affecting the verbosity of the program has no bearing on the timeliness of their effect - they are dealt with first by Aten regardless of where they appear in the program's arguments.

Switches

A

--atendata <dir>

Tells Aten to use the specified <dir> as its data directory (where filters etc are stored). This overrides the ATENDATA shell variable.

B

-b, --bohr

Specifies that the unit of length used in any models and grid data that follow is Bohr rather than Å, and should be converted to the latter.

--batch

When specified, each subsequent command given with the -c or --command switches will be stored but not executed. Once all model files specified on the command-line are loaded, each stored command is executed on each loaded model, before being saved to the same filename. In this way, batch processing of multiple files can be performed. The GUI is not started if --batch is specified. If model export filters are not available for one or more loaded models, any changes will not be saved. It is advisable to work on a copy of the model files when using this command, or to export to a different format in order to preserve the original files (see the --export switch).

For example, to transmute all iron atoms into cobalt for a series of xyz files named 'complex_001.xyz', 'complex_002.xyz' etc.

bob@pc: ~> aten --batch -c 'select(Fe); transmute(Co);'
						
--bond

Force recalculation of bonding in loaded models, regardless of whether the filter used any of the rebond commands (see the Bond Commands).

C

-c <commands>, --command <commands>

Provides a command or compound command to execute. Commands should be enclosed in single quotes (to prevent the shell from misquoting any character strings) and individual commands separated with semicolons. Commands provided in this way can be used to set up Aten in the way you want it from the command line, perform operations on model files before loading the GUI, or perform operations on model files without loading the GUI at all.

For example, to start the GUI with a new model named 'cube' that has a cubic cell of 30 Å side length:

bob@pc:~> aten -c 'newmodel("cube"); cell(30,30,30,90,90,90);'
						

Similarly, to load a model and make a duplicate copy of the atoms (pasted into the same model):

bob@pc:~> aten original.xyz -c 'selectall(); copy(); paste(10,10,10);'
						

In both cases the GUI initialises itself without being told - this can be prevented with the quit command. Consider the last example - to save the newly-expanded model and quit without ever launching the GUI:

bob@pc:~> aten original.xyz -c 'selectall; copy; paste(10,10,10); savemodel("xyz", "pasted.xyz"); quit;'
						

Multiple sets of commands may be given:

bob@pc:~> aten source.xyz -c 'selectall; copy' target.xyz -c 'paste(10,10,10);'
						

Take care here - the commands provided act on the current model, i.e. the one that was most recently loaded. Of course, there are commands that select between the loaded models (see the list of model commands) but that would confuse this supposedly simple example, wouldn't it?

--cachelimit <limit>

Sets the size limit for trajectory loading, in kilobytes. If an entire trajectory will fit into this cache, all frames in the trajectory are loaded immediately. If not, frames will be read from disk as and when required.

--centre

Force translation of non-periodic models centre-of-geometry to the origin, even if the centre was not used in the corresponding filter.

D

-d [<type>], --debug [<type>]

Enables debugging of subroutine calls so that program execution can be traced, or enables extra debug output from specific types of routines (if <type> is given). Warning - this creates a lot of output, most of which is incomprehensible to people with their sanity still intact, but is useful to track the program up to the point of, say, a hideous crash. Valid <type> options are listed in Output Types.

--double <name=value>

Creates a 'floating' variable <name> which is of type 'double' and that can be accessed from any subsequent script, command, or filter. Note that declarations of variables with the same name made in scripts, commands and filters will override any passed value names in order to avoid conflicts and breaking of existing filters and scripts. The intended use is to be able to pass values easily from the command-line into scripts or one-line commands.

For example, in a bash shell:

bob@pc:~> for num in 10.0 50.5 100.0; do aten --double d=$num -c 'printf("Value is %f\n", d); quit();' done
					

E

--export <nickname>

For each model file specified on the command line, it is loaded and immediately saved in the format specified by <nickname>. The GUI is not started.

For instance, to convert three DL_POLY CONFIG files and an xyz into mol2 format:

bob@pc:~> aten --export mol2 bio1.CONFIG bio2.CONFIG watercell.CONFIG random.xyz
						

If specified in conjunction with the --batch switch, commands may be applied to each loaded model file before it is saved.

--exportmap <name=element,...>

Manually map assigned atom typenames in an expression to the names defined here when expressions are written to a file. For example:

bob@pc:~> aten --ff spc.ff data/test/water.xyz --exportmap "OW=Ospc,H=Hspc" -c 'saveexpression("dlpoly", "water.FIELD"); quit();'
						

writes the water forcefield with the OW and HW atomtype names mapped to Ospc and Hspc respectively.

F

-f <nickname>, --format <nickname>

For any forthcoming model files provided as arguments on the command line, the specified model import filter is used to load them, regardless of their filename extension (or, indeed, actual format). Since Aten tends not to determine file formats by looking at their content, this is useful for when you know that file is in a particular format, but with an extension that doesn't help Aten recognise it as such.

--ff <file>

Loads the specified forcefield file, making it the current forcefield. If the desired forcefield is present in either Aten's installed data/ directory or in your own '.aten/ff' directory (see Installation), then just the filename need be given as Aten searches these locations by default.

--filter <file>

Load the specified <file> as if it were a filter file, installing any filters defined within it. Any filters already loaded that have the same 'nickname', 'id' etc. will be hidden by those loaded from <file>. See Overriding Existing Filters for more information.

--fold

Force folding of atoms to within the boundaries of the unit cell (if one is present) in loaded models, even if the command fold was not used in the corresponding filter.

G

-g <file>, --grid <file>

Loads the specified grid data file, associating it to the current model, and making it the current grid. A model (even an empty one) must exist for a grid to be loaded.

H

-h, --help

Show the possible command-line switches and a short description of their meaning.

I

-i, --interactive

Starts Aten in interactive mode, where commands are typed and immediately executed. The GUI is not started by default, but may be invoked.

--int <name=value>

Creates a 'floating' variable <name> which is of type 'int'. See the --double switch for a full description.

K

-k, --keepview

Preserves the last stored view of models when the GUI starts, retaining any model rotations and camera transformations performed in scripts or on the command line (normally, the view is reset to display the entire model on startup).

--keepnames

If specified, for each model loaded the original atom names in the file will be preserved as a series of forcefield types generated within a new forcefield created specifically for the model. Elements are still determined from conversion of the atom names, and may still be mapped with the --map option. This option is useful for quickly creating a skeleton set of forcefield types from an existing model with type names, or to allow quick import and export of typed configurations without requiring the original forcefield file to be loaded.

M

-m <name=element,...>, --map <name=element,...>

Manually map atom typenames occurring in model files to elements according to the rules defined here. For example:

bob@pc:~> aten --map 'CX=C,N_=P'
						

will result in atoms called 'CX' being mapped to carbon, and atoms called 'N_' mapped to phosphorus (for whatever reason). These mappings are attempted prior to any z-mapping scheme defined in the filter, and so will take precedence over standard typename-to-element conversions.

N

-n

Create a new, empty model.

--nobond

Prevent recalculation of bonding in loaded models, overriding filter directives. This basically means that, if a filter tries to run the rebond command, then specifying --nobond will prevent it.

--nocentre

Prevent translation of non-periodic models centre-of-geometry to the origin, overriding filter directives.

--nofold

Prevent initial folding of atoms to within the boundaries of the unit cell (if one is present) in loaded models, overriding the use of the fold command in the corresponding filters.

--nofragments

Prevent loading of fragments from both standard ans user locations on startup.

--nofragmenticons

Prevent generation of fragment icons, used in the Fragment Library Window.

--nopack

Prevent generation of symmetry-equivalent atoms from spacegroup information in loaded models, overriding any occurences of the pack command is used in the corresponding filter.

--noqtsettings

Don't read in any system-stored Qt settings on startup (such as window positions, toolbar visibilities etc.) using the defaults instead.

P

Force generation of symmetry-equivalent atoms from spacegroup information in loaded models, even if the command pack was not used in the corresponding filter.

S

-s <file>, --script <file>

Specifies that the script file is to be loaded and run before moving on to the next command-line argument. A script file is just a plain text file that contains sequence of commands to be executed, written in the command language style.

--string <name=value>

Creates a 'floating' variable <name> which is of type 'string'. See the --double switch for a full description.

T

-t <file>, --trajectory <file>

Associates a trajectory file with the last loaded / current model.

U

-u <nlevels>, --undolevels <nlevels>

Set the maximum number of undo levels per model, or -1 for unlimited (the default).

V

-v, --verbose

Switch on verbose reporting of program actions.

Z

-z <maptype>, --zmap <maptype>

Override the names to elements z-mapping style defined in file filters. For a list of possible mapping types see ZMapping Types.

Chapter 4. Import / Export

Supported File Formats

A list of formats currently supported by Aten follows as well as the file extensions and assigned filter ID. Remember, adding support for other codes is in your hands with Aten's filters system.

Model Formats

Table 4.1. Supported Model Formats

FormatExtension(s)NicknameIDRead?Write?Notes
Aten Keyword Format*.akfakf1YesYesPlain-text format used by Aten
Cambridge Structural Database Service *.dat|*.fdatcsd7yesno 
Crystallographic Information File*.cifcif8yesno 
DL_POLY Configuration*CONFIG | *REVCONdlpoly2yesyes 
GAMESS-US Output (Log)*.loggamuslog10yesno 
GAMESS-US Input*.inpgamusinp5yesyesCartesian coordinates only.
Mopac Control File *.mopmop4yesyesIncluding periodic systems. Cartesian coordinates only.
MDL Molfile*.molmol10yesno 
MSI (Cerius2) Model File*.msimsi12yesno 
Protein Databank (PDB)*.pdbpdb13yesno 
SIESTA Flexible Data Format*.fdfsiesta9yesyes 
Tripos Sybyl Mol2 *.mol2mol26yesyes 
XMol XYZ*.xyzxyz3yesyes 

Trejactory Formats

Table 4.2. Supported Trajectory Formats

FormatExtension(s)NicknameNotes
DL_POLY Formatted/Unformatted Trajectories*HISu | *HISf | HISTORYdlpoly 
XYZ Trajectory (Multiple XYZ file)*.xyzxyz 

Gridded Data Formats

Table 4.3. Supported Grid Data Formats

FormatExtension(s)NicknameIDNotes
Gaussian Cube*.cubecube1 
Probability density*.pdenspdens2Simple 3D volumetric data format
Surface*.surfsurf3Simple 2D surface data format

Expression Data Formats

Table 4.4. Supported Expression Data Formats

FormatExtension(s)NicknameIDRead?Write?Notes
DL_POLY FIELD file*.FIELD | FIELDdlpoly1noyes 

Filters

Filters determine the model/trajectory, grid/surface, and forcefield expression formats that Aten can read and write. They are essentially small programs written in the style of C, and are stored as plain text files (source files, if you like) on disk and loaded and 'compiled' when Aten starts up. This has several advantages:

  • Users may add support for their own particular formats at will.

  • No recompilation of Aten is necessary when adding new filters or adjusting old ones

  • Potentially any file format can be supported, even binary formats

With this flexibility, of course, comes some modest disadvantages:

  • Speed - although the C-style code contained within filters is 'compiled', it is by no means as fast as proper C code

  • File formats that need particularly awkward operations requiring a more 'complete' C language may be difficult to implement

These two points aside, though, filters make Aten a powerful and flexible tool, adaptable to conform to many different program/code input and output formats.

As mentioned, the programming language used by filters is essentially a subset of C, implemented with the same syntax and style (see command language overview for a description), but includes several hundred custom commands to control Aten in order to build up atoms in models, access data etc. So, if you already know C or C++, writing a filter should be a breeze. If you don't, its not too difficult to pick up, and there are plenty of filters already written to use as worked examples.

When a filter is called in order to write out data, no references to any of the current (i.e. displayed or selected) data are sent directly to the filter itself. Instead, this must be probed by using the Aten master reference available to all scripts, commands and filters. Within &aten the currently displayed model may be deduced, as well as the current frame (if a trajectory is associated). In most cases for model export filters, the path 'aten.frame' should be used to determine the model data that should be written.

Filter Contents

A filter is a plain text file containing one or more C-style programs that permit the input or output of data in a specific format. For example, a purely model-oriented filter file may contain two filters, one to read in files of the specified format, and one to write the data out again. Each individual filter is given a short nickname, a shell-style glob, and possibly several other bits of data that allow files to be recognised (if the file extensions defined for it are not enough).

Different filters that recognise the same file type may be provided if necessary, each performing a slightly different set of import or export commands (if it is not convenient to do so within a single filter), and all will appear in the drop-down list of filters in file dialogs within the program. Note that in batch, command-line, or scripting mode, filters are either selected automatically based on the filename, extension, or contents, or picked by matching only the associated nickname. In the former case, the first filter that matches the extension is used.

Filter Locations

A basic stock of filters is provided with Aten and installed with the program - several default locations are searched for these filters on startup. Alternatively, if Aten fails to find these filters, or you wish to point it to a suitable directory by hand, either the $ATENDATA environment variable may be set to the relevant path (on Windows, this variable is set by the installer) or the --atendata command-line option may be used to provide the path.

Additional filters may be placed in a user's '.aten' directory, e.g. ~bob/.aten/filters/.

Overriding Existing Filters

Filters that possess the same ID or nickname as other filters of the same type may be loaded simultaneously, with the last to be loaded taking preference over the other. Thus, an importmodel filter nicknamed 'xyz' from Aten's installed filter stock will be overridden by one of the same nickname present in a user's '.aten/filters' directory. Similarly, both these filters will be overridden by one of the same nickname loaded by hand from the command line (with the --filter switch). Note that this only holds true for filters referenced by nickname or determined automatically by Aten when loading data - from the GUI all filters are available in the file dialogs.

Filter Definitions

Filter definitions are made in a filter file in a similar way to declaring a user subroutine or function. The 'filter' keyword marks the start of a filter definition, and contains a list of properties in parentheses that define the subsequent filter, its name, and how to recognise the files (from their filenames and/or contents) that it is designed for. The definition of the filter to import XYZ-style model data is as follows:

filter(type="importmodel", name="XMol XYZ Coordinates", nickname="xyz", extension="xyz", glob="*.xyz", id=3)
{
	commands
	...
}
		

The comma-separated list of properties defines the type of filter ('type="importmodel"') and how to recognise files of that type (e.g., 'extension="xyz"'), amongst other things. The full list of possible properties is as follows:

Table 4.5. Filter properties

PropertyDescription
exactComma-separated list of filenames that are of this type
extensionComma-separated list of filename extensions that indicate files of this type
globShell-style glob to use in file fialogs in order to filter out files of the described type
idNumerical ID of the filter to enable partnering of import/export filters for files of the same type
nameDescriptive name for the filter, shown in file dialogs etc.
nicknameShort name used by commands in order to identify specific filters
searchProvides a string to search for in the file. If the string is found, the file is identified as being readable by this filter type. The number of lines searched is governed by the within property
typeDefines the kind of filter that is described (i.e. if it loads/saves, acts on models/grid data etc.) so that Aten knows when to use it. Must always be defined!
withinSpecifies the number of lines to search for any supplied search strings
zmapDetermines which zmapping style to employ when converting atom names from the file

exact

Occasionally (and annoyingly) files have no extension at all, instead having short, fixed names, which must be checked for literally when probing files. This command defines one or more exact filenames that identify files to be acted on by this filter section. Multiple names may be given, separated by commas or whitespace. Exact filename matching is case-insensitive.

For example:

exact="coords"
			

associates any file called 'coords' to this filter.

exact="results,output"
			

associates any files called 'results' or 'output' to this filter.

extension

Sets the filename extension(s) that identify files to be read / written by this filter. When files are being probed for their type, in the first instance the filename is examined and the extension (everything after the last '.') is compared to those defined in filter sections by this command. Multiple file extensions may be given, separated by commas or whitespace. File extension matching is case-insensitive.

For example:

extension="xyz"
			

means that files with extension '.xyz' will be recognised by this filter.

extension="xyz,abc,foo"
			

means that files with extensions '.xyz', '.abc', and '.foo' will be recognised by this filter.

glob

Sets the file dialog filter extension to use in the GUI, and should be provided as a shell-style glob.

For example:

glob="*.doc"
			

filters any file matching '*.doc' in the relevant GUI file selector dialogs.

id

When separate import and export filters for a given file type have been provided it is prudent to associate the pair together so that Aten knows how to save the data that has just been loaded in. Each filter has a user-definable integer ID associated with it that can be used to link import and export filters together. For example, if a model import filter has an ID of 7, and a model export filter also has this ID, then it will be assumed that the two are linked, and that a model saved with export filter 7 can be subsequently loaded with import filter 7. If the ID for a filter is not set it defaults to -1, and it is assumed that no partner exists and the file cannot be directly saved back into this format.

For example:

id	=13
			
[Note]See Also:

name

Sets the long name of the filter, to be used as the filetype description of files identified by the filter. This name will appear in the file type lists of file dialogs in the GUI, and also in the program output when reading / writing files of the type.

For example:

name="SuperHartree Coordinates File"
			

nickname

Sets a nickname for the filter, which allows it to be identified easily in the command language and, importantly, from the command line. It should be a short name or mnemonic that easily identifies the filter. No checking is made to see if a filter using the supplied nickname already exists.

For example:

nickname="shart"
			

sets the nickname of the filter to 'shart'.

nickname="zyx"
			

sets the nickname of the filter to 'zyx'.

search

Occasionally, checking the contents of the file is the easiest way to determining its type, and is probably of most use for the output of codes where the choice of filename for the results is entirely user-defined. For example, most codes print out a whole load of blurb and references at the very beginning, and usually searching for the program name within this region is enough to identify it. For files that are only easily identifiable from their contents and not their filename, plain text searches within files can be made to attempt to identify them. Individual strings can be given to the 'search' keyword, and multiple 'search' keywords can be provided. The default is to search the first 10 lines of the file for one or more of the defined search strings, but this can be changed with the within property.

For example:

search="UberCode Version 20.0"
			

matches the filter to any file containing the string 'UberCode Version 20.0' within its first 10 lines (the default).

search="SIESTA"
			

searches the first 10 lines of the file for the string 'SIESTA'.

search=""GAMESS VERSION = 11 APR 2008 (R1)"
			

attempts to identify output from a specific version of GAMESS-US.

type

The 'type' keyword must be provided an all filter definitions - an error will be raised if it is not. It specifies which class of data the filter targets (e.g. models, grid data etc.) and whether it is an import or export filter. A given filter may only have one 'type'. The possible values for 'type' are:

Table 4.6. Filter types

TypeDescription
exportexpressionDescribes how to export forcefield descriptions (expressions) for models
exportgridDescribes how to export grid-style data
exportmodelDescribes how to write out model data
exporttrajectoryFilter suitable for the export of trajectory data
importexpressionDescribes how to load in forcefield-style expressions
importgridDescribes how to read gridded volumetric or surface data from files. Any grids created in these sections must have the finalisegrid command called on them, otherwise they will not be registered properly within the program.
importmodelDescribes how to import model data, including atoms, cell and spacegroup data, bonds, glyphs etc. Any models created in 'importmodel' sections must have the finalisemodel command called on them, otherwise they will not be registered properly within the program.
importtrajectoryRead frames from trajectory files. See the section on trajectories for additional information on how trajectories are handled within Aten.

For example:

type="importgrid"
			
type="exportmodel"
			

within

Defines the number of lines to search for any 'search' string definitions (default is 10).

For example:

within=50
			

specifies that the first 50 lines should be searched for identifying strings.

zmap

By default, it is assumed that the commands which create new atoms will be given a proper element symbol from which to determine the atomic number. Case is unimportant, so 'na', 'Na', and 'NA' will all be interpreted as atomic number 11 (sodium). Where element symbols are not used in the model file, there are several alternative options that tell these commands how to convert the element data they are passed into atomic numbers. For example, the 'ff' style is particularly useful when loading in coordinate files which contain forcefield atom type names that do not always correspond trivially to element information (e.g. DL_POLY configurations).

For example:

zmap="numeric"
			

indicates that atomic numbers are provided in place of element names and no conversion should be performed.

[Note]See Also:

Trajectory Files

Trajectory files usually mean one of two things - either a sequence of frames from a molecular dynamics simulation trajectory, or a sequence of configurations from a geometry optimisation of some kind. Either way, both boil down to the same thing from Aten's perspective, that is a set of models in a sequence. In terms of displaying such a set of models, either they may be loaded as individual models (i.e. having a separate tab in the GUI) or the sequence of models may be associated to a single 'master' or 'parent' model. Most commonly, the latter is the preferred method (especially when large numbers of models are present in the trajectory).

There are two related ways to get this data into Aten. From the perspective of molecular dynamics simulations, the 'parent' model or configuration and the trajectory frames are stored in separate files. In this case, the model can be loaded first, and then the trajectory file attached or associated to this model afterwards. From the perspective of geometry optimisations, for example, the parent configuration (i.e. the starting point of the optimisation) and the sequence of coordinates are most often stored in the same output file. In this case, the importmodel filter can detect the presence of the additional trajectory frames and manually attach them to the parent model. The following sections explain the details of how both methods work.

Trajectories in Separate Files

DL_POLY, being a molecular dynamics code, stores its configuration and trajectory data in separate files. Filters are supplied with Aten that read in DL_POLY trajectories, and so this example will revolve around those filters.

Necessity for a Master Configuration?

Thus far, it has been implicity stated that the 'master' configuration and the trajectory files come necessarily as a pair - the master configuration is read in, and then the trajectory associated to it. This implies that the trajectory file is somehow tied to the master configuration - perhaps the trajectory file does not contain information such as the number of atoms or element data, and so a 'reference' configuration is necessary? Of course, this may not always be the case, and it is possible that some trajectory formats will store all the necessary information needed in order to fully generate the trajectory configurations. DL_POLY trajectories do, in fact, contain all the necessary data, but even so the master configuration is still used as a template for the trajectory data, and is used to check that the correct number of atoms are present etc. It comes down to a matter of preference as to whether the master configuration should be demanded, or whether the trajectory can itself be associated to any (even an empty) model. Remember, 'importtrajectory' filters always attach the trajectory data to an existing model.

ImportTrajectory Filters

An 'importtrajectory' filter is written in a slightly different way to other filter types. Since trajectory files may contain header data which is written once at the beginning of the file, preceeding the frame data, there are potentially two separate sets of data to read from trajectory files - header data and (individual) frame data. So, rather than putting the code to read this data directly in the main body of the filter, two functions should be defined instead, one for reading the header, and one for reading an individual frame. Note that, if a given trajectory format does not contain a header, the corresponding function may be left 'empty' (but must still be defined). The functions must be called 'readheader' and 'readframe' respectively, take no arguments, and must return an integer. A template for an 'importtrajectory' filter is thus:

filter(type='importtrajectory', name="Example Filter Template")
{
	int readheader()
	{
		// Code to read header data goes here
	}
	
	int readframe()
	{
		// Code to read frame data goes here
	}
}
			

The functions must take responsibility for informing Aten when the desired data cannot be read. Both should return a value of '1' if the data was read successfully, and should return '0' if an error is encountered.

Header Data

When opening a trajectory file with an 'importtrajectory' filter, the first thing Aten does is attempt to read any header information from the file by calling the 'readheader' function defined in the filter. Since a trajectory file may not contain a header, and consists simply of individual frames back to back, in these situations the readheader() function defined in the filter should not read any data. The filter definition then becomes simply:

filter(type='importtrajectory', name="Example Filter Template")
{
	int readheader()
	{
		// No header, so just return
		return 1;
	}
	
	int readframe()
	{
		// Code to read frame data goes here
	}
}
			

Here, the readheader() function always succeeds, so Aten always thinks it has successfully read a header, even if there isn't one.

Frame Data

If readheader() is successful, Aten proceeds to read the first frame (by calling the readframe() function) in order to get an idea of the size of an individual frame, and hence the total number of frames in the trajectory. Of course, this assumes that all frames take up the same number of bytes in the file, and may not always be the case, especially for plain-text trajectory files. Thus, the frame estimate output by Aten should not necessarily be taken as gospel.

Unless an error is encountered when reading the test frame (i.e. readframe() returns '0') the trajectory file is then 'rewound' to the end of the header section (start of the frame data). One of two things then happens. Since trajectory files are typically enormous (hundreds or thousands of megabytes) then it is unwise to try and load the whole trajectory into memory at once. Aten knows this, and from the estimated frame size also knows roughly how big the whole trajectory is. If the total trajectory file size is greater than an internally-defined limit (the ''trajectory cache size'') then only a single frame is stored at any one point. If the total size is smaller then this limit, the whole trajectory is cached in memory. Both have their advantages and disadvantages, as listed in the following sections.

Uncached Frames

If the trajectory is too big to be stored in memory, Aten only holds a single frame in memory at any one time. This means that:

  • Memory use is minimised - single frame stored = less memory used!

  • Performance is slower - moving between frames means data must be read from disk

  • Edits are forgotten - changes (both atomic and stylistic) made to the loaded frame are forgotten when a different frame is read

Aten tries to minimise the seek time between frames by storing file offsets of frames it has already read in. However, since trajectory frames can be different sizes Aten never tries to 'jump' ahead in the file based on the size of a single frame. Skipping immediately to the final frame in the trajectory will, thus, read all frames along the way and store file offsets for all frames. Then, seeking to any individual frame is a much quicker process.

Although style and editing changes are forgotten between frames, the overall camera view of the model is linked to that of the master configuration and so is retained between frames. If the trajectory cannot be cached and you require changes (edits or styles) to be made to each frame (e.g. for the purposes of making a movie of the trajectory) then a script is the way to go (load frame, apply edits, save image, etc.).

Cached Frames

If the trajectory is small enough to be stored in memory, Aten reads in all frames at once. This means that:

  • Memory use is increased

  • Performance is optimal - speed of moving between frames is governed only by the time taken to draw the model

  • Edits are retained - edits can be made to individual frames and will be remembered on moving to a different frame

The size of the cache can be adjusted either from the command line with the --cachelimit switch or by setting the 'cachelimit' member of the &prefs. No check is made of the new cache limit with respect to the memory available on the machine on which Aten is running, so use with care.

In the current versions of Aten, the total trajectory size is determined from the size of the frame on disk, whereas it would be more appropriate to use the size of the frame in memory. This will change in a future release.

Reading and Writing

Formatted output in Aten is based largely on string formatting in C, so if you're familiar with C then this should be a breeze. If you're a Soldier of Fortran, then the principles are very similar. If you're familiar with neither, then now's the time to learn.

[Note]See Also:

Formatted Output

Formatted output corresponds to output to either the screen or to files, and is used in the following commands:

Table 4.7. Formatted output commands

CommandFunction
errorWrite a message to the screen and immediately terminate execution of the current script / filter / command structure
printfWrite a message to the screen
verboseWrite a message to the screen, provided verbose output mode is on
writelinefWrite a formatted line to the current output file
writevarfWrite a formatted string to a variable (equivalent to the C 'sprintf' command)

Note that all are called the same as their ((Delimited Reading and Writing|delimited counterparts)), but with the addition of an 'f' at the end of the name.

Basic Strings

Formatting a string for output, as mentioned elsewhere on numerous occasions, works the same as for C. The C 'printf' command (equivalent to the command of the same name in Aten) takes a character string as its first argument, and at its simplest, this is all that is required:

printf("Hello");
			

This prints 'Hello' to the screen (minus the quotes). Importantly, however, a newline character is not printed, meaning that the next thing you try and printf will appear on the same line. For instance:

printf("Hello");
printf("There.");
			

would output:

HelloThere.
			

The end of a character constant in the printf command does not implicitly mean 'and this is the end of the line' - you must indicate the end of the line yourself by placing '\n' at the point where you wish the line to end. So:

printf("Hello\n");
printf("There.");
			

would output:

Hello
There.
			

Newlines (\n) are an example of escaped characters - the backslash '\' indicates that the following character, in this case 'n', is not to be treated as a normal 'n', but instead will take on its alternative 'meaning', in this case a newline. There are one or two other escaped characters recognised - see Escaped Characters for a list. Note that the newline token can appear anywhere in the string, and any number of times. So:

printf("Hello\nThere\n.");
			

would output:

Hello
There
.
			

Printing Data

Being able to print simple text strings is good, but not nearly enough. The first argument to the 'printf' command must always be a character string, but any number of additional arguments may be provided. Now, these additional arguments may be number constants, other character strings, variables, etc., and may be output in the resulting string by referencing them with 'specifiers' placed within the first example. One example of a specifier is '%i' which is shorthand for saying 'an integer value' - if used within the character string provided to printf, the command will expect an integer constant or variable to be provided as an additional argument. For example:

printf("This number is %i.\n", 10);
		

will print

This number is 10.
		

Similarly,

int value = 1234;
printf("Constant is %i, variable is %i.\n", 10, value);
		

will print

Constant is 10, variable is 1234.
		

There are other specifiers suitable for different types of data. The way data is presented by the specifier in the final output can also be controlled (e.g. for numerical arguments the number of decimal places, presence of exponentiation, etc., can be defined).

Formatted Input

Formatted input corresponds to input from either files or string variables, and is used in the following commands:

Table 4.8. Formatted input commands

CommandFunction
readlinefRead a formatted line from the current input file
readvarfRead a formatted string from a variable

Note that the meaning of the formatting string changes slightly here - in essence, the type and formats of the specifiers are used to break up the supplied string into separate arguments, which are then placed in the provided corresponding variable arguments. When reading in string data, note that blank characters are significant and will be retained. To strip trailing blank characters (spaces and tabs) when reading a fixed-length string in a format, supply the length as a negative number.

Specifiers

The list of allowable variable specified corresponds more or less exactly to that found in C, with some small omissions and minor inclusions. For a full list see the reference page at cplusplus.com or cppreference.com. The list of printf features that are not (currently) supported in Aten are as follows:

  • The pointer specifier '%p' is not supported. To print out reference addresses, use '%li'.

  • The single-character specifier '%c' is not supported.

  • Output of long doubles by prefixing a specifier with 'L' (e.g. '%Le') is not supported.

Extra Specifiers Within Aten

As well as the mostly complete standard set of specifiers provided by C, Aten also includes some other useful specifiers that may be used in formatted input and output.

Table 4.9. Extra read/write specifiers

SpecifierMeaning
%*Relevant to formatted input only. Discard the next item, regardless of its type. A corresponding variable argument need not be provided
%rRead characters (starting from the next delimited argument) until the end of the input line is encountered (i.e. 'rest-of-line' specifier). A corresponding string variable should be provided

Escaped Characters

Table 4.10. Escaped characters in format strings

Escape SequenceMeaning
\nPrint newline (next character will appear on the next line)
\rCarriage return
\tTab character

Delimited Reading and Writing

Formatting strings can be used to specify the layout of data items on a line when reading or writing data, but if the data are separated by whitespace characters such as spaces or tabs (or, alternatively, commas), such 'delimited' data can be read in more easily. In such cases, it is not necessary to know beforehand the number of characters taken up by each item on the line, since the delimiters separate adjacent data items. A simplified method for reading and writing can be employed in these cases.

Commands providing delimited reading and writing are:

Table 4.11. Delimited read/write commands

CommandFunction
readlineRead delimited items from a source file, placing into the variables provided
readnextRead the next delimited item from a source file, placing into the variable provided
readvarRead delimited items from a source variable, placing into the variables provided
writelineWrite the supplied items to a single line in the output file, separating them with whitespace
writevarWrite the supplied items to a supplied string variable, separating them with whitespace

Note that all are called the same as their formatted counterparts, but minus the 'f' at the end of the name.

Delimited Data Example

Consider this example datafile:

Na      0.0     1.0     0.0
Cl      1.0     0.0     0.0
Na      0.0    -1.0     0.0
			

Since the data items (element type and coordinates) are separated by whitespace, we need only provide the target variables to the relevant command - a formatting string, as is demanded by the printf command, is not required. Using the readline command, the following code will parse this data correctly:

double x,y,z;
string el;
while (!eof()) { readline(el,x,y,z); newatom(el,x,y,z); }
			

The variables el, x, y, and z will, at any one time, contain the element type and coordinates from one line of the file. In an analogous manner, the data may be written out again with the corresponding writeline command:

for (atom i = aten.model.atoms; i; ++i) writeline(i.symbol,i,rx,i.ry,i.rz);
			

Each line will have the individual data items separated by a single space.

The readnext command reads in a single delimited item from a source file, preserving the remainder of the input line for subsequent operations. If there is no data left on the current line, a new line is read and the first delimited item is returned. The example above might be written in a slightly clunkier form as:

double x,y,z;
string el;
while (!eof())
{
	readnext(el);
	readnext(x);
	readnext(y);
	readnext(z);
	newatom(el,x,y,z);
}
			

For all delimited reading operations, items of data read from the line are converted automatically into the type of the destination variable. So, the atom coordinates read in above, which are put into 'double'-type variables, could equally well be put into string variables. Standard C routines are used to convert data items in this way, and only some conversions make sense. For instance, attempting to read an item which is a proper character string (such as element symbol/name data) into a double or integer variable does not make sense. No error message will be raised, and the variables will likely be set to a value of zero (or whatever passes for 'zero' in the context of the type).

For all delimited writing operations, a suitable standard format specifier is chosen with which to write out the data.

Unformatted Reading and Writing

TODO

Chapter 5. The GUI

Aside from a powerful command-line tool, Aten has a GUI which is able to control must of the functionality available within the code. It is written in a style similar to other editing programs - at its simplest it is just a visualiser, but models can also be created and edited interactively.

GUI Overview

Most of the main window is taken up with a canvas which is used to display and edit models and take input from the user. A set of tabs directly above the main view shows the title of each loaded model currently available. The model being displayed on the main canvas (the 'current' model) is the one for which all input and editing tools will act on.

Each of the mouse buttons has a different action on the canvas, each of which can be set to the users taste in the preferences (menu item Settings->Preferences on Linux/Windows). In addition the Shift, Ctrl, and Alt keys modify or augment these default actions performed by the mouse. At the foot of the window is a message box (where output and errors are thrown) and a status bar reflecting the content of the current model displayed, listing the number of atoms and the number of selected atoms (bold value in parentheses, but only if there are selected atoms), the mass of the model, and the cell type and density (if the model is periodic).

Toolbars at the top of the window contain most commonly-used tools (strangely enough...), for example drawing atoms and bonds, selecting atoms etc. Not all are shown by default - right-clicking in the general region of the toolbars brings up a context menu allowing the available toolbars to be shown and hidden. A toolbar of icons starting off on the right-hand side of the window provides quick access to different Tool Windows for more complex building and editing tools.

Mouse Control

The mouse is, of course, the main method of interaction when using the GUI. Here is described which mouse-parts do what...

Manipulating the View

At its most basic Aten's main view acts as a visualiser allowing models to be rotated, zoomed in and out, and drawn in various different styles. By default, the right mouse button is used to rotate the model in the plane of the screen (right-click and hold on an empty area of the canvas and move the mouse) and th e mouse wheel zooms in and out. Note that right-clicking on an atom brings up the ((Atom Context Menu)). The middle mouse button translates the model in the plane of the screen - again, click-hold and drag.

These rotation and translation operate only the position and orientation of the camera, with no modifications made to the actual coordinates of the model. The view can be reset at any time from the main menu (View->Reset) or by pressing Ctrl-R. Both the main menu (View->Style) and the View toolbar allow the drawing style of models to be changed between stick, tube, sphere, scaled sphere, and individual. The last option allows different view styles to be set for different atoms.

The Ctrl key changes the normal behaviour of the rotation and translation operations and forces them to be performed on the coordinates of the current atom selection instead of the camera. The centroid of rotation is the geometric centre of the selected atoms.

Atom Selection

Atom selection or picking is performed with the left mouse button by default - single-click on any atom to highlight (select) it. Single-clicks perform 'exclusive' selections; that is, all other atom(s) are deselected before the clicked atom is (re)selected. Clicking in an empty region of the canvas deselects all atoms. Clicking on an empty space in the canvas, holding, and dragging draws a rectangular selection region - releasing the mouse button then selects all atoms within this area. Again, this selection operation is exclusive. Inclusive selections (where already-selected atoms are not deselected) are performed by holding the Shift key while performing the above operations. Furthermore, single-clicking on a selected atom while holding Shift will deselect the atom.

To summarise mouse control, standard settings out of the box are:

Table 5.1. Mouse Button Actions

Buttonw/ModifierAction
LeftNoneClick on individual atoms to select exclusively
Click-hold-drag to exclusively select all atoms within rectangular region
ShiftClick on individual atoms to toggle selection state
Click-hold-drag to inclusively select all atoms within rectangular region 
RightNoneClick-hold-drag to rotate camera around model 
Click on atom to show context menu 
CtrlClick-hold-drag to rotate selection in local (model) space 
MiddleNoneClick-hold-drag to translate camera 
CtrlClick-hold-drag to translate selection in local (model) space 

The primary actions of the mouse buttons may be swapped around at will to suit the individual users tastes (see ((GUI Preferences))). In addition, the mouse toolbar (see Toolbars) permits the primary function of the left mouse button to be changed on the fly (useful on systems which only have one mouse button).

Toolbars

Many of Aten's commonly-used functions are accessible through individual toolbars. At the outset, several of these are visible at the top of the main window (as well as the tool window toolbar to the right), but may be repositioned around the main window as necessary. Right-clicking on a toolbar area brings up a list of all available toolbars, allowing them to be shown and hidden. The last state of the toolbars (positions and visibility) is restored the next time Aten is started.

Bonding

Bonds between atoms can be calculated and removed en masse with the bonding toolbar, encompassing either the whole model or just the current atom selection. The bond tolerance used in the calculation of bonds can be set with the spin control. Automatic detection of multiple bonds can be performed with the augment tool.

Table 5.2. Bonding Toolbar Icons

Recalculate bonding in the current model
Clear bonding in the current model
Recalculate bonding in the current model, restricted to the current atom selection
Clear all bonds between atoms in the current selection
Based on the current connectivity, determine multiple bonds
N/AThe spinbox controls the bonding tolerance to use when automatically determining which atoms are bound - if the distance between two is less than the sum of their defined radii multiplied by this factor, then a bond exists

Build

The primary function of the build toolbar is to allow for drawing, deletion, and transmuting of individual atoms and bonds using the mouse. Setting the type of bond requires pairs of atoms to be clicked sequentially after the tool is activated. Similarly, transmuting atoms to the currently selected element and removing atoms simply involve clicking on atoms in the main view.

Table 5.3. Build Toolbar Icons

Draw unbound atoms
Draw chains of atoms by clicking and dragging the mouse
Add pre-defined molecular fragments to the model
Delete individual atoms, or hold Shift to delete all bonds attached to clicked atoms
Change clicked atoms to the currently selected element
Satisfy the natural valencies of all C, N, and O atoms by adding hydrogen atoms
Add hydrogens to clicked atoms
Set the current element to hydrogen
Set the current element to carbon
Set the current element to nitrogen
Select the current element from the periodic table
N/AThe current element set by the final button (which defaults to oxygen) is set from the last element chosen in the periodic table.
Create (or change to) a single bond between two clicked atoms
Create (or change to) a double bond between two clicked atoms
Create (or change to) a triple bond between two clicked atoms

Draw Style

The general drawing style for all atoms in all models is determined by the selection made on the Style toolbar. This does not clear any specific styles set for individual atoms, it only overrides them. The final 'Individual' style draws atoms in their associated styles (which defaults to 'Stick').

Table 5.4. Draw Style Toolbar Icons

Atoms are not explicitly drawn unless they possess no bonds, bonds are drawn using simple lines
Atoms and bonds are drawn as tubes
Atoms are drawn as uniformly-sized spheres, with bonds drawn as tubes
Atoms are drawn as spheres whose size depends on their atomic radii, bonds are drawn as tubes
Each atom is drawn according to its own assigned style

Edit

Standard Cut, Copy, Paste, and Delete functions that work on the atom selection of the current model. Only the last copied (or cut) selection of atoms is remembered. Pasted atoms are created with exactly the same coordinates as when they were copied - i.e. no translation of the pasted atoms is made to avoid other atoms in the target model. The newly pasted atoms become the current selection.

Table 5.5. Edit Toolbar Icons

Copy the current atom selection to Aten's clipboard
Copy the current atom selection to Aten's clipboard and then delete it
Paste the contents of the clipboard to the current model at the original coordinates. The pasted atoms then become the current selection
Delete the current atom selection

File

Quick tools to load, save, and close models.

Table 5.6. File Toolbar Icons

Create a new, empty model
Load an existing model into Aten
Save the current model under its original filename
Save the current model under a different filename
Close the current model (prompting to save first if changes have been made)

Forcefields

The minimiser can be run quickly from here (using the current method and associated settings from the minimiser window) and the total energy and forces of the current model calculated. A list of all loaded forcefields reflects the current default forcefield and allows selection of a new one.

Table 5.7. Forcefield Toolbar Icons

Minimise the energy of the current model
Calculate the total energy of the current model
Calculate the atomic forces in the current model
N/AThe combobox lists all currently loaded forcefields, and represents the default forcefield to use if no other has been assigned specifically to a model or pattern

Measure

Simple measurements of distances, angles, and torsions between picked atoms or the current selection of atoms is possible from the measure toolbar.

Table 5.8. Mouse Toolbar Icons

Measure distances between clicked atoms
Measure angles between clicked atoms
Measure torsion andlges between clicked atoms
Measure all bond distances between atoms in the current selection
Measure all bond angles between atoms in the current selection
Measure all torsion angles between atoms in the current selection

Mouse

For multi-button mice each button can be assigned an invidual action (select, rotate model etc.). For those who use single-button rats, this toolbar changes the function of the first (or left) button between select / interact, rotate model, and translate model. Selecting these buttons overwrite the stored action for the left button in the Preferences.

Table 5.9. Mouse Toolbar Icons

The left button selects and interacts with atoms
The left button rotates the view or selection
The left button translates the view or selection

Select

The standard mode for whichever mouse button is the interactor (by default its the left button) is Box Select, where atoms or groups of atoms are selected by click-dragging a box on the main canvas. This and other selection types are available here.

Table 5.10. Select Toolbar Icons

Atoms may be (de)selected by clicking on them individually, or selected en masse with a click-hold-drag
Bound fragments are selected by clicking on a single atom within that fragment
Clicking on a single atom selects all atoms of the same element
The current selection is expanded by following bonds attached to any select atoms.
Select all atoms in the current model
Deselect all atoms in the current model
Toggle the selection state of all atoms

Tool Stack

Tool windows are shown and hidden through the buttons on the tool stack toolbar. See the Tool Windows section.

Table 5.11. Tool Window Toolbar Icons

Show the atomlist window
Show the surface/grid management window
Show the fragment library
Show the building tools window
Show the atom transformation tools
Show the atom positioning tools
Show the atom geometry tools
Show the cell definition window
Show the cell transformation window
Show the disordered builder window
Show the energy minimiser window
Show the forcefield management woindow
Show the command window

Trajectory

If a trajectory is associated to the current model, the trajectory toolbar allows to skip through frames and playback the trajectory.

Table 5.12. Trajectory Toolbar Icons

Toggle between view of trajectory frames and the parent model
Return to the first frame in the trajectory
Go to the previous frame in the trajectory
Start / stop sequential frame playback of the trajectory
Go to the next frame in the trajectory
Skip to the last frame in the trajectory
N/AThe slider and spinbox represent the current frame position, and provide quick access to other frames

Tool Windows

Most of Aten's functions in the GUI are accessed through the various tool windows. These can be shown/hidden through the toggle buttons in the Tool Stack toolbar, which appears on the right-hand side of the main canvas by default.

Atom List Window

Atom List Window

Figure 5.1. Atom List Window

Atom List Window

General Format

The atom list shows, unsurprisingly, a list of all atoms in the model, displaying elements, charges, and positions. If patterns have been defined for the model, the atoms in the list will be grouped according to their encompassing pattern, otherwise they are listed in one continuous run by ascending ID.

Atom Selection

The selection of items in the atom list mirrors the selection in the current model - (de)selecting atoms in one will also (de)select them in the other. If patterns are defined, (de)selecting the pattern name in the list (de)selects all atoms making up the pattern.

Changing the Order of Atoms

The four buttons at the foot of the atom list allow the current selection of atoms to be moved up and down the list, useful for reordering atoms into a specific sequence. Selected atoms can be shifted up/down the list one place at a time, or all moved to the top or bottom of the list at once. In the latter case the order of the original selection is preserved.

Build Window

Build Window

More complex drawing tools, or those than cannot easily be presented in the form of a toolbar, can be found here. This window is more of a placeholder for future features, and doesn't contain much at present.

Add Atom

Figure 5.2. Build Window, Add Atom Panel

Build Window, Add Atom Panel

The Add Atom page allows atoms to be created at specific positions in the model. Coordinates are entered and the atom created (with element defined by the current selected element in the Build toolbar) by pressing the Add button. If the 'Frac' checkbox is ticked the coordinates are assumed to be fractional and are converted to cell coordinates as the atom is added. For example, setting coordinates to {0.5,0.5,0.5} will create an atom in the centre of the current unit cell.

Cell Definition Window

Cell Define Window

Figure 5.3. Cell Definition Window

Cell Definition Window

Allows the user to edit the unit cell specification of the current model, assign a crystallographic spacegroup, and perform spacegroup packing according to the spacegroup.

Whether or not the current model possesses a unit cell is determined wholly by the 'Has Cell' checkbox - if checked, the current model is periodic, if not, then it is an isolated atomic globule (or a 'molecule', if you prefer). If the model has a cell, its lengths (in Angstroms) and angles (in degrees) are displayed on the left-hand side, and may be freely edited (the volume of the current cell is displayed just below). Any changes made are immediately applied to the model. Any changes made here are immediately applied to the current model.

The spacegroup assigned to the current model can be changed and removed here. On its own, an assigned spacegroup is just a number - no modifications to the atoms are made by changing the assigned spacegroup. Packing of atoms, however, is a different matter. Once a spacegroup is assigned, symmetry-equivalent atoms may be generated by use of the 'Pack' button. This assumes that the current contents of the model represents the symmetry-unique set of atoms (i.e. the minimal generator set which, along with the spacegroup and unit cell, defines the entire crystal).

Cell Transform Window

Cell Transform Window

Transformations of the unit cell and its contents can be made here, encompassing geometric scaling of the cell (and atoms contained within) and replication of the system in three dimensions.

Replicate

Figure 5.4. Cell Transform Window, Replicate Panel

Cell Transform Window, Replicate Panel

The Replicate panel allows the current cell to be replicated along its three principal axes in both positive and negative directions. The six inputs represent negative and positive replication values for each direction -- most of the time its probably only useful to consider the positive (right-most) replication directions. Note that the numbers define the ''additional'' cells that will be created in addition to the original one. So, if all numbers are left at zero the original cell will remain untouched. Entering a value of 1 for each positive direction will give a 2x2x2 supercell of the original cell, and so on.

Atoms in the model are folded into the unit cell prior to replication, unless the Fold Atoms checkbox is unticked. Similarly, atoms that exist outside of the cell after replication are trimmed unless the Trim Atoms checkbox is unchecked.

Scale

Figure 5.5. Cell Transform Window, Scale Panel

Cell Transform Window, Scale Panel

The Scale panel allows the principal axes of the current unit cell to be arbitrarily scaled, along with the cell's contents. If a valid pattern description exists for the model, then the positions of individual molecules or bound fragments within the cell are scaled relative to their centres of geometry - all intramolecular distances within molecules remains the same as before the scaling. If this is undesirable (or unintended) then performing the scaling with no pattern definition will scale the position of each atom separately.

Command Window

Command Window

The command window allows commands or sequences of commands to be run, and also allows management of scripts.

Scripts

Figure 5.6. Command Window, Scripts Panel

Command Window, Scripts Panel

Command

Figure 5.7. Command Window, Prompt Panel

Command Window, Prompt Panel

Any command or compound command can be entered in the bottom editbox and will be executed immediately. This command will then be added to the list above, and can be single-clicked to return it to the editbox for tweaking or re-editing, or double-clicked to execute it again. The list of stored commands is saved when Aten exits.

Disordered Builder Window

Disordered Builder Window

Figure 5.8. Disordered Builder Window

Disordered Builder Window

The Disordered builder page allows the creation of randomly-oriented collections of molecules in periodic cells (e.g. gases, liquids, mixtures etc.) from individual molecule components. The list at the top of the panel gives all the currently-loaded molecules that are suitable for use as components – the main criterion is that they do not themselves possess a unit cell. Next to the name of each model in the list is a number, which specifies the number of molecules that you want to be inserted into the target model, and two checkboxes that allow certain Monte Carlo move types to be prevented for individual molecules. The first checkbox, if unticked, prevents rotations (both on insertion and in standard Monte Carlo moves) of the model, while the second checkbox, if unticked, will prevent the standard Monte Carlo translation move from being used with this model. If the number is set to zero (the default for all components) then no insertions of that model will be attempted.

The disordered builder needs a model with a cell already defined to insert into, and should be selected as the current model in the main view. The Build button will only be available if the current model is periodic. Note that the current model does not have to be empty to begin with, but if it is not, a forcefield must be assigned (or must be available) that describes completely the existing contents.

By default, all components are randomly distributed over the entire space of the model cell, but can be restricted to specific regions of the cell if required. For the model currently selected in the list of components, the Region panel may be used to define an area of the unit cell in which to restrict insertions of the model. If regions are defined for one or more models, these will displayed in the current model's cell.

The number of cycles determined the number of times to perform a round of Monte Carlo moves (see XXX), while the VDW Scale sets a temporary scaling factor to use in the energy calculation.

Forcefield Window

Forcefield Window

Figure 5.9. Forcefield Window

Forcefield Window

Forcefield files are managed through the Forcefield window. A list of currently-loaded forcefields is shown at the top, the default forcefield (if any) is indicated with a tick, and is used whenever a forcefield is required by a process but none has been linked to the target model. The forcefield selected in the list is the current forcefield, and the one used by all other actions on the page. Forcefields are loaded, unloaded, and edited with the buttons immediately underneath the list.

Assigning Forcefields to Models

The Associate panel links the selected forcefield to one or more models and their patterns; the 'Model' button links the current forcefield to the current model, while the 'All' button links the current forcefield to all loaded model. The 'Pattern' button brings up a dialog listing the patterns of the current model, from which one is selected to link the forcefield to. A forcefield associated to an individual pattern will be used in preference to the forcefield associated with its parent model.

Assigning Atom Types

Automatic Typing takes the current model and either assigns or removes forcefield types from the model's (or pattern's) associated forcefield(s). Forcefield types for all atoms are determined unless they have been assigned a specific type manually.

Manual assignment of forcefield types can be performed in the Manual Typing panel. The list gives all atom types in the current forcefield that are relevant to the element entered just above the list. One can be selected from the list and be manually assigned (forced) onto the current atom selection with the Set button. Such assignments will not be overwritten by subsequent automatic typings. Manual typings can be removed with the Delete button, and the currently selected atomtype can be tested for suitability on the current selection of atoms with the Test button.

Fragment Library Window

Fragment Library Window

Figure 5.10. Fragment Library Window

Fragment Library Window

When in fragment drawing mode, the Fragment Library window presents a list of all the available fragment models, and whichever is selected represents the current fragment to add in to the model. The current fragment is 'attached' to the mouse pointer when moving over the main canvas, and shows a preview of what will be the orientation and position of the fragment when a left-click is made.

Fragment Models

Fragment models are just normal models stored in specific places. The only real difference is that atoms with unknown element (integer '0', or string 'XX') are slightly more useful than usual. These can act as anchor points for the fragment that do not correspond to the position of any 'proper' atom to allow for more control over the placement of structures - for instance, such an atom may be placed at the centre of a ring. It is important to note that all atoms with unknown element type are removed when the fragment is added to the current model.

Anchor Points

At any time, a single atom in the selected fragment represents the attachment point and appears directly under the mouse pointer. Any atom in the fragment can be selected as the current anchor point, and may be cycled through by pressing Alt. If the atom acting as the anchor point has at least one bond to another atom then a reference vector is constructed allowing the fragment to be oriented along vectors dependent on the current geometry of existing atoms, for example.

Placing Fragments in Free Space

Single-clicking in free space (i.e. not over an existing atom) places a copy of the current fragment in the current orientation in the current model. Click-dragging allows the fragment to be freely rotated about the anchor point before the placement is final. On placement, the anchor atom is pasted too unless it is of unknown element (see above).

Attaching to Existing Atoms

When moving over an existing atom with an anchor point that has at least one bond to another atom, the fragment is attached at a suitable geometry, provided the valency of the atom allows (if not, the atom will be surrounded by a crossed-out box and the fragment will temporarily disappear). A single-click will place the fragment in the shown position and orientation, while click-dragging rotates the fragment about the newly-formed bond to allow fine adjustment before the final placement. If the anchor point has no bonds to other atoms, the fragment is placed in no specific orientation, and click-dragging freely rotates the molecule about the anchor point. In both cases, the anchor atom is always removed when being added to the model since the existing atom which was clicked on will replace it in terms of position.

If the existing atom in the model has one or more hydrogens attached to it, holding Shift will orient the fragment along the existing X-H bond. In this case, both the anchor atom and the existing hydrogen atom are removed when the fragment is placed.

Geometry Window

Geometry Window

Figure 5.11. Geometry Window

Geometry Window

The geometry window can be used to explicitly set the distance, angle, or torsion of a group of selected atoms. Exactly two, three, or four atoms must be selected for the individual panels to be available. The atoms need not be connected with bonds. The panels on this window are also used when setting geometry from the atom context menu.

Each page is essentially the same, displaying the atom IDs which make up the current target geometry. The new value of the geometry can be set explicitly, or increased/decreased by 'nudging' the current value by a specified amount.

Table 5.13. 

Add a specified amount to the current value 
Subtract a specified amount from the current value 

Grids Window

Grids Window

Figure 5.12. Grids Window

Grids Window

The Grids Tool Window provides management for grid data sets owned by the different models. All grid data sets held by the current model are displayed here, and. The appearance of individual grids may be changed, and axes / cutoffs changed. Grid data can also be cut, copied, and pasted to different models.

General Grid Management

Each grid in the left-hand list has associated with it a checkbox that determines whether or not it is currently visible. Below the list the minimum and maximum data values contained within the grid, and the current cutoff (i.e. the value that the isosurface is drawn at) to use when rendering the data. The File and Edit menus allow to load new grids into the current model, and to cut, paste, and delete grids between models.

Data Manipulation

The associated origin and axes to the currently selected grid may be modified in the top-right panel. In this way grid data may be arbitrarily flipped, stretched, and sheared, and its position in the local space of the model changed. All changes made are reflected immediately in the main view.

Appearance

The style of the selected grid can be modified in the lower-right panel, with the general rendering style set with the combo box (see grid styles for a list of possible styles).

For grids in which the data is 'symmetric' about a cutoff of zero (as is the case for orbital data, for example) the 'Symm' checkbox should be ticked to inform Aten that both the normal surface (above the cutoff) and the negative surface (below the negative of the cutoff) should be drawn.

Colouring

In the simplest case the points, triangles, or polygons that make up the rendered grid data are drawn in a single colour. This colour is determined by the upper of the two colour selections. If the data is symmetric (see above) and is composed of 'positive' and 'negative' parts, then the uppermost colour selection is applied to the positive part, and the lower colour selection is applied to the negative part. In addition, the transparency of the rendered data (if drawn in the Solid style) is determined by the Alpha value (0.0 being fully transparent, and 1.0 being fully opaque).

Should a more useful colouring scheme be desired than the grid may be rendered using a colour scale, in which case the isovalue (if volumetric) or height (if a 2D grid) determines the colour of the data point. To do so, enable the checkbox next to the CScale widget, and select the ID of the colour scale to use (from the ten definable in the program).

Minimiser Window

Minimiser Window

Figure 5.13. Minimiser Window

Minimiser Window

The Minimiser Window allows models to be energy-minimised w.r.t. their atomic coordinates. Several methods are available, listed in the drop-down list at the top-left. Each may have its own set of options, which are displayed in the panel underneath the convergence criterion for the energy and RMS force.

Atom Position Window

Atom Position Window

Tools for the absolute positioning of atoms are available here. All work on the current selection of atoms in the current model.

Centre Atoms

Figure 5.14. Atom Position Window, Centre Panel

Atom Position Window, Centre Panel

The Centre page allows the centre of geometry of the current selection to be positioned at absolute coordinates. The desired position is entered in the three input boxes, or can be defined from the geometric centre of a selection of atoms (prior to the positioning of a different set). Any (or all) of the Cartesian axes may be 'locked' preventing coordinate adjustment along parcitular directions.

Table 5.14. 

Define target coordinates from centre of geometry of current atom selection 

Flip About Axis

Figure 5.15. Atom Position Window, Flip Panel

Atom Position Window, Flip Panel

The Flip page mirrors the positions of atoms in the current selection through its centre of geometry in either the X, Y, or Z directions. Note that this tool currently works only along the Cartesian axes, and does not take into account the shape of any defined cell.

Table 5.15. 

Flip coordinates in the X direction 
Flip coordinates in the Y direction 
Flip coordinates in the Z direction 

Translate

Figure 5.16. Atom Position Window, Translate Panel

Atom Position Window, Translate Panel

Translations of atoms within model (local), world (view) and cell frames of reference can be performed in the Translate page. The group of directional buttons move the selected atoms along the relevant axis within the selected frame of reference, and by the amount specified in the Shift control. For model and world reference frames the Shift control specified the number of Angstroms moved along the axis in each step. For the cell reference frame it defines the fractional cell distance moved in each direction.

Table 5.16. 

Translate selection along the positive X axis of the current frame 
Translate selection along the negative X axis of the current frame 
Translate selection along the positive Y axis of the current frame 
Translate selection along the negative Y axis of the current frame 
Translate selection along the positive Z axis of the current frame 
Translate selection along the negative Z axis of the current frame 

Shift (Along Axis)

Figure 5.17. Atom Position Window, Shift Panel

Atom Position Window, Shift Panel

The axis along which to move the current selection is define in the left half of the Shift page. Furthermore, the axis may be defined by two clicked atoms in the main window. The supplied vector need not be normalised, as this is done automatically. This also means that un-normalised vectors are always displayed, so defining the axis from two clicked atoms will use the actual positional difference of the two atoms as the shift vector. Since the axis is normalised prior to the shift taking place, the shift distance 'delta' is the actual distance the atoms are moved by.

Table 5.17. 

Define vector from two selected atoms 
Normalise the currently defined vector to 1.0 
Move selected atoms 'delta' Angstroms along the defined vector 
Move selected atoms 'delta' Angstroms backwards along the defined vector 

Reposition

Figure 5.18. Atom Position Window, Reposition Panel

Atom Position Window, Reposition Panel

The reposition page allows the centre of geometry of a selection of atoms to be moved from a reference coordinate (defined by the 'Reference' box) to a destination coordinate (defined by the 'Target' box).

Table 5.18. 

Define source or target coordinates from centre of geometry of current atom selection 

Atom Transform Window

Atom Transform Window

For a selection of atoms, rotational or matrix-based transformations can be applied through the Transform Window.

Rotation About Arbitrary Axis

Figure 5.19. Atom Transform Window, Rotate Panel

Atom Transform Window, Rotate Panel

The Rotate panel allows an origin and a rotation axis about this origin to be defined about which to rotate atom selections. The origin and axis may be entered manually, can be determined from a current atom selection, or defined by the click-selection of two atoms. Defining the rotation axis from the current selection will set the axis to the vector between the currently-defined origin and the centre of geometry of the current atom selection. Rotations of atom selections about this axis/origin combination are then made by defining the angle of rotation (in degrees) and then applying the rotation either clockwise or anticlockwise.

Table 5.19. 

(Left) Define rotation origin from current atom selection 
(Right) Define rotation axis as the vector between current origin and centre of current selection 
(Right) Define rotation axis from two picked atoms 
Rotate current atom selection clockwise around defined axis/origin 
Rotate current atom selection counter-clockwise around defined axis/origin 

Matrix Transformation

Figure 5.20. Atom Transform Window, Matrix Transform Panel

Atom Transform Window, Matrix Transform Panel

From here a 3x3 transformation matrix can be applied to the current atom selection, and with a specific coordinate origin (not necessarily the centre of geometry of the selection).

Table 5.20. 

Define the matrix rows from pairs of picked atoms 
Normalise the matrix row to be a unit vector 
Orthogonalise the matrix row with respect to the other rows 
Generate the matrix row from the cross product of the other two 
Define transformation origin from the centre of geometry of the current atom selection 
Define transformation origin to be the centre of the current unit cell 

Matrix Conversion

Figure 5.21. Atom Transform Window, Matrix Convert Panel

Atom Transform Window, Matrix Convert Panel

It is possible to transform the orientation of a given set of atoms if a suitable pair of source and destination matrices are defined - this page attempts to do so! The 'Source' matrix defines what should be considered the current frame of reference for the current set of coordinates, while the 'Target' matrix defines what the 'Source' matrix should become after the operation.

Table 5.21. 

Define the matrix rows from pairs of picked atoms 
Normalise the matrix row to be a unit vector 
Orthogonalise the matrix row with respect to the other rows 
Generate the matrix row from the cross product of the other two 
Define transformation origin from the centre of geometry of the current atom selection 
Define transformation origin to be the centre of the current unit cell 

Chapter 6. Command Language

Command Language Overview

The scripting language in Aten is based syntactically on C/C++, with echoes of useful Fortran features included for good measure. This means that if you're familiar with C/C++ then writing a script, command, or filter for Aten should be relatively straightforward. There are lots of C primers on the web, so the following sections provide only a brief summary of the style of the language.

General Input Style

Keywords, variables, and function names are case sensitive, so 'for' is different from 'For' (all internal commands in Aten are in lowercase). Individual commands must be separated by a semicolon ';', and newlines are optional. For example:

int i; printf("Hello there.\n"); i = 5;
		

...and...

int i;
printf("Hello there.\n");
i = 5;
		

...are equivalent. Whitespace characters (spaces and tabs) are ignored and may be present in any amount in any position in the code.

Individual lines or parts of them may be commented out. The presence of either the hash symbol '#' or '//' in a line means 'ignore rest of line'. Note that the '/*...*/' commenting style is not supported.

Variables

There are several standard rules for variables within Aten:

  • They must be declared before use

  • They are strongly-typed, i.e. they hold a specific type of value (e.g. an integer, a character string etc.)

  • They must begin with an alpha character ('a' to 'z'), but may otherwise consist of letters, numbers, and the underscore ('_')

  • They may not be named the same as any existing function or internal keyword

Since variables are strongly-typed, trying to set an integer variable from a string will not work since these are incompatible types. However, standard C-style string conversion functions are available - see String Commands.

So, to initialise some variables, assign them values, and print them out, we would do the following:

int i;
double result;

i = 10;

result = i*5.0;

printf("i multiplied by 5.0 = %f\n", result);
		

In addition to the standard 'int' and 'double' types, a 'string' variable exists for the storage of arbitrary-length character strings, and do not need to have a length specified on their creation (they will adjust dynamically to suit the assigned contents). Literal character strings should be surrounded by double-quotes. A set of variable types exist that are able to contain references (not copies) of various objects within Aten, e.g. atoms, models, unit cells, etc. Variables of these types are declared in exactly the same way as normal variables (see Variable Types for a list of available types). A 'vector' type is provided for convenience and stores a triplet of real ('double') values. There is no boolean type - use an 'int' instead - but the built-in constants 'TRUE' and 'FALSE' may be used in assignment, etc., and correspond to the integer values '1' and '0' respectively.

All variables will default to sensible values (e.g. empty string, numbers equal to zero) on initialisation. To create a variable with a specific value simply do the following:

int i=1,j=2,k=1001;
double myvar=0.0, angle = 90.0;
		

Arrays

Arrays of most variable types are allowed (some, for instance the aten type, don't really make sense as an array). Arrays are requested by providing a constant size (or an expression) in square brackets after the name:

int values[100], i = 4;
double q[i];
		

Here, two arrays are created - an array of 100 integer numbers called 'values', and an array of four floating point numbers called 'q'. Array indices always run from 1 to the size of the array, unlike C in which arrays run from 0 to N-1, and Fortran in which it is possible to specify custom lower and upper indices for an array.

Arrays can be initialised to a simple value on creation, setting all elements to the same value...

string s[4] = "Nothing";
		

...or each element to a different value using alist enclosed in curly brackets:

string s[4] = { "Nothing", "Nicht", "Nada", "Not a sausage" };
		

Also, all array elements can be set to the same value with a simple assignment:

int t[100];
t = 40;
		
[Note]See Also:

Predefined Constants

Several predefined constants exist, and may not be overridden by variables of the same name. All predefined in constants are defined using uppercase letters, so the lower case equivalents of the names may be used as variables, functions etc.

Table 6.1. Built-in Constants

NameTypeValue
FALSEint0
NULLint0
PIdouble3.14159265358979323846
TRUEint1

In addition, all element symbols found in the input will be seen as their equivalent integer atomic number. So, instead of having to provide short strings containing the element name to, for example, the transmute command, simply the capitalised element name itself may be used. Thus...

transmute("Xe");
transmute(Xe);
transmute(54);
		

...are all entirely equivalent.

Blocks, Scope, and Variable Hiding

As with C, variable scope is employed in Aten meaning that a variable may be local to certain parts of the code / filter / script. In addition, two or more variables of the same name (but possibly different types) may peacefully co-exist in different scopes within the same code / filter / script. Consider this example:

int n = 4, i = 99;
printf("%i\n", i);
if (n == 4)
{
	int i = 0;
	printf("%i\n", i);
}
printf("%i\n", i);
		

...will generate the following output:

99
0
99
		

Why? Well, even though two variables called i have legitimately been declared, the second declaration is made within a different block, enclosed within a pair of curly braces. Each time a new block is opened it has access to all of the variables visible within the preceeding scope, but these existing variable names may be re-used within the new block in new declarations, and does *not* affect the original variable. Hence, in the example given above, after the termination of the block the final printf statement again sees the original variable i, complete with its initial value of '99' intact. Note that if a variable is re-declared within a scoping block, there is no way to access the original variable until the scoping block has been closed. Blocks can be nested to any depth.

Functions

For functions that take arguments, the argument list should be provided as a comma-separated list in parentheses after the function name. For instance:

newatom("C", 1.1, 0, 4.2);
		

Arguments may be constant values (as in this example), variables, arithmetic expressions, or any other function that returns the correct type. For functions that (optionally) do not take arguments, the empty parentheses may be omitted. A list of all functions, their arguments, and their return types is given in the command reference.

All functions return a value, even if it is 'no data' (the equivalent of 'void' in C/C++). For instance, in the example above the newatom command actually returns a reference to the atom it has just created, and this may be stored for later use:

atom a;
a = newatom("C", 1.0, 1.0, 1.0);
		

However, if the return value of any function is not required then it may simply be 'forgotten about', as in the example prior to the one above.

User Defined Functions

User-defined functions can be defined and used in Aten, taking a list of variable arguments with (optional) default values. The syntax for defining a function is as follows:

type name ( arguments ) { commands }
		

type is one of the standard variable types and indicates the expected return value type for the function. If no return value is required (i.e. it is a subroutine rather than a function) then type should be replaced by the keyword 'void':

void name ( arguments ) { commands }
		

Once defined, functions are called in the same way as are built-in functions. The name of the function obeys the same conventions that apply to variable names, e.g. must begin with a letter, cannot be the name of an existing keyword, function, or variable. The arguments are specified in a similar manner to variable declarations. A comma-separated list of types and names should be provided, e.g.:

void testroutine ( int i, int j, double factor ) { ... }
		

Our new subroutine 'testroutine' is defined to take three arguments; two integers, i and j, and a double factor. All three must be supplied when calling the function, e.g.

printf("Calling testroutine...\n");
int num = 2;
double d = 10.0;
testroutine(num, 4, d);
printf("Done.\n");
		

When defining the function/subroutine arguments, default values may be indicated, and permit the function to be called in the absence of one or more arguments. For instance, lets say that for our 'testroutine', the final argument factor is likely to be 10.0 on most occasions. We may then define a default value for this argument, such that if the function is called without it, this default value will be assumed:

void testroutine ( int i, int j, double factor = 10.0 ) { ... }

printf("Calling testroutine...\n");
int num = 2;
testroutine(num, 4);
testroutine(num, 4, 20.0);
printf("Done.\n");
		

Both methods of calling 'testroutine' in this example are valid.

Return Values

For functions defined to return a specific type, at some point in the bpdy of the function a suitable value should be returned. This is achieved with the return keyword. Consider this simple example which checks the sign of a numeric argument, returning '1' for a positive number and '-1' for a negative number:

int checksign ( double num )
{
	if (num < 0) return -1;
	else return 1;
}
		

If an attempt is made to return a value whose type does not match the type of the function, an error will be raised. Note that, once a return statement is reached, the function is exited immediately. For functions that do not return values (i.e. those declared with 'void') then return simply exits from the function - no return value need be supplied.

Arithmetic Expressions and Operators

Arithmetic operates in the same way as in C, and utilises the same operator precedence etc. Similarly, comparison operators (less than, equal to etc.) are the same as those found in C.

Variable Types

Overview

For variables in Aten that are of reference type (i.e. the non-standard types) various sub-variables and functions may be accessed in the same way class members are utilised in C++. Each non-standard variable type is listed here along with the types and descriptions of their available subvariables / members.

In the same way that class members are accessed in C/C++, subvariables of reference types are accessed by use of the full stops '.' between member names. For instance, the atom type allows all the information of a given atom to be accessed. The following example illustrates the process of retrieving the third atom in the current model, finding its coordinates, and subsequently adjusting them:

atom a = aten.model.atoms[3];
vector v = a.r;
printf("Old coordinates are: %f %f %f\n", v.x, v.y, v.z);
v.x += 4.0;
a.r = v;
printf("New coordinates are: %f %f %f\n", a.rx, a.ry, a.rz);
				

Lots of paths are used here. Firstly, the global aten variable is used to get access to the current model and grab a reference to its third atom (aten.model.atoms[3]). Then, the coordinates of this atom are placed in a vector v by requesting the r subvariable from the stored atom reference. We then adjust the vector and store the new coordinates in the atom.

All subvariables can be read, but not all can be written back to - these are read-only subvariables, and are indicated with 'ro' in the Access column in the following tables.

Function members act in the same as subvariable members except that they take one or more arguments enclosed in parentheses immediately following the member name, just as command functions do.

Aten

The 'master' class type, 'aten', is there to provide access to various other structures such as the list of loaded models, preferences, element data etc. It is available at all times from any command, script, or filter, and is always called 'aten'.

Table 6.2. Aten type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
elementselement[]roArray of element data (masses, symbols, names, etc.)
framemodelroThe current model being 'displayed' and the focus of editing, i.e. the current trajectory frame or, if no trajectory is associated to the current model then the current selected model is returned
modelmodelroThe current model selected (this is the parent model of a trajectory if a frame is currently being displayed)
modelsmodel[]roArray of all loaded models currently available
nelementsintroNumber of chemical elements defined in the 'elements' array
nmodelsintroNumber of models (parent models, i.e. not including trajectory frames) currently loaded
prefsprefsroProgram preferences

Table 6.3. Bond type functions

FunctionReturn TypeDescription
findelement ( string name )elementConvert the string specified into an element, according to the current zmapping type.

Atom

Table 6.4. Atom type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
fixedintrwWhether the atom's position is fixed (1) or not (0)
fvectorrwForce vector
fxdoublerwForce x-component
fydouble rwForce y-component
fzdoublerwForce z-component
hiddenintrwWhether the atom is hidden (1) or visible (0)
idintroNumerical ID of the atom within its parent model
massdoubleroAtomic mass of the atom
namestringroElement name of the atom
qdoublerwAtomic charge associated to the atom
rvectorrwPosition vector
rxdoublerwPosition x-component
rydoublerwPosition y-component
rzdoublerwPosition z-component
selectedintrwWhether the atom is selected (1) or unselected (0)
symbolstringroElement symbol of the atom
typeffatomrwForcefield type of the atom
vvectorrwVelocity vector
vxdoublerwVelocity x-component
vydoublerwVelocity y-component
vzdoublerwVelocity z-component
zintrwAtomic number of the atom

Bond

Table 6.5. Bond type members

MemberTypeAccessDescription
iatomroFirst atom involved in the bond
jatomroSecond atom involved in the bond
orderdoubleroBond order
typestringroBond type - see Bond Types for a list

Table 6.6. Bond type functions

FunctionReturn TypeDescription
partner ( Atom i )atomReturn the other atom (i.e. not i) involved in the bond

Bound

Table 6.7. Bound type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
datadoubleroParameters describing the bound interaction
escaledoubleroElectrostatic 1-4 scaling factor (for torsion interactions)
formstringroFunctional form of the bound interaction
idint[]roArray of atom IDs involved in the interaction
termidintroArray index of forcefield term in relevant list (ffangles, ffbonds, or fftorsions) in local pattern
typenamesstring[]roArray of typenames involved in the interaction
vscaledoubleroShort-range 1-4 scaling factor (for torsion interactions)

Element

Table 6.8. Element type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
ambientdouble[4]rwAmbient colour of the element
colourdouble[4]rwReturns the ambient colour of the element. Set this property to define both ambient (supplied values) and diffuse (0.75*supplied values) components simultaneously
diffusedouble[4]rwDiffuse colour of the element
massdoubleroAtomic mass of the element
namestringroCapitalised name of the element
radiusdoublerwAtomic radius of the element. Affects the scaled sphere rendering style and bond calculation.
symbolstringroAtomic symbols of the element

FFAtom

Table 6.9. FFAtom type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
chargedoublerwCharge associated to the type
datadouble[6]rwParameter data for short-range potential
descriptionstringrwText data describing the type
equivalentstringrwEquivalent name for the type
formstringrwFunctional form of short-range potential
idintroInternal ID of the atom type within its parent forcefield
namestringrwName of the type
netastringroThe original type description used to identify the type
ffforcefieldroParent forcefield containing the type
zintrwElement id (Z) corresponding to the target element of this type

Table 6.10. FFAtom type functions

FunctionReturn TypeDescription
datad ( string varname )doubleReturn the value of the defined data item varname as a double if it has been defined in a data block in its encompassing forcefield.
datai ( string varname )intReturn the value of the defined data item varname as an integer if it has been defined in a data block in its encompassing forcefield.
datas ( string varname )stringReturn the value of the defined data item varname as a string if it has been defined in a data block in its encompassing forcefield.
generatord ( string varname )doubleReturn the value of the defined generator data varname as a double if it has been defined in a generator block in its encompassing forcefield.
generatori ( string varname )intReturn the value of the defined generator data varname as an integer if it has been defined in a generator block in its encompassing forcefield.
generators ( string varname )stringReturn the value of the defined generator data varname as a string if it has been defined in a generator block in its encompassing forcefield.

FFBound

Table 6.11. FFBound type members

MemberTypeAccessDescription
datadouble[]rwParameter data for short-range potential
escaledouble[]rwFor torsion-type interactions, the electrostatic scaling factor between atoms 1 and 4
formstringrwFunctional form of short-range potential - see VDW Forms
natomsintroNumber of atoms involved in the bound interaction
typestringrwActual type of the bound interaction (bond, angle, etc.)
typenamesstringrwNames of the atom types the interaction is relevant to
vscaledouble[]rwFor torsion-type interactions, the VDW scaling factor between atoms 1 and 4

Forcefield

Table 6.12. Forcefield type members

MemberTypeAccessDescription
energygeneratorsint[]rwArray of integers flagging which generator data are 'energetic' and should be converted
filenamestringrwFilename if the forcefield was loaded from a file
namestringrwName of the forcefield

Glyph

Table 6.13. Glyph type members

MemberTypeAccessDescription
dataglyphdataroIndividual data for each vertex of the glyph
rotationdouble[9]rwRotation matrix for the glyph
solidintrwSpecifies whether the glyph is drawn as a filled (solid) shape or in wireframe
textstringrwText data associated to the glyph. Not all glyphs use text
typestringrwStyle of the glyph - see Glyph Types for a list
visibleintrwFlag indicating whether the glyph is currently visible

Table 6.14. Glyph type functions

FunctionReturn TypeDescription
resetrotation ()voidReset any rotation applied to the glyph
rotatex ( double angle )voidRotates the glyph by angle degrees about its x axis
rotatey ( double angle )voidRotates the glyph by angle degrees about its y axis
rotatey ( double angle )voidRotates the glyph by angle degrees about its z axis

GlyphData

Table 6.15. GlyphData type members

MemberTypeAccessDescription
colourdouble[4]rwRGBA colour of the vertex
vectorvectorrwVertex coordinates

Measurement

Table 6.16. Measurement type members

MemberTypeAccessDescription
atomsatom[]roArray of atoms involved in the measurement
iatomroFirst atom involved in the measurement
jatomroSecond atom involved in the measurement
katomroThird atom involved in the measurement (if any)
latomroFourth atom involved in the measurement (if any)
valuedoubleroValue (e.g. distance, angle, or torsion angle) of the measurement

Model

Table 6.17. Model type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
anglesmeasurement[]roList of current angle measurements in the model
atomsatom[]roArray of atoms in the model
bondsbond[]roArray of bonds defined in the model
cellunitcellrwThe model's unit cell
distancesmeasurement[]roList of current distance measurements in the model
ffforcefieldrwForcefield associated to the model (if any)
ffanglesffbound[]roList of unique forcefield angle terms in the model
ffbondsffbound[]roList of unique forcefield bond terms in the model
ffmassdoubleroForcefield mass of the current model, which can differ from the actual mass if united-atom types have been assigned
fftorsionsffbound[]roList of unique forcefield torsion terms in the model
fftypesffatomroArray of unique atom types used in the model
framemodelroThe current frame in the model's trajectory (if it has one)
framesmodel[]roArray of trajectory frame pointers (only if the trajectory is cached)
glyphsglyph[]roList of glyphs owned by the model
idintroThe index of the model in Aten's internal list of loaded models
massdoubleroMass of the current model
namestringrwName of the model
nanglesintroNumber of angle measurements in the model
natomsintroNumber of atoms in the model
nbondsintroNumber of bonds in the model
ndistancesintroNumber of distance measurements in the model
nffanglesintroNumber of unique angle terms used in the model
nffbondsintroNumber of unique bond terms used in the model
nfftorsionsintroNumber of unique torsion terms used in the model
nfftypesintroNumber of unique atom types used in the model
nframesintroNumber of frames in associated trajectory
nglyphsintroNumber of glyphs owned by the model
npatternsintroNumber of patterns defined for the model
nselectedintroNumber of atoms selected in the model
ntorsionsintroNumber of torsion angle measurements in the model
nunknownintroNumber of atoms in the model that are of unknown element
patternspattern[]roArray of patterns currently defined for the model
regionregionroRegion data for this model, used by the disordered builder
torsionsmeasurement[]roList of current torsion angle measurements in the model

Pattern

Table 6.18. Pattern type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
anglesbound[]roArray of angle interactions in one molecule of the pattern
atomsatom[]roArray of atoms spanned by the pattern
bondsbound[]roArray of bond interactions in one molecule of the pattern
cogvector[]roArray of centres of mass of the molecules in the pattern
comvector[]roArray of centres of geometry of the molecules in the pattern
ffforcefield[]rwReference to the forcefield associated to the pattern (if any)
ffanglesffbound[]roList of unique forcefield angle terms in the pattern
ffbondsffbound[]roList of unique forcefield bond terms in the pattern
fftorsionsffbound[]roList of unique forcefield torsion terms in the pattern
fftypesffatomroArray of unique atom types used in the pattern
firstatomatom[]roReference to the first atom spanned by the pattern
firstatomidintroAtom ID of the first atom spanned by the pattern
fixedintrwWhether the coordinates of all atoms in the pattern are fixed in MC routines
lastatomatom[]roReference to the last atom spanned by the pattern
lastatomidintroAtom ID of the last atom spanned by the pattern
namestringrwName of the pattern
nanglesintroNumber of angles in one molecule of the pattern
natomsintroTotal number of atoms spanned by the pattern
nbondsintroNumber of bonds in one molecule of the pattern
nffanglesintroNumber of unique angle terms used in the pattern
nffbondsintroNumber of unique bond terms used in the pattern
nfftorsionsintroNumber of unique torsion terms used in the pattern
nfftypesintroNumber of unique atom types used in the pattern
nmolatomsintroNumber of atoms in one molecule of the pattern
nmolsintroNumber of molecules (repeat units) in the pattern
ntorsionsintroNumber of torsion interactions in one molecule of the pattern
torsionsbound[]roArray of torsion interactions in one molecule of the pattern

Prefs

Table 6.19. Prefs type members

MemberTypeAccessDescription
elementselementroArray of element data (masses, symbols, names, etc.)
anglelabelstringrwThe units label appended to angle measurements
atomdetailintrwQuadric detail of atoms. Higher values give rounder atoms but make rendering slower
atomstyleradiusdouble[4]rwThe atom radii used for selection and rendering in the four Drawing Styles
backcullintrwWhether culling of backward-facing polygons should be performed
backgroundcolourdouble[4]rwBackground colour of the main canvas on which models are drawn
bonddetailintrwQuadric detail of bonds. Higher values give rounder bonds but make rendering slower
bondstyleradiusdouble[4]rwThe bond radii used for selection and rendering in the four Drawing Styles
bondtolerancedoublerwTolerance used in automatic calculation of bonds between atoms
cachelimitintrwThe trajectory cache size (in kilobytes) - trajectory files calculated to have more than this amount of data will not be cached in memory
calculateelecintrwControls whether electrostatic contributions to the energy/forces are calculated
calculateintraintrwControls whether intramolecular contributions to the energy/forces are calculated
calculatevdwintrwControls whether short-range Vdw contributions to the energy/forces are calculated
clipfardoublerwThe far clipping distance used when rendering
clipneardoublerwThe near clipping distance used when rendering
colourschemestringrwThe current Colour Scheme used to colour atoms and bonds
combinationrulestringrwLennard-Jones parameter combination rule equations. See Combination Rules for a list of rules.
commonelementsstringrwComma-separated list of common elements that appear in the Select Element dialog
densityunitstringrwThe unit of density to used when displaying cell densities
depthcueintrwEnables/disables depth cueing
depthfarintrwThe far fog distance used when rendering (if depth cueing is enabled)
depthnearintrwThe near fog distance used when rendering (if depth cueing is enabled)
distancelabelstringrwThe units label appended to distance measurements
eleccutoffdoublerwThe electrostatic cutoff distance
elecmethodstringrwThe method of electrostatic energy/force calculation
energyunitdoublerwSet the unit of energy to use
energyupdateintrwUpdate frequency for the energy in various methods
ewaldalphadoublerwConvergence parameter in Ewald sum
ewaldkmaxint[3]rwVector of Ewald reciprocal space vector limits (kmax)
ewaldprecisiondoublerwPrecision parameter to use when generating parameters in EwaldAuto
forcerhombohedralintrwFor spacegroups that are detected to have a hexagonal basis, force packing to use generators in a rhombohedral basis
foregroundcolourdouble[4]rwForground pen colour of the main canvas on which models are drawn, affecting colour of text labels, rotation globe, unit cell etc.
globesizeintrwSize, in pixels, of the rotation globe in the lower-right-hand corner of the screen
hdistancedoublerwDefault H-X bond distance to use when adding hydrogen atoms
keyactionstring[3]rwCurrent actions of the modifier keys Shift, Ctrl, and Alt
labelsizeintrwFont pointsize for label text
linealiasingintrwEnables/disables line aliasing
manualswapbuffersintrwFlag whether manual swapping of GL buffers is enabled
maxringsintrwMaximum allowable number of rings to detect within any single pattern
maxringsizeintrwMaximum size of ring to detect when atom typing
maxundointrwMaximum number of undo levels remembered for each model (-1 = unlimited)
modelupdateintrwUpdate frequency for the current model in various methods
mouseactionstring[4]rwCurrent actions of the Left, Middle, Right, and Wheel mouse buttons
offscreenobjectsintrwBitarray of View Objects drawn when rendering scenes to image files
perspectiveintrwWhether perspective view is enabled
perspectivefovdoublerwField of vision angle to use for perspective rendering
polygonaliasingintrwEnables/disables polygon aliasing
renderstylestringrwThe current model drawing style
replicatefoldintrwWhether to fold atoms before cell replicate
replicatetrimintrwWhether to trim atoms after cell replicate
screenobjectsintrwBitarray of View objects drawn when rendering to screen
selectionscaledoublerwMultiple of the standard atom radius to use for transparent selection spheres
shininessintrwThe shininess of atoms (value must be between 0 and 127 inclusive)
specularcolourdouble[4]rwColour of all specular reflections
spotlightintrwWhether the spotlight is on or off
spotlightambientdouble[4]rwThe ambient colour component of the spotlight
spotlightdiffusedouble[4]rwThe diffuse colour component of the spotlight
spotlightpositiondouble[4]rwSpotlight coordinates (in Å)
spotlightspeculardouble[4]rwThe specular colour component of the spotlight
useframebufferintrwWhether to use the grabFrameBuffer() method of the main widget instead of the normal renderPixmap() method when saving bitmap images. If saving an image results in a completely black or corrupt bitmap, try setting this to TRUE.
usenicetextintrwWhether QPainter (on/1/TRUE) or QGlWidget (off/0/FALSE) is used to render label text
vdwcutdoublerwThe VDW cutoff distance
vdwscaledoublerwScaling factor to use for short-range radii in energy/force calculation
warn1056intrwMany changes to the typing language syntax were introduced in revision 1056, and a warning message was implemented. This can be turned off by setting this variable to FALSE
zoomthrottledoublerwZooming 'throttle' value used to calm down or increase the distance jumped when zooming with the mouse

Region

Table 6.20. Region type members

MemberTypeAccessDescription
centrevectorrwGeometric centre of the region in real coordinates
centrefracvectorrwGeometric centre of the region in fractional cell coordinates
geometryvectorrwGeometry of the region in real coordinates
geometryvectorrwGeometry of the region in fractional cell coordinates
iscentrefracintroIndicates whether the current region centre was defined in fractional coordinates
isgeometryfracintroIndicates whether the current region geometry was defined in fractional coordinates
overlapintrwFlag to specify whether inserting molecules at positions that overlap with other regions is allowed
shapestringrwThe current shape of the region. See Region Shapes for a list
xrotationdoublerwThe x-rotation of the region
yrotationdoublerwThe y-rotation of the region

UnitCell

Table 6.21. UnitCell type members

MemberTypeAccessDescription
adoublerwLength of cell axis A
alphadoublerwAngle between cell axes B and C
bdoublerwLength of cell axis B
betadoublerwAngle between cell axes B and C
cdoublerwLength of cell axis C
axdoublerwx-component of cell axis A
aydoublerwy-component of cell axis A
azdoublerwz-component of cell axis A
bxdoublerwx-component of cell axis B
bydoublerwy-component of cell axis B
bzdoublerwz-component of cell axis B
centrexdoublerox-coordinate at centre of defined cell
centreydoubleroy-coordinate at centre of defined cell
centrezdoubleroz-coordinate at centre of defined cell
cxdoublerwx-component of cell axis C
cydoublerwy-component of cell axis C
czdoublerwz-component of cell axis C
densitydoubleroDensity of the current cell
gammadoublerwAngle between cell axes A and B
matrixdouble[9]rwCell axis matrix containing all three cell vectors. For example, ax = matrix[1], ay = matrix[2], etc.)
sgidintrwInteger ID of the current spacegroup
sgnamestringrwSymbol of the current spacegroup
typestringroType of the current unit cell (see Cell Types
volumedoubleroVolume of the cell in cubic Å

Vector

Table 6.22. Vector type members

MemberTypeAccessDescription
magdoublerwMagnitude of the vector. Setting this value rescales the vector
xdoublerwThe x component of the vector
ydoublerwThe y component of the vector
zdoublerwThe z component of the vector

Command Reference

Atom Commands

Define and set properties of atoms.

[Note]See also:

atomstyle

Syntax:

void atomstyle(string  style);

Sets the individual drawing style for the current atom selection, used when the global drawing style is 'individual'.

For example:

atomstyle("tube")
		

sets the current atom selection to be drawn in the 'tube' style.

[Note]See also:

currentatom

Syntax:

atom currentatom(); 
atom currentatom(id); 
atom|id  id;

Return a reference to the current atom. If a new atom/id is provided the current atom is set before being returned.

For example:

atom i = getatom(1);
		

makes the first atom in the current model the current atom, and returns a reference to it.

fix

Syntax:

void fix(id = 0); 
atom|id  id = 0;

Fix the positions of the current atom selection (or individual atom specified) so that they remain in the same position following various methods (e.g. minimisations).

For example:

fix();
		

fixes the positions of all selected atoms.

for (int n=1; n<=10; ++n) fix(n);
		

fixes the positions of the first 10 atoms in the current model.

free

Syntax:

void free(id = 0); 
atom|id  id = 0;

Free the positions of previously fixed atoms in the current selection (or the individual atom specified).

For example:

free(5);
		

allows the fifth atom in the current model to be moved again.

getatom

Syntax:

atom getatom(id); 
atom|id  id;

Return a reference to the atom specified.

For example:

atom i = getatom(3);
		

returns a reference to the third atom in the current model.

hide

Syntax:

void hide(id = 0); 
atom|id  id = 0;

Hides the current selection of atoms (or the supplied atom) from view, meaning they cannot be selected by direct clicking/highlighting in the GUI. They are still subject to transformation if they are selected by other means.

setcharge

Syntax:

void setcharge(q); 
double  q;
void setcharge(q,  
 id); 
double  q;
int  id;

Set the atomic charge of the current (or specified) atom.

setcoords

Syntax:

void setcoords(x,  
 y,  
 z); 
double  x;
double  y;
double  z;
void setcoords(x,  
 y,  
 z,  
 id); 
double  x;
double  y;
double  z;
int  id;

Set the coordinates of the current (or specified) atom.

setelement

Syntax:

void setelement(element); 
string|int  element;
void setelement(element,  
 id); 
string|int  element;
int  id;

Set the element of the current (or specified) atom.

setforces

Syntax:

void setforces(fx,  
 fy,  
 fz); 
double  fx;
double  fy;
double  fz;
void setforces(fx,  
 fy,  
 fz,  
 id); 
double  fx;
double  fy;
double  fz;
int  id;

Set the forces of the current (or specified) atom.

setfx

Syntax:

void setfx(d); 
double  d;
void setfx(d,  
 id); 
double  d;
int  id;

Set the x force of the current (or specified) atom.

setfy

Syntax:

void setfy(d); 
double  d;
void setfy(d,  
 id); 
double  d;
int  id;

Set the y force of the current (or specified) atom.

setfz

Syntax:

void setfz(d); 
double  d;
void setfz(d,  
 id); 
double  d;
int  id;

Set the z force of the current (or specified) atom.

setid

Syntax:

void setid(newid); 
int  newid;
void setid(newid,  
 id); 
int  newid;
int  id;

Set the temporary ID of the current (or specified) atom, useful for when parsing atoms from a file that are not in any useful order but have an id specified for the purposes of subsequent connectivity definitions, for example. Within filters, once loading is complete the finalisemodel command will reset all atom ids to internal numbering.

setrx

Syntax:

void setrx(d); 
double  d;
void setrx(d,  
 id); 
double  d;
int  id;

Set the x coordinate of the current (or specified) atom.

setry

Syntax:

void setry(d); 
double  d;
void setry(d,  
 id); 
double  d;
int  id;

Set the y coordinate of the current (or specified) atom.

setrz

Syntax:

void setrz(d); 
double  d;
void setrz(d,  
 id); 
double  d;
int  id;

Set the z coordinate of the current (or specified) atom.

setvelocities

Syntax:

void setvelocities(vx,  
 vy,  
 vz); 
double  vx;
double  vy;
double  vz;
void setvelocities(vx,  
 vy,  
 vz,  
 id); 
double  vx;
double  vy;
double  vz;
int  id;

Set the velocity components of the current (or specified) atom.

setvx

Syntax:

void setvx(d); 
double  d;
void setvx(d,  
 id); 
double  d;
int  id;

Set the x velocity of the current (or specified) atom.

setvy

Syntax:

void setvy(d); 
double  d;
void setvy(d,  
 id); 
double  d;
int  id;

Set the y velocity of the current (or specified) atom.

setvz

Syntax:

void setvz(d); 
double  d;
void setvz(d,  
 id); 
double  d;
int  id;

Set the z velocity of the current (or specified) atom.

show

Syntax:

void show(id = 0); 
atom|int  id = 0;

Makes the current selection of atoms (or the supplied atom) visible again if they were previously hidden.

Bond Commands

Create bonds and perform automatic bonding operations.

augment

Syntax:

void augment(); 

Augments bonds in the current model, automatically determining multiple bonds based on the valency of atoms, and aromaticity based on double bonds in rings.

For example:

augment();
		
[Note]See also:
  • Augment method for a description of the rebonding algorithm implemented in Aten

bondtolerance

Syntax:

double bondtolerance(); 
double bondtolerance(tol); 
double  tol;

Adjust the bond calculation tolerance. It may often be necessary to tweak the bond tolerance in order to get Aten to recognise patterns within models correctly. The current or new bond tolerance is returned.

For example:

bondtolerance(1.20);
		

sets the bonding tolerance to 1.2.

double tol = bondtolerance();
		

retrieve the current bond tolerance.

[Note]See also:
  • Rebond method for a description of the rebonding algorithm implemented in Aten

clearbonds

Syntax:

void clearbonds(); 

Delete all bonds in the current model.

For example:

clearbonds();
		

clearselectedbonds

Syntax:

void clearselectedbonds(); 

Delete all bonds in the current atom selection.

For example:

clearselectedbonds();
		

newbond

Syntax:

void newbond(i,  
 j); 
atom|int  i;
atom|int  j;
void newbond(i,  
 j,  
 bondtype); 
atom|int  i;
atom|int  j;
string|int  bondtype;

Create a new bond in the model between the specified atoms. The optional bondtype argument specified the type of bond: e.g. single (default), double, or triple. Alternatively, an integer number representing the bond order may be given.

For example:

newbond(4, 5, "double");
		

creates a double bond between the fourth and fifth atoms in the model.

newbond(1, 2, 3);
		

creates a triple bond between the first and second atoms in the model.

atom i,j;
i = newatom("C", 0, 0, 0);
j = newatom("H", 0, 1.08, 0);
newbond(i, j, "single");
		

creates a new single bond between two atoms, supplied as references.

newbondid

Syntax:

void newbondid(i,  
 j); 
int  i;
int  j;
void newbondid(i,  
 j,  
 bondtype); 
int  i;
int  j;
string|int  bondtype;

Create a new bond in the model between atoms referenced by their temporary ID, set manually with the setid command. Otherwise identical to the newbond command.

rebond

Syntax:

void rebond(); 

Calculate bonding in the current model.

For example:

rebond();
		

rebondpatterns

Syntax:

void rebondpatterns(); 

Calculate bonding in the current model, but restrict bond creation to between atoms in individual molecules of defined patterns.

For example:

rebondpatterns();
		

'rebondpatterns' can be useful when molecules in a system are too close together to have the correct bonding detected. In such a case, bonds and any old patterns in the model may be cleared, new patterns created by hand, and then 'rebondpatterns' used to calculate bonds only between the atoms of individual molecules in the defined patterns in order to recreate the original molecules.

For example:

clearbonds();                    # Delete existing bonds in model
clearpatterns();                 # Delete any existing patterns in the model
newpattern("benzene", 100, 12);  # Add new pattern: 100 molecules of benzene (12 atoms), followed by...
newpattern("ether", 50, 15);     # ...50 molecules of diethyl-ether (15 atoms)
rebondpatterns();                # Calculate bonds within individual benzene and ether molecules
		

rebondselection

Syntax:

void rebondselection(); 

Calculate bonding between atoms in the current atom selection.

For example:

rebondselection();
		

Building Commands

Tools to build molecules from scratch, or finalise unfinished models. When creating atoms using the commands listed below, if the coordinates of the new atom are not specified then it is placed at the current pen position. In addition, the reference frame of the pen position is represented as a set of three orthogonal vectors defining the pen's local coordinate system (set initially to the Cartesian axes) centred at an arbitrary origin (the pen position). Subsequent rotations operate on these coordinate axes. Think of it as a 3D version of the old-school turtle.

addhydrogen

Syntax:

void addhydrogen(); 
void addhydrogen(i); 
atom|int  i;

Satisfy the valencies of all atoms in the current model by adding hydrogens to heavy atoms. If an integer id or atom reference is provided as the argument then the addition of hydrogen is restricted to the specified atom.

For example:

addhydrogen();
		

add hydrogens to all atoms in the current model.

addhydrogen(10);
		

add hydrogens to atom 10 only.

bohr

Syntax:

void bohr(x,  
 ...); 
object  x;
 ...;

Converts the specified object(s) data to Å, assuming that it is currently specified in Bohr.

For example:

atom i = aten.model.atoms[2];
bohr(i);
		

converts the coordinates of the supplied atom from Bohr to Å.

chain

Syntax:

atom chain(el); 
int|string  el;
atom chain(el,  
 bondtype); 
int|string  el;
int|string  bondtype;
atom chain(el,  
 x,  
 y,  
 z); 
int|string  el;
double  x;
double  y;
double  z;
atom chain(el,  
 x,  
 y,  
 z,  
 bondtype); 
int|string  el;
double  x;
double  y;
double  z;
int|string  bondtype;

Create a new atom of element el at the current pen position (or the specified coordinates) bound to the last drawn atom with a single bond (or of type bondtype if it was specified). The element can be provided as a character string containing the element symbol or element name instead of the integer atomic number. A reference to the new atom is returned.

For example:

atom i = chain("C");
		

places a carbon atom at the current pen coordinates, and creates a single bond with the last drawn atom.

atom i = chain(8, "double");
		

places an oxygen atom at the current pen coordinates, and creates a double bond with the last drawn atom.

atom i = chain("Cl", 4.0, 5.0, 6.0, "single");
		

creates a chlorine at coordinates { 4.0, 5.0, 6.0 }, joined by a single bond to the last drawn atom.

endchain

Syntax:

void endchain(); 

Ends the current chain (so that the next atom drawn with 'chain' will be unbound).

For example:

endchain();
		

locate

Syntax:

void locate(x,  
 y,  
 z); 
double  x;
double  y;
double  z;

Sets the pen position to the coordinates specified (in Å).

For example:

locate(0.0, 0.0, 0.0);
		

moves the pen back to the coordinate origin.

move

Syntax:

void move(x,  
 y,  
 z); 
double  x;
double  y;
double  z;

Moves the pen position by the amounts specified (in Å).

For example:

move(1.0, 1.0, 0.0);
		

moves the pen +1 Angstrom in both the x and y directions.

movetoend

Syntax:

void movetoend(); 

Move the current atom selection to the end of the list. The relative order of atoms in the selection is preserved.

For example:

movetoend();
		

movetostart

Syntax:

void movetostart(); 

Move the current atom selection to the start of the list. The relative order of the atoms in the selection is preserved.

For example:

movetostart();
		

newatom

Syntax:

void newatom(el); 
int|string  el;
void newatom(el,  
 x,  
 y,  
 z); 
int|string  el;
double  x;
double  y;
double  z;
void newatom(el,  
 x,  
 y,  
 z,  
 vx,  
 vy,  
 vz); 
int|string  el;
double  x;
double  y;
double  z;
double  vx;
double  vy;
double  vz;
void newatom(el,  
 x,  
 y,  
 z,  
 vx,  
 vy,  
 vz,  
 fx,  
 fy,  
 fz); 
int|string  el;
double  x;
double  y;
double  z;
double  vx;
double  vy;
double  vz;
double  fx;
double  fy;
double  fz;

Create a new atom of element el at the current pen position or, if provided, the specified coordinates (and optional velocities or velocities and forces). Either the integer atomic number or the symbol/name of the element may be used to identify the desired element. A reference to the new atom is returned.

For example:

atom i = newatom("N");
		

places a nitrogen atom at the current pen coordinates.

atom i = newatom(18, 5.2, 0, 0);
		

places an argon atom at the coordinates { 5.2, 0.0, 0.0 }.

newatomfrac

Syntax:

void newatomfrac(el,  
 x,  
 y,  
 z); 
int|string  el;
double  x;
double  y;
double  z;
void newatomfrac(el,  
 x,  
 y,  
 z,  
 vx,  
 vy,  
 vz); 
int|string  el;
double  x;
double  y;
double  z;
double  vx;
double  vy;
double  vz;
void newatomfrac(el,  
 x,  
 y,  
 z,  
 vx,  
 vy,  
 vz,  
 fx,  
 fy,  
 fz); 
int|string  el;
double  x;
double  y;
double  z;
double  vx;
double  vy;
double  vz;
double  fx;
double  fy;
double  fz;

Create a new atom of element el at the specified fractional coordinates (velocities and forces are optional). Either the integer atomic number or the symbol/name of the element may be used to identify the desired element. A reference to the new atom is returned.

For example:

atom i = newatomfrac("C", 0.5, 0.5, 0.5);
		

places a carbon atom at the centre of the model's cell.

reorder

Syntax:

void reorder(); 

Adjust the ordering of atoms in the current selection such that atoms in bound fragments/molecules have successive IDs. Useful to recover 'molecularity' in order to apply a suitable pattern description to the system.

For example:

reorder();
		

rotx

Syntax:

void rotx(angle); 
double  angle;

Rotates the reference coordinate system about the x axis by angle degrees.

For example:

rotx(90.0);
		

rotates around the x axis by 90 degrees.

roty

Syntax:

void roty(angle); 
double  angle;

Rotates the reference coordinate system about the y axis by angle degrees.

For example:

roty(45.0);
		

rotates around the y axis by 45 degrees.

rotz

Syntax:

void rotz(angle); 
double  angle;

Rotates the reference coordinate system about the z axis by angle degrees.

For example:

rotz(109.5);
		

rotates around the z axis by 109.5 degrees.

shiftdown

Syntax:

void shiftdown(); 
void shiftdown(n); 
int  n;

Move the current atom selection one (or n) places down in the atom list (i.e. towards higher IDs).

For example:

shiftdown(4);
		

moves the current atom selection down four places.

shiftup

Syntax:

void shiftup(); 
void shiftup(n); 
int  n;

Move the current atom selection one (or n) places up in the atom list (i.e. towards lower IDs).

For example:

shiftup();
		

moves the current atom selection up one place.

transmute

Syntax:

void transmute(el); 
int|string  el;

Transmute the current atom selection to the specified element.

For example:

transmute("F");
		

changes all atoms in the current selection to fluorine.

transmute(Cl);
		

changes all atoms in the current selection to chlorine.

transmute(6);
		

changes all atoms in the current selection to carbon

Cell Commands

Create, remove, modify, pack, and replicate the model's unit cell.

adjustcell

Syntax:

void adjustcell(parameter,  
 value); 
string  parameter;
double  value;

Adjust a single unit cell parameter (one of 'a', 'b', 'c', 'alpha', 'beta', 'gamma', or one of the matrix elements 'ax', 'ay', 'az', ..., 'cz') by the given 'value'. This does not set the specified 'parameter' to the given 'value'; instead the supplied 'value' is added to the existing value of the parameter.

For example:

adjustcell("alpha",5.0);
		

increases the cell angle 'alpha' by 5 degrees.

adjustcell("c",-10.0);
		

decreases the cell length 'c' by 10 Å.

cell

Syntax:

void cell(a,  
 b,  
 c,  
 alpha,  
 beta,  
 gamma); 
double  a;
double  b;
double  c;
double  alpha;
double  beta;
double  gamma;

Set cell lengths and angles of current model. This command will modify an existing cell or add a new cell to a model currently without a unit cell specification.

For example:

cell(20.0, 10.0, 10.0, 90.0, 90.0, 90.0);
		

sets the model's cell to be orthorhombic with side lengths 20x10x10 Å.

cellaxes

Syntax:

void cellaxes(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;

Set cell axes of current model. This command will modify an existing cell or add a new cell to a model currently without a unit cell specification.

For example:

cellaxes(15, 0, 0, 0, 15, 0, 0, 0, 15);
		

sets the model's cell to be cubic with side length 15 Å.

fold

Syntax:

void fold(); 

Fold all atoms so they are within the boundaries of the unit cell.

For example:

fold();
		

foldmolecules

Syntax:

void foldmolecules(); 

Fold all pattern molecules so the are unbroken across cell boundaries.

For example:

foldmolecules();
		

millercut

Syntax:

void millercut(h,  
 k,  
 l,  
 inside = FALSE); 
int  h;
int  k;
int  l;
bool  inside = FALSE;

Remove all atoms from the unit cell that lay 'outside' the specified Miller plane (and its mirror, if it has one). If the final parameter is given as TRUE, then atoms 'inside' the bounding Miller plane(s) are selected.

For example:

millercut(1,2,1,TRUE);
		

removes all atoms inside the two enclosing (121) planes.

pack

Syntax:

void pack(); 

Perform spacegroup packing on the current model.

For example:

pack();
		

printcell

Syntax:

void printcell(); 

Prints the cell parameters of the current model.

For example:

printcell();
		

replicate

Syntax:

void replicate(negx,  
 negy,  
 negz,  
 posx,  
 posy,  
 posz); 
double  negx;
double  negy;
double  negz;
double  posx;
double  posy;
double  posz;

Create a supercell of the current model, creating copies of the cell in each of the three cell axis directions. The number of cells to replicate in each positive and negative direction are specified as 'additional' cells beyond the original. So:

replicate(0, 0, 0, 0, 0, 0);
		

will do nothing at all to the model, while:

	
replicate(-5, 0, 0, 5, 0, 0);
		

will result in a supercell that consists of eleven copies of the original cell along the 'x' axis direction. Similarly,

replicate(0, 0, 0, 4, 4, 4);
replicate(-2, -2, -2, 2, 2, 2);
		

will both create a 5x5x5 arrangement of the original cell.

removecell

Syntax:

void removecell(); 

Clears any cell description (removes periodic boundary conditions) from the current model.

For example:

removecell();
		

scale

Syntax:

void scale(x,  
 y,  
 z,  
 calcenergy = FALSE); 
double  x;
double  y;
double  z;
bool  calcenergy = FALSE;

Scale unit cell and its constituent atoms by the scale factors x, y, and z. The optional calcenergy parameter calculates the energy difference resulting from the scaling operation.

For example:

scale(1.0, 2.0, 1.0);
		

doubles the length of the y-axis of the system. x- and z-axes remain unchanged.

scalemolecules

Syntax:

void scalemolecules(x,  
 y,  
 z,  
 calcenergy = FALSE); 
double  x;
double  y;
double  z;
bool  calcenergy = FALSE;

Scale unit cell and centres-of-geometry of molecules within it by the scale factors x, y, and z. Within individual molecules the relative distances between atoms stays the same, but the centres-of-geometry of other molecules do not. The optional calcenergy parameter calculates the energy difference resulting from the scaling operation.

For example:

scalemolecules(0.5, 0.5, 0.5);
		

halves the lengths of all axes, scaling the positions of the molecules to reflect the new size.

setcell

Syntax:

void setcell(parameter,  
 value); 
string  parameter;
double  value;

Set a single unit cell parameter one of 'a'/, 'b', 'c', 'alpha', 'beta', 'gamma', or one of the matrix elements 'ax', 'ay', 'az', ..., 'cz') to the given value.

For example:

setcell("beta", 101.0);
		

sets the cell angle 'beta' to 101 degrees.

setcell("a", 15.5);
		

sets the cell length 'a' to 15.5 Å.

spacegroup

Syntax:

void spacegroup(sg); 
int|string  sg;

Sets the spacegroup of the model, used for crystal packing.

For example:

spacegroup(12);
		

sets the model spacegroup to be C2/m (number 12).

spacegroup("P1/m");
		

sets the model spacegroup to P1/m.

Charges Commands

Assign partial charges to models, atoms, and patterns.

charge

Syntax:

double charge(); 
double charge(q); 
double  q;

Assigns a charge of q to each selected atom in the current model, or returns the total charge of the current selection if no value is supplied.

For example:

charge(1.0);
		

gives each atom in the current model's selection a charge of 1.0.

chargeff

Syntax:

void charge(); 

Assigns charges to all atoms in the current model based on the forcefield associated to the model and the current types of the atoms.

For example:

chargeff();
		

chargefrommodel

Syntax:

void chargefrommodel(); 

Copies charges of all atoms in the current model to the atoms of the current trajectory frame.

For example:

chargefrommodel();
		

chargepatom

Syntax:

void chargepatom(id,  
 q); 
int  id;
double  q;

Assigns a charge of q to atom id in each molecule of the current pattern.

For example:

chargepatom(3, 0.1);
		

assigns a charge of 0.1 to the third atom in each molecule of the current pattern.

chargetype

Syntax:

void chargetype(fftype,  
 q); 
string  fftype;
double  q;

Assigns a charge of q to each atom that is of type fftype in the current model.

For example:

chargetype("OW",-0.8);
		

gives a charge of -0.8 to every atom that has an assigned typename of 'OW'.

clearcharges

Syntax:

void clearcharges(); 

Clears all charges in the current model, setting them to zero.

For example:

clearcharges();
		

ColourScales Commands

Define colourscales to colour objects. Each colourscale has a number of points defining colours at specific values - between adjacent points the colour is linearly interpolated. Points in a colourscale are numbered from 1 onwards. There are ten available colourscales, with IDs 1-10. Some of these have specific uses within Aten.

[Note]See also:
  • Colourscales for a discussion of colourscales and how they may be used within Aten.

addpoint

Syntax:

void addpoint(scaleid,  
 value,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
double  value;
double  r;
double  g;
double  b;
double  a = 1.0;

Adds a new point to the end of the specified colourscale, at the point value and with the RGB[A] colour provided.

For example:

addpoint(1, 15.0, 0.0, 1.0, 0.0);
		

adds a point to colourscale 1 at a value of 15.0 in a nasty green colour.

clearpoints

Syntax:

void clearpoints(scaleid); 
int  scaleid;

Clears all points from the specified colourscale.

For example:

clearpoints(3);
		

clears all points from the third colourscale.

listscales

Syntax:

void listscales(); 

Lists the current types, colours, and ranges of the colourscales

For example:

listscales();
		

removepoint

Syntax:

void removepoint(scaleid,  
 pointid); 
int  scaleid;
int  pointid;

Remove a single point from the selected colourscale.

For example:

removepoint(1,4);
		

deletes the fourth point from colourscale 1.

scalename

Syntax:

string scalename(scaleid); 
int  scaleid;
string scalename(scaleid,  
 newname); 
int  scaleid;
string  newname;

Retrieves the name of the colourscale id provided, or sets the name if a new name is provided). The name is displayed next to the gradient bar (if drawn).

For example:

scalename(1, "Orientation");
		

renames the first colourscale to 'Orientation'.

scalevisible

Syntax:

void scalevisible(scaleid,  
 visible); 
int  scaleid;
bool  visible;

Sets whether the gradient bar for the specified colourscale should be drawn in the main view. Default is 'off' for all colourscales.

For example:

scalevisible(9, "yes");
		

draws the gradient bar for the 9th colourscale in the main view.

setpoint

Syntax:

void setpoint(scaleid,  
 pointid,  
 value,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
int  pointid;
double  value;
double  r;
double  g;
double  b;
double  a = 1.0;

Sets the value and colour of an existing point in the specified colourscale.

For example:

setpoint(1, 2, -3.3, 1.0, 1.0, 1.0);
		

sets the second point on colourscale 1 to a value of -3.3 and white colour.

setpointcolour

Syntax:

void setpointcolour(scaleid,  
 pointid,  
 r,  
 g,  
 b,  
 a = 1.0); 
int  scaleid;
int  pointid;
double  r;
double  g;
double  b;
double  a = 1.0;

Sets the colour of an existing point in the specified colourscale.

For example:

setpointcolour(5, 1, 0.0, 0.0, 1.0);
		

sets the first point on colourscale 5 to be coloured blue.

setpointvalue

Syntax:

void setpointvalue(scaleid,  
 pointid,  
 value); 
int  scaleid;
int  pointid;
double  value;

Sets the value of an existing point in the specified colourscale.

For example:

setpointvalue(4, 3, 0.1);
		

sets the third point of colourscale 4 to a value of 0.1.

Disordered Commands

Set up the disordered builder to create systems from individual components using Monte Carlo methods.

disorder

Syntax:

void disorder(ncycles); 
int  ncycles;

Start the disordered builder, requesting ncycles cycles of Monte Carlo moves.

For example:

disorder(50);
		

runs 50 cycles of the disordered builder.

nmols

Syntax:

void nmols(n); 
int  n;

Specify that n copies of the current model are to be added (or attempted to be added) during the build process.

For example:

nmols(300);
		

requests that the current model, whatever it is, should be used in disordered building and that there should be 300 copies of the model in the new system.

listcomponents

Syntax:

void listcomponents(); 

Prints a list of the currently requested populations for all models to be added during the disordered building process.

For example:

listcomponents();
		

regioncentre

Syntax:

void regioncentre(x,  
 y,  
 z); 
double  x;
double  y;
double  z;

Sets the coordinates of the centre of the set region for the current model.

For example:

regioncentre(5.0, 7.0, 6.0);
		

sets the centre of the current model's region to {5.0, 7.0, 6.0}.

regioncentrefrac

Syntax:

void regioncentrefrac(fx,  
 fy,  
 fz); 
double  fx;
double  fy;
double  fz;

As with regioncentre, sets the coordinates of the centre of the set region for the current model but in fractional cell coordinates.

regiongeometry

Syntax:

void regiongeometry(x,  
 y,  
 z); 
double  x;
double  y;
double  z;

Sets the geometry of the allowed region for the current model. The x, y, and z values determine the total extent/size of the region along each principal axis. For cylindrical regions, x and y determine the radii of the cylinder in the perpendicular directions to the cylinder vector, while z determines the length of the cylinder.

For example:

regiongeometry(10.0, 10.0, 3.0);
		

sets the geometry of the region for the current model. For example, if the region was of type 'sphere' this would create an elongated ellipsoid.

regiongeometryfrac

Syntax:

void regiongeometryfrac(fx,  
 fy,  
 fz); 
double  fx;
double  fy;
double  fz;

As with regiongeometry, sets the geometry of the allowed region for the current model but in fractional cell coordinates.

regionoverlap

Syntax:

void regionoverlap(allowoverlap); 
bool  allowoverlap;

Determines whether additions into the current model's region are allowed to overlap with regions defined for other models. Default is true.

For example:

regionoverlap("false");
		

restricts the current model to the subspace of its defined region that does not overlap with any other region.

regionrotation

Syntax:

void regionrotation(rotx,  
 roty); 
double  rotx;
double  roty;

Set the rotations of the current region.

regionshape

Syntax:

void regionshape(shape); 
string  shape;

Sets the shape of the allowed insertion region for the current model. Valid shapes are 'cell', 'cuboid', 'spheroid' and 'cylinder'.

For example:

regionshape("sphere");
		

restricts the current model to a spherical region of the cell.

vdwscale

Syntax:

double vdwscale(); 
double vdwscale(scale); 
double  scale;

Sets the scaling factor for VDW radii to use in the disordered builder, or returns the current value.

For example:

vdwscale(0.75);
		

scales all VDW radii by 0.75 in the calculation.

dosuble currentscale = vdwscale();
		

returns the current VDW scaling factor that will bbe applied.

Edit Commands

Standard editing commands.

copy

Syntax:

void copy(); 

Copy the current atom selection to the clipboard, ready for pasting.

For example:

copy();
		

cut

Syntax:

void cut(); 

Cut the current atom selection to the clipboard.

For example:

cut();
		

delete

Syntax:

void delete(); 

Delete the current atom selection.

For example:

delete();
		

paste

Syntax:

void paste(); 

Paste the copied atom selection.

For example:

paste();
		

redo

Syntax:

void redo(); 

Redo the last 'undone' operation.

For example:

redo();
		

undo

Syntax:

void undo(); 

Undo the last operation.

For example:

undo();
		

Energy Commands

Calculate energies for models and trajectory frames. All printing commands refer to the last energy calculated for either the model or a trajectory frame.

ecut

Syntax:

double ecut(); 
double ecut(cutoff); 
double  cutoff;

Return (or set and return) the cutoff radius used in calculation of the electrostatics for a system.

For example:

ecut(15.0);
		

sets the electrostatic cutoff radius to 15.0 Å.

elec

Syntax:

void elec(type = "none"); 
string  type = "none";
void elec("coulomb"); 
 "coulomb";
void elec("ewald",  
 alpha,  
 kx,  
 ky,  
 kz); 
 "ewald";
double  alpha;
int  kx;
int  ky;
int  kz;
void elec("ewaldauto",  
 precision); 
 "ewaldauto";
double  precision;

Set the style of electrostatic energy calculation to use, either no electrostatics, coulombic (non-periodic) electrostatics, or Ewald-based electrostatics. For the latter, either the various parameters may be defined explicitly (when "ewald" is the chosen method) or may be estimated for the current system by using "ewaldauto".

frameenergy

Syntax:

double frameenergy(); 

Calculate energy of the current frame of the trajectory associated with the current model.

For example:

double energy = frameenergy();
		

modelenergy

Syntax:

double modelenergy(); 

Calculate the energy of the current model, which can then be printed out (in whole or by parts) by the other subcommands.

For example:

double e = modelenergy();
		

printelec

Syntax:

void printelec(); 

Prints out the electrostatic energy decomposition matrix.

For example:

printelec();
		

printewald

Syntax:

void printewald(); 

Prints the components of the Ewald sum energy.

For example:

printewald();
		

printinter

Syntax:

void printinter(); 

Prints out the total inter-pattern energy decomposition matrix.

For example:

printinter();
		

printintra

Syntax:

void printintra(); 

Prints out the total intramolecular energy decomposition matrix.

For example:

printintra();
		

printenergy

Syntax:

void printenergy(); 

Prints the elements of the calculated energy in a list.

For example:

printenergy();
		

printsummary

Syntax:

void printsummary(); 

Print out a one-line summary of the calculated energy.

For example:

printsummary();
		

printvdw

Syntax:

void printvdw(); 

Prints out the VDW energy decomposition matrix.

For example:

printvdw();
		

vcut

Syntax:

double vcut(); 
double vcut(cutoff); 
double  cutoff;

Return (or set and return) the cutoff radius used in calculation of the VDW interactions for a system.

For example:

vcut(9.0);
		

sets the VDW cutoff radius to 9.0 Å.

Flow Commands

Loops and if tests. Flow control is styled to replicate the common syntax used in C. Because of this, providing an in-depth explanation here is unnecessary since lots of people have already written far clearer and more in-depth documents. A good Google should find them.

do

Syntax:

do { commands } while { condition }
		

The do-while loop is cousin of the 'for' loop, except that there is no control variable. The termination of the loop depends on the condition which is tested at the end of every execution of the commands. If 'true', the commands are executed again, and condition re-tested afterwards. If 'false' the loop ends.

For example:

int i = 1;
do
{
	i = i * 2;
	printf("i = %d\n", i);
} while (i < 100)
		

will print out the following:

i = 2
i = 4
i = 8
i = 16
i = 32
i = 64
i = 128
		

Note that the final value of i inside the loop is '128' (greater than 100) since the condition is only tested at the end of the execution of the commands. The while loop works in the same way, save that the condition is tested at the beginning of the loop, before commands are executed, rather than at the end.

for

Syntax:

for ( startvalue ; condition ; increment ) { commands }
		

Three separate components make up a 'for' loop. startvalue defines both the control variable (i.e. the variable that changes on each loop iteration) and optionally its starting value, the condition is tested on each loop iteration to see whether or not to continue with the loop, and finally the increment is an expression to modify the control variable after each iteration, setting it to a new value. If multiple commands are to make up the body of the loop (executed on each iteration) then they should be enclosed in curly brackets (as written in the syntax above). If only a single command is executed on each iteration, the curly brackets may be omitted.

Some examples:

for (int i=1; i<=10; i = i + 1) printf("%i\n", i);
		

Loop over and print all integers between 1 and 10. A local variable i is declared and initialised all in one go in the startvalue part of the loop. The 'long' way of incrementing the integer variable (i = i + 1) is typically not used in C/C++, most people preferring to take advantage of the C's useful postfix and prefix operators, as in the next example).

for (n = 100; n>0; --n) printf("Counting down... %i\n", n);
		

Here, an existing variable n is decreased from 100 to 1, printing out all numbers along the way. Note the usage of the double-minus '--' operator (the prefix decrease operator) which decreases its associated variable, in this case n. For integers, to decrease means to reduce the value by 1. For other types the meaning may vary - for instance, with reference types the '--' operator means 'previous item in the list', since all such objects in Aten (e.g. atoms) are stored in lists containing many objects of the same type. This makes iterating over, say, all atoms in a given model pretty easy...

for (atom a = aten.model.atoms; a; ++a) printf("Atom id %i is element %s.\n", a.id, a.symbol);
		

In this example the variable a is declared and initialised to be a reference to the first atom in the current model. The condition part simply consists of the expression 'a', which effectively tests the reference address currently stored in a. Since any positive number equates to 'true' (see below for the 'if' test) the loop will continue until a contains no reference. Since most all reference objects in Aten are stored internally in linked lists, the prefix increment operator ('++') changes the value of the variable to be the reference of the next item in the list, or 0 if there are no more items. In this way, the whole list of atoms can be traversed and neatly ended once the final item in the list has passed.

if

Syntax:

if ( condition ) { commands }
if ( condition ) { commands... } else { commands }
		

The 'if' statement permits sections of code to be executed based on the assessment of logical comparison of values. If the supplied condition evaluates to be 'true' then the following commands are executed, otherwise nothing happens. In the second form of the command, if the condition evaluates to be 'false' then the second set of commands are executed instead. If multiple commands are to be executed then they should be enclosed in curly brackets (as written in the syntax above). If only a single command is to be executed the curly brackets may be omitted.

Typically, comparisons are made between two variables, for example 'if ( var1 > var2 ) ... ' checks for var1 being greater in value than var2, executing the following commands if this turns out to be true. The comparison operator may be any one of the following symbols:

Table 6.23. Test Operators

OperatorMeaning
==Equal to
!=Not equal to
<>Not equal to
>Greater than
<Less than
>=Greater than or qual to
<=Less than or qual to

In truth, the condition part may be any expression, command, or amalgam of both, provided the end result of executing it is a single value. The type of the final result doesn't even matter, since conversion to a boolean is guaranteed. Deep down in the logic of Aten, integers are at the heart of it all, with zero or any negative number being 'false', and any positive number meaning 'true'.

For example:

int i = 10;
if (i > 5) printf("Hooray!\n");
		

in this case 'Hooray!' will be printed, because i is greater than 5.

int i = 10, j = 20;
if (i > j) printf("Hooray!\n");
		

but in this case 'Hooray!' will not be printed, because i is not greater than j.

int i = 10, j = 20;
if (i > j) printf("Hooray!\n"); else { printf("Too small.\n"); i = j; }
		

Here, the test fails for the same reason, but since an 'else' part was provided we still execute some commands (printing 'Too small.' and setting the variable i equal to j).

			if (i) printf("Snoopy.\n");
		

since any positive number is 'true', we can simply test the value of a variable.

atom a = newatom("H");
if (a) printf("New atom.\n");
		

In a similar way, a reference variable has a positive integer value at its heart, and so can also be tested in this way.

atom a = newatom("H");
double alpha = 100.0;
if ( (a) && (alpha < 50.0) ) printf("Alpha and atom are OK.\n"); else printf("No good!\n");
		

Two or more consecutive conditions can be tested in order to determine 'truth', in this case using the 'and' operator '&&'. Here, the value of the reference variable a and the value of alpha are both checked, and the text 'Alpha and atom are OK.' is only printed if both turn out to be 'true'.

if (time == 0) printf("There is no time.");
else if (time > 5) printf("There is more than enough time.");
else printf("There is only a little time.");
		

Multiple if tests can also be nested to create a sequence of tests. As soon as a condition is encountered that equates to 'true' the accompanying commands are executed and any subsequent 'else'd tests or commands are ignored.

return

Syntax:

return(); 
return(value); 
 value;

Used in (user-defined) functions, and returns control immediately back to the calling function. In the case of a 'void' function, no return value must be specified. Similarly, for functions returning a value a valid value of that type must be given.

while

Syntax:

while ( condition ) { commands }
		

The while loop is another cousin of the 'for' loop, and as with the do-while loop there is no control variable. The termination of the loop depends on the condition which is tested at the beginning of the loop, before execution of the commands. If 'true', the commands are executed, but if 'false' the loop ends without executing the commands (and meaning that it is possible that the commands are never executed).

For example:

int i = 1024;
while (i > 100)
{
	i = i / 2;
	printf("i = %d\n", i);
}
		

will print out the following:

i = 512
i = 256
i = 128
i = 64
		

Forcefield Commands

Forcefield management and manual term creation.

angledef

Syntax:

void angledef(form,  
 type_i,  
 type_j,  
 type_k,  
 data1,  
 ...); 
string  form;
string  type_i;
string  type_j;
string  type_k;
double  data1;
 ...;

Add an angle definition to the current forcefield. form should correspond to one of the implemented angle functional forms, while the three types refer to either type or equivalent names of defined atom types. Up to ten data parameters may be supplied.

bonddef

Syntax:

void bonddef(form,  
 type_i,  
 type_j,  
 data1,  
 ...); 
string  form;
string  type_i;
string  type_j;
double  data1;
 ...;

Add a bond definition to the current forcefield. form should correspond to one of the implemented bond functional forms, while the two types refer to either type or equivalent names of defined atom types. Up to ten data parameters may be supplied.

clearmap

Syntax:

void clearmap(); 

Clear any manual typemap definitions.

For example:

clearmap();
		

clearexportmap

Syntax:

void clearexportmap(); 

Clear any manual export typemap definitions.

For example:

clearexportmap();
		

clearexpression

Syntax:

void clearexpression(); 

Removes any forcefield expression defined for the current model.

For example:

clearexpression();
		

createexpression

Syntax:

void createexpression(); 

Creates a suitable energy description for the current model.

For example:

createexpression();
		

defaultff

Syntax:

void defaultff(ff); 
string|forcefield  ff;

Makes the supplied/named forcefield the default forcefield to use when none is associated.

For example:

defaultff("oplsaa");
		

equivalents

Syntax:

void equivalents(name,  
 typename(s),  
 ...); 
string  name;
string  typename(s);
 ...;

Define equivalent terms in the current forcefield. name is the new typename to which the list of quoted typenames are linked, for subsequent use in intramolecular term definitions. See the equivalents forcefield keyword for more information.

exportmap

Syntax:

void exportmap(maps); 
string  maps;

Set up manual mappings that convert atomtype names when expression are exported. Works in the opposite way to the 'map' command.

For example:

map("CT=Ctet,N3=N");
		

converts the atomtype names 'CT' and 'N3' so that they appear as 'Ctet' and 'N' in any expression files written out.

ffmodel

Syntax:

void ffmodel(); 

Associates current forcefield to the current model.

For example:

ffmodel();
		

ffpattern

Syntax:

void ffpattern(pattern); 
string  pattern;
void ffpattern(patternid); 
int  patternid;
void ffpattern(p); 
pattern  p;

Associates current forcefield to the current pattern, or one specified by either a reference, integer ID in the current model, or a pattern pointer.

For example:

ffpattern();
		

associates the current forcefield to the current pattern.

ffpattern("bulk");
		

associates the current forcefield to a pattern named 'bulk' in the current model.

finaliseff

Syntax:

void finaliseff(); 

Perform necessary operations on the current forcefield once all data has been added. Must be called!

fixtype

Syntax:

void fixtype(typeid,  
 id = 0); 
int  typeid;
atom|int  id = 0;

Set the current atom selection, or the specified atom, to have the type id (in the current forcefield) specified. Types set in this manner will not be overwritten by tha typing routines, allowing specific types to be applied above the normal rules. Note that the type's NETA description is not checked, and so any (even types not matching the base element) may be applied in this way.

For example:

typedef(99, "NX", "NX", N, "-C(n=4)");
select(C);
fixtype(99);
		

assigns newly-created type 99 (specific to nitrogen) to all carbons in the model.

fixtype

Syntax:

void freetype(id = 0); 
atom|int  id = 0;

For the current atom selection, or the specified atom, free any previously-fixed types

For example:

freetype(14);
		

frees any previously-set type on atom 14.

getcombinationrule

Syntax:

string getcombinationrule(form,  
 parameter); 
string  form;
string  parameter;

Returns the combination rule in use for the specifed parameter of the given functional form. The form and related parameter should correspond to those given in the VDW functional forms table. A string corresponding to one of the available combination rule options is returned.

For example:

string cr = getcombinationrule("lj", "epsilon");
		

getff

Syntax:

forcefield getff(name); 
string  name;
forcefield getff(id); 
int  id;

Select the named forcefield (or forcefield with the specified id) and make it current, returning a reference to it in the process.

For example:

forcefield uff = getff("uff");
		

makes the loaded forcefield named 'uff' the current one, and stores a reference to it.

interdef

Syntax:

void interdef(form,  
 typeid,  
 charge,  
 data1,  
 ...); 
string  form;
int  typeid;
double  charge;
double  data1;
 ...;

Add a new short-range data definition to a type in the current forcefield. form should correspond to one of the implemented VDW functional forms. Up to ten parameters for the VDW potential may be given.

loadff

Syntax:

forcefield loadff(file,  
 name); 
string  file;
string  name;

Load a forcefield from file and reference it by name. Becomes the current forcefield.

For example:

loadff("/home/foo/complex.ff", "waterff");
		

loads a forcefield called 'complex.ff' and names it 'waterff'.

map

Syntax:

void map(map,  
 ...); 
string  map;
 ...;

Set up manual typename mappings for atom names that do not readily correspond to element symbols, forcefield types etc. All atoms that are subsequently created using name as the element are automatically converted to the corresponding element.

For example:

map("CT1=C,CT2=C");
		

converts atoms with names 'CT1' and 'CT2' to carbon.

newff

Syntax:

forcefield newff(name); 
string  name;

Create a new, empty forcefield with the given name and make it current. Returns a reference to the new forcefield.

For example:

forcefield ff = newff("testff");
		

printsetup

Syntax:

void printsetup(); 

Prints the current expression setup.

For example:

printsetup();
		

recreateexpression

Syntax:

void recreateexpression(); 

Delete and recreate a suitable energy description for the current model.

For example:

recreateexpression();
		

rules

Syntax:

void rules(ruleset); 
string  ruleset;

Set rules set to use for parameter generation in the current forcefield (see forcefield fules for more info).

Note: The implementation of rule-based forcefields will change in a future release.

saveexpression

Syntax:

int saveexpression(filter,  
 filename); 
string  filter;
string  filename;

Export the forcefield expression for the current model in the format determined by the filter nickname, to the filename specified. Return value is '1' for successful write, or '0' otherwise.

For example:

saveexpression("dlpoly", "data.FIELD");
		

setcombinationrule

Syntax:

void setcombinationrule(form,  
 parameter,  
 rule); 
string  form;
string  parameter;
string  rule;

Sets the combination rule to use for the specifed parameter of the given functional form. The form and related parameter should correspond to those given in the VDW functional forms table, while rule should correspond to one of the available combination rule options.

For example:

setcombinationrule("lj", "sigma", "geometric");
		

torsiondef

Syntax:

void torsiondef(form,  
 type_i,  
 type_j,  
 type_k,  
 type_l,  
 data1,  
 ...); 
string  form;
string  type_i;
string  type_j;
string  type_k;
string  type_l;
double  data1;
 ...;

Add a torsion definition to the current forcefield. form should correspond to one of the implemented torsion functional forms, while the four types refer to either type or equivalent names of defined atom types. Up to ten real-valued parameter values for the function may be provided.

typedef

Syntax:

int typedef(typeid,  
 name,  
 equiv,  
 element,  
 neta,  
 description = ""); 
int  typeid;
string  name;
string  equiv;
string|int  element;
string  neta;
string  description = "";

Add a new atom type definition to the current forcefield, with the identifying typeid and called name, with the equivalent typename equiv. The basic element of the new type is given as element, and neta is the NETA definition of the type. An optional string describing the type in more detail can be given in description. The command returns '1' if the model was typed successfully or '0' otherwise.

For example:

typedef(101, "Ctet", C, "nbonds=4", "Standard tetrahedral carbon");
		

creates a new simple type for a carbon atom with four bonds.

typemodel

Syntax:

int typemodel(); 

Perform atom typing on the current model. Returns '1' if atom typing was performed successfully or '0' otherwise.

For example:

int success = typemodel();
		

typetest

Syntax:

int typetest(typeid,  
 id); 
int  typeid;
atom|int  id;

Test the current forcefield's atomtype typeid on the atom specified, returning the type score of the match (zero indicating no match).

For example:

int score = typetest(112,10);
		

tests typeid 112 on the tenth atom in the model.

units

Syntax:

void units(unit); 
string  unit;

Sets the units in which energetic parameters are given for the current forcefield. For a list of available units see energy units.

vdw

Syntax:

void vdw(calculate); 
bool  calculate;

Controls calculation of van der Waals terms in energy / force calculations (on by default).

For example:

vdw("off");
		

turns van der Waals energy / force calculation off.

vdw(TRUE);
		

turns van der Waals energy / force calculation on.

Forces Commands

Calculate forces for models and trajectory frames.

frameforces

Syntax:

void frameforces(); 

Calculate the atomic forces of the current frame of the trajectory associated with the current model.

For example:

frameforces();
		

modelforces

Syntax:

void modelforces(); 

Calculate the atomic forces of the current model.

For example:

modelforces();
		

printforces

Syntax:

void printforces(); 

Print out the forces of the current model.

For example:

printforces();
		

Glyph Commands

Add glyphs to atoms in the model.

[Note]See also:
  • Glyphs for information on glyph types and how they use vector data.

  • Glyph window for management of glyphs in the GUI.

autoellipsoids

Syntax:

void autoellipsoids(); 

Note: Experimental Feature!

Using the current atom selection, this command creates ellipsoid glyphs that cover (or represent) individual bound fragments within the selection. An ellipsoid glyph is added for each bound fragment within the selection, positioned at the geometric centre of the bound fragment, and scaled in an attempt to cover all atoms within the bound fragment. Such things are useful when wanting to represent molecules by simple geometric shapes, rather than by their fine-grained atomic positions.

For instance, given a box full of benzene molecules:

selectall();
autoellipsoids();
		

will add on a flattened ellipsoid to each individual molecule. To do the same thing but using only the ring carbons to generate the ellipsoids:

select("C");
autoellipsoids();
		

Now the ellipsoids will cover the carbon atoms in each ring, leaving the hydrogens poking out.

[Note]See also:

autopolyhedra

Syntax:

void autopolyhedra(options = ""); 
string  options = "";

Note: Very Experimental Feature!

In a similar way to the autoellipsoids command, 'autopolyhedra' adds triangle glyphs to the current selection in an attempt to enclose certain atoms within solid structures. There are two principal modes of operation. The first (the default) assumes that the current atom selection consists of individual atoms that should be enclosed in a polyhedron made up from triangles added between triplets of bound neighbours. The carbon atom at the centre of methane would make a good example. The alternative mode (requested with the 'fragments' option) assumes that atoms within individual bound fragments in the current selection should be used as the vertices to form an enclosed shell.

Possible options are:

Table 6.24. Autopolyhedra options

OptionEffect
centresAssume that the current selection consists of individual atomic centres that should be enclosed (the default).
fragmentsUse individual bound fragments instead of assuming individual centres.
nolinkDo not link the coordinates of generated glyphs to coordinates of the atoms (the default is to link glyph coordinates to atoms).
rcut=distanceSpecifies the maximum distance allowed between vertices of a triangle

[Note]See also:

glyphatomf

Syntax:

void glyphatomf(n); 
int  n;
void glyphatomf(n,  
 sourceatom); 
int  n;
atom|int  sourceatom;

Set current (or specified) atom's forces as data n in the current glyph.

For example:

glyphatomf(1);
		

links the current atoms forces to the first datum in the current glyph.

glyphatomr

Syntax:

void glyphatomr(n); 
int  n;
void glyphatomr(n,  
 sourceatom); 
int  n;
atom|int  sourceatom;

Set current (or specified) atom's position as data n in the current glyph.

For example:

glyphatomr(3, 55);
		

links the 55th atom's position to the third datum in the current glyph.

glyphatomv

Syntax:

void glyphatomv(n); 
int  n;
void glyphatomv(n,  
 sourceatom); 
int  n;
atom|int  sourceatom;

Set current (or specified) atom's velocity as data n in the current glyph.

For example:

atom i = newatom("H");
glyphatomv(2,i);
		

links the velocity of new atom i to the second datum in the current glyph.

glyphatomsf

Syntax:

void glyphatomsf(sourceatom,  
 ...); 
atom|int  sourceatom;
 ...;

Accepts one or more atoms, setting consecutive data in the current glyph to the forces of the atoms / atom IDs provided.

For example:

glyphatomsf(1, 2, 3);
		

links the forces of atoms 1, 2, and 3 to the first three glyph data.

glyphatomsr

Syntax:

void glyphatomsr(sourceatom,  
 ...); 
atom|int  sourceatom;
 ...;

Accepts one or more atoms, setting consecutive data in the current glyph to the positions of the atoms / atom IDs provided.

For example:

glyphatomsr(3, 10);
		

links the positions of atoms 3 and 10 to the first two glyph data.

glyphatomsv

Syntax:

void glyphatomsv(sourceatom,  
 ...); 
atom|int  sourceatom;
 ...;

Accepts one or more atoms, setting consecutive data in the current glyph to the velocities of the atoms / atom IDs provided.

For example:

glyphatomsv(9, 11, 13);
		

links the velocities of atoms 9, 11, and 13 to first three glyph data.

glyphcolour

Syntax:

void glyphcolour(n,  
 r,  
 g,  
 b,  
 alpha = 1.0); 
int  n;
double  r;
double  g;
double  b;
double  alpha = 1.0;

Set the colour of vertex n for the current glyph to the RGB(A) colour provided.

For example:

glyphcolour(1, 1.0, 0.0, 0.0);
		

sets the colour of the first vertex in the current glyph to red.

glyphdata

Syntax:

void glyphdata(n,  
 r,  
 g,  
 b); 
int  n;
double  r;
double  g;
double  b;

Set vector data n for the current glyph to the fixed values provided.

For example:

glyphdata(1, 0.0, 5.0, 2.4);
		

sets the first positional data in the glyph to {0.0, 5.0, 2.4}.

glyphsolid

Syntax:

void glyphsolid(issolid); 
bool  issolid;

Sets the drawing style of the current glyph to solid (true) or wireframe (false) (if the glyph style permits).

For example:

glyphsolid("true");
		

glyphtext

Syntax:

void glyphtext(text); 
string  text;

Set the text data in the current glyph. For text-style glyphs, this is of course useful! For others, whether or not the text is used depends on the style of the glyph.

For example:

glyphtext("Coordinate Origin");
		

newglyph

Syntax:

glyph newglyph(style,  
 options = ""); 
string  style;
string  options = "";

Create a new glyph of the specified style, and make it current. The colour of the glyph is set using the default glyph colour set in the global preferences. Valid glyph styles are listed in the Glyphs section. Positional / size / scale vector data should be set afterwards with appropriate 'glyphatom*' and 'glyphdata' commands.

One or more options may be given to the command. The list of possible options is:

Table 6.25. Newglyph options

OptionEffect
linewidth=widthSet the linewidth used to draw the glyph to the (floating point) value provided.
solidRender the glyph in solid mode (if the glyph supports it). Same as calling glyphsolid(TRUE) after creation.
text=stringSet the character data associated to the glyph to string. Currently, this has no effect for glyphs other than those that display text.
wireRender the glyph in wireframe mode (if the glyph supports it). Same as calling glyphsolid(FALSE) after creation.

For example:

newglyph("cube");
		

creates a new cube in the model.

newglyph("text","text=\"I am some text\"");
		

creates a new text glyph in the model, reading 'I am some text'. Note the need to escape the quotes surrounding the text.

newglyph("tetrahedron", "wire");
		

creates a new wireframe tetrahedron in the model.

Grid Commands

Add gridded data to the current model.

[Note]See also:

addgridpoint

Syntax:

void addgridpoint(ix,  
 iy,  
 iz,  
 value); 
int  ix;
int  iy;
int  iz;
double  value;

Set a specific data point in the current grid.

For example:

addgridpoint(4, 1, 15, 4.123);
		

set the grid value at point { 4,1,15 } in the dataset to 4.123.

addnextgridpoint

Syntax:

void addnextgridpoint(value); 
double  value;

Add the next sequential grid point, starting at (1,1,1) and proceeding through dimensions as defined by the gridlooporder command (default is x->y->z, i.e. {1,1,1} is set first, then {2,1,1}, {3,1,1} etc.).

For example:

addnextgridpoint(20.0);
		

sets the next grid point value to be 20.0.

finalisegrid

Syntax:

void finalisegrid(); 

Perform internal post-load operations on the grid. Must be called for every new grid, after all data has been read in.

For example:

finalisegrid();
		

gridalpha

Syntax:

double gridalpha(); 
double gridalpha(newalpha); 
double  newalpha;

Set the alpha value (transparency of the current surface), with 0.0 being fully opaque and 1.0 being fully transparent (i.e. invisible), or simply return the current alpha value if no new value is provided.

For example:

gridalpha(0.5);
		

gridaxes

Syntax:

void gridaxes(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;

Set the axes of the current grid, specified as three vectors.

For example:

gridaxes(1, 0, 0, 0, 1, 0, 0, 0, 1);
		

sets a cubic system of axes for the current grid.

gridaxes(0.8, 0, 0, 0.1, 0.6, 0, 0, 0, 0.7);
		

sets a monoclinic system of axes for the current grid.

gridcolour

Syntax:

void gridcolour(r,  
 g,  
 b,  
 a = 1.0); 
double  r;
double  g;
double  b;
double  a = 1.0;

Set the internal colour (of the positive sign if the 'symmetric' option is enabled for the grid) of the surface to the RGB(A) triplet.

For example:

gridcolour(1.0, 1.0, 0.0);
		

sets the (positive) surface colour to yellow.

gridcolournegative

Syntax:

void gridcolournegative(r,  
 g,  
 b,  
 a = 1.0); 
double  r;
double  g;
double  b;
double  a = 1.0;

Set the internal colour of the negative sign of the surface to the RGB(A) triplet.

For example:

gridcolournegative(0.9, 0.9, 0.9);
		

sets the negative surface colour to off-white.

gridcolourscale

Syntax:

void gridcolourscale(id); 
int  id;

Set the colourscale to use for the current grid to the colourscale ID specified, which should be in the range 1-10. If '0' is given as the argument, the internal colour of the grid data is used. Linking a colourscale to a grid will result in the minimum and maximum ranges of the grid being recalculated to ensure all points in the grid are covered by the scale, whose range is adjusted if necessary.

For example:

gridcolourscale(4);
		

colours the grid data according to colourscale 4.

gridcolourscale(0);
		

uses the internal c