Back to main menu

## Option: add-atom

#### Syntax

`-add-atom <species> at <x> <y> <z>`

`-add-atom <species> relative <index> <x> <y> <z>`

`-add-atom <species> near <index>`

`-add-atom <species> random <N>`

#### Description

This option adds one or more new atom(s) of the given <species> in the system.

When using the keyword at, a new atom is inserted exactly at the given location. The positions <x>, <y>, <z> are usually given in Å. It is also possible to give them with respect to the box dimensions with the keyword BOX and an operation (see this page).

When using the keyword relative, the new atom is placed at the given vector (x,y,z) relatively to the atom of the given <index>.

When using the keyword near <index> (where <index> is an integer), a new atom is inserted near the atom with the given <index>. The new atom will be inserted in the tetrahedral site formed by the atom with the given <index> and its three nearest neighbors.

When using the keyword random <N> (where <N> is an integer), then <N> new atoms are inserted at random positions in the system. The position of each new atom will be decided randomly, and then changed to be at the center of the four nearest neighbors of that position. Note that this option attempts to generate random positions for the new atoms, therefore it is largely non-reproducible, i.e. starting from the exact same system and applying the present option will likely lead to different results.

The new atom(s) are added at the end of the atom list, so that pre-existing atoms keep their former indices. In order to change the way atoms are sorted it is possible to use the option `-sort`.

If auxiliary properties exist, they are given a zero value for new atoms, except for the electric charge ("q") and the "type" which will be identical to those of pre-existing atoms with the same <species>. If no pre-existing atom has the same <species> as the new atoms, then the new atoms will be given a neutral charge (q=0) and/or a new type.

If pre-existing atoms of the same <species> have shells (in the sense of an ionic core-shell model), then the new atoms are also created with a shell at the same position as their core. If other atoms had auxiliary properties, then the properties of the first atom of the same species are applied to the new atom(s).

#### Default

By default no new atom is introduced.

#### Examples

- `atomsk initial.xsf -add-atom Si at 3.0 2.5 6 final.cfg`

  This will read the file `initial.xsf`, add a silicon atom at the position (3.0,2.5,6), and output the result into `final.cfg`.

- `atomsk initial.xsf -add-atom Si at 0.25*box 0.33*box 0.5*box final.cfg`

  This will read the file `initial.xsf`, add a silicon atom at the fractional coordinate (0.25,0.33,0.5), and output the result into `final.cfg`.

- `atomsk initial.xsf -add-atom Fe near 3815 final.cfg`

  This will read the file `initial.xsf`, and add an iron atom near the atom #3815. The new atom will be inserted in the middle of the tetrahedral site formed by the atom # and its three nearest neighbors.

- `atomsk initial.xsf -add-atom C random 25 final.cfg`

  This will read the file `initial.xsf`, and add 25 new carbon atoms at random positions in the system.

Back to main menu