Back to main menu

## Mode: normal

#### Syntax

`atomsk <inputfile> [options] <outputfile>`

`atomsk <inputfile> [options] <formats>`

`atomsk <inputfile> [options] <prefix> <formats>`

#### Description

This mode is the default. In this mode, Atomsk reads one <inputfile>, applies options if any, and writes the final result into one or several <outputfile>.

If an <outputfile> name is given with a recognisable extension (for instance "file.xyz", or "system.cfg"), then Atomsk will write it into the appropriate format.

If no output file name is given, but one or several <format> are given (among those supported by Atomsk), then Atomsk will use the name of the input file, and replace its extension with the one appropriate for each <format>.

If a <prefix> is given (i.e. a file name with no extension), followed by one or several <formats>, then Atomsk will use the prefix to produce all the output files according to the <formats>.

Atomsk checks for the existence of the files given in the command-line. If only one file exists, then Atomsk considers it as the input file, and considers the other file name as the output file, regardless of the ordering of the file names in the command. If both files exist, then Atomsk prompts which one should be used as input file, and asks if the output file should be overwritten. If you wish to avoid these questions, it is recommended to delete the output file(s) before running Atomsk, and/or to use the option `-ignore` or the option `-overwrite`.

Using options is not mandatory. If the command-line contains one or several options, then they are applied sequentially, in the order specified in the command line, after reading the intput file, and before writing the output file. Please refer to the documentation about options.

Note that in this mode, Atomsk accepts only one input file name, and one output file name (and possibly one or several formats). If more than two file names are specified, only the first two names are used, and other file names are ignored. As a result, you should never use a wildcard (i.e. the star symbol *) to specify file names, like "atomsk *.xyz cfg". If you wish to convert many input files, please use the mode File list.

Note that contrary to other modes, you do not have to write "`--normal`" to use the normal mode, since it is the default mode.

#### Examples

- `atomsk mysystem.gin example.cfg`

  This will convert the file `mysystem.gin` into `example.cfg`.

- `atomsk example.cfg mysystem.gin`

  Same as previous example, assuming the file `mysystem.gin` exists and `example.cfg` does not. The program recognizes which file exists, and which file has to be created. If both files already exist, you will be prompted which one to use as an input file.

- `atomsk mysystem.gin cfg`

  This will convert the file `mysystem.gin` into `mysystem.cfg`.

- `atomsk mysystem.gin new_system cfg xsf`

  This example uses a prefix (`new_system`) and several output formats. It will convert the file `mysystem.gin` into `new_system.cfg` and `new_system.xsf`.

- `atomsk xsf new_system cfg mysystem.gin`

  Same as previous example. Note that command-line parameters can be specified in any order.

- `atomsk unitcell.xyz -duplicate 2 2 6 -shift above 6.5 z 0.2 0.6 0.0 stackingfault.xsf`

  This example uses several options. The file `unitcell.xyz` will be read, then the system will be duplicated to a 2x2x6 supercell, then part of the system will be shifted, and the resulting system will be written to `stackingfault.xsf`.

Back to main menu