Skip to content

Commit 1e6ab76

Browse files
committed
Rename input parameters
1 parent c44750f commit 1e6ab76

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

docs/advanced/input_files/input-main.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@
431431
- [vdw\_cutoff\_type](#vdw_cutoff_type)
432432
- [vdw\_cutoff\_radius](#vdw_cutoff_radius)
433433
- [vdw\_radius\_unit](#vdw_radius_unit)
434-
- [vdw\_cutoff\_smooth\_width\_2b](#vdw_cutoff_smooth_width_2b)
435-
- [vdw\_cutoff\_smooth\_width\_3b](#vdw_cutoff_smooth_width_3b)
434+
- [vdw\_cutoff\_width2](#vdw_cutoff_width2)
435+
- [vdw\_cutoff\_width3](#vdw_cutoff_width3)
436436
- [vdw\_cutoff\_period](#vdw_cutoff_period)
437437
- [vdw\_cn\_thr](#vdw_cn_thr)
438438
- [vdw\_cn\_thr\_unit](#vdw_cn_thr_unit)
@@ -4064,7 +4064,7 @@
40644064
- Bohr
40654065
- **Default**: Bohr
40664066

4067-
### vdw_cutoff_smooth_width_2b
4067+
### vdw_cutoff_width2
40684068

40694069
- **Type**: Real
40704070
- **Availability**: *[`vdw_method`](#vdw_method)==d4*
@@ -4073,7 +4073,7 @@
40734073
- **Default**: 0.05
40744074
- **Unit**: Bohr
40754075

4076-
### vdw_cutoff_smooth_width_3b
4076+
### vdw_cutoff_width3
40774077

40784078
- **Type**: Real
40794079
- **Availability**: *[`vdw_method`](#vdw_method)==d4*

docs/parameters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,7 +4312,7 @@ parameters:
43124312
default_value: Bohr
43134313
unit: ""
43144314
availability: vdw_cutoff_type==radius
4315-
- name: vdw_cutoff_smooth_width_2b
4315+
- name: vdw_cutoff_width2
43164316
category: vdW correction
43174317
type: Real
43184318
description: |
@@ -4321,7 +4321,7 @@ parameters:
43214321
default_value: "0.05"
43224322
unit: Bohr
43234323
availability: vdw_method==d4
4324-
- name: vdw_cutoff_smooth_width_3b
4324+
- name: vdw_cutoff_width3
43254325
category: vdW correction
43264326
type: Real
43274327
description: |

source/source_hamilt/module_vdw/vdwd4.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ Vdwd4::Vdwd4(const UnitCell& unit_in, const std::string& xc_name, const Input_pa
8686
cutoff_disp2_ = cutoff_to_bohr(input.vdw_cutoff_radius, input.vdw_radius_unit);
8787
cutoff_disp3_ = std::min(40.0, cutoff_disp2_);
8888
cutoff_cn_ = length_to_bohr(input.vdw_cn_thr, input.vdw_cn_thr_unit);
89-
smooth_width_2b_ = input.vdw_cutoff_smooth_width_2b;
90-
smooth_width_3b_ = input.vdw_cutoff_smooth_width_3b;
89+
smooth_width_2b_ = input.vdw_cutoff_width2;
90+
smooth_width_3b_ = input.vdw_cutoff_width3;
9191

9292
if (smooth_width_2b_ < 0.0 || smooth_width_2b_ > cutoff_disp2_)
9393
{
9494
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
95-
"vdw_cutoff_smooth_width_2b must satisfy 0 <= width <= two-body cutoff");
95+
"vdw_cutoff_width2 must satisfy 0 <= width <= two-body cutoff");
9696
}
9797
if (smooth_width_3b_ < 0.0 || smooth_width_3b_ > cutoff_disp3_)
9898
{
9999
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
100-
"vdw_cutoff_smooth_width_3b must satisfy 0 <= width <= three-body cutoff");
100+
"vdw_cutoff_width3 must satisfy 0 <= width <= three-body cutoff");
101101
}
102102

103103
double valence_charge = 0.0;

source/source_io/module_parameter/input_parameter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ struct Input_para
569569
///< structure, radius or period
570570
std::string vdw_cutoff_radius = "default"; ///< radius cutoff for periodic structure
571571
std::string vdw_radius_unit = "Bohr"; ///< unit of radius cutoff for periodic structure
572-
double vdw_cutoff_smooth_width_2b = 0.05; ///< smooth cutoff width for two-body dispersion, Bohr
573-
double vdw_cutoff_smooth_width_3b = 0.05; ///< smooth cutoff width for three-body dispersion, Bohr
572+
double vdw_cutoff_width2 = 0.05; ///< smooth cutoff width for two-body dispersion, Bohr
573+
double vdw_cutoff_width3 = 0.05; ///< smooth cutoff width for three-body dispersion, Bohr
574574
double vdw_cn_thr = 40.0; ///< radius cutoff for cn
575575
std::string vdw_cn_thr_unit = "Bohr"; ///< unit of cn_thr, Bohr or Angstrom
576576
std::string vdw_d4_xc = "default"; ///< functional name passed to DFT-D4

source/source_io/module_parameter/read_inp_model.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ Namely, each line contains the element name and the corresponding parameter.)";
573573
this->add_item(item);
574574
}
575575
{
576-
Input_Item item("vdw_cutoff_smooth_width_2b");
576+
Input_Item item("vdw_cutoff_width2");
577577
item.annotation = "smooth cutoff width for two-body dispersion";
578578
item.category = "vdW correction";
579579
item.type = "Real";
@@ -582,17 +582,17 @@ A value of zero disables smoothing for the two-body contribution.)";
582582
item.default_value = "0.05";
583583
item.unit = "Bohr";
584584
item.set_availability("vdw_method==d4");
585-
read_sync_double(input.vdw_cutoff_smooth_width_2b);
585+
read_sync_double(input.vdw_cutoff_width2);
586586
item.check_value = [](const Input_Item& item, const Parameter& para) {
587-
if (para.input.vdw_cutoff_smooth_width_2b < 0.0)
587+
if (para.input.vdw_cutoff_width2 < 0.0)
588588
{
589-
ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_smooth_width_2b must be non-negative");
589+
ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_width2 must be non-negative");
590590
}
591591
};
592592
this->add_item(item);
593593
}
594594
{
595-
Input_Item item("vdw_cutoff_smooth_width_3b");
595+
Input_Item item("vdw_cutoff_width3");
596596
item.annotation = "smooth cutoff width for three-body dispersion";
597597
item.category = "vdW correction";
598598
item.type = "Real";
@@ -601,11 +601,11 @@ A value of zero disables smoothing for the three-body contribution.)";
601601
item.default_value = "0.05";
602602
item.unit = "Bohr";
603603
item.set_availability("vdw_method==d4");
604-
read_sync_double(input.vdw_cutoff_smooth_width_3b);
604+
read_sync_double(input.vdw_cutoff_width3);
605605
item.check_value = [](const Input_Item& item, const Parameter& para) {
606-
if (para.input.vdw_cutoff_smooth_width_3b < 0.0)
606+
if (para.input.vdw_cutoff_width3 < 0.0)
607607
{
608-
ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_smooth_width_3b must be non-negative");
608+
ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_width3 must be non-negative");
609609
}
610610
};
611611
this->add_item(item);

source/source_io/test/read_input_ptest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ TEST_F(InputParaTest, ParaRead)
274274
EXPECT_FALSE(param.inp.vdw_abc);
275275
EXPECT_EQ(std::stod(param.inp.vdw_cutoff_radius), 56.6918);
276276
EXPECT_EQ(param.inp.vdw_radius_unit, "Bohr");
277-
EXPECT_DOUBLE_EQ(param.inp.vdw_cutoff_smooth_width_2b, 0.05);
278-
EXPECT_DOUBLE_EQ(param.inp.vdw_cutoff_smooth_width_3b, 0.05);
277+
EXPECT_DOUBLE_EQ(param.inp.vdw_cutoff_width2, 0.05);
278+
EXPECT_DOUBLE_EQ(param.inp.vdw_cutoff_width3, 0.05);
279279
EXPECT_DOUBLE_EQ(param.inp.vdw_cn_thr, 40.0);
280280
EXPECT_EQ(param.inp.vdw_cn_thr_unit, "Bohr");
281281
EXPECT_EQ(param.inp.vdw_C6_file, "default");

source/source_io/test_serial/read_input_item_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,17 +1440,17 @@ TEST_F(InputTest, Item_test2)
14401440
output = testing::internal::GetCapturedStdout();
14411441
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
14421442
}
1443-
{ // vdw_cutoff_smooth_width_2b
1444-
auto it = find_label("vdw_cutoff_smooth_width_2b", readinput.input_lists);
1445-
param.input.vdw_cutoff_smooth_width_2b = -1.0;
1443+
{ // vdw_cutoff_width2
1444+
auto it = find_label("vdw_cutoff_width2", readinput.input_lists);
1445+
param.input.vdw_cutoff_width2 = -1.0;
14461446
testing::internal::CaptureStdout();
14471447
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
14481448
output = testing::internal::GetCapturedStdout();
14491449
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
14501450
}
1451-
{ // vdw_cutoff_smooth_width_3b
1452-
auto it = find_label("vdw_cutoff_smooth_width_3b", readinput.input_lists);
1453-
param.input.vdw_cutoff_smooth_width_3b = -1.0;
1451+
{ // vdw_cutoff_width3
1452+
auto it = find_label("vdw_cutoff_width3", readinput.input_lists);
1453+
param.input.vdw_cutoff_width3 = -1.0;
14541454
testing::internal::CaptureStdout();
14551455
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
14561456
output = testing::internal::GetCapturedStdout();

0 commit comments

Comments
 (0)