Skip to content

Commit 8d6b780

Browse files
authored
Refactor: change the name of keyword force_thr_ev2 to force_zero_out for clarity (#6313)
* Refactor: change the name of keyword `force_thr_ev2` to `force_zero_out` for clarity * update the name of variable in unittest * update testfile
1 parent abcb9f2 commit 8d6b780

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
- [cal\_force](#cal_force)
119119
- [force\_thr](#force_thr)
120120
- [force\_thr\_ev](#force_thr_ev)
121-
- [force\_thr\_ev2](#force_thr_ev2)
121+
- [force\_zero\_out](#force_zero_out)
122122
- [relax\_bfgs\_w1](#relax_bfgs_w1)
123123
- [relax\_bfgs\_w2](#relax_bfgs_w2)
124124
- [relax\_bfgs\_rmax](#relax_bfgs_rmax)
@@ -1507,10 +1507,10 @@ These variables are used to control the geometry relaxation.
15071507
- **Default**: 0.0257112
15081508
- **Unit**: eV/Angstrom (0.03889 Ry/Bohr)
15091509

1510-
### force_thr_ev2
1510+
### force_zero_out
15111511

15121512
- **Type**: Real
1513-
- **Description**: The calculated force will be set to 0 when it is smaller than the parameter `force_thr_ev2`.
1513+
- **Description**: The force whose value is smaller than `force_zero_out` will be treated as zero.
15141514
- **Default**: 0.0
15151515
- **Unit**: eV/Angstrom
15161516

source/module_io/input_conv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ void Input_Conv::Convert()
177177

178178

179179
#ifdef __LCAO
180-
Force_Stress_LCAO<double>::force_invalid_threshold_ev = PARAM.inp.force_thr_ev2;
181-
Force_Stress_LCAO<std::complex<double>>::force_invalid_threshold_ev = PARAM.inp.force_thr_ev2;
180+
Force_Stress_LCAO<double>::force_invalid_threshold_ev = PARAM.inp.force_zero_out;
181+
Force_Stress_LCAO<std::complex<double>>::force_invalid_threshold_ev = PARAM.inp.force_zero_out;
182182
#endif
183183

184184
BFGS_Basic::relax_bfgs_w1 = PARAM.inp.relax_bfgs_w1;

source/module_io/read_input_item_relax.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ void ReadInput::item_relax()
109109
this->add_item(item);
110110
}
111111
{
112-
Input_Item item("force_thr_ev2");
112+
Input_Item item("force_zero_out");
113113
item.annotation = "force invalid threshold, unit: eV/Angstrom";
114-
read_sync_double(input.force_thr_ev2);
114+
read_sync_double(input.force_zero_out);
115115
this->add_item(item);
116116
}
117117
{

source/module_io/test/read_input_ptest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ TEST_F(InputParaTest, ParaRead)
107107
EXPECT_TRUE(param.inp.symmetry_autoclose);
108108
EXPECT_EQ(param.inp.cal_force, 0);
109109
EXPECT_NEAR(param.inp.force_thr, 1.0e-3, 1.0e-7);
110-
EXPECT_DOUBLE_EQ(param.inp.force_thr_ev2, 0);
110+
EXPECT_DOUBLE_EQ(param.inp.force_zero_out, 0);
111111
EXPECT_DOUBLE_EQ(param.inp.stress_thr, 1.0e-2);
112112
EXPECT_DOUBLE_EQ(param.inp.press1, 0.0);
113113
EXPECT_DOUBLE_EQ(param.inp.press2, 0.0);

source/module_io/test/support/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ relax_nmax 1 #number of ion iteration steps
102102
out_stru 0 #output the structure files after each ion step
103103
force_thr 0.001 #force threshold, unit: Ry/Bohr
104104
force_thr_ev 0.0257112 #force threshold, unit: eV/Angstrom
105-
force_thr_ev2 0 #force invalid threshold, unit: eV/Angstrom
105+
force_zero_out 0 #force invalid threshold, unit: eV/Angstrom
106106
relax_cg_thr 0.5 #threshold for switching from cg to bfgs, unit: eV/Angstrom
107107
stress_thr 0.01 #stress threshold
108108
press1 0 #target pressure, unit: KBar

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct Input_para
157157
double relax_cg_thr = 0.5; ///< threshold when cg to bfgs, pengfei add 2011-08-15
158158
double force_thr = -1; ///< threshold of force in unit (Ry/Bohr)
159159
double force_thr_ev = -1; ///< threshold of force in unit (eV/Angstrom)
160-
double force_thr_ev2 = 0; ///< invalid force threshold, mohan add 2011-04-17
160+
double force_zero_out = 0; ///< invalid force threshold, mohan add 2011-04-17
161161
double stress_thr = 0.5; ///< Pengfei Li 2017-11-01 ///<LiuXh update 20180515
162162
double press1 = 0;
163163
double press2 = 0;

0 commit comments

Comments
 (0)