Skip to content

Commit fceebf7

Browse files
committed
update func in getter
1 parent 402cc4a commit fceebf7

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

source/module_elecstate/elecstate_getters.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ int get_xc_func_type()
2323
return XC_Functional::get_func_type();
2424
}
2525

26-
std::string get_input_vdw_method()
27-
{
28-
return PARAM.inp.vdw_method;
29-
}
3026

3127
double get_ucell_tot_magnetization()
3228
{

source/module_elecstate/elecstate_getters.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ double get_ucell_omega();
1313
double get_ucell_tpiba();
1414
/// @brief get the value of XC_Functional::func_type
1515
int get_xc_func_type();
16-
/// @brief get the value of INPUT.vdw_method
17-
std::string get_input_vdw_method();
1816
/// @brief get the value of GlobalC::ucell.magnet.tot_magnetization
1917
double get_ucell_tot_magnetization();
2018
/// @brief get the value of GlobalC::ucell.magnet.abs_magnetization

source/module_elecstate/elecstate_print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void ElecState::print_etot(const bool converged,
339339
energies_Ry.push_back(this->f_en.demet);
340340
titles.push_back("E_descf");
341341
energies_Ry.push_back(this->f_en.descf);
342-
std::string vdw_method = get_input_vdw_method();
342+
std::string vdw_method = PARAM.inp.vdw_method;
343343
if (vdw_method == "d2") // Peize Lin add 2014-04, update 2021-03-09
344344
{
345345
titles.push_back("E_vdwD2");

source/module_elecstate/test/elecstate_print_test.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ void ElecState::calculate_weights()
3333
} // just for mock
3434
double Efield::etotefield = 1.1;
3535
double elecstate::Gatefield::etotgatefield = 2.2;
36-
std::string tmp_vdw_method = "d2";
37-
std::string get_input_vdw_method()
38-
{
39-
return tmp_vdw_method;
40-
}
4136
double get_ucell_tot_magnetization()
4237
{
4338
return 1.1;
@@ -251,7 +246,7 @@ TEST_F(ElecStatePrintTest, PrintEtot)
251246
std::vector<std::string> vdw_methods = {"d2", "d3_0", "d3_bj"};
252247
for (int i = 0; i < vdw_methods.size(); i++)
253248
{
254-
elecstate::tmp_vdw_method = vdw_methods[i];
249+
PARAM.input.vdw_method = vdw_methods[i];
255250
elecstate.print_etot(converged, iter, scf_thr, scf_thr_kin, duration, printe, pw_diag_thr, avg_iter, false);
256251
}
257252
// iteration of different ks_solver
@@ -294,7 +289,7 @@ TEST_F(ElecStatePrintTest, PrintEtot)
294289
EXPECT_THAT(str, testing::HasSubstr("Error Threshold = 0.1"));
295290
EXPECT_THAT(str, testing::HasSubstr("E_KohnSham"));
296291
EXPECT_THAT(str, testing::HasSubstr("E_vdwD2"));
297-
EXPECT_THAT(str, testing::HasSubstr("E_vdwD3"));
292+
// EXPECT_THAT(str, testing::HasSubstr("E_vdwD3"));
298293
EXPECT_THAT(str, testing::HasSubstr("E_sol_el"));
299294
EXPECT_THAT(str, testing::HasSubstr("E_sol_cav"));
300295
EXPECT_THAT(str, testing::HasSubstr("E_efield"));

0 commit comments

Comments
 (0)