Skip to content

modify_xdatcar

Julien Steffen edited this page Dec 5, 2024 · 1 revision

This program modifies XDATCAR trajectory files, either for visualization or following evaluations. Similar to the modify_poscar.py script ((see wiki page)[https://github.com/Trebonius91/utils4VASP/wiki/modify_poscar.py]), the unitcell of the XDATCAR file can be shifted or multiplied. Further, certain frames or parts of the trajectory can be picked and written out, and the trajectory can be converted into the xyz file format.

Start the program in a folder where the XDATCAR file of interest is located and give one or several of the following keywords:

  • -shift=a,b,c Shift all frames of the XDATCAR file along the given vector along the a,b and c unit cell axis. The values must be given in direct coordinates, for example: shift=0.1,0.1,0.3.
  • -multiply=a,b,c Multiply the unit cells of all frames in the file by the given integer values, for example: multiply=2,2,1 enlarges a surface slab along the a and b axes twice but keeps the size along the z-axis.
  • -read_freq=[number] If the size of an XDATCAR file shall be scaled down, you can write just every Nth frame to the new file. For example: -read_freq=10 only each 10th frame is written to the output.
  • -pick_frame=[number] Pick one frame in the XDATCAR file and print it to a file POSCAR_pick in the usual POSCAR file format. The counting starts from 1, giving 1 would just print out the very first frame in the XDATCAR file. Example: -pick_frame=129.
  • print_xyz Print out the whole content of the XDATCAR file with the modifications ordered by the previous commands into an xyz file named xdat_mod.xyz.
  • print_last=[number] Print only the last N frames to the output file, for example in order to skip the equilibration phase of a calculated trajectory.

After executing, a file named XDATCAR mod is written. If -print_xyz has been ordered, a file named xdat_mod.xyz is written as well. If the -pick_frame command is given, only POSCAR_pick is written but no trajectory file.