From 6ef377d0d6ce349bcd4e9e5007dc492bb9ba4a60 Mon Sep 17 00:00:00 2001 From: janssenhenning Date: Thu, 31 Mar 2022 12:23:07 +0200 Subject: [PATCH] Fix detection of non-converged LDA+U/LDA+HIA the previous condition would abort always if the criteria were reached --- aiida_fleur/workflows/scf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aiida_fleur/workflows/scf.py b/aiida_fleur/workflows/scf.py index 720e130dd..1dbd83797 100644 --- a/aiida_fleur/workflows/scf.py +++ b/aiida_fleur/workflows/scf.py @@ -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: @@ -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: @@ -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: