Skip to content

Commit ec1d009

Browse files
committed
fix get_wf_lcao
1 parent 43c43a8 commit ec1d009

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/module_io/get_wf_lcao.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
6868
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "On-the-fly memory consumption (MB)", mem_size);
6969

7070
int mode_norm = 0;
71-
const int norm_size = static_cast<int>(out_wfc_norm.size();
71+
const int norm_size = static_cast<int>(out_wfc_norm.size());
7272

73-
if (nbands_istate > 0 && norm_size) == 0)
73+
if (nbands_istate > 0 && norm_size == 0)
7474
{
7575
mode_norm = 1;
7676
}
@@ -89,7 +89,6 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
8989
{
9090
if (bands_picked_[ib])
9191
{
92-
9392
for (int is = 0; is < nspin; ++is)
9493
{
9594
ModuleBase::GlobalFunc::ZEROS(pes_->charge->rho[is], pw_wfc->nrxx);
@@ -143,11 +142,14 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
143142
}
144143

145144
int mode_re_im = 0;
146-
if (nbands_istate > 0 && static_cast<int>(out_wfc_re_im.size()) == 0)
145+
146+
const int re_im_size = static_cast<int>(out_wfc_re_im.size());
147+
148+
if (nbands_istate > 0 && re_im_size == 0)
147149
{
148150
mode_re_im = 1;
149151
}
150-
else if (static_cast<int>(out_wfc_re_im.size()) > 0)
152+
else if (re_im_size > 0)
151153
{
152154
// If out_wfc_re_im is not empty, set mode to 2
153155
mode_re_im = 2;

0 commit comments

Comments
 (0)