Skip to content

Commit 2efc97b

Browse files
committed
fix bug
1 parent 2ba27ab commit 2efc97b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/module_lr/utils/lr_util.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,15 @@ namespace LR_Util
110110
assert(nk_in * nbasis_in == psi_kfirst.get_nbasis());
111111
int ib_now = psi_kfirst.get_current_b();
112112
psi_kfirst.fix_b(0); // for get_pointer() to get the head pointer
113-
psi::Psi<T, Device> psi_bfirst(psi_kfirst.get_pointer(), nk_in, psi_kfirst.get_nbands(), nbasis_in, psi_kfirst.get_ngk_pointer(), false);
113+
114+
std::vector<int> ngk_vector_temp(psi_kfirst.get_nk(), 0);
115+
for (size_t i = 0; i < ngk_vector_temp.size(); i++)
116+
{
117+
ngk_vector_temp[i] = psi_kfirst.get_ngk_pointer()[i];
118+
}
119+
120+
121+
psi::Psi<T, Device> psi_bfirst(psi_kfirst.get_pointer(), nk_in, psi_kfirst.get_nbands(), nbasis_in, ngk_vector_temp, false);
114122
psi_kfirst.fix_b(ib_now);
115123
return psi_bfirst;
116124
}
@@ -124,7 +132,6 @@ namespace LR_Util
124132
psi_bfirst.fix_kb(0, 0); // for get_pointer() to get the head pointer
125133

126134
std::vector<int> ngk_vector_temp(psi_bfirst.get_nk(), 0);
127-
128135
for (size_t i = 0; i < ngk_vector_temp.size(); i++)
129136
{
130137
ngk_vector_temp[i] = psi_bfirst.get_ngk_pointer()[i];

0 commit comments

Comments
 (0)