Skip to content

Commit f1e2cca

Browse files
committed
fix bugs
1 parent 05f2df6 commit f1e2cca

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

source/module_psi/psi.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Range::Range(const bool k_first_in, const size_t index_1_in, const size_t range_
3232
template <typename T, typename Device>
3333
Psi<T, Device>::Psi()
3434
{
35-
this->npol = this->get_npol();
3635
}
3736

3837
template <typename T, typename Device>
@@ -52,8 +51,6 @@ Psi<T, Device>::Psi(const int nk_in, const int nbd_in, const int nbs_in, const i
5251
assert(nbd_in >= 0); // 187_PW_SDFT_ALL_GPU && 187_PW_MD_SDFT_ALL_GPU
5352
assert(nbs_in > 0);
5453

55-
this->npol = this->get_npol();
56-
5754
this->k_first = k_first_in;
5855
this->allocate_inside = true;
5956

@@ -91,9 +88,6 @@ Psi<T, Device>::Psi(const int nk_in,
9188
assert(nbd_in > 0);
9289
assert(nbs_in > 0);
9390

94-
95-
this->npol = this->get_npol();
96-
9791
this->k_first = k_first_in;
9892
this->allocate_inside = true;
9993

@@ -131,9 +125,6 @@ Psi<T, Device>::Psi(T* psi_pointer,
131125
// Currently this function only supports nk_in == 1 when called within diagH_subspace_init.
132126
// assert(nk_in == 1); // NOTE because lr/utils/lr_uril.hpp func & get_psi_spin func
133127

134-
135-
this->npol = this->get_npol();
136-
137128
this->k_first = k_first_in;
138129
this->allocate_inside = false;
139130

@@ -165,8 +156,6 @@ Psi<T, Device>::Psi(const int nk_in,
165156
// Currently this function only supports nk_in == 1 when called within diagH_subspace_init.
166157
assert(nk_in == 1);
167158

168-
this->npol = this->get_npol();
169-
170159
this->k_first = k_first_in;
171160
this->allocate_inside = true;
172161

@@ -196,7 +185,6 @@ Psi<T, Device>::Psi(const int nk_in,
196185
template <typename T, typename Device>
197186
Psi<T, Device>::Psi(const Psi& psi_in)
198187
{
199-
this->npol = this->get_npol();
200188

201189
this->ngk = psi_in.ngk;
202190
this->nk = psi_in.get_nk();
@@ -225,8 +213,6 @@ template <typename T_in, typename Device_in>
225213
Psi<T, Device>::Psi(const Psi<T_in, Device_in>& psi_in)
226214
{
227215

228-
this->npol = this->get_npol();
229-
230216
this->ngk = psi_in.get_ngk_pointer();
231217
this->nk = psi_in.get_nk();
232218
this->nbands = psi_in.get_nbands();
@@ -351,7 +337,7 @@ const int& Psi<T, Device>::get_current_ngk() const
351337
}
352338

353339
template <typename T, typename Device>
354-
const int& Psi<T, Device>::get_npol() const
340+
const int Psi<T, Device>::get_npol() const
355341
{
356342
if (PARAM.inp.nspin == 4)
357343
{

source/module_psi/psi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ class Psi
137137
// solve Range: return(pointer of begin, number of bands or k-points)
138138
std::tuple<const T*, int> to_range(const Range& range) const;
139139

140-
141-
const int& get_npol() const;
140+
const int get_npol() const;
142141

143142
private:
144143
T* psi = nullptr; // avoid using C++ STL

0 commit comments

Comments
 (0)