Skip to content

Toolkit for analyzing the output files and generating the input files for VASP density functional theory simulations.

Notifications You must be signed in to change notification settings

cameronmcelfresh/vasp-toolkit

Repository files navigation

Vasp Toolkit

Toolkit for analyzing the output files and generating the input files for VASP density functional theory simulations.

Getting Started

The following programs are used to generate and evaluate some of the basic files used in our VASP modeling:

  • POSCAR_generator.py
  • NEB_image_generator.py
  • ENCUT_generate.py
  • ENCUT_scrape.py

A basic understanding of the POSCAR, INCAR, POTCAR, KPOINTS, and OUTCAR files is necessary. Please read through the VASP wiki on these topics and the file formats if you have not already done so. https://cms.mpi.univie.ac.at/wiki/index.php/The_VASP_Manual

Installing

These programs utilize the following libraries:

  • tikinter
  • os
  • shutil
  • numpy
  • re
  • matplotlib

POSCAR_generator

This program generates a POSCAR file with calculated atomic positions when provided the crystal structure type, repeating cell size, and lattice parameter. Currently, POSCAR_generator is developed to handle simple cubic (sc), body-centered cubic (bcc), and face-centered cubic (fcc) crystal types.

Input

Three user inputs are needed for this program - and they are all within the first several lines of code.

  1. element symbol
  2. Atomic Structure Type (bcc, fcc, sc)
  3. Box size (i.e. for a 3x3x3 structure box size=3)

To create a 2x2x2 matrix of bcc tungsten, the user could input:

element = "W"
atomic_structure = "bcc"
lattice_parameter = 3.22
box_size = 2

Output

A POSCAR file is created in the same directory as the the current directory as the POSCAR_generator.py file. The output of the this example reads:

W bcc
6.44
1 0 0
0 1 0
0 0 1
16
Direct
0.0 0.0 0.0
0.0 0.0 0.5
0.0 0.5 0.0
0.0 0.5 0.5
0.25 0.25 0.25
0.25 0.25 0.75
0.25 0.75 0.25
0.25 0.75 0.75
0.5 0.0 0.0
0.5 0.0 0.5
0.5 0.5 0.0
0.5 0.5 0.5
0.75 0.25 0.25
0.75 0.25 0.75
0.75 0.75 0.25
0.75 0.75 0.75

The correct structure can then be validated by opening the newly generated POSCAR file in VESTA.

The above structure generated in VESTA confirms an 2x2x2 bcc structure.

NEB_image_generator

This program generates the required POSCAR files and folders to run a nudged elastic band (NEB) calculation on VASP. A linear interpolation is performed between the starting and ending points and of the CONTCAR_ei (initial) and CONTCAR_ef (final) files. The CONTCAR_ei and CONTCAR_ef files are generated by performing individual relaxations of the starting and ending configurations.

The CONTCAR_ei and CONTCAR_ef files must be in the the same folder in order to run this program. The generated files and directories will be placed in the same directory as the input CONTCAR files. This is the same format that is needed to run the VASP NEB simulation.

Input

Two user defined inputs and two starting files are required to run this program:

  1. Number of images to generate
  2. Total number of atoms
  3. CONTCAR_ei (output of relaxed initial state)
  4. CONTCAR_ef (output of relaxed final state)

If a 2x2x2 bcc cell has 16 atoms in the host matrix and a single migrating oxygen atom, 5 images could be generated by modifying the first several lines of code to:

num_images = 5
num_atoms = 17

The user is then prompted to select the directory that contains the initial CONTCAR_ei and CONTCAR_ef files.

Output

If the original directory selected apeared as shown below:

A series of folders labeled 00, 01, 02, ..etc. will be generated - each containing a POSCAR file with the linearly interpolated atomic positions.

Note that the first and last folder (00, and 07 in this case) hold the same positions as the CONTCAR_ei and CONTCAR_ef files, respectively.

ENCUT_generate

This program generates the datafiles and directories to run a series of DFT simulations that test varying the ENCUT values.

Input

Running this program follows the sequence.

  1. Run program
  2. Prompt for user to select original directory containing starting files (INCAR, KPOINTS, POTCAR, RUN_VASP.sh)
  3. Prompt for user to select destination directory
  4. Prompt for user to enter minimum, maximum, and number of ENCUT trials to generate
  5. Prompt for user to enter desired folder prefix (no spaces - something simple such as Test2x2x2)

To produce folders for trials with ENCUT = 50, 100, 150, 200, and 250, the sequence would be;

  1. Run program
  2. Select original directory

  1. Select destination directory

  1. Prompt user to enter relevant ENCUT value information

Please enter ENCUT minimum: 100

Please enter ENCUT maximum: 500

Please enter the number of encut values to make: 5
You will make encut values:
100
200
300
400
500

Are you satisfied with these values? [Y] or [N]: y

  1. Prompt user to enter desired directory prefix

Please enter the prefix for the new directory: Tungsten2x2x2

Output

The result of above input is a sequence of directories filled with VASP starting files with the given prefixes. The numerical value following "encut" in the directory title is equivalent to the ENCUT value provided in respective INCAR file.

ENCUT_scape

This program will locate the resulting final TOTEN minimization energy from a given respective trial, and link it to the ENCUT value provided in the correlated INCAR file (must be in the same folder). After going through all folders contianing an INCAR and OUTCAR file, this program will print the plot the ENCUT and minimum TOTEN value for each trial.

This program should be run after all of the files generated by ENCUT_generate have been relaxed in VASP

Input

The user must select the directory that contains all of the folders with each VASP trial. For instance, if the user generated a 5 ENCUT values between 100-500 using ENCUT_generator the user must select the "Tungsten ENCUT Test" folder when prompted.

Output

Encut_val: 100
Toten_val: 565.635
Toten_val: -207.81
Toten_val: -228.70
Toten_val: -228.74
Toten_val: -228.74
Toten_val: -170.44
Toten_val: -148.12
Toten_val: -148.10
Toten_val: -147.93
Toten_val: -147.92
Toten_val: -147.92
Toten_val: -147.92
Toten_val: -147.92
Toten_val: -147.92
Toten_val: -147.92
Toten_val: -147.92

Encut_val: 200
Toten_val: 1417.13
Toten_val: -128.82
Toten_val: -217.21
Toten_val: -218.07
Toten_val: -218.08
Toten_val: -209.51
Toten_val: -207.07
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98
Toten_val: -206.98

Encut_val: 300
Toten_val: 1796.14
Toten_val: -87.966
Toten_val: -215.83
Toten_val: -217.76
Toten_val: -217.77
Toten_val: -209.40
Toten_val: -207.12
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03
Toten_val: -207.03

Encut_val: 400
Toten_val: 2065.21
Toten_val: -55.107
Toten_val: -214.92
Toten_val: -217.78
Toten_val: -217.80
Toten_val: -209.45
Toten_val: -207.14
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04

Encut_val: 500
Toten_val: 2270.94
Toten_val: -26.196
Toten_val: -214.00
Toten_val: -217.79
Toten_val: -217.81
Toten_val: -209.45
Toten_val: -207.14
Toten_val: -207.05
Toten_val: -207.05
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
Toten_val: -207.04
ENCUT TOTEN
100 -147.92
200 -206.98
300 -207.03
400 -207.04
500 -207.04

About

Toolkit for analyzing the output files and generating the input files for VASP density functional theory simulations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages