Skip to content

Commit 94c011d

Browse files
committed
Fix: error for kpar != 1
1 parent d8e205d commit 94c011d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/module_pw/pw_basis_k.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ void PW_Basis_K::setupIndGk()
6969
//count npwk
7070
this->npwk_max = 0;
7171
delete[] this->npwk; this->npwk = new int [this->nks];
72+
//minimun npw, only for check
73+
int npwk_min = this->npw;
7274
for (int ik = 0; ik < this->nks; ik++)
7375
{
7476
int ng = 0;
@@ -80,7 +82,6 @@ void PW_Basis_K::setupIndGk()
8082
++ng;
8183
}
8284
}
83-
ModuleBase::CHECK_WARNING_QUIT((ng==0), "PW_Basis_K::setupIndGk", "some cores have no plane waves!");
8485
this->npwk[ik] = ng;
8586
if(ng == 0)
8687
{
@@ -90,7 +91,12 @@ void PW_Basis_K::setupIndGk()
9091
{
9192
this->npwk_max = ng;
9293
}
94+
if ( npwk_min > ng)
95+
{
96+
npwk_min = ng;
97+
}
9398
}
99+
ModuleBase::CHECK_WARNING_QUIT((npwk_min==0), "PW_Basis_K::setupIndGk", "some cores have no plane waves!");
94100

95101
//get igl2isz_k and igl2ig_k
96102
delete[] igl2isz_k; this->igl2isz_k = new int [this->nks * this->npwk_max];

0 commit comments

Comments
 (0)