Back to main menu

## Option: cell

#### Syntax

`-cell <add|rm|set> <d> <H1|H2|H3|x|y|z|xy|xz|yx|yz|zx|zy|xyz>`

#### Description

This option allows to modify the cell vectors.

It is possible to add, remove, or set a given length <d> to the provided component(s) of the cell.

Keywords H1, H2, H3 refer to the three box vectors. Adding a distance <d> to a cell vector means that it will keep the same direction, but its norm will be longer by <d>. The same logic applies for removing (rm) or setting (set) the distance.

Keywords x, y, z, refer to the Cartesian components of cell vectors. Adding a distance <d> to the x component, means that the cell vector with the largest component along X will be rescaled so that the "bounding box" (difference between maximum and minimum coordinates along X) will be longer by <d>. Cell vectors will keep their respective directions and relative angles. Note that if cell vectors are inclined with respect to Cartesian axes, then their length is not modified by <d> but by another amount. The component "xyz" means that the same distance <d> will be added (or removed) to all Cartesian components. The components xy, xz, yx, yz, zx, zy are non-diagonal elements of the cell vectors matrix.

Note that if cell vectors are aligned with Cartesian axis, such that H1//x, H2//y, and H3//z, then using "H1" is equivalent to using "x", because H1 only has a non-zero component along x. The same is true for H2 and y, and for H3 and z.

The distance <d> must be given in angströms (Å), and should be positive to avoid confusion. Using "add" with a negative value of <d> will actually reduce the length of a box vector. Similarly, using "rm" with a negative value of <d> will increase the vector length.

The Cartesian positions of atoms are not modified by this option. Therefore, elongating a box vector (with "add" or "set") will introduce a void region along the given direction. Inversely, if a box vector is reduced (with "rm" or "set"), then atoms may end up out of the box.

In order to specify all cell vectors components, it is possible to write them into a file and use the option `-property`. To force Atomsk to construct automatically a bounding box, one may use the option `-rebox`.

#### Default

By default Atomsk uses the cell vectors read from the input file. If no cell vectors are found in the input file, then a warning is displayed and the option `-rebox` is automatically called after reading the file (and before applying any other option). For instance, this is the case with the default XYZ format which does not contain any box vector.

#### Examples

- `atomsk initial.cfg -cell add 10 H2 final.cfg`

  With this command, Atomsk will read the file `initial.cfg`, and then add 10 Å to the second cell vector (H2). In other words, the second cell vector will keep the same direction, but will be 10 Å longer. Atom positions will remain the same, so this will add "void" along that direction. The result will be output in `final.cfg`.

- `atomsk initial.cfg -cell add 20 y final.cfg`

  This will read the file `initial.cfg` and add 20 Å to the cell length along the Cartesian Y axis. In practice this is equivalent to adding void along the Y direction. The result will be output in `final.cfg`.

- `atomsk initial.cfg -cell set 87.4 H1 final.cfg`

  This will change the length of the first box vector to 87.4 Å.

- `atomsk initial.cfg -cell rm 0.5 H3 final.cfg`

  This will reduce the length of the third box vector by 0.5 Å.

Back to main menu