Skip to content

Commit 862e594

Browse files
committed
fix compile error
1 parent a71dd61 commit 862e594

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

source/module_hamilt_pw/hamilt_pwdft/kernels/test/ekinetic_op_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class TestModuleHamiltEkinetic : public ::testing::Test
7070
TEST_F(TestModuleHamiltEkinetic, ekinetic_pw_op_cpu)
7171
{
7272
std::vector<std::complex<double> > hpsi(expected_hpsi.size(), std::complex<double>(0.0, 0.0));
73-
ekinetic_cpu_op()(cpu_ctx, band, dim, dim, tpiba2, gk2.data(), hpsi.data(), psi.data());
73+
ekinetic_cpu_op()(cpu_ctx, band, dim, dim, false, tpiba2, gk2.data(), hpsi.data(), psi.data());
7474
for (int ii = 0; ii < hpsi.size(); ii++) {
7575
EXPECT_LT(std::abs(hpsi[ii] - expected_hpsi[ii]), 1e-6);
7676
}

source/module_hamilt_pw/hamilt_stodft/test/test_sto_tool.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,27 @@
77
* unit test of sto_tool.cpp
88
***********************************************/
99

10-
void Stochastic_hchi::hchi_norm(std::complex<double>* chig, std::complex<double>* hchig, const int m)
11-
{
12-
return;
13-
}
10+
template <typename T, typename Device>
11+
hamilt::HamiltPW<T, Device>::HamiltPW(elecstate::Potential* pot_in, ModulePW::PW_Basis_K* wfc_basis, K_Vectors* p_kv){}
12+
template <typename T, typename Device>
13+
hamilt::HamiltPW<T, Device>::~HamiltPW(){};
14+
template <typename T, typename Device>
15+
void hamilt::HamiltPW<T, Device>::updateHk(int){}
16+
template <typename T, typename Device>
17+
void hamilt::HamiltPW<T, Device>::sPsi(T const*, T*, const int, const int, const int) const{}
18+
19+
template <typename T, typename Device>
20+
hamilt::HamiltSdftPW<T, Device>::HamiltSdftPW(elecstate::Potential* pot_in,
21+
ModulePW::PW_Basis_K* wfc_basis,
22+
K_Vectors* p_kv,
23+
const int& npol,
24+
double* emin_in,
25+
double* emax_in): HamiltPW<T, Device>(pot_in, wfc_basis, p_kv), ngk(p_kv->ngk){}
26+
template <typename T, typename Device>
27+
void hamilt::HamiltSdftPW<T, Device>::hPsi_norm(const T* psi_in, T* hpsi, const int& nbands){}
28+
29+
template class hamilt::HamiltPW<std::complex<double>, base_device::DEVICE_CPU>;
30+
template class hamilt::HamiltSdftPW<std::complex<double>, base_device::DEVICE_CPU>;
1431

1532
/**
1633
* - Tested Functions:

source/module_hsolver/test/diago_mock.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ class OperatorMock : public hamilt::Operator<T>
447447
const int npol,
448448
const T* tmpsi_in,
449449
T* tmhpsi,
450-
const int ngk_ik = 0)const;
450+
const int ngk_ik = 0,
451+
const bool is_first_node = false)const;
451452
};
452453
template<>
453454
void OperatorMock<double>::act(
@@ -490,8 +491,8 @@ void OperatorMock<std::complex<double>>::act(
490491
const int npol,
491492
const std::complex<double>* tmpsi_in,
492493
std::complex<double>* tmhpsi,
493-
const bool is_first_node,
494-
const int ngk_ik)const
494+
const int ngk_ik,
495+
const bool is_first_node)const
495496
{
496497
int nprocs = 1, mypnum = 0;
497498
#ifdef __MPI
@@ -524,8 +525,8 @@ void OperatorMock<std::complex<float>>::act(
524525
const int npol,
525526
const std::complex<float>* tmpsi_in,
526527
std::complex<float>* tmhpsi,
527-
const bool is_first_node,
528-
const int ngk_ik)const
528+
const int ngk_ik,
529+
const bool is_first_node)const
529530
{
530531
int nprocs = 1, mypnum = 0;
531532
#ifdef __MPI

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ StoChe<REAL>::~StoChe(){}
3131

3232
template class StoChe<double>;
3333

34-
Stochastic_hchi::Stochastic_hchi(){};
35-
Stochastic_hchi::~Stochastic_hchi(){};
36-
3734
Stochastic_Iter::Stochastic_Iter()
3835
{
3936
change = false;
@@ -43,7 +40,11 @@ Stochastic_Iter::Stochastic_Iter()
4340

4441
Stochastic_Iter::~Stochastic_Iter(){};
4542

46-
void Stochastic_Iter::init(K_Vectors* pkv, ModulePW::PW_Basis_K *wfc_basis, Stochastic_WF &stowf, StoChe<double> &stoche)
43+
void Stochastic_Iter::init(K_Vectors* pkv_in,
44+
ModulePW::PW_Basis_K* wfc_basis,
45+
Stochastic_WF& stowf,
46+
StoChe<double>& stoche,
47+
hamilt::HamiltSdftPW<std::complex<double>>* p_hamilt_sto)
4748
{
4849
this->nchip = stowf.nchip;;
4950
this->targetne = 1;
@@ -136,12 +137,13 @@ class TestHSolverPW_SDFT : public ::testing::Test
136137
K_Vectors kv;
137138
wavefunc wf;
138139
StoChe<double> stoche;
140+
hamilt::HamiltSdftPW<std::complex<double>>* p_hamilt_sto = nullptr;
139141
hsolver::HSolverPW_SDFT hs_d = hsolver::HSolverPW_SDFT(&kv,
140142
&pwbk,
141143
&wf,
142144
stowf,
143145
stoche,
144-
146+
p_hamilt_sto,
145147
"scf",
146148
"pw",
147149
"cg",

0 commit comments

Comments
 (0)