Skip to content

Commit 43c43a8

Browse files
committed
update get_pchg and get_wf
1 parent e9ad74e commit 43c43a8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

source/module_io/get_pchg_pw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void get_pchg_pw(const std::vector<int>& bands_to_print,
4646
// Check if length of bands_to_print is valid
4747
if (static_cast<int>(bands_to_print.size()) > nbands)
4848
{
49-
ModuleBase::WARNING_QUIT("ESolver_KS_PW::get_pchg_pw",
49+
ModuleBase::WARNING_QUIT("ModuleIO::get_pchg_pw",
5050
"The number of bands specified by `bands_to_print` in the "
5151
"INPUT file exceeds `nbands`!");
5252
}
@@ -56,7 +56,7 @@ void get_pchg_pw(const std::vector<int>& bands_to_print,
5656
{
5757
if (value != 0 && value != 1)
5858
{
59-
ModuleBase::WARNING_QUIT("ESolver_KS_PW::get_pchg_pw",
59+
ModuleBase::WARNING_QUIT("ModuleIO::get_pchg_pw",
6060
"The elements of `bands_to_print` must be either 0 or 1. "
6161
"Invalid values found!");
6262
}

source/module_io/get_wf_lcao.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,21 @@ 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-
if (nbands_istate > 0 && static_cast<int>(out_wfc_norm.size()) == 0)
71+
const int norm_size = static_cast<int>(out_wfc_norm.size();
72+
73+
if (nbands_istate > 0 && norm_size) == 0)
7274
{
7375
mode_norm = 1;
7476
}
75-
else if (static_cast<int>(out_wfc_norm.size()) > 0)
77+
else if (norm_size > 0)
7678
{
7779
// If out_wfc_norm is not empty, set mode to 2
7880
mode_norm = 2;
7981
std::cout << " Notice: INPUT parameter `nbands_istate` overwritten by `out_wfc_norm`!" << std::endl;
8082
}
8183

8284
// Set this->bands_picked_ according to the mode
83-
select_bands(nbands_istate, out_wfc_norm, nbands, nelec, mode_norm, fermi_band);
85+
this->select_bands(nbands_istate, out_wfc_norm, nbands, nelec, mode_norm, fermi_band);
8486

8587
// Calculate out_wfc_norm
8688
for (int ib = 0; ib < nbands; ++ib)
@@ -153,7 +155,7 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
153155
}
154156

155157
// Set this->bands_picked_ according to the mode
156-
select_bands(nbands_istate, out_wfc_re_im, nbands, nelec, mode_re_im, fermi_band);
158+
this->select_bands(nbands_istate, out_wfc_re_im, nbands, nelec, mode_re_im, fermi_band);
157159

158160
if (out_wfc_pw || out_wfc_r)
159161
{
@@ -325,7 +327,7 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
325327
}
326328

327329
// Set this->bands_picked_ according to the mode
328-
select_bands(nbands_istate, out_wfc_norm, nbands, nelec, mode_norm, fermi_band);
330+
this->select_bands(nbands_istate, out_wfc_norm, nbands, nelec, mode_norm, fermi_band);
329331

330332
// Calculate out_wfc_norm
331333
for (int ib = 0; ib < nbands; ++ib)

0 commit comments

Comments
 (0)