diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 79d8cd982f..2a59f7996b 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -808,13 +808,13 @@ void ESolver_KS_LCAO::update_pot(const int istep, const int iter) // 1) print Hamiltonian and Overlap matrix if (this->conv_elec || iter == GlobalV::SCF_NMAX) { - if (!GlobalV::GAMMA_ONLY_LOCAL && (hsolver::HSolverLCAO::out_mat_hs[0] || GlobalV::deepks_v_delta)) + if (!GlobalV::GAMMA_ONLY_LOCAL && (PARAM.inp.out_mat_hs[0] || GlobalV::deepks_v_delta)) { this->GK.renew(true); } for (int ik = 0; ik < this->kv.get_nks(); ++ik) { - if (hsolver::HSolverLCAO::out_mat_hs[0]|| GlobalV::deepks_v_delta) + if (PARAM.inp.out_mat_hs[0]|| GlobalV::deepks_v_delta) { this->p_hamilt->updateHk(ik); } @@ -828,13 +828,13 @@ void ESolver_KS_LCAO::update_pot(const int istep, const int iter) this->p_hamilt->matrix(h_mat, s_mat); - if (hsolver::HSolverLCAO::out_mat_hs[0]) + if (PARAM.inp.out_mat_hs[0]) { ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, - hsolver::HSolverLCAO::out_mat_hs[1], + PARAM.inp.out_mat_hs[1], 1, GlobalV::out_app_flag, "H", @@ -845,7 +845,7 @@ void ESolver_KS_LCAO::update_pot(const int istep, const int iter) s_mat.p, GlobalV::NLOCAL, bit, - hsolver::HSolverLCAO::out_mat_hs[1], + PARAM.inp.out_mat_hs[1], 1, GlobalV::out_app_flag, "S", diff --git a/source/module_esolver/esolver_ks_lcao_tddft.cpp b/source/module_esolver/esolver_ks_lcao_tddft.cpp index 9ac24357e9..c7940f374f 100644 --- a/source/module_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/module_esolver/esolver_ks_lcao_tddft.cpp @@ -239,7 +239,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(const int istep, const int iter) } for (int ik = 0; ik < kv.get_nks(); ++ik) { - if (hsolver::HSolverLCAO>::out_mat_hs[0]) + if (PARAM.inp.out_mat_hs[0]) { this->p_hamilt->updateHk(ik); } @@ -250,13 +250,13 @@ void ESolver_KS_LCAO_TDDFT::update_pot(const int istep, const int iter) { hamilt::MatrixBlock> h_mat, s_mat; this->p_hamilt->matrix(h_mat, s_mat); - if (hsolver::HSolverLCAO>::out_mat_hs[0]) + if (PARAM.inp.out_mat_hs[0]) { ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, - hsolver::HSolverLCAO>::out_mat_hs[1], + PARAM.inp.out_mat_hs[1], 1, GlobalV::out_app_flag, "H", @@ -268,7 +268,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(const int istep, const int iter) s_mat.p, GlobalV::NLOCAL, bit, - hsolver::HSolverLCAO>::out_mat_hs[1], + PARAM.inp.out_mat_hs[1], 1, GlobalV::out_app_flag, "S", diff --git a/source/module_esolver/lcao_fun.cpp b/source/module_esolver/lcao_fun.cpp index 76b58e88ba..77a1312474 100644 --- a/source/module_esolver/lcao_fun.cpp +++ b/source/module_esolver/lcao_fun.cpp @@ -52,19 +52,19 @@ namespace ModuleESolver template ModuleIO::Output_Mat_Sparse ESolver_KS_LCAO::create_Output_Mat_Sparse(int istep) { - return ModuleIO::Output_Mat_Sparse(hsolver::HSolverLCAO::out_mat_hsR, - hsolver::HSolverLCAO::out_mat_dh, - hsolver::HSolverLCAO::out_mat_t, - PARAM.inp.out_mat_r, - istep, - this->pelec->pot->get_effective_v(), - this->pv, - this->GK, // mohan add 2024-04-01 - two_center_bundle_, - orb_, - GlobalC::GridD, // mohan add 2024-04-06 - this->kv, - this->p_hamilt); + return ModuleIO::Output_Mat_Sparse(PARAM.inp.out_mat_hs2, + PARAM.inp.out_mat_dh, + PARAM.inp.out_mat_t, + PARAM.inp.out_mat_r, + istep, + this->pelec->pot->get_effective_v(), + this->pv, + this->GK, // mohan add 2024-04-01 + two_center_bundle_, + orb_, + GlobalC::GridD, // mohan add 2024-04-06 + this->kv, + this->p_hamilt); } //------------------------------------------------------------------------------ diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp index dc47a7ec88..ebc60ac7f4 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -5,6 +5,8 @@ #include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include "module_hsolver/hsolver_lcao.h" +#include "module_parameter/parameter.h" + #ifdef __ELPA #include "module_hsolver/diago_elpa.h" #include "module_hsolver/diago_elpa_native.h" @@ -16,7 +18,7 @@ template <> void OperatorLCAO::get_hs_pointers() { ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); this->hmatrix_k = this->hsk->get_hk(); - if ((this->new_e_iteration && ik == 0) || hsolver::HSolverLCAO::out_mat_hs[0]) + if ((this->new_e_iteration && ik == 0) || PARAM.inp.out_mat_hs[0]) { if (this->smatrix_k == nullptr) { diff --git a/source/module_hsolver/hsolver_lcao.h b/source/module_hsolver/hsolver_lcao.h index d139e79abe..9d27f50c19 100644 --- a/source/module_hsolver/hsolver_lcao.h +++ b/source/module_hsolver/hsolver_lcao.h @@ -19,11 +19,6 @@ class HSolverLCAO const std::string method_in, const bool skip_charge); - static std::vector out_mat_hs; // mohan add 2010-09-02 - static int out_mat_hsR; // LiuXh add 2019-07-16 - static int out_mat_t; - static int out_mat_dh; - private: void hamiltSolvePsiK(hamilt::Hamilt* hm, psi::Psi& psi, double* eigenvalue); @@ -41,15 +36,6 @@ class HSolverLCAO std::string method = "none"; }; -template -std::vector HSolverLCAO::out_mat_hs = {0, 8}; -template -int HSolverLCAO::out_mat_hsR = 0; -template -int HSolverLCAO::out_mat_t = 0; -template -int HSolverLCAO::out_mat_dh = 0; - template inline T my_conj(T value) { diff --git a/source/module_io/input_conv.cpp b/source/module_io/input_conv.cpp index 06afbd64d8..a2e81f9e54 100644 --- a/source/module_io/input_conv.cpp +++ b/source/module_io/input_conv.cpp @@ -561,14 +561,7 @@ void Input_Conv::Convert() GlobalV::out_app_flag = PARAM.inp.out_app_flag; #ifdef __LCAO - hsolver::HSolverLCAO::out_mat_hs = PARAM.inp.out_mat_hs; - hsolver::HSolverLCAO::out_mat_hsR = PARAM.inp.out_mat_hs2; // LiuXh add 2019-07-16 - hsolver::HSolverLCAO::out_mat_t = PARAM.inp.out_mat_t; - hsolver::HSolverLCAO::out_mat_dh = PARAM.inp.out_mat_dh; - hsolver::HSolverLCAO>::out_mat_hs = PARAM.inp.out_mat_hs; - hsolver::HSolverLCAO>::out_mat_hsR = PARAM.inp.out_mat_hs2; // LiuXh add 2019-07-16 - hsolver::HSolverLCAO>::out_mat_t = PARAM.inp.out_mat_t; - hsolver::HSolverLCAO>::out_mat_dh = PARAM.inp.out_mat_dh; + if (GlobalV::GAMMA_ONLY_LOCAL) { elecstate::ElecStateLCAO::out_wfc_lcao = PARAM.inp.out_wfc_lcao;