1- #include " wfinit .h"
1+ #include " psiinit .h"
22
33#include " module_base/macros.h"
44#include " module_base/timer.h"
@@ -18,14 +18,12 @@ PSIInit<T, Device>::PSIInit(const std::string& init_wfc_in,
1818 const std::string& ks_solver_in,
1919 const std::string& basis_type_in,
2020 const bool & use_psiinitializer_in,
21- wavefunc* p_wf_in,
2221 ModulePW::PW_Basis_K* pw_wfc_in)
2322{
2423 this ->init_wfc = init_wfc_in;
2524 this ->ks_solver = ks_solver_in;
2625 this ->basis_type = basis_type_in;
2726 this ->use_psiinitializer = use_psiinitializer_in;
28- this ->p_wf = p_wf_in;
2927 this ->pw_wfc = pw_wfc_in;
3028}
3129
@@ -122,16 +120,16 @@ void PSIInit<T, Device>::allocate_psi(Psi<std::complex<double>>*& psi,
122120 // old method explicitly requires variables such as total number of kpoints, number
123121 // of bands, number of G-vectors, and so on. Comparatively in new method, these
124122 // variables are imported in function called initialize.
125- psi = this ->p_wf -> allocate (nkstot, nks, ngk, npwx);
123+ psi = this ->wf_old . allocate (nkstot, nks, ngk, npwx);
126124
127125 // however, init_at_1 does not actually initialize the psi, instead, it is a
128126 // function to calculate a interpolate table saving overlap intergral or say
129127 // Spherical Bessel Transform of atomic orbitals.
130- this ->p_wf -> init_at_1 (p_sf);
128+ this ->wf_old . init_at_1 (p_sf);
131129 // similarly, wfcinit not really initialize any wavefunction, instead, it initialize
132130 // the mapping from ixy, the 1d flattened index of point on fft grid (x, y) plane,
133131 // to the index of "stick", composed of grid points.
134- this ->p_wf -> wfcinit (psi, pw_wfc);
132+ this ->wf_old . wfcinit (psi, pw_wfc);
135133 }
136134}
137135
@@ -143,8 +141,8 @@ void PSIInit<T, Device>::make_table(const int nks, Structure_Factor* p_sf)
143141 } // do not need to do anything because the interpolate table is unchanged
144142 else // old initialization method, used in EXX calculation
145143 {
146- this ->p_wf -> init_after_vc (nks); // reallocate wanf2, the planewave expansion of lcao
147- this ->p_wf -> init_at_1 (p_sf); // re-calculate tab_at, the overlap matrix between atomic pswfc and jlq
144+ this ->wf_old . init_after_vc (nks); // reallocate wanf2, the planewave expansion of lcao
145+ this ->wf_old . init_at_1 (p_sf); // re-calculate tab_at, the overlap matrix between atomic pswfc and jlq
148146 }
149147}
150148
@@ -271,7 +269,7 @@ void PSIInit<T, Device>::initialize_psi(Psi<std::complex<double>>* psi,
271269 kspw_psi->fix_k (ik);
272270
273271 // / for psi init guess!!!!
274- hamilt::diago_PAO_in_pw_k2 (this ->ctx , ik, *(kspw_psi), this ->pw_wfc , this ->p_wf , p_hamilt);
272+ hamilt::diago_PAO_in_pw_k2 (this ->ctx , ik, *(kspw_psi), this ->pw_wfc , & this ->wf_old , p_hamilt);
275273 }
276274 }
277275 else
@@ -280,7 +278,7 @@ void PSIInit<T, Device>::initialize_psi(Psi<std::complex<double>>* psi,
280278 kspw_psi->fix_k (ik);
281279
282280 // / for psi init guess!!!!
283- hamilt::diago_PAO_in_pw_k2 (this ->ctx , ik, *(kspw_psi), this ->pw_wfc , this ->p_wf , p_hamilt);
281+ hamilt::diago_PAO_in_pw_k2 (this ->ctx , ik, *(kspw_psi), this ->pw_wfc , & this ->wf_old , p_hamilt);
284282 }
285283 }
286284 }
0 commit comments