Skip to content

Commit 8e4323f

Browse files
committed
delete Psi(const int* ngk_in);
1 parent 38cef80 commit 8e4323f

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

source/module_io/get_wf_lcao.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void IState_Envelope::begin(const UnitCell& ucell,
305305
printf(" Estimated on-the-fly memory consuming by IState_Envelope::begin::wfc_k_grid: %f MB\n", mem_size);
306306

307307
// for pw_wfc in G space
308-
psi::Psi<std::complex<double>> psi_g(kv.ngk.data());
308+
psi::Psi<std::complex<double>> psi_g;
309309
if (out_wf || out_wf_r)
310310
{
311311
psi_g.resize(nks, nbands, pw_wfc->npwk_max);

source/module_psi/psi.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ template <typename T, typename Device> Psi<T, Device>::~Psi()
4141
if (this->allocate_inside) delete_memory_op()(this->ctx, this->psi);
4242
}
4343

44-
template <typename T, typename Device> Psi<T, Device>::Psi(const int* ngk_in)
45-
{
46-
this->ngk = ngk_in;
47-
this->npol = PARAM.globalv.npol;
48-
this->device = base_device::get_device_type<Device>(this->ctx);
49-
}
44+
// template <typename T, typename Device> Psi<T, Device>::Psi(const int* ngk_in)
45+
// {
46+
// this->ngk = ngk_in;
47+
// this->npol = PARAM.globalv.npol;
48+
// this->device = base_device::get_device_type<Device>(this->ctx);
49+
// }
5050

5151
template <typename T, typename Device> Psi<T, Device>::Psi(const int nk_in, const int nbd_in, const int nbs_in, const int* ngk_in, const bool k_first_in)
5252
{

source/module_psi/psi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "module_base/module_device/types.h"
66

77
#include <tuple>
8+
#include <vector>
89

910
namespace psi
1011
{
@@ -38,7 +39,7 @@ class Psi
3839
// Constructor 1: basic
3940
Psi();
4041
// Constructor 2: specify ngk only, should call resize() later
41-
Psi(const int* ngk_in);
42+
// Psi(const int* ngk_in);
4243
// Constructor 3: specify nk, nbands, nbasis, ngk, and do not need to call resize() later
4344
Psi(const int nk_in, const int nbd_in, const int nbs_in, const int* ngk_in = nullptr, const bool k_first_in = true);
4445
// Constructor 4: copy a new Psi which have several k-points and several bands from inputted psi_in

source/module_psi/test/psi_test.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ TEST_F(TestPsi, get_val)
6363
EXPECT_EQ(psi_object14->get_psi_bias(), 0);
6464
}
6565

66-
TEST_F(TestPsi, get_ngk)
67-
{
68-
psi::Psi<std::complex<double>>* psi_object21 = new psi::Psi<std::complex<double>>(&ngk[0]);
69-
psi::Psi<double>* psi_object22 = new psi::Psi<double>(&ngk[0]);
70-
psi::Psi<std::complex<float>>* psi_object23 = new psi::Psi<std::complex<float>>(&ngk[0]);
71-
psi::Psi<float>* psi_object24 = new psi::Psi<float>(&ngk[0]);
66+
// TEST_F(TestPsi, get_ngk)
67+
// {
68+
// psi::Psi<std::complex<double>>* psi_object21 = new psi::Psi<std::complex<double>>(&ngk[0]);
69+
// psi::Psi<double>* psi_object22 = new psi::Psi<double>(&ngk[0]);
70+
// psi::Psi<std::complex<float>>* psi_object23 = new psi::Psi<std::complex<float>>(&ngk[0]);
71+
// psi::Psi<float>* psi_object24 = new psi::Psi<float>(&ngk[0]);
7272

73-
EXPECT_EQ(psi_object21->get_ngk(2), ngk[2]);
74-
EXPECT_EQ(psi_object21->get_ngk_pointer()[0], ngk[0]);
73+
// EXPECT_EQ(psi_object21->get_ngk(2), ngk[2]);
74+
// EXPECT_EQ(psi_object21->get_ngk_pointer()[0], ngk[0]);
7575

76-
EXPECT_EQ(psi_object22->get_ngk(2), ngk[2]);
77-
EXPECT_EQ(psi_object22->get_ngk_pointer()[0], ngk[0]);
76+
// EXPECT_EQ(psi_object22->get_ngk(2), ngk[2]);
77+
// EXPECT_EQ(psi_object22->get_ngk_pointer()[0], ngk[0]);
7878

79-
EXPECT_EQ(psi_object23->get_ngk(2), ngk[2]);
80-
EXPECT_EQ(psi_object23->get_ngk_pointer()[0], ngk[0]);
79+
// EXPECT_EQ(psi_object23->get_ngk(2), ngk[2]);
80+
// EXPECT_EQ(psi_object23->get_ngk_pointer()[0], ngk[0]);
8181

82-
EXPECT_EQ(psi_object24->get_ngk(2), ngk[2]);
83-
EXPECT_EQ(psi_object24->get_ngk_pointer()[0], ngk[0]);
84-
}
82+
// EXPECT_EQ(psi_object24->get_ngk(2), ngk[2]);
83+
// EXPECT_EQ(psi_object24->get_ngk_pointer()[0], ngk[0]);
84+
// }
8585

8686
TEST_F(TestPsi, get_pointer_op_zero_complex_double)
8787
{

0 commit comments

Comments
 (0)