-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A problem reading the DIELECTRIC TENSOR #1
Comments
Or even try and use this code: if "MACROSCOPIC STATIC DIELECTRIC TENSOR" in line:
outcar_fh.readline()
try:
epsilon.append([float(x) for x in outcar_fh.readline().split()])
epsilon.append([float(x) for x in outcar_fh.readline().split()])
epsilon.append([float(x) for x in outcar_fh.readline().split()])
except:
doc = etree.parse('vasprun.xml')
epsilon = [[float(x) for x in c.text.split()] for c in doc.xpath("/modeling/calculation/varray")[3].getchildren()]
return epsilon |
Hi ,
I got a error message: ElementTree instance has no attribute 'xpath' |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I came a cross a problem with vasp and the dielectric tensor, sometimes when the valuesof the tensor are very big the numbers in the OUTCAR are mixedup and so the python script doesn't read them correctly. For example see the following sinnpet
In vasprun.xml the data is printed correctly, so I suggest to try and read the OUTCAR, and if it doesn't succeed then read the data from the xml with the following commands:
The text was updated successfully, but these errors were encountered: