Back to main menu

Option: unit

Syntax

-unit <property> <factor>

-unit <unit1> <unit2>

Description

This option multiplies the values of the given auxiliary property by the given factor. It also allows to convert atom coordinates or velocities from one unit system <unit1> to another <unit2>.

The <property> can be a Cartesian direction (X, Y or Z) to rescale atom coordinates, or any defined auxiliary property (like vx, vy or vz for atom velocities, fx, fy, fz for atom forces, etc.). The <factor> must be a real number (it may be equal to zero).

This option also has presets that allow to convert the cell dimensions and atom coordinates from one unit system into another. The supported units of distance are:

This option also has presets to convert atom velocities. Units of velocity must be specified as the concatenation of a unit of distance, a slash symbol (/), and a unit of time (see examples below). The supported units of time are:

Note that in any case, Atomsk performs the conversion blindly, as it has no way to know in which unit the coordinates are written in the input file. It is up to the user to make sure that the <unit1> actually corresponds to what is written in the input file.

If a selection was defined (with the option -select) then the unit conversion is applied only to selected atoms. Non-selected atoms and box vectors will remain unchanged.

Default

By default the units are not changed. When reading an input file, Atomsk just reads and stores the numbers as-is, without performing any implicit conversion of units. For instance if the input file contains the atom coordinates "1.0 2.0 3.0" in units of Bohr radius, then they will also appear as "1.0 2.0 3.0" in the output file, even in file formats that use another unit as their default. The conversion of units must be performed explicitely by the user, e.g. with the option -unit.

Examples

Back to main menu