Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Jun 28, 2024
1 parent 3ba447a commit 1211fc3
Show file tree
Hide file tree
Showing 51 changed files with 2,023 additions and 1,789 deletions.
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 @@ -390,7 +390,7 @@ void ESolver_KS_LCAO<TK, TR>::cal_stress(ModuleBase::matrix& stress)
//! mohan add 2024-05-11
//------------------------------------------------------------------------------
template <typename TK, typename TR>
void ESolver_KS_LCAO<TK, TR>::after_all_runners(void)
void ESolver_KS_LCAO<TK, TR>::after_all_runners()
{
ModuleBase::TITLE("ESolver_KS_LCAO", "after_all_runners");
ModuleBase::timer::tick("ESolver_KS_LCAO", "after_all_runners");
Expand Down
146 changes: 56 additions & 90 deletions source/module_esolver/esolver_ks_lcao_tmpfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,104 +8,70 @@
namespace ModuleESolver
{

using namespace std;
using namespace std;

//! dftu occupation matrix for gamma only using dm(double)
template <>
void ESolver_KS_LCAO<double, double>::dftu_cal_occup_m(
const int& iter,
const vector<vector<double>>& dm)const
{
GlobalC::dftu.cal_occup_m_gamma(
iter,
dm,
this->p_chgmix->get_mixing_beta(),
this->p_hamilt);
}
//! dftu occupation matrix for gamma only using dm(double)
template <>
void ESolver_KS_LCAO<double, double>::dftu_cal_occup_m(const int& iter, const vector<vector<double>>& dm) const
{
GlobalC::dftu.cal_occup_m_gamma(iter, dm, this->p_chgmix->get_mixing_beta(), this->p_hamilt);
}

//! dftu occupation matrix for multiple k-points using dm(complex)
template <>
void ESolver_KS_LCAO<complex<double>, double>::dftu_cal_occup_m(
const int& iter,
const vector<vector<complex<double>>>& dm)const
{
GlobalC::dftu.cal_occup_m_k(
iter,
dm,
this->kv,
this->p_chgmix->get_mixing_beta(),
this->p_hamilt);
}
//! dftu occupation matrix for multiple k-points using dm(complex)
template <>
void ESolver_KS_LCAO<complex<double>, double>::dftu_cal_occup_m(const int& iter,
const vector<vector<complex<double>>>& dm) const
{
GlobalC::dftu.cal_occup_m_k(iter, dm, this->kv, this->p_chgmix->get_mixing_beta(), this->p_hamilt);
}

//! dftu occupation matrix
template <>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dftu_cal_occup_m(
const int& iter,
const vector<vector<complex<double>>>& dm)const
{
GlobalC::dftu.cal_occup_m_k(
iter,
dm,
this->kv,
this->p_chgmix->get_mixing_beta(),
this->p_hamilt);
}
//! dftu occupation matrix
template <>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dftu_cal_occup_m(
const int& iter,
const vector<vector<complex<double>>>& dm) const
{
GlobalC::dftu.cal_occup_m_k(iter, dm, this->kv, this->p_chgmix->get_mixing_beta(), this->p_hamilt);
}

#ifdef __DEEPKS
template<>
void ESolver_KS_LCAO<double, double>::dpks_cal_e_delta_band(
const vector<vector<double>>& dm)const
{
GlobalC::ld.cal_e_delta_band(dm);
}


template<>
void ESolver_KS_LCAO<complex<double>, double>::dpks_cal_e_delta_band(
const vector<vector<complex<double>>>& dm)const
{
GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks());
}


template<>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dpks_cal_e_delta_band(
const vector<vector<complex<double>>>& dm)const
{
GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks());
}

template <>
void ESolver_KS_LCAO<double, double>::dpks_cal_e_delta_band(const vector<vector<double>>& dm) const
{
GlobalC::ld.cal_e_delta_band(dm);
}

template<>
void ESolver_KS_LCAO<double, double>::dpks_cal_projected_DM(
const elecstate::DensityMatrix<double, double>* dm)const
{
GlobalC::ld.cal_projected_DM(dm,
GlobalC::ucell,
GlobalC::ORB,
GlobalC::GridD);
}
template <>
void ESolver_KS_LCAO<complex<double>, double>::dpks_cal_e_delta_band(const vector<vector<complex<double>>>& dm) const
{
GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks());
}

template <>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dpks_cal_e_delta_band(
const vector<vector<complex<double>>>& dm) const
{
GlobalC::ld.cal_e_delta_band_k(dm, this->kv.get_nks());
}

template<>
void ESolver_KS_LCAO<complex<double>, double>::dpks_cal_projected_DM(
const elecstate::DensityMatrix<complex<double>, double>* dm)const
{
GlobalC::ld.cal_projected_DM_k(dm,
GlobalC::ucell,
GlobalC::ORB,
GlobalC::GridD);
}
template <>
void ESolver_KS_LCAO<double, double>::dpks_cal_projected_DM(const elecstate::DensityMatrix<double, double>* dm) const
{
GlobalC::ld.cal_projected_DM(dm, GlobalC::ucell, GlobalC::ORB, GlobalC::GridD);
}

template <>
void ESolver_KS_LCAO<complex<double>, double>::dpks_cal_projected_DM(
const elecstate::DensityMatrix<complex<double>, double>* dm) const
{
GlobalC::ld.cal_projected_DM_k(dm, GlobalC::ucell, GlobalC::ORB, GlobalC::GridD);
}

template<>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dpks_cal_projected_DM(
const elecstate::DensityMatrix<complex<double>, double>* dm)const
{
GlobalC::ld.cal_projected_DM_k(dm,
GlobalC::ucell,
GlobalC::ORB,
GlobalC::GridD);
}
#endif
template <>
void ESolver_KS_LCAO<complex<double>, complex<double>>::dpks_cal_projected_DM(
const elecstate::DensityMatrix<complex<double>, double>* dm) const
{
GlobalC::ld.cal_projected_DM_k(dm, GlobalC::ucell, GlobalC::ORB, GlobalC::GridD);
}
#endif
} // namespace ModuleESolver
3 changes: 2 additions & 1 deletion source/module_hamilt_general/matrixblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
namespace hamilt
{

template <typename T> struct MatrixBlock
template <typename T>
struct MatrixBlock
{
/* this is a simple template block of a matrix
would change to Eigen in the future */
Expand Down
5 changes: 2 additions & 3 deletions source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ void Force_LCAO<std::complex<double>>::allocate(const Parallel_Orbitals& pv,
{
cal_deri = false;

ModuleBase::WARNING_QUIT("cal_syns",
"This function has been broken and will be fixed later.");
ModuleBase::WARNING_QUIT("cal_syns", "This function has been broken and will be fixed later.");

LCAO_domain::build_ST_new(lm,
fsr,
Expand All @@ -161,7 +160,7 @@ void Force_LCAO<std::complex<double>>::allocate(const Parallel_Orbitals& pv,

for (int ik = 0; ik < nks; ik++)
{

bool bit = false; // LiuXh, 2017-03-21
/*ModuleIO::save_mat(0,
lm.Hloc2.data(),
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class LCAO_Matrix
#endif

public:

// LiuXh add 2019-07-15
double**** Hloc_fixedR_tr;
double**** SlocR_tr;
Expand Down
Loading

0 comments on commit 1211fc3

Please sign in to comment.