Skip to content

Commit 4ec6f2a

Browse files
add some docs and comments
1 parent 86777d2 commit 4ec6f2a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
- [scf\_thr](#scf_thr)
8989
- [scf\_ene\_thr](#scf_ene_thr)
9090
- [scf\_thr\_type](#scf_thr_type)
91+
- [scf\_thr\_os](#scf_thr_os)
92+
- [scf\_os\_ndim](#scf_os_ndim)
9193
- [chg\_extrap](#chg_extrap)
9294
- [lspinorb](#lspinorb)
9395
- [noncolin](#noncolin)
@@ -1205,6 +1207,21 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12051207

12061208
- **Default**: 1 (plane-wave basis), or 2 (localized atomic orbital basis).
12071209

1210+
### scf_thr_os
1211+
1212+
- **Type**: double
1213+
- **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+
- **>=0**: The SCF will continue to run regardless of whether there is oscillation or not.
1215+
- **<0**: If the calculated slope is larger than `scf_thr_os`, stop the SCF.
1216+
1217+
- **Default**: 0
1218+
1219+
### scf_os_ndim
1220+
1221+
- **Type**: int
1222+
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
1223+
- **Default**: `mixing_ndim`
1224+
12081225
### chg_extrap
12091226

12101227
- **Type**: String

source/module_elecstate/module_charge/charge_mixing.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,7 @@ bool Charge_Mixing::if_scf_oscillate(const int iteration, const double drho, con
17311731
double slope = 0.0;
17321732

17331733
// Least Squares Method
1734+
// this part is too short, so I do not design it as a free function in principle
17341735
double sumX = 0, sumY = 0, sumXY = 0, sumXX = 0;
17351736
for (int i = iteration - iternum_used; i < iteration; i++)
17361737
{

0 commit comments

Comments
 (0)