Skip to content

Commit

Permalink
Added a new search tag for atomic forces in QE ( > version 6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Aug 3, 2017
1 parent 9493108 commit 4270568
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def print_displacements_QE(pwout_files,
def get_atomicforces_QE(pwout_file):

search_tag = "Forces acting on atoms (Ry/au):"
search_tag_QE6 = "Forces acting on atoms (cartesian axes, Ry/au):"

found_tag = False

Expand All @@ -430,7 +431,7 @@ def get_atomicforces_QE(pwout_file):

while line:

if search_tag in line:
if search_tag in line or search_tag_QE6 in line:
found_tag = True

f.readline()
Expand All @@ -444,7 +445,9 @@ def get_atomicforces_QE(pwout_file):
f.close()

if not found_tag:
print "%s tag not found in %s" % (search_tag, pwout_file)
print "following search tags not found in %s" % pwout_file
print search_tag
print search_tag_QE6
exit(1)

return np.array(force, dtype=np.float)
Expand Down

0 comments on commit 4270568

Please sign in to comment.