Skip to content

Commit 5b19d01

Browse files
fixing issue #5961 (#6071)
1 parent cac78df commit 5b19d01

File tree

7 files changed

+83
-16
lines changed

7 files changed

+83
-16
lines changed

source/module_esolver/esolver_ks.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,6 @@ void ESolver_KS<T, Device>::before_all_runners(UnitCell& ucell, const Input_para
106106
//! 1) initialize "before_all_runniers" in ESolver_FP
107107
ESolver_FP::before_all_runners(ucell, inp);
108108

109-
//! 2) setup the charge mixing parameters
110-
p_chgmix->set_mixing(PARAM.inp.mixing_mode,
111-
PARAM.inp.mixing_beta,
112-
PARAM.inp.mixing_ndim,
113-
PARAM.inp.mixing_gg0,
114-
PARAM.inp.mixing_tau,
115-
PARAM.inp.mixing_beta_mag,
116-
PARAM.inp.mixing_gg0_mag,
117-
PARAM.inp.mixing_gg0_min,
118-
PARAM.inp.mixing_angle,
119-
PARAM.inp.mixing_dmr,
120-
ucell.omega,
121-
ucell.tpiba);
122-
p_chgmix->init_mixing();
123-
124109
/// PAW Section
125110
#ifdef USE_PAW
126111
if (PARAM.inp.use_paw)
@@ -201,7 +186,7 @@ void ESolver_KS<T, Device>::before_all_runners(UnitCell& ucell, const Input_para
201186
#endif
202187
/// End PAW
203188

204-
//! 4) it has been established that
189+
//! 3) it has been established that
205190
// xc_func is same for all elements, therefore
206191
// only the first one if used
207192
if (PARAM.inp.use_paw)
@@ -214,6 +199,21 @@ void ESolver_KS<T, Device>::before_all_runners(UnitCell& ucell, const Input_para
214199
}
215200
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "SETUP UNITCELL");
216201

202+
//! 4) setup the charge mixing parameters
203+
p_chgmix->set_mixing(PARAM.inp.mixing_mode,
204+
PARAM.inp.mixing_beta,
205+
PARAM.inp.mixing_ndim,
206+
PARAM.inp.mixing_gg0,
207+
PARAM.inp.mixing_tau,
208+
PARAM.inp.mixing_beta_mag,
209+
PARAM.inp.mixing_gg0_mag,
210+
PARAM.inp.mixing_gg0_min,
211+
PARAM.inp.mixing_angle,
212+
PARAM.inp.mixing_dmr,
213+
ucell.omega,
214+
ucell.tpiba);
215+
p_chgmix->init_mixing();
216+
217217
//! 5) ESolver depends on the Symmetry module
218218
// symmetry analysis should be performed every time the cell is changed
219219
if (ModuleSymmetry::Symmetry::symm_flag == 1)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
INPUT_PARAMETERS RUNNING ABACUS-DFT
2+
3+
#Parameters (1.General)
4+
suffix autotest # suffix of OUTPUT DIR
5+
nspin 2 # 1/2/4 4 for SOC
6+
symmetry 0 # 0/1 1 for open, default
7+
esolver_type ksdft # ksdft, ofdft, sdft, tddft, lj, dp
8+
dft_functional MGGA_X_R2SCAN+MGGA_C_R2SCAN # same as upf file, can be lda/pbe/scan/hf/pbe0/hse
9+
ks_solver genelpa # default for ksdft-lcao
10+
vdw_method none # d3 , d3_bj, none
11+
pseudo_dir ../../PP_ORB
12+
orbital_dir ../../PP_ORB
13+
14+
#Parameters (2.Iteration)
15+
calculation scf # scf relax cell-relax md
16+
ecutwfc 20
17+
scf_thr 1e-7
18+
printe 1
19+
#Parameters (3.Basis)
20+
basis_type lcao # lcao or pw
21+
gamma_only 1 # 0/1, replace KPT
22+
23+
#Parameters (4.Smearing)
24+
smearing_method cold # mp/gaussian/cold/fixed
25+
smearing_sigma 0.008 # Rydberg
26+
27+
nx 3
28+
ny 3
29+
nz 3
30+
31+
#Parameters (5.Mixing)
32+
mixing_type broyden # pulay/broyden
33+
mixing_ndim 20
34+
mixing_beta 0.4 # for metal: 0.05-0.4
35+
mixing_gg0 1.0 # only for metal
36+
mixing_tau true
37+

tests/integrate/218_NO_mixing_tau/KPT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
K_POINTS
2+
0
3+
Gamma
4+
1 1 1 0 0 0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ATOMIC_SPECIES
2+
C 12.011 C.LDA.UPF
3+
4+
NUMERICAL_ORBITAL
5+
C_gga_8au_100Ry_2s2p1d.orb
6+
7+
LATTICE_CONSTANT
8+
1.889726
9+
10+
LATTICE_VECTORS
11+
1.5000000000 0.0000000000 0.0000000000 #latvec1
12+
0.0000000000 1.5000000000 0.0000000000 #latvec2
13+
0.0000000000 0.0000000000 1.5000000000 #latvec3
14+
15+
ATOMIC_POSITIONS
16+
Direct
17+
18+
C #label
19+
0.0000 #magnetism
20+
1 #number of atoms
21+
0.0000000000 0.0000000000 0.0000000000 m 0 0 0

tests/integrate/218_NO_mixing_tau/jd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
r2scan functional with mixing tau test in LCAO base. System: C in a 2*2*2-Angstrom^3 box.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
etotref -122.1473084278620
2+
etotperatomref -122.1473084279
3+
totaltimeref 2.60

tests/integrate/CASES_CPU.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
216_NO_scan_Si2
189189
217_NO_out_pot
190190
217_NO_out_pot_nscf
191+
218_NO_mixing_tau
191192
219_NO_out_elf
192193
220_NO_KP_MD_MSST
193194
#220_NO_KP_MD_MSST_level2

0 commit comments

Comments
 (0)