Skip to content

Commit 5169f08

Browse files
committed
fix bug when nproc > nz of scan
1 parent d5bfeaf commit 5169f08

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

source/module_hamilt/ks_pw/meta_pw.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ void Meta<OperatorPW>::act
6565
}
6666

6767
wfcpw->recip2real(porter, porter, ik);
68-
69-
const double* pvk = &(this->vk[0](current_spin, 0));
70-
for (int ir = 0; ir < this->vk->nc; ir++)
68+
if(this->vk->nc != 0)
7169
{
72-
porter[ir] *= pvk[ir];
70+
const double* pvk = &(this->vk[0](current_spin, 0));
71+
for (int ir = 0; ir < this->vk->nc; ir++)
72+
{
73+
porter[ir] *= pvk[ir];
74+
}
7375
}
7476
wfcpw->real2recip(porter, porter, ik);
7577

tests/integrate/101_PW_15_lowz/INPUT

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ nbands 6
77
symmetry 1
88
pseudo_dir ../tools/PP_ORB/
99
pseudo_type upf201
10+
dft_functional scan
1011

1112
#Parameters (2.Iteration)
1213
ecutwfc 20
1314
scf_thr 1e-9
14-
scf_nmax 1
15+
scf_nmax 2
1516

1617

1718
#Parameters (3.Basis)
1819
basis_type pw
1920

2021
#Parameters (4.Smearing)
2122
smearing_method gauss
22-
smearing_sigma 0.002
23+
smearing_sigma 0.002
2324

2425
#Parameters (5.Mixing)
2526
mixing_type pulay
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -1.407077993281502
2-
etotperatomref -0.7035389966
3-
totaltimeref 0.15155
1+
etotref -0.03063241935806423
2+
etotperatomref -0.0153162097
3+
totaltimeref

0 commit comments

Comments
 (0)