htesp.vasp_process¶
Module to process vasp input files
Functions
|
Write k-points of high-symmetry points for Phonopy band structure plot using 'band.conf' file. |
|
Remove every line of |
Process the EIGENVAL file generated by VASP. |
|
Function to check ENCUT in INCAR file and replace with 1.3xENCUTMAX of POTCAR, when ENCUT is less than that. |
|
|
Return the INCAR key a line sets, upper-cased, or |
|
Return the text a line assigns to its key, stripped. |
|
main function |
|
Read |
|
Return the lines of an INCAR, or an empty list when it is missing. |
|
Split an ASE band-path string into its labels. |
Processes the INCAR file using the 'vasp.in' file. |
|
|
Write |
- htesp.vasp_process.incar_key(line)[source]¶
Return the INCAR key a line sets, upper-cased, or
None.A line sets a key when the text before the first
=is a single word. This is whatsed -i '/KEY/d'was meant to match.
- htesp.vasp_process.read_incar_lines(path='INCAR')[source]¶
Return the lines of an INCAR, or an empty list when it is missing.
- htesp.vasp_process.drop_incar_keys(keys, path='INCAR')[source]¶
Remove every line of
paththat sets one ofkeys.FIX(23):
sed -i '/ENCUT/d' INCARis a substring match, so deleting ENCUT also deleted ENCUTGW and deleting NELM also deleted NELMIN and NELMDL. The key is matched here at the start of the line, followed by optional whitespace and=.
- htesp.vasp_process.parse_vasp_in(path='vasp.in')[source]¶
Read
vasp.ininto an ordered list of(key, value)pairs.valueisNonefor a key-only line, which means “delete this key from INCAR”.FIX(24): the old parser appended keys and values to two independent lists and then paired them by index, so a key-only (delete) line anywhere but at the end shifted every later value onto the wrong key.
- htesp.vasp_process.encut_check()[source]¶
Function to check ENCUT in INCAR file and replace with 1.3xENCUTMAX of POTCAR, when ENCUT is less than that.
- htesp.vasp_process.vasp_process()[source]¶
Processes the INCAR file using the ‘vasp.in’ file. Look for ‘vasp.in’ file in the utility folder as a demo.
If ‘vasp.in’ is found, it reads the file and replaces corresponding keys in the ‘INCAR’ file with the provided values. Existing keys such as ISPIN, MAGMOM, and LORBIT in ‘INCAR’ are removed to avoid conflicts. If magnetic moment values are provided in ‘config.json’, it updates the ‘MAGMOM’ keyword accordingly. If ‘METAGGA’ is present, ‘LMIXTAU = .TRUE.’ is added to ‘INCAR’. To remove unwanted keywords from ‘INCAR’, put those keywords at the bottom in ‘vasp.in’ file after the keyword that has values.
- Returns:
None
- htesp.vasp_process.eigen_process()[source]¶
Process the EIGENVAL file generated by VASP.
Reads the ‘input.in’ file to determine if the ‘vasp-line’ keyword is present, indicating a line-mode calculation.
Reads the ‘EIGENVAL’ file to extract band structure data and writes it to ‘band.dat’.
If ‘vasp-line’ is present or the weight of a k-point is less than 0.000001, it writes the k-point index and corresponding band energies to ‘band.dat’. Otherwise, it skips the k-point and its associated data.
Additionally, it creates ‘band.dat.gnu’, a file suitable for plotting band structures in GNUPlot.
- Returns:
None
- htesp.vasp_process.split_path_labels(path_string)[source]¶
Split an ASE band-path string into its labels.
'GXWK1G'->['G', 'X', 'W', 'K1', 'G']: a digit belongs to the label in front of it.