Skip to content

Commit 2af9154

Browse files
rename scf_thr_os as scf_os_thr
1 parent d8eda67 commit 2af9154

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
- [scf\_ene\_thr](#scf_ene_thr)
9090
- [scf\_thr\_type](#scf_thr_type)
9191
- [scf\_os\_stop](#scf_os_stop)
92-
- [scf\_thr\_os](#scf_thr_os)
92+
- [scf\_os\_thr](#scf_os_thr)
9393
- [scf\_os\_ndim](#scf_os_ndim)
9494
- [chg\_extrap](#chg_extrap)
9595
- [lspinorb](#lspinorb)
@@ -1211,19 +1211,19 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12111211
### scf_os_stop
12121212

12131213
- **Type**: bool
1214-
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_thr_os`, stop the SCF.
1214+
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
12151215

12161216
- **0**: The SCF will continue to run regardless of whether there is oscillation or not.
1217-
- **1**: If the calculated slope is larger than `scf_thr_os`, stop the SCF.
1217+
- **1**: If the calculated slope is larger than `scf_os_thr`, stop the SCF.
12181218

12191219
- **Default**: false
12201220

1221-
### scf_thr_os
1221+
### scf_os_thr
12221222

12231223
- **Type**: double
1224-
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_thr_os`, stop the SCF.
1224+
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
12251225
- **>=0**: The SCF will continue to run regardless of whether there is oscillation or not.
1226-
- **<0**: If the calculated slope is larger than `scf_thr_os`, stop the SCF.
1226+
- **<0**: If the calculated slope is larger than `scf_os_thr`, stop the SCF.
12271227

12281228
- **Default**: 0
12291229

source/module_elecstate/test/charge_mixing_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ TEST_F(ChargeMixingTest, SCFOscillationTest)
10301030
Charge_Mixing CMtest;
10311031
int scf_nmax = 20;
10321032
int scf_os_ndim = 3;
1033-
double scf_thr_os = -0.05;
1033+
double scf_os_thr = -0.05;
10341034
bool scf_oscillate = false;
10351035
std::vector<double> drho(scf_nmax, 0.0);
10361036
std::vector<bool> scf_oscillate_ref(scf_nmax, false);
@@ -1058,7 +1058,7 @@ TEST_F(ChargeMixingTest, SCFOscillationTest)
10581058
false,false,true,false,false,true,true,true,true,true};
10591059
for (int i = 1; i <= scf_nmax; ++i)
10601060
{
1061-
scf_oscillate = CMtest.if_scf_oscillate(i,drho[i-1],scf_os_ndim,scf_thr_os);
1061+
scf_oscillate = CMtest.if_scf_oscillate(i,drho[i-1],scf_os_ndim,scf_os_thr);
10621062
EXPECT_EQ(scf_oscillate, scf_oscillate_ref[i-1]);
10631063
}
10641064
}

source/module_esolver/esolver_ks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell)
534534

535535
if (PARAM.inp.scf_os_stop) // if oscillation is detected, SCF will stop
536536
{
537-
this->oscillate_esolver = this->p_chgmix->if_scf_oscillate(iter, drho, PARAM.inp.scf_os_ndim, PARAM.inp.scf_thr_os);
537+
this->oscillate_esolver = this->p_chgmix->if_scf_oscillate(iter, drho, PARAM.inp.scf_os_ndim, PARAM.inp.scf_os_thr);
538538
}
539539

540540
// drho will be 0 at this->p_chgmix->mixing_restart step, which is

source/module_io/read_input_item_elec_stru.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ void ReadInput::item_elec_stru()
535535
this->add_item(item);
536536
}
537537
{
538-
Input_Item item("scf_thr_os");
538+
Input_Item item("scf_os_thr");
539539
item.annotation = "charge density threshold for oscillation";
540-
read_sync_double(input.scf_thr_os);
540+
read_sync_double(input.scf_os_thr);
541541
this->add_item(item);
542542
}
543543
{

source/module_io/test/read_input_ptest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ TEST_F(InputParaTest, ParaRead)
165165
EXPECT_EQ(param.inp.test_stress, 0);
166166
EXPECT_NEAR(param.inp.scf_thr, 1.0e-8, 1.0e-15);
167167
EXPECT_EQ(param.inp.scf_os_stop, 1);
168-
EXPECT_NEAR(param.inp.scf_thr_os, -0.02, 1.0e-15);
168+
EXPECT_NEAR(param.inp.scf_os_thr, -0.02, 1.0e-15);
169169
EXPECT_EQ(param.inp.scf_os_ndim, 10);
170170
EXPECT_NEAR(param.inp.scf_ene_thr, 1.0e-6, 1.0e-15);
171171
EXPECT_EQ(param.inp.scf_nmax, 50);

source/module_io/test/support/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pw_diag_thr 0.01 #threshold for eigenvalues is cg electron it
5353
scf_thr 1e-08 #charge density error
5454
scf_ene_thr 1e-06 #total energy error threshold
5555
scf_os_stop 1 #whether to stop scf when oscillation is detected
56-
scf_thr_os -0.02 #charge density threshold for oscillation
56+
scf_os_thr -0.02 #charge density threshold for oscillation
5757
scf_os_ndim 10 #number of old iterations used for oscillation detection
5858
scf_thr_type 2 #type of the criterion of scf_thr, 1: reci drho for pw, 2: real drho for lcao
5959
init_wfc atomic #start wave functions are from 'atomic', 'atomic+random', 'random' or 'file'

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct Input_para
116116
int scf_thr_type = -1; ///< type of the criterion of scf_thr, 1: reci drho, 2: real drho
117117
bool final_scf = false; ///< whether to do final scf
118118
bool scf_os_stop = false; ///< whether to stop scf when oscillation is detected
119-
double scf_thr_os = -0.01; ///< drho threshold for oscillation
119+
double scf_os_thr = -0.01; ///< drho threshold for oscillation
120120
int scf_os_ndim = 0; ///< number of old iterations used for oscillation detection
121121

122122
bool lspinorb = false; ///< consider the spin-orbit interaction

0 commit comments

Comments
 (0)