Skip to content

Commit

Permalink
Fix detection of non-converged LDA+U/LDA+HIA
Browse files Browse the repository at this point in the history
the previous condition would abort always if the criteria were reached
  • Loading branch information
janssenhenning committed Apr 7, 2022
1 parent 73ef302 commit 20923fe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aiida_fleur/workflows/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,14 @@ def condition(self):
self.ctx.last_hubbard1_elem_distance >= self.ctx.wf_dict.get('hubbard1_elem_converged'):
ldahia_notconverged = True

ignore_convergence_criteria = ldau_notconverged or ldahia_notconverged
if mode == 'density':
if self.ctx.wf_dict.get('density_converged') >= self.ctx.last_charge_density:
if not ldau_notconverged or not ldahia_notconverged:
if not ignore_convergence_criteria:
return False
elif mode in ('energy', 'gw'):
if self.ctx.wf_dict.get('energy_converged') >= self.ctx.energydiff:
if not ldau_notconverged or not ldahia_notconverged:
if not ignore_convergence_criteria:
return False
elif mode == 'force':
if self.ctx.last_charge_density is None:
Expand All @@ -774,7 +775,7 @@ def condition(self):
except NotExistent:
pass
else:
if not ldau_notconverged or not ldahia_notconverged:
if not ignore_convergence_criteria:
return False

elif self.ctx.wf_dict.get('density_converged') >= self.ctx.last_charge_density:
Expand All @@ -783,7 +784,7 @@ def condition(self):
except NotExistent:
pass
else:
if not ldau_notconverged or not ldahia_notconverged:
if not ignore_convergence_criteria:
return False

if self.ctx.loop_count >= self.ctx.max_number_runs:
Expand Down

0 comments on commit 20923fe

Please sign in to comment.