Skip to content

Commit

Permalink
Fix: fix scf_nmax restart (#3808)
Browse files Browse the repository at this point in the history
* fix scf_nmax restart

* do not print at last step
  • Loading branch information
WHUweiqingzhou committed Mar 26, 2024
1 parent 9391a3d commit b447558
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ namespace ModuleESolver
if(stop) break;
}
// notice for restart
if (GlobalV::MIXING_RESTART > 0 && iter == this->p_chgmix->mixing_restart - 1)
if (GlobalV::MIXING_RESTART > 0 && iter == this->p_chgmix->mixing_restart - 1 && iter != GlobalV::SCF_NMAX)
{
std::cout<<"SCF restart after this step!"<<std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ namespace ModuleESolver
if (iter == 1)
{
this->p_chgmix->init_mixing(); // init mixing
this->p_chgmix->mixing_restart = GlobalV::SCF_NMAX;
this->p_chgmix->mixing_restart = GlobalV::SCF_NMAX + 1;
}
// for mixing restart
if (iter == this->p_chgmix->mixing_restart && GlobalV::MIXING_RESTART > 0.0)
Expand Down
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void ESolver_KS_PW<T, Device>::eachiterinit(const int istep, const int iter)
if (iter == 1)
{
this->p_chgmix->init_mixing();
this->p_chgmix->mixing_restart = GlobalV::SCF_NMAX;
this->p_chgmix->mixing_restart = GlobalV::SCF_NMAX + 1;
}
// for mixing restart
if (iter == this->p_chgmix->mixing_restart && GlobalV::MIXING_RESTART > 0.0)
Expand Down

0 comments on commit b447558

Please sign in to comment.