diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 2c83ed749d..d7250f7f33 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -118,7 +118,7 @@ - [cal\_force](#cal_force) - [force\_thr](#force_thr) - [force\_thr\_ev](#force_thr_ev) - - [force\_thr\_ev2](#force_thr_ev2) + - [force\_zero\_out](#force_zero_out) - [relax\_bfgs\_w1](#relax_bfgs_w1) - [relax\_bfgs\_w2](#relax_bfgs_w2) - [relax\_bfgs\_rmax](#relax_bfgs_rmax) @@ -1507,10 +1507,10 @@ These variables are used to control the geometry relaxation. - **Default**: 0.0257112 - **Unit**: eV/Angstrom (0.03889 Ry/Bohr) -### force_thr_ev2 +### force_zero_out - **Type**: Real -- **Description**: The calculated force will be set to 0 when it is smaller than the parameter `force_thr_ev2`. +- **Description**: The force whose value is smaller than `force_zero_out` will be treated as zero. - **Default**: 0.0 - **Unit**: eV/Angstrom diff --git a/source/module_io/input_conv.cpp b/source/module_io/input_conv.cpp index 00d7491d36..b6ceaff1bd 100644 --- a/source/module_io/input_conv.cpp +++ b/source/module_io/input_conv.cpp @@ -177,8 +177,8 @@ void Input_Conv::Convert() #ifdef __LCAO - Force_Stress_LCAO::force_invalid_threshold_ev = PARAM.inp.force_thr_ev2; - Force_Stress_LCAO>::force_invalid_threshold_ev = PARAM.inp.force_thr_ev2; + Force_Stress_LCAO::force_invalid_threshold_ev = PARAM.inp.force_zero_out; + Force_Stress_LCAO>::force_invalid_threshold_ev = PARAM.inp.force_zero_out; #endif BFGS_Basic::relax_bfgs_w1 = PARAM.inp.relax_bfgs_w1; diff --git a/source/module_io/read_input_item_relax.cpp b/source/module_io/read_input_item_relax.cpp index 80c012b6ff..cc0efa2464 100644 --- a/source/module_io/read_input_item_relax.cpp +++ b/source/module_io/read_input_item_relax.cpp @@ -109,9 +109,9 @@ void ReadInput::item_relax() this->add_item(item); } { - Input_Item item("force_thr_ev2"); + Input_Item item("force_zero_out"); item.annotation = "force invalid threshold, unit: eV/Angstrom"; - read_sync_double(input.force_thr_ev2); + read_sync_double(input.force_zero_out); this->add_item(item); } { diff --git a/source/module_io/test/read_input_ptest.cpp b/source/module_io/test/read_input_ptest.cpp index 2ec4bdce1d..058c895376 100644 --- a/source/module_io/test/read_input_ptest.cpp +++ b/source/module_io/test/read_input_ptest.cpp @@ -107,7 +107,7 @@ TEST_F(InputParaTest, ParaRead) EXPECT_TRUE(param.inp.symmetry_autoclose); EXPECT_EQ(param.inp.cal_force, 0); EXPECT_NEAR(param.inp.force_thr, 1.0e-3, 1.0e-7); - EXPECT_DOUBLE_EQ(param.inp.force_thr_ev2, 0); + EXPECT_DOUBLE_EQ(param.inp.force_zero_out, 0); EXPECT_DOUBLE_EQ(param.inp.stress_thr, 1.0e-2); EXPECT_DOUBLE_EQ(param.inp.press1, 0.0); EXPECT_DOUBLE_EQ(param.inp.press2, 0.0); diff --git a/source/module_io/test/support/INPUT b/source/module_io/test/support/INPUT index b6d31ba51a..d366d5b0db 100644 --- a/source/module_io/test/support/INPUT +++ b/source/module_io/test/support/INPUT @@ -102,7 +102,7 @@ relax_nmax 1 #number of ion iteration steps out_stru 0 #output the structure files after each ion step force_thr 0.001 #force threshold, unit: Ry/Bohr force_thr_ev 0.0257112 #force threshold, unit: eV/Angstrom -force_thr_ev2 0 #force invalid threshold, unit: eV/Angstrom +force_zero_out 0 #force invalid threshold, unit: eV/Angstrom relax_cg_thr 0.5 #threshold for switching from cg to bfgs, unit: eV/Angstrom stress_thr 0.01 #stress threshold press1 0 #target pressure, unit: KBar diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 548e7da575..ad918356cc 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -157,7 +157,7 @@ struct Input_para double relax_cg_thr = 0.5; ///< threshold when cg to bfgs, pengfei add 2011-08-15 double force_thr = -1; ///< threshold of force in unit (Ry/Bohr) double force_thr_ev = -1; ///< threshold of force in unit (eV/Angstrom) - double force_thr_ev2 = 0; ///< invalid force threshold, mohan add 2011-04-17 + double force_zero_out = 0; ///< invalid force threshold, mohan add 2011-04-17 double stress_thr = 0.5; ///< Pengfei Li 2017-11-01 ///