Skip to content

Commit

Permalink
pass is_elmin_converged instead of inferring convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarshanv01 committed Apr 19, 2024
1 parent 6aa1797 commit 403c852
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/py4vasp/_raw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/py4vasp/_raw/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 2 additions & 6 deletions src/py4vasp/calculation/_OSZICAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 403c852

Please sign in to comment.