pymatgen
pymatgen copied to clipboard
More robust parsing of (electronic) piezoelectric tensor from OUTCAR
Feature Requested
Using VASP v6.3.2:
- Running a calculation with LEPSILON=.TRUE. and LRPA=.FALSE. produces the following OUTCAR line:
PIEZOELECTRIC TENSOR (including local field effects) for field in x, y, z (C/m^2). This line does not match the search string inpymatgen > io > vasp > outputs.pyline 2909, resulting in an improperly parsedpiezo_tensor - It would be useful to define a
read_lcalceps()method, equivalent toread_lepsilon(), to extract the piezoelectric tensor from calculations using LCALCEPS=.TRUE. since it is sometimes beneficial to use the finite differences approach
Proposed Solution
- Modify the search string to look for the relevant elements of the output string, i.e. "PIEZOELECTRIC TENSOR" && "for field in x, y, z (C/m^2)" as opposed to the whole string. This would accommodate variations in the output related to VASP versions.
- Add a check for
lcalcepsand create a duel of theread_lepsilon()
Relevant Information
These changes would allow for
- greater compatibility with different VASP versions, which seem to use different output strings in the OUTCAR.
- ability to parse the piezolectric tensor from LCALCEPS calculations