atomsk --average <listfile> <outputfile> [<formats>] [options]
In this mode Atomsk will average atom positions over a list of files. This can be convenient e.g. to obtain a time-average of atom positions from snapshots of a high-temperature molecular dynamics run.
The file <listfile> is a text file that should contain a list of files to convert (one file name per line). Empty lines and lines starting with # are ignored (this can be used to insert comments). All files must have the exact same number of particles, and shall correspond to the same system (i.e. same base vectors, same atom types, etc.) for the computation to make sense. The files may be in different formats as long as these formats are supported by Atomsk.
The coordinates of cell vectors are also averaged. If they are the same for all systems then they will also be the same in the final file. If they change over the snapshots, then the final system will contain an average of all cells and all fractional coordinates of atoms.
If all files contain shells (in the sense of an ionic core-shell model) then the positions of shells will also be averaged. If all files contain auxiliary properties, they will also be averaged, except for the property related to atom types. If one or several files do not contain shells (or auxiliary properties) then the shells (respectively auxiliary properties) will be ignored and will not be present in the final system.
If this mode is used with one or several options, these options will be applied to the final file (i.e. the one containing the averaged atom positions).
atomsk --average filelist.lst averaged.cfg
This will read all the files which names are specified in filelist.lst
, and make an average of each atom position. The final result will be output into averaged.cfg
.
ls *.xsf > list.lst && atomsk --average list.lst -duplicate 2 2 2 average.cfg xsf
This will list all files with the extension .xsf and save the list in list.lst
. Then it will run Atomsk to make an average of atom positions of all these systems. The averaged system will be duplicated twice in each direction (thanks to the option -duplicate
), and the final result will be written to average.cfg
and average.xsf
.