Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,13 +808,13 @@ void ESolver_KS_LCAO<TK, TR>::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<TK>::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<TK>::out_mat_hs[0]|| GlobalV::deepks_v_delta)
if (PARAM.inp.out_mat_hs[0]|| GlobalV::deepks_v_delta)
{
this->p_hamilt->updateHk(ik);
}
Expand All @@ -828,13 +828,13 @@ void ESolver_KS_LCAO<TK, TR>::update_pot(const int istep, const int iter)

this->p_hamilt->matrix(h_mat, s_mat);

if (hsolver::HSolverLCAO<TK>::out_mat_hs[0])
if (PARAM.inp.out_mat_hs[0])
{
ModuleIO::save_mat(istep,
h_mat.p,
GlobalV::NLOCAL,
bit,
hsolver::HSolverLCAO<TK>::out_mat_hs[1],
PARAM.inp.out_mat_hs[1],
1,
GlobalV::out_app_flag,
"H",
Expand All @@ -845,7 +845,7 @@ void ESolver_KS_LCAO<TK, TR>::update_pot(const int istep, const int iter)
s_mat.p,
GlobalV::NLOCAL,
bit,
hsolver::HSolverLCAO<TK>::out_mat_hs[1],
PARAM.inp.out_mat_hs[1],
1,
GlobalV::out_app_flag,
"S",
Expand Down
8 changes: 4 additions & 4 deletions source/module_esolver/esolver_ks_lcao_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::complex<double>>::out_mat_hs[0])
if (PARAM.inp.out_mat_hs[0])
{
this->p_hamilt->updateHk(ik);
}
Expand All @@ -250,13 +250,13 @@ void ESolver_KS_LCAO_TDDFT::update_pot(const int istep, const int iter)
{
hamilt::MatrixBlock<complex<double>> h_mat, s_mat;
this->p_hamilt->matrix(h_mat, s_mat);
if (hsolver::HSolverLCAO<std::complex<double>>::out_mat_hs[0])
if (PARAM.inp.out_mat_hs[0])
{
ModuleIO::save_mat(istep,
h_mat.p,
GlobalV::NLOCAL,
bit,
hsolver::HSolverLCAO<std::complex<double>>::out_mat_hs[1],
PARAM.inp.out_mat_hs[1],
1,
GlobalV::out_app_flag,
"H",
Expand All @@ -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<std::complex<double>>::out_mat_hs[1],
PARAM.inp.out_mat_hs[1],
1,
GlobalV::out_app_flag,
"S",
Expand Down
26 changes: 13 additions & 13 deletions source/module_esolver/lcao_fun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ namespace ModuleESolver
template <typename TK, typename TR>
ModuleIO::Output_Mat_Sparse<TK> ESolver_KS_LCAO<TK, TR>::create_Output_Mat_Sparse(int istep)
{
return ModuleIO::Output_Mat_Sparse<TK>(hsolver::HSolverLCAO<TK>::out_mat_hsR,
hsolver::HSolverLCAO<TK>::out_mat_dh,
hsolver::HSolverLCAO<TK>::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<TK>(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);
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -16,7 +18,7 @@ template <>
void OperatorLCAO<double, double>::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<double>::out_mat_hs[0])
if ((this->new_e_iteration && ik == 0) || PARAM.inp.out_mat_hs[0])
{
if (this->smatrix_k == nullptr)
{
Expand Down
14 changes: 0 additions & 14 deletions source/module_hsolver/hsolver_lcao.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ class HSolverLCAO
const std::string method_in,
const bool skip_charge);

static std::vector<int> 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<T>* hm, psi::Psi<T>& psi, double* eigenvalue);

Expand All @@ -41,15 +36,6 @@ class HSolverLCAO
std::string method = "none";
};

template <typename T, typename Device>
std::vector<int> HSolverLCAO<T, Device>::out_mat_hs = {0, 8};
template <typename T, typename Device>
int HSolverLCAO<T, Device>::out_mat_hsR = 0;
template <typename T, typename Device>
int HSolverLCAO<T, Device>::out_mat_t = 0;
template <typename T, typename Device>
int HSolverLCAO<T, Device>::out_mat_dh = 0;

template <typename T>
inline T my_conj(T value)
{
Expand Down
9 changes: 1 addition & 8 deletions source/module_io/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,7 @@ void Input_Conv::Convert()
GlobalV::out_app_flag = PARAM.inp.out_app_flag;

#ifdef __LCAO
hsolver::HSolverLCAO<double>::out_mat_hs = PARAM.inp.out_mat_hs;
hsolver::HSolverLCAO<double>::out_mat_hsR = PARAM.inp.out_mat_hs2; // LiuXh add 2019-07-16
hsolver::HSolverLCAO<double>::out_mat_t = PARAM.inp.out_mat_t;
hsolver::HSolverLCAO<double>::out_mat_dh = PARAM.inp.out_mat_dh;
hsolver::HSolverLCAO<std::complex<double>>::out_mat_hs = PARAM.inp.out_mat_hs;
hsolver::HSolverLCAO<std::complex<double>>::out_mat_hsR = PARAM.inp.out_mat_hs2; // LiuXh add 2019-07-16
hsolver::HSolverLCAO<std::complex<double>>::out_mat_t = PARAM.inp.out_mat_t;
hsolver::HSolverLCAO<std::complex<double>>::out_mat_dh = PARAM.inp.out_mat_dh;

if (GlobalV::GAMMA_ONLY_LOCAL)
{
elecstate::ElecStateLCAO<double>::out_wfc_lcao = PARAM.inp.out_wfc_lcao;
Expand Down