Skip to content

Commit

Permalink
Merge pull request #546 from pyiron/vasp_vol
Browse files Browse the repository at this point in the history
Store VASP volumes as numpy arrays
  • Loading branch information
sudarsan-surendralal authored Feb 22, 2022
2 parents 79c82a5 + 627c422 commit bc32bd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pyiron_atomistics/vasp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,9 +2075,7 @@ def collect(self, directory=os.getcwd(), sorted_indices=None):
if vasprun_working:
log_dict["forces"] = self.vp_new.vasprun_dict["forces"]
log_dict["cells"] = self.vp_new.vasprun_dict["cells"]
log_dict["volume"] = [
np.linalg.det(cell) for cell in self.vp_new.vasprun_dict["cells"]
]
log_dict["volume"] = np.linalg.det(self.vp_new.vasprun_dict["cells"])
# log_dict["total_energies"] = self.vp_new.vasprun_dict["total_energies"]
log_dict["energy_tot"] = self.vp_new.vasprun_dict["total_energies"]
if "kinetic_energies" in self.vp_new.vasprun_dict.keys():
Expand Down
5 changes: 5 additions & 0 deletions tests/vasp/test_vasp_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ def test_output(self):
ham = self.project.inspect("full_job_sample")
self.assertEqual(ham["output/generic/dft/energy_free"][-1], -17.7379867884)
self.assertIsInstance(ham["output/charge_density"].to_object(), VaspVolumetricData)
with ham.project_hdf5.open("output/generic") as h_gen:
for node in h_gen.list_nodes():
if h_gen[node] is not None:
self.assertIsInstance(h_gen[node], np.ndarray,
f"output/generic/{node} is not stored as a numpy array")


if __name__ == "__main__":
Expand Down

0 comments on commit bc32bd0

Please sign in to comment.