Skip to content

Commit bcd549f

Browse files
Refactor: Remove final_scf
1 parent 4737f8a commit bcd549f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

source/module_cell/k_vector_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void k_vec_c2d(K_Vectors& kv, const ModuleBase::Matrix3& latvec)
7777

7878
void set_both_kvec(K_Vectors& kv, const ModuleBase::Matrix3& G, const ModuleBase::Matrix3& R, std::string& skpt)
7979
{
80-
if (PARAM.inp.final_scf) // Todo: Any way to avoid directly using input variables?
80+
if (true) // Originally GlobalV::FINAL_SCF, but we don't have this variable in the new code.
8181
{
8282
if (kv.k_nkstot == 0)
8383
{

source/module_cell/test/klist_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ TEST_F(KlistTest, SetBothKvecFinalSCF)
650650
kv->kvec_c[0].y = 0.0;
651651
kv->kvec_c[0].z = 0.0;
652652
std::string skpt;
653-
PARAM.input.final_scf = true;
653+
// PARAM.input.final_scf = true;
654654
kv->kd_done = false;
655655
kv->kc_done = false;
656656
// case 1
@@ -697,7 +697,7 @@ TEST_F(KlistTest, SetBothKvec)
697697
kv->kc_done = false;
698698
kv->kd_done = true;
699699
std::string skpt;
700-
PARAM.input.final_scf = false;
700+
// PARAM.input.final_scf = false;
701701
// kv->set_both_kvec(ucell.G, ucell.latvec, skpt);
702702
KVectorUtils::set_both_kvec(*kv, ucell.G, ucell.latvec, skpt);
703703
EXPECT_TRUE(kv->kc_done);

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct Input_para
115115
double scf_thr = -1.0; ///< \sum |rhog_out - rhog_in |^2
116116
double scf_ene_thr = -1.0; ///< energy threshold for scf convergence, in eV
117117
int scf_thr_type = -1; ///< type of the criterion of scf_thr, 1: reci drho, 2: real drho
118-
bool final_scf = false; ///< whether to do final scf
118+
// bool final_scf = false; ///< whether to do final scf
119119
bool scf_os_stop = false; ///< whether to stop scf when oscillation is detected
120120
double scf_os_thr = -0.01; ///< drho threshold for oscillation
121121
int scf_os_ndim = 0; ///< number of old iterations used for oscillation detection

0 commit comments

Comments
 (0)