@@ -23,11 +23,40 @@ Sto_Func<REAL>::Sto_Func()
2323}
2424template 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+
2645template <>
2746void elecstate::ElecStatePW<std::complex <double >, base_device::DEVICE_CPU>::init_rho_data()
2847{
2948}
3049
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+
3160template <typename REAL, typename Device>
3261StoChe<REAL, Device>::StoChe(const int & nche, const int & method, const REAL& emax_sto, const REAL& emin_sto)
3362{
@@ -141,7 +170,7 @@ Charge::~Charge(){};
141170class TestHSolverPW_SDFT : public ::testing::Test
142171{
143172 public:
144- TestHSolverPW_SDFT () : stoche(8 , 1 , 0 , 0 )
173+ TestHSolverPW_SDFT () : stoche(8 , 1 , 0 , 0 ), elecstate_test( nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr )
145174 {
146175 }
147176 ModulePW::PW_Basis_K pwbk;
@@ -175,7 +204,7 @@ class TestHSolverPW_SDFT : public ::testing::Test
175204 psi::Psi<std::complex <double >> psi_test_cd;
176205 psi::Psi<std::complex <double >> psi_test_no;
177206
178- elecstate::ElecState elecstate_test;
207+ elecstate::ElecStatePW<std:: complex < double >> elecstate_test;
179208
180209 std::string method_test = " cg" ;
181210
@@ -239,6 +268,8 @@ TEST_F(TestHSolverPW_SDFT, solve_noband_skipcharge)
239268 elecstate_test.charge ->rho = new double *[1 ];
240269 elecstate_test.charge ->rho [0 ] = new double [10 ];
241270 elecstate_test.charge ->nrxx = 10 ;
271+ elecstate_test.rho = new double *[1 ];
272+ elecstate_test.rho [0 ] = new double [10 ];
242273 int istep = 0 ;
243274 int iter = 0 ;
244275
0 commit comments