atomsk --match-id <file1> <file2> [options] [<outputfile>] [<formats>]
This mode reads two files, and attempts to sort atoms from <file2> in the same order as atoms from <file1>. The two files may be in different formats as long as these formats are supported by Atomsk. Both files shall correspond to the same system (i.e. same atom types, same lattice, etc.) for the computation to make sense.
If both files contain exactly the same number of atoms, then Atomsk creates unique pairs of atoms from <file1> and <file2>.
If the two files contain different numbers of atoms, then atoms from the <file1> are paired to those from <file2> in an injective way, i.e. so that each atom from <file1> is paired at maximum with only one atom from <file2>. If <file1> contains fewer atoms, then some atoms from <file2> will not be paired, and will appear at the end of the list in the final file. Atomsk then creates a new auxiliary property named "new_atoms", equal to zero for all atoms that were paired, and to 1 for atoms that could not be paired (i.e. atoms that were added when going from <file1> to <file2>). If <file1> contains the most atoms, then all atoms from <file2> should be paired and sorted accordingly. The final file will contain as many atoms as the <file2>.
If shells (in the sense of an ionic core-shell model) and/or auxiliary properties exist in both systems, then they are also sorted so that each atom keeps its properties
If you use this mode with one or several options, then these options will be applied on the final file after atoms are sorted.
atomsk --matchid config1.cfg config2.xsf final.cfg
This will read config1.cfg
and config2.xsf
, and sort atoms from config2.xsf
so that they are in the same order as in config1.cfg
. The final result will be written in final.cfg
.