diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 8439558806..eb5844d9c7 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -249,7 +249,6 @@ OBJS_ESOLVER=esolver.o\ OBJS_ESOLVER_LCAO=esolver_ks_lcao.o\ esolver_ks_lcao_tddft.o\ - dpks_cal_e_delta_band.o\ lcao_before_scf.o\ esolver_gets.o\ lcao_others.o\ diff --git a/source/module_esolver/CMakeLists.txt b/source/module_esolver/CMakeLists.txt index 0f8eba8c8b..395350f1d5 100644 --- a/source/module_esolver/CMakeLists.txt +++ b/source/module_esolver/CMakeLists.txt @@ -16,7 +16,6 @@ if(ENABLE_LCAO) list(APPEND objects esolver_ks_lcao.cpp esolver_ks_lcao_tddft.cpp - dpks_cal_e_delta_band.cpp lcao_before_scf.cpp esolver_gets.cpp lcao_others.cpp diff --git a/source/module_esolver/dpks_cal_e_delta_band.cpp b/source/module_esolver/dpks_cal_e_delta_band.cpp deleted file mode 100644 index d2d0cf45a0..0000000000 --- a/source/module_esolver/dpks_cal_e_delta_band.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "esolver_ks_lcao.h" -#ifdef __DEEPKS -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_pw/hamilt_pwdft/global.h" -#endif - -namespace ModuleESolver -{ - - using namespace std; - -#ifdef __DEEPKS - template<> - void ESolver_KS_LCAO::dpks_cal_e_delta_band( - const vector>& dm)const - { - GlobalC::ld.cal_e_delta_band(dm); - } - - - template<> - void ESolver_KS_LCAO, double>::dpks_cal_e_delta_band( - const vector>>& dm)const - { - GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks()); - } - - - template<> - void ESolver_KS_LCAO, complex>::dpks_cal_e_delta_band( - const vector>>& dm)const - { - GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks()); - } - - - template<> - void ESolver_KS_LCAO::dpks_cal_projected_DM( - const elecstate::DensityMatrix* dm)const - { - GlobalC::ld.cal_projected_DM(dm, - GlobalC::ucell, - orb_, - GlobalC::GridD); - } - - - template<> - void ESolver_KS_LCAO, double>::dpks_cal_projected_DM( - const elecstate::DensityMatrix, double>* dm)const - { - GlobalC::ld.cal_projected_DM_k(dm, - GlobalC::ucell, - orb_, - GlobalC::GridD); - } - - - template<> - void ESolver_KS_LCAO, complex>::dpks_cal_projected_DM( - const elecstate::DensityMatrix, double>* dm)const - { - GlobalC::ld.cal_projected_DM_k(dm, - GlobalC::ucell, - orb_, - GlobalC::GridD); - } -#endif -} diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 84e005902b..371218361d 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -879,7 +879,7 @@ void ESolver_KS_LCAO::iter_finish(const int istep, int& iter) const std::vector>& dm = dynamic_cast*>(this->pelec)->get_DM()->get_DMK_vector(); - this->dpks_cal_e_delta_band(dm); + GlobalC::ld.dpks_cal_e_delta_band(dm, this->kv.get_nks()); } #endif diff --git a/source/module_esolver/esolver_ks_lcao.h b/source/module_esolver/esolver_ks_lcao.h index a52160095c..95cdd9f77f 100644 --- a/source/module_esolver/esolver_ks_lcao.h +++ b/source/module_esolver/esolver_ks_lcao.h @@ -92,13 +92,6 @@ class ESolver_KS_LCAO : public ESolver_KS { std::shared_ptr>> exx_lri_complex = nullptr; #endif - private: -#ifdef __DEEPKS - void dpks_cal_e_delta_band(const std::vector>& dm) const; - - void dpks_cal_projected_DM( - const elecstate::DensityMatrix* dm) const; -#endif friend class LR::ESolver_LR; friend class LR::ESolver_LR, double>; }; diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp index ddf0723d83..0c6701e83d 100644 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp +++ b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp @@ -482,4 +482,14 @@ void LCAO_Deepks::del_v_delta_pdm_shell(const int nks,const int nlocal) return; } +void LCAO_Deepks::dpks_cal_e_delta_band(const std::vector>& dm, const int nks) +{ + this->cal_e_delta_band(dm); +} + +void LCAO_Deepks::dpks_cal_e_delta_band(const std::vector>>& dm, const int nks) +{ + this->cal_e_delta_band_k(dm, nks); +} + #endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h index bd11deef26..cd8d899a65 100644 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h +++ b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h @@ -382,6 +382,10 @@ class LCAO_Deepks void cal_e_delta_band_k(const std::vector>>& dm /**<[in] density matrix*/, const int nks); + //! a temporary interface for cal_e_delta_band and cal_e_delta_band_k + void dpks_cal_e_delta_band(const std::vector>& dm, const int nks); + void dpks_cal_e_delta_band(const std::vector>>& dm, const int nks); + //------------------- // LCAO_deepks_odelta.cpp //-------------------