Skip to content

Commit fe570e1

Browse files
authored
Merge pull request #864 from dyzheng/develop
Fix: 1. only init wfc once for MD and relax; 2. reset PW_DIAG_THR every Ionic step. 3. 17 test cases reference updated
2 parents 7e42ed7 + e6b1023 commit fe570e1

File tree

21 files changed

+93
-85
lines changed

21 files changed

+93
-85
lines changed

source/module_hsolver/diago_cg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ void DiagoCG::diag_mock(psi::Psi<std::complex<double>> &phi, double *eigenvalue_
3535
this->dmx = phi.get_nbasis();
3636
this->n_band = phi.get_nbands();
3737
this->eigenvalue = eigenvalue_in;
38+
ModuleBase::GlobalFunc::ZEROS(this->eigenvalue, this->n_band);
3839

3940
/// record for how many loops in cg convergence
4041
double avg = 0.0;

source/src_ions/ions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void Ions::reset_after_relax(const int& istep)
343343
GlobalC::pot.init_pot( istep, GlobalC::pw.strucFac );
344344

345345
GlobalV::ofs_running << " Setup the new wave functions?" << std::endl;
346-
GlobalC::wf.wfcinit();
346+
//GlobalC::wf.wfcinit();
347347
}
348348
void Ions::reset_after_cellrelax(int& f_step, int& s_step)
349349
{

source/src_pw/run_md_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void Run_MD_PW::md_ions_pw(ModuleESolver::ESolver *p_esolver)
104104
GlobalC::pot.init_pot(verlet->step_, GlobalC::pw.strucFac);
105105

106106
// new wave functions
107-
GlobalC::wf.wfcinit();
107+
//GlobalC::wf.wfcinit();
108108

109109
// update force and virial due to the update of atom positions
110110
MD_func::force_virial(p_esolver, verlet->step_, verlet->mdp, verlet->ucell, verlet->potential, verlet->force, verlet->virial);

source/src_pw/threshold_elec.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ void Threshold_Elec::update_pw_diag_thr(const int &iter)
8686
}
8787

8888
}
89+
else
90+
{
91+
if(GlobalV::CALCULATION=="md"||GlobalV::CALCULATION=="relax"||GlobalV::CALCULATION=="cell-relax")
92+
{
93+
GlobalV::PW_DIAG_THR = std::max(GlobalV::PW_DIAG_THR, INPUT.pw_diag_thr);
94+
}
95+
}
8996
return;
9097
}
9198

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -211.5049348072273858
2-
etotperatomref -105.7524674036
3-
totalforceref 5.333244
4-
totalstressref 831.312161
5-
totaltimeref +0.82470
1+
etotref -211.5049348009860921
2+
etotperatomref -105.7524674005
3+
totalforceref 5.333906
4+
totalstressref 831.302656
5+
totaltimeref +1.12711
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
etotref -211.6198578547672184
2-
etotperatomref -105.8099289274
3-
totalforceref 6.582534
4-
totaltimeref 0.67360
1+
etotref -211.6198578527780114
2+
etotperatomref -105.8099289264
3+
totalforceref 6.583242
4+
totaltimeref 1.04643
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
etotref -210.7981143004323030
2-
etotperatomref -105.3990571502
3-
totalforceref 25.502706
4-
totaltimeref 0.63231
1+
etotref -210.7981143000803286
2+
etotperatomref -105.3990571500
3+
totalforceref 25.502220
4+
totaltimeref 0.81761
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -211.8220727419407581
2-
etotperatomref -105.9110363710
3-
totalforceref 0.000046
4-
totalstressref 348.864353
5-
totaltimeref +0.72742
1+
etotref -211.8220727461786623
2+
etotperatomref -105.9110363731
3+
totalforceref 0.000060
4+
totalstressref 348.831786
5+
totaltimeref +1.22228
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -211.8207678645103726
2-
etotperatomref -105.9103839323
3-
totalforceref 0.046640
4-
totalstressref 355.693369
5-
totaltimeref +1.58581
1+
etotref -211.8207812297203532
2+
etotperatomref -105.9103906149
3+
totalforceref 0.046304
4+
totalstressref 355.720592
5+
totaltimeref +1.22281
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -211.8190843580214846
2-
etotperatomref -105.9095421790
3-
totalforceref 0.065762
4-
totalstressref 360.024885
5-
totaltimeref +1.56269
1+
etotref -211.8190977238703852
2+
etotperatomref -105.9095488619
3+
totalforceref 0.064928
4+
totalstressref 360.085170
5+
totaltimeref +1.20929

0 commit comments

Comments
 (0)