Skip to content

Commit 7bb6fd6

Browse files
author
dyzheng
committed
Feature: auto open mixing_dftu for oscillate occured
1 parent b2498e7 commit 7bb6fd6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,13 @@ void ESolver_KS_PW<T, Device>::iter_finish(const int iter, const bool conv_elec)
846846
if(sc.higher_mag_prec)
847847
{ // if oscillate, increase the precision of magnetization and do mixing_restart in next iteration
848848
this->p_chgmix->mixing_restart_step = iter + 1;
849+
if(PARAM.inp.dft_plus_u && !GlobalC::dftu.mixing_dftu)
850+
{
851+
// set mixing_dftu true to mix occupation in next iteration
852+
// allocate memory for uom_mdata
853+
this->p_chgmix->allocate_mixing_uom(GlobalC::dftu.get_size_eff_pot_pw());
854+
GlobalC::dftu.mixing_dftu = true;
855+
}
849856
}
850857
}
851858
}

0 commit comments

Comments
 (0)