Back to main menu

## Mode: merge

#### Syntax

`atomsk --merge [stack <x|y|z>] [scale <x|y|z|xy|xz|yz|xyz>] <N> <file1>...<fileN> <outputfile> [<formats>] [options]`

#### Description

This mode merges several systems into one, either by gathering atoms from different systems into the same box or by juxtaposing several systems along an axis. The results are output in the specified <outputfile> and <formats>.

The integer <N> indicates how many systems must be merged. It is mandatory, and must be followed by the corresponding number of files names <file1> to <fileN>.

The keyword "stack" is optional. It can be used to specify the Cartesian direction (x, y or z) along which the different systems are stacked. Along that given direction, the dimension of the final box is the sum of the dimensions of all stacked systems. If this keyword is omitted, then all atoms are merged into the same box as the first system of the list (i.e. in the system <file1>).

The keyword "scale" is optional. If it is used, then all systems are deformed along the given direction(s) to match the dimensions of the first system. The directions can be: 'x', 'y', 'z' (systems are deformed only to match first system along the given direction), 'xy', 'xz', 'yz' (systems are deformed along both directions), or 'xyz' (systems are deformed to match all three dimensions of the first system).

Beware that Atomsk does not "automagically" shift atomic positions, find optimal interfaces or whatsoever. It is up to you to build, for instance, one system in one half of the supercell, the other system in the other half, and then use this mode to merge them. For quickly redefining the dimensions of the final system one can use the option `-rebox`.

Auxiliary properties are conserved when merging systems, i.e. each atom keeps the auxiliary properties that are defined for it. If a property is defined in some files but not all of them, that property will be assigned a zero value for atoms for which it is not defined.

If you use this mode with one or several options they will be applied after the merge.

#### Examples

- `atomsk --merge 2 fccal_bottom.cfg bcciron_top.xsf interface.xyz xsf`

  This will merge all atoms `fccal_bottom.cfg` and `bcciron_top.xsf` in the same box (the one defined in `fccal_bottom.cfg`), and output the result in `interface.xyz` and `interface.xsf`.

- `atomsk --merge stack z 3 one.cfg two.xsf three.cfg final.xsf`

  This will stack the three systems `one.cfg`, `two.xsf` and `three.cfg` along the Cartesian Z direction, and output the result in `final.xsf`.

- `atomsk --merge stack x 4 file.cfg file.cfg file.cfg file.cfg final.xsf`

  This will stack the file `file.cfg` four times along X. This operation is equivalent to duplicating the system four times along X (i.e. "-duplicate 4 1 1").

- `atomsk --merge stack Z scale XY 2 bottom.cfg top.cfg final.xsf`

  This will stack the files `bottom.cfg` and `top.cfg` along Z, and deform `top.cfg` along X and Y so that it matches the size of `bottom.cfg`.

- You may also want to look at the scripts in the "examples" folder provided with the program. The folder "`Cu_Fe_interface`" contains a bash script that builds two slabs, one of fcc copper and one of bcc iron, and merges them to form an interface.

Back to main menu