1 \chapter{Modifications to the VASP code}
5 In the {\textsc vasp} code, the {\em selective dynamics} mode provides a feature to allow or constrain the change of each of the three coordinates for every single atom.
6 By this, however, applied constraints are restricted to the chosen basis.
7 For the investigation of migration pathways utilizing the constrained relaxation technique as detailed in section~\ref{section:basics:migration}, the required constraint not necessarily corresponds to one of the coordinate axes as defined by the basis, which, in turn, is determined to enable a construction within the supercell approach.
9 Thus, the functionality of the {\em selective dynamics} mode had to be extended by modifications in the particle position evaluation routine of {\textsc vasp}.
10 These modifications allow for a rotation of all atom coordinates individually before respective constraints are applied and a following, final inverse transformation.
11 In that way, constraints for every single atom can be applied independently of the chosen basis.
12 A patch against version 4.6 of the {\textsc vasp} code containing these modifications is available for download\footnote{http://www.physik.uni-augsburg.de/\~{}zirkelfr/download/posic/sd\_rot\_all-atoms.patch}.
14 \section{Mode of operation}
16 The extended capabilities can only be used within the {\em selective dynamics} mode.
17 It is enabled by adding the word {\em transformed} in front of the {\em selective dynamics} switch.
18 This feature only works in {\em direct} mode.
19 Two values of angles need to be added after the extra flags of each atom.
20 The first angle corresponds to the rotation of the basis about the $z$-axis.
21 The second angle determines the rotation about the transformed $x$-axis, $x'$.
22 All values have to be supplied in degrees.
23 The entire information is given in the POSCAR file as can be seen in the example displayed in Fig.~\ref{fig:vasp_input}.
25 \begin{Verbatim}[frame=single]
28 1.00000 0.00000 0.00000
29 0.00000 1.00000 0.00000
30 0.00000 0.00000 1.00000
32 transformed selective dynamics
34 0.00000 0.00000 0.00000 T F T 45.0 30.0
35 0.50000 0.50000 0.00000 T T T 0.0 0.0
36 0.50000 0.00000 0.50000 T T T 0.0 0.0
37 0.00000 0.50000 0.50000 T T T 0.0 0.0
38 0.25000 0.25000 0.25000 T F T 135.0 -10.0
39 0.75000 0.75000 0.25000 T T T 0.0 0.0
40 0.75000 0.25000 0.75000 T T T 0.0 0.0
41 0.25000 0.75000 0.75000 T T T 0.0 0.0
43 \caption{Example {\textsc vasp} input file utilizing the {\em transformed selective dynamics} mode of operation.}
44 \label{fig:vasp_input}
46 In case of the first atom, the basis is transformed by a rotation of $45^{\circ}$ and $30^{\circ}$ about the $z$ and $x'$ axis.
47 The basis of the fifth atom is likewise rotated by $135^{\circ}$ and $-10^{\circ}$ respectively.
48 Relaxation of both atoms is only allowed within the plane perpendicular to the $y''$-axis.