Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 1. only init wfc once for MD and relax; 2. reset PW_DIAG_THR every Ionic step. 3. 17 test cases reference updated #864

Merged
merged 2 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/module_hsolver/diago_cg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void DiagoCG::diag_mock(psi::Psi<std::complex<double>> &phi, double *eigenvalue_
this->dmx = phi.get_nbasis();
this->n_band = phi.get_nbands();
this->eigenvalue = eigenvalue_in;
ModuleBase::GlobalFunc::ZEROS(this->eigenvalue, this->n_band);

/// record for how many loops in cg convergence
double avg = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion source/src_ions/ions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void Ions::reset_after_relax(const int& istep)
GlobalC::pot.init_pot( istep, GlobalC::pw.strucFac );

GlobalV::ofs_running << " Setup the new wave functions?" << std::endl;
GlobalC::wf.wfcinit();
//GlobalC::wf.wfcinit();
}
void Ions::reset_after_cellrelax(int& f_step, int& s_step)
{
Expand Down
2 changes: 1 addition & 1 deletion source/src_pw/run_md_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void Run_MD_PW::md_ions_pw(ModuleESolver::ESolver *p_esolver)
GlobalC::pot.init_pot(verlet->step_, GlobalC::pw.strucFac);

// new wave functions
GlobalC::wf.wfcinit();
//GlobalC::wf.wfcinit();

// update force and virial due to the update of atom positions
MD_func::force_virial(p_esolver, verlet->step_, verlet->mdp, verlet->ucell, verlet->potential, verlet->force, verlet->virial);
Expand Down
7 changes: 7 additions & 0 deletions source/src_pw/threshold_elec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ void Threshold_Elec::update_pw_diag_thr(const int &iter)
}

}
else
{
if(GlobalV::CALCULATION=="md"||GlobalV::CALCULATION=="relax"||GlobalV::CALCULATION=="cell-relax")
{
GlobalV::PW_DIAG_THR = std::max(GlobalV::PW_DIAG_THR, INPUT.pw_diag_thr);
}
}
return;
}

Expand Down
10 changes: 5 additions & 5 deletions tests/integrate/108_PW_RE/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.5049348072273858
etotperatomref -105.7524674036
totalforceref 5.333244
totalstressref 831.312161
totaltimeref +0.82470
etotref -211.5049348009860921
etotperatomref -105.7524674005
totalforceref 5.333906
totalstressref 831.302656
totaltimeref +1.12711
8 changes: 4 additions & 4 deletions tests/integrate/108_PW_RE_MB/result.ref
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
etotref -211.6198578547672184
etotperatomref -105.8099289274
totalforceref 6.582534
totaltimeref 0.67360
etotref -211.6198578527780114
etotperatomref -105.8099289264
totalforceref 6.583242
totaltimeref 1.04643
8 changes: 4 additions & 4 deletions tests/integrate/108_PW_RE_MG/result.ref
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
etotref -210.7981143004323030
etotperatomref -105.3990571502
totalforceref 25.502706
totaltimeref 0.63231
etotref -210.7981143000803286
etotperatomref -105.3990571500
totalforceref 25.502220
totaltimeref 0.81761
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8220727419407581
etotperatomref -105.9110363710
totalforceref 0.000046
totalstressref 348.864353
totaltimeref +0.72742
etotref -211.8220727461786623
etotperatomref -105.9110363731
totalforceref 0.000060
totalstressref 348.831786
totaltimeref +1.22228
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_a/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8207678645103726
etotperatomref -105.9103839323
totalforceref 0.046640
totalstressref 355.693369
totaltimeref +1.58581
etotref -211.8207812297203532
etotperatomref -105.9103906149
totalforceref 0.046304
totalstressref 355.720592
totaltimeref +1.22281
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_ab/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8190843580214846
etotperatomref -105.9095421790
totalforceref 0.065762
totalstressref 360.024885
totaltimeref +1.56269
etotref -211.8190977238703852
etotperatomref -105.9095488619
totalforceref 0.064928
totalstressref 360.085170
totaltimeref +1.20929
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_ac/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8190843231361953
etotperatomref -105.9095421616
totalforceref 0.065806
totalstressref 360.020296
totaltimeref +1.56614
etotref -211.8190976888836303
etotperatomref -105.9095488444
totalforceref 0.064980
totalstressref 360.080949
totaltimeref +1.21303
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_b/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8207678536984133
etotperatomref -105.9103839268
totalforceref 0.046662
totalstressref 355.700355
totaltimeref +1.62886
etotref -211.8207812192243580
etotperatomref -105.9103906096
totalforceref 0.046224
totalstressref 355.722719
totaltimeref +1.23053
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_bc/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8190843424089849
etotperatomref -105.9095421712
totalforceref 0.065532
totalstressref 360.030957
totaltimeref +1.52568
etotref -211.8190977082276731
etotperatomref -105.9095488541
totalforceref 0.065026
totalstressref 360.080238
totaltimeref +1.23848
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_c/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8207678703479360
etotperatomref -105.9103839352
totalforceref 0.046506
totalstressref 355.699480
totaltimeref +1.59702
etotref -211.8207812358708679
etotperatomref -105.9103906179
totalforceref 0.046272
totalstressref 355.720757
totaltimeref +1.21472
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_fix_volume/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8484410668845044
etotperatomref -105.9242205334
totalforceref 1.657758
totalstressref 397.924123
totaltimeref +1.51646
etotref -211.8484544306434998
etotperatomref -105.9242272153
totalforceref 1.658732
totalstressref 397.832826
totaltimeref +1.19204
10 changes: 5 additions & 5 deletions tests/integrate/109_PW_CR_moveatoms/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.8220593792576096
etotperatomref -105.9110296896
totalforceref 0.000046
totalstressref 348.864357
totaltimeref +1.38640
etotref -211.8220727461786623
etotperatomref -105.9110363731
totalforceref 0.000060
totalstressref 348.831786
totaltimeref +1.21771
10 changes: 5 additions & 5 deletions tests/integrate/120_PW_KP_MD_FIRE/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.7811196630946426
etotperatomref -105.8905598315
totalforceref 2.488928
totalstressref 438.340492
totaltimeref +0.75608
etotref -211.7811196632030146
etotperatomref -105.8905598316
totalforceref 2.488852
totalstressref 438.345326
totaltimeref +1.00831
10 changes: 5 additions & 5 deletions tests/integrate/120_PW_KP_MD_NVE/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.7811196630946426
etotperatomref -105.8905598315
totalforceref 2.488928
totalstressref 438.340492
totaltimeref +0.81354
etotref -211.7811196632030146
etotperatomref -105.8905598316
totalforceref 2.488852
totalstressref 438.345326
totaltimeref +1.00976
10 changes: 5 additions & 5 deletions tests/integrate/120_PW_KP_MD_NVT/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.7844289597302634
etotperatomref -105.8922144799
totalforceref 2.079832
totalstressref 427.615125
totaltimeref +0.74218
etotref -211.7844289596574754
etotperatomref -105.8922144798
totalforceref 2.079716
totalstressref 427.620463
totaltimeref +1.01257
10 changes: 5 additions & 5 deletions tests/integrate/170_PW_MD_1O/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.7989764183330408
etotperatomref -105.8994882092
totalforceref 0.673690
totalstressref 387.297991
totaltimeref +1.30228
etotref -211.7989767552216165
etotperatomref -105.8994883776
totalforceref 0.673666
totalstressref 387.295282
totaltimeref +1.49023
10 changes: 5 additions & 5 deletions tests/integrate/170_PW_MD_2O/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -211.7989763501604443
etotperatomref -105.8994881751
totalforceref 0.674650
totalstressref 387.345104
totaltimeref +1.21653
etotref -211.7989768004593714
etotperatomref -105.8994884002
totalforceref 0.674632
totalstressref 387.327664
totaltimeref +1.46934