-fix <axis>
-fix <axis> <above|below> <d> <normal>
This option allows to fix or "freeze" the X, Y and/or Z coordinates of some atoms.
The parameters for this option are the following:
The distance <d> is usually given in Å. It is also possible to give it with respect to the box dimension along <axis> with the keyword BOX and an operation (see this page).
The <normal> can be one of 'x', 'y', 'z' (referring to cartesian axes), or a crystallographic direction defined by its Miller indices [hkl], or [hkil] for hexagonal systems (see how to specify Miller indices). If the crystallographic orientation of the system is defined (e.g. through the option -properties
) then the Miller indices are considered with respect to that orientation. Otherwise the orientation assumed is X=[100], Y=[010], Z=[001].
Note that this option does not actually make atoms inert for Atomsk, it just "marks" them as fixed (by adding three auxiliary properties to each atom: fixx, fixy, fixz). As far as Atomsk is concerned, fixed atoms are not different from other atoms. Only when writing the output files will the fixed atoms be marked differently in formats that support it (see the list of formats). In order to restrict the options of Atomsk to only some atoms one may use the option -select
.
This option can be used several times to fix atoms in several directions, or to fix different atoms (see example 2 below).
If some atoms have shells (in the sense of an ionic core-shell model), then only the core is fixed (and not the shell).
If a selection was defined (with the option -select
) then only selected atoms are fixed.
By default no atom is fixed.
atomsk initial.xsf -fix Y final.gin
This will read the file initial.xsf
, and fix the Y coordinate of all atoms. The result will be output to the file final.gin
.
atomsk system.xsf -select out box 10 BOX-10 10 BOX-10 10 BOX-10 -fix all lammps
This will read the file system.xsf
, select atoms that are within 10 Å of each boundary, and fix these atoms (in all three coordinates X, Y and Z). The result will be output to the file system.lmp
.
atomsk system.xsf -fix x above 5 z gin
This will read the file system.xsf
, and fix the X coordinate of all atoms that are above 5 Å along Z. The result will be output to the file system.gin
.
atomsk initial.xsf -fix x below 2.4 z -fix y below 2.4 z final.gin
This will fix the X and Y coordinates of all atoms that are below 2.4 Å along Z.
atomsk initial.xsf -fix all below 0.2*BOX z -fix all above 0.8*BOX z final.gin
This will fix all atoms that are below 0.2 times the box height along Z, or above 0.8 times that height.