Skip to content

Commit

Permalink
Refactor: remove dpks_cal_e_delta_band.cpp (#5560)
Browse files Browse the repository at this point in the history
* Refactor: remove dpks_cal_e_delta_band.cpp

* update esolver_ks_lcao.h

* update dpks_cal_e_delta_band
  • Loading branch information
YuLiu98 authored Nov 22, 2024
1 parent c13f16f commit 8c3def4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 79 deletions.
1 change: 0 additions & 1 deletion source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down
1 change: 0 additions & 1 deletion source/module_esolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
69 changes: 0 additions & 69 deletions source/module_esolver/dpks_cal_e_delta_band.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
const std::vector<std::vector<TK>>& dm
= dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(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

Expand Down
7 changes: 0 additions & 7 deletions source/module_esolver/esolver_ks_lcao.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ class ESolver_KS_LCAO : public ESolver_KS<TK> {
std::shared_ptr<Exx_LRI<std::complex<double>>> exx_lri_complex = nullptr;
#endif

private:
#ifdef __DEEPKS
void dpks_cal_e_delta_band(const std::vector<std::vector<TK>>& dm) const;

void dpks_cal_projected_DM(
const elecstate::DensityMatrix<TK, double>* dm) const;
#endif
friend class LR::ESolver_LR<double, double>;
friend class LR::ESolver_LR<std::complex<double>, double>;
};
Expand Down
10 changes: 10 additions & 0 deletions source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::vector<double>>& dm, const int nks)
{
this->cal_e_delta_band(dm);
}

void LCAO_Deepks::dpks_cal_e_delta_band(const std::vector<std::vector<std::complex<double>>>& dm, const int nks)
{
this->cal_e_delta_band_k(dm, nks);
}

#endif
4 changes: 4 additions & 0 deletions source/module_hamilt_lcao/module_deepks/LCAO_deepks.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ class LCAO_Deepks
void cal_e_delta_band_k(const std::vector<std::vector<std::complex<double>>>& 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<std::vector<double>>& dm, const int nks);
void dpks_cal_e_delta_band(const std::vector<std::vector<std::complex<double>>>& dm, const int nks);

//-------------------
// LCAO_deepks_odelta.cpp
//-------------------
Expand Down

0 comments on commit 8c3def4

Please sign in to comment.