Skip to content

Commit 744cc33

Browse files
committed
update unit tests
1 parent 9c46b77 commit 744cc33

File tree

2 files changed

+41
-30
lines changed

2 files changed

+41
-30
lines changed

source/module_hsolver/test/hsolver_supplementary_mock.h

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include "module_elecstate/elecstate.h"
2+
#include "module_elecstate/elecstate_pw.h"
33
#include "module_psi/wavefunc.h"
44

55
namespace elecstate
@@ -62,6 +62,46 @@ void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
6262
return;
6363
}
6464

65+
template <typename T, typename Device>
66+
ElecStatePW<T, Device>::ElecStatePW(ModulePW::PW_Basis_K* wfc_basis_in,
67+
Charge* chg_in,
68+
K_Vectors* pkv_in,
69+
UnitCell* ucell_in,
70+
pseudopot_cell_vnl* ppcell_in,
71+
ModulePW::PW_Basis* rhodpw_in,
72+
ModulePW::PW_Basis* rhopw_in,
73+
ModulePW::PW_Basis_Big* bigpw_in)
74+
: basis(wfc_basis_in)
75+
{
76+
}
77+
78+
template <typename T, typename Device>
79+
ElecStatePW<T, Device>::~ElecStatePW()
80+
{
81+
}
82+
83+
template <typename T, typename Device>
84+
void ElecStatePW<T, Device>::psiToRho(const psi::Psi<T, Device>& psi)
85+
{
86+
}
87+
88+
template <typename T, typename Device>
89+
void ElecStatePW<T, Device>::cal_tau(const psi::Psi<T, Device>& psi)
90+
{
91+
}
92+
93+
template <typename T, typename Device>
94+
void ElecStatePW<T, Device>::cal_becsum(const psi::Psi<T, Device>& psi)
95+
{
96+
}
97+
98+
template class ElecStatePW<std::complex<float>, base_device::DEVICE_CPU>;
99+
template class ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>;
100+
#if ((defined __CUDA) || (defined __ROCM))
101+
template class ElecStatePW<std::complex<float>, base_device::DEVICE_GPU>;
102+
template class ElecStatePW<std::complex<double>, base_device::DEVICE_GPU>;
103+
#endif
104+
65105
Potential::~Potential()
66106
{
67107
}

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,11 @@ Sto_Func<REAL>::Sto_Func()
2323
}
2424
template class Sto_Func<double>;
2525

26-
27-
template <>
28-
elecstate::ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>::ElecStatePW(ModulePW::PW_Basis_K* wfc_basis_in,
29-
Charge* chg_in,
30-
K_Vectors* pkv_in,
31-
UnitCell* ucell_in,
32-
pseudopot_cell_vnl* ppcell_in,
33-
ModulePW::PW_Basis* rhodpw_in,
34-
ModulePW::PW_Basis* rhopw_in,
35-
ModulePW::PW_Basis_Big* bigpw_in)
36-
: basis(wfc_basis_in)
37-
{
38-
}
39-
40-
template<>
41-
elecstate::ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>::~ElecStatePW()
42-
{
43-
}
44-
4526
template<>
4627
void elecstate::ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>::init_rho_data()
4728
{
4829
}
4930

50-
template<>
51-
void elecstate::ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>::psiToRho(const psi::Psi<std::complex<double>, base_device::DEVICE_CPU>& psi)
52-
{
53-
}
54-
55-
template<>
56-
void elecstate::ElecStatePW<std::complex<double>, base_device::DEVICE_CPU>::cal_tau(const psi::Psi<std::complex<double>, base_device::DEVICE_CPU>& psi)
57-
{
58-
}
59-
6031
template <typename REAL, typename Device>
6132
StoChe<REAL, Device>::StoChe(const int& nche, const int& method, const REAL& emax_sto, const REAL& emin_sto)
6233
{

0 commit comments

Comments
 (0)