Back to main menu

## Companion tools

The folder `/tools/` provided in the Atomsk package contains some scripts that can be used to make simple transformations on some files. When installing Atomsk (either with the script "install.sh", or with the command "`make install`"), these scripts are made executable and copied in the /usr/local/bin folder. Running any of these scripts without any argument will display its usage.

As the rest of the code, these bash scripts are provided as-is and without any warranty. I suggest that you edit them to check what they do and/or adapt them to your needs.

#### cfg_setA.sh

This bash script sets the scaling factor A to a given <value> in Atomeye configuration files (*.cfg). This script can be useful if Atomeye refuses to display a configuration and displays the error message "`ATOM_COORDINATION_MAX = 24 exceeded`". For instance, to set A=1.3 in the file "myfile.cfg" just type:

`cfg_setA.sh 1.3 myfile.cfg`

If many file names are specified, they will all be treated.

#### dat_mulvec.sh

This bash script reads a data file (*.dat) containing at least six columns of real numbers, assuming they are the positions of atoms followed by some vector (X Y Z vx vy vz), and multiplies all the vectors by the given <factor>. In order to convert the file "myfile.dat" just type:

`dat_mulvec.sh <factor> myfile.dat`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file.

#### dat_rm0.sh

This bash script reads a data file (*.dat) containing at least six columns of real numbers, assuming they are the positions of atoms followed by some vector (X Y Z vx vy vz), and removes all lines where the three last values are zero. In order to process the file "myfile.dat" just type:

`dat_rm0.sh myfile.dat`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file.

#### lmp_atom2charge.sh

This bash script converts one or several LAMMPS data files (*.lmp) with the format "`ID type x y z`" (suited for "`atom_style atom`") into the format "`ID type charge x y z`" (suited for "`atom_style charge`"). In order to convert the file "myfile.lmp" just type:

`lmp_atom2charge.sh myfile.lmp`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file. Practically, the script copies the first two columns of data, adds zeros in the third column, and copies the last three columns of data.

#### lmp_charge2atom.sh

This bash script does the inverse of the one above, i.e. it converts a LAMMPS data file (*.lmp) from the format "`ID type charge x y z`" to the format "`ID type x y z`". Similarly, to convert the file "myfile.lmp" just type:

`lmp_charge2atom.sh myfile.lmp`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file. Practically, the script copies only the first two and the last three columns of data of the file.

#### lmp_ortho2tri.sh

This bash script transforms a LAMMPS data file (*.lmp) into a triclinic box, i.e. after the line ending with "`zhi`" it adds a new line containing: "`0.0000000 0.00000000 0.00000000 xy xz yz`". If a line containing "`xy xz yz`" already exists then the script doesn't do anything. Like the previous scripts, to convert the file "myfile.lmp" just type:

`lmp_ortho2tri.sh myfile.lmp`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file.

#### qepw_bohr.sh

This bash script sets the lines "`CELL PARAMETERS`" and "`ATOMIC_POSITIONS`" to "bohr" in one or several Quantum Espresso pwscf files (*.pw). When writing PW files Atomsk does not recognize the units and will always assume "angstroms", this script allows to change that to "bohr". To convert the file "myfile.pw" just type:

`qepw_bohr.sh myfile.pw`

Many file names can be specified at once in the same command-line. Beware that this script replaces the file.

Back to main menu