Skip to content

Commit

Permalink
Update OUTCAR parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed May 4, 2024
1 parent 364b0c5 commit 45e983c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jarvis/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def all_structures(self, elements=[]):
force_pattern = "TOTAL-FORCE (eV/Angst)"
if not elements:
try:
atoms = Atoms.from_poscar(
elements = Atoms.from_poscar(
self.filename.replace("OUTCAR", "POSCAR")
).elements
except Exception:
Expand Down Expand Up @@ -550,14 +550,14 @@ def all_structures(self, elements=[]):
[tmp3[0], tmp3[1], tmp3[2]],
]
if " free energy TOTEN =" in i:
energy = (
energy = float(
self.data[ii]
.split(" free energy TOTEN =")[1]
.split("eV")[0]
)
energy_array.append(energy)
if " free energy ML TOTEN =" in i:
energy = (
energy = float(
self.data[ii]
.split(" free energy TOTEN =")[1]
.split("eV")[0]
Expand All @@ -580,6 +580,7 @@ def all_structures(self, elements=[]):
)

atoms_array.append(atoms)
force_array.append(forces)
if len(blocks) != len(atoms_array):
print(
"WARNING: check OUTCAR parser", len(blocks), len(atoms_array)
Expand Down

0 comments on commit 45e983c

Please sign in to comment.