diff --git a/src/py4vasp/_raw/data.py b/src/py4vasp/_raw/data.py index d5e291fa..cd4fb444 100644 --- a/src/py4vasp/_raw/data.py +++ b/src/py4vasp/_raw/data.py @@ -324,8 +324,8 @@ class OSZICAR: "All columns of the OSZICAR file stored for all ionic steps." label: VaspData "Label of all the data from the OSZICAR file." - EDIFF: VaspData - "EDIFF decides the energy converge of the SCF step." + is_elmin_converged: VaspData + "Is the electronic minimization step converged?" @dataclasses.dataclass diff --git a/src/py4vasp/_raw/definition.py b/src/py4vasp/_raw/definition.py index 98aebf6b..dca42446 100644 --- a/src/py4vasp/_raw/definition.py +++ b/src/py4vasp/_raw/definition.py @@ -383,7 +383,7 @@ def selections(quantity): required=raw.Version(6, 5), label="intermediate/ion_dynamics/oszicar_label", convergence_data="intermediate/ion_dynamics/oszicar", - EDIFF="/intermediate/ion_dynamics/EDIFF", + is_elmin_converged="/intermediate/ion_dynamics/electronic_step_converged", ) # group = "intermediate/pair_correlation" diff --git a/src/py4vasp/calculation/_OSZICAR.py b/src/py4vasp/calculation/_OSZICAR.py index b78f2d8c..410d41a6 100644 --- a/src/py4vasp/calculation/_OSZICAR.py +++ b/src/py4vasp/calculation/_OSZICAR.py @@ -118,9 +118,5 @@ def to_graph(self, selection="E"): @_base.data_access def is_converged(self): - difference_energy = self._read(b"dE") - if self._more_than_one_ionic_step(difference_energy): - last_step_energy = [dE[-1] for dE in difference_energy] - else: - last_step_energy = difference_energy[-1] - return last_step_energy < self._raw_data.EDIFF + is_elmin_converged = self._raw_data.is_elmin_converged[self._steps] + return is_elmin_converged == 0.0