Skip to content

Commit 64d73a9

Browse files
committed
change the INPUT check of exx_ccp_rmesh_times
1 parent 275442c commit 64d73a9

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3030,7 +3030,7 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
30303030
### exx_ccp_rmesh_times
30313031

30323032
- **Type**: Real
3033-
- **Description**: This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. The value should be at least 1. Reducing this value can effectively increase the speed of self-consistent calculations using hybrid functionals.
3033+
- **Description**: This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. The value should be larger than 0. Reducing this value can effectively increase the speed of self-consistent calculations using hybrid functionals.
30343034
- **Default**:
30353035
- 5: if *[dft_functional](#dft_functional)==hf/pbe0/scan0/muller/power/wp22*
30363036
- 1.5: if *[dft_functional](#dft_functional)==hse/cwp22*

source/source_io/read_input_item_exx_dftu.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ void ReadInput::item_exx()
331331
}
332332
}
333333
};
334-
//item.check_value = [](const Input_Item& item, const Parameter& para) {
335-
// if (std::stod(para.input.exx_ccp_rmesh_times) < 1)
336-
// {
337-
// ModuleBase::WARNING_QUIT("ReadInput", "exx_ccp_rmesh_times must >= 1");
338-
// }
339-
//};
334+
item.check_value = [](const Input_Item& item, const Parameter& para) {
335+
if (std::stod(para.input.exx_ccp_rmesh_times) <=0)
336+
{
337+
ModuleBase::WARNING_QUIT("ReadInput", "exx_ccp_rmesh_times must > 0");
338+
}
339+
};
340340
this->add_item(item);
341341
}
342342
{

source/source_io/test_serial/read_input_item_test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,12 @@ TEST_F(InputTest, Item_test2)
13961396
param.input.dft_functional = "none";
13971397
it->second.reset_value(it->second, param);
13981398
EXPECT_EQ(param.input.exx_ccp_rmesh_times, "1");
1399+
1400+
param.input.exx_ccp_rmesh_times = "-1";
1401+
testing::internal::CaptureStdout();
1402+
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
1403+
output = testing::internal::GetCapturedStdout();
1404+
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
13991405
}
14001406
{ // exx_opt_orb_ecut
14011407
auto it = find_label("exx_opt_orb_ecut", readinput.input_lists);

0 commit comments

Comments
 (0)