Skip to content

Commit 362908d

Browse files
committed
update read_input_ptest.cpp and read_input_item_test.cpp
1 parent a9e79d1 commit 362908d

File tree

3 files changed

+25
-46
lines changed

3 files changed

+25
-46
lines changed

source/module_io/test/read_input_ptest.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,26 +278,24 @@ TEST_F(InputParaTest, ParaRead)
278278
EXPECT_EQ(param.inp.vdw_cutoff_period[0], 3);
279279
EXPECT_EQ(param.inp.vdw_cutoff_period[1], 3);
280280
EXPECT_EQ(param.inp.vdw_cutoff_period[2], 3);
281-
EXPECT_EQ(std::stod(param.inp.exx_hybrid_alpha), 0.25);
281+
EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_fock_alpha[0]), 1);
282+
EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_erfc_alpha[0]), 0.25);
282283
EXPECT_EQ(param.inp.exx_real_number, "1");
283-
EXPECT_DOUBLE_EQ(param.inp.exx_hse_omega, 0.11);
284+
EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_erfc_omega[0]), 0.11);
284285
EXPECT_TRUE(param.inp.exx_separate_loop);
285286
EXPECT_EQ(param.inp.exx_hybrid_step, 100);
286-
EXPECT_DOUBLE_EQ(param.inp.exx_lambda, 0.3);
287+
EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_fock_lambda[0]), 0.3);
287288
EXPECT_DOUBLE_EQ(param.inp.exx_mixing_beta, 1.0);
288289
EXPECT_DOUBLE_EQ(param.inp.exx_pca_threshold, 0);
289290
EXPECT_DOUBLE_EQ(param.inp.exx_c_threshold, 0);
290291
EXPECT_DOUBLE_EQ(param.inp.exx_v_threshold, 0);
291292
EXPECT_DOUBLE_EQ(param.inp.exx_dm_threshold, 0);
292-
EXPECT_DOUBLE_EQ(param.inp.exx_schwarz_threshold, 0);
293-
EXPECT_DOUBLE_EQ(param.inp.exx_cauchy_threshold, 0);
294293
EXPECT_DOUBLE_EQ(param.inp.exx_c_grad_threshold, 0);
295294
EXPECT_DOUBLE_EQ(param.inp.exx_v_grad_threshold, 0);
296-
EXPECT_DOUBLE_EQ(param.inp.exx_cauchy_force_threshold, 0);
297-
EXPECT_DOUBLE_EQ(param.inp.exx_cauchy_stress_threshold, 0);
295+
EXPECT_DOUBLE_EQ(param.inp.exx_c_grad_r_threshold, 0);
296+
EXPECT_DOUBLE_EQ(param.inp.exx_v_grad_r_threshold, 0);
298297
EXPECT_EQ(param.inp.exx_ccp_rmesh_times, "1.5");
299298
EXPECT_DOUBLE_EQ(param.inp.rpa_ccp_rmesh_times, 10.0);
300-
EXPECT_EQ(param.inp.exx_distribute_type, "htime");
301299
EXPECT_EQ(param.inp.exx_opt_orb_lmax, 0);
302300
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_ecut, 0.0);
303301
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_tolerence, 0.0);

source/module_io/test/support/INPUT

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,23 @@ vdw_cn_thr_unit Bohr #unit of cn_thr, Bohr or Angstrom
274274
vdw_cutoff_period 3 3 3 #periods of periodic structure
275275

276276
#Parameters (14.exx)
277-
exx_hybrid_alpha default #
278-
exx_hse_omega 0.11 #
277+
exx_fock_alpha 1 #
278+
exx_erfc_alpha 0.25 #
279+
exx_erfc_omega 0.11 #
279280
exx_separate_loop 1 #0 or 1
280281
exx_hybrid_step 100 #
281282
exx_mixing_beta 1.0 #
282-
exx_lambda 0.3 #
283+
exx_fock_lambda 0.3 #
283284
exx_real_number default #0 or 1
284285
exx_pca_threshold 0 #
285286
exx_c_threshold 0 #
286287
exx_v_threshold 0 #
287288
exx_dm_threshold 0 #
288-
exx_schwarz_threshold 0 #
289-
exx_cauchy_threshold 0 #
290289
exx_c_grad_threshold 0 #
291290
exx_v_grad_threshold 0 #
292-
exx_cauchy_force_threshold 0 #
293-
exx_cauchy_stress_threshold 0 #
291+
exx_c_grad_r_threshold 0 #
292+
exx_v_grad_r_threshold 0 #
294293
exx_ccp_rmesh_times default #
295-
exx_distribute_type htime #htime or kmeans1 or kmeans2
296294
exx_opt_orb_lmax 0 #
297295
exx_opt_orb_ecut 0 #
298296
exx_opt_orb_tolerence 0 #

source/module_io/test_serial/read_input_item_test.cpp

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,38 +1263,29 @@ TEST_F(InputTest, Item_test2)
12631263
output = testing::internal::GetCapturedStdout();
12641264
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
12651265
}
1266-
{ // exx_hybrid_alpha
1267-
auto it = find_label("exx_hybrid_alpha", readinput.input_lists);
1268-
param.input.exx_hybrid_alpha = "default";
1266+
{ // exx_fock_alpha
1267+
auto it = find_label("exx_fock_alpha", readinput.input_lists);
1268+
param.input.exx_fock_alpha[0] = "default";
12691269
param.input.dft_functional = "HF";
12701270
it->second.reset_value(it->second, param);
1271-
EXPECT_EQ(param.input.exx_hybrid_alpha, "1");
1271+
EXPECT_EQ(param.input.exx_fock_alpha[0], "1");
12721272

1273-
param.input.exx_hybrid_alpha = "default";
1273+
param.input.exx_fock_alpha[0] = "default";
12741274
param.input.dft_functional = "PBE0";
12751275
it->second.reset_value(it->second, param);
1276-
EXPECT_EQ(param.input.exx_hybrid_alpha, "0.25");
1276+
EXPECT_EQ(param.input.exx_fock_alpha[0], "0.25");
12771277

1278-
param.input.exx_hybrid_alpha = "default";
1278+
param.input.exx_fock_alpha[0] = "default";
12791279
param.input.dft_functional = "SCAN0";
12801280
it->second.reset_value(it->second, param);
1281-
EXPECT_EQ(param.input.exx_hybrid_alpha, "0.25");
1282-
1283-
param.input.exx_hybrid_alpha = "default";
1281+
EXPECT_EQ(param.input.exx_fock_alpha[0], "0.25");
1282+
}
1283+
{ // exx_erfc_alpha
1284+
auto it = find_label("exx_erfc_alpha", readinput.input_lists);
1285+
param.input.exx_erfc_alpha[0] = "default";
12841286
param.input.dft_functional = "HSE";
12851287
it->second.reset_value(it->second, param);
1286-
EXPECT_EQ(param.input.exx_hybrid_alpha, "0.25");
1287-
1288-
param.input.exx_hybrid_alpha = "default";
1289-
param.input.dft_functional = "none";
1290-
it->second.reset_value(it->second, param);
1291-
EXPECT_EQ(param.input.exx_hybrid_alpha, "0");
1292-
1293-
param.input.exx_hybrid_alpha = "-1";
1294-
testing::internal::CaptureStdout();
1295-
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
1296-
output = testing::internal::GetCapturedStdout();
1297-
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
1288+
EXPECT_EQ(param.input.exx_erfc_alpha[0], "0.25");
12981289
}
12991290
{ // exx_hybrid_step
13001291
auto it = find_label("exx_hybrid_step", readinput.input_lists);
@@ -1349,14 +1340,6 @@ TEST_F(InputTest, Item_test2)
13491340
output = testing::internal::GetCapturedStdout();
13501341
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
13511342
}
1352-
{ // exx_distribute_type
1353-
auto it = find_label("exx_distribute_type", readinput.input_lists);
1354-
param.input.exx_distribute_type = "none";
1355-
testing::internal::CaptureStdout();
1356-
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
1357-
output = testing::internal::GetCapturedStdout();
1358-
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
1359-
}
13601343
{ // exx_opt_orb_lmax
13611344
auto it = find_label("exx_opt_orb_lmax", readinput.input_lists);
13621345
param.input.exx_opt_orb_lmax = -1;

0 commit comments

Comments
 (0)