Skip to content

Commit 6e1518c

Browse files
author
abacus_fixer
committed
update esolvers
1 parent 6758930 commit 6e1518c

4 files changed

Lines changed: 42 additions & 71 deletions

File tree

source/source_esolver/esolver_fp.cpp

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,31 @@ void ESolver_FP::before_all_runners(BaseCell& basecell, const Input_para& inp)
4444
ModuleBase::TITLE("ESolver_FP", "before_all_runners");
4545

4646
//! 1) read pseudopotentials
47-
const std::string pseudo_dir = this->inp_->pseudo_dir;
4847
const std::string global_out_dir = PARAM.globalv.global_out_dir;
49-
const bool out_element_info = this->inp_->out_element_info;
50-
const std::string dft_functional = this->inp_->dft_functional;
51-
const bool lspinorb = this->inp_->lspinorb;
52-
const double pseudo_rcut = this->inp_->pseudo_rcut;
53-
const double soc_lambda = this->inp_->soc_lambda;
54-
const int nspin = this->inp_->nspin;
5548
const int npol = PARAM.globalv.npol;
56-
const std::string basis_type = this->inp_->basis_type;
57-
const std::string esolver_type = this->inp_->esolver_type;
58-
const std::string init_wfc = this->inp_->init_wfc;
59-
const int nbands = this->inp_->nbands;
6049
const bool two_fermi = PARAM.globalv.two_fermi;
61-
const double nelec_delta = this->inp_->nelec_delta;
62-
const std::string smearing_method = this->inp_->smearing_method;
63-
const std::string ks_solver = this->inp_->ks_solver;
64-
const int bndpar = this->inp_->bndpar;
65-
const double nelec = this->inp_->nelec;
66-
const double nupdown = this->inp_->nupdown;
67-
auto atoms_info = unitcell::read_pseudo(GlobalV::ofs_running, ucell, pseudo_dir, global_out_dir, out_element_info, dft_functional, lspinorb, pseudo_rcut, soc_lambda, nspin, npol, basis_type, esolver_type, init_wfc, nbands, two_fermi, nelec_delta, smearing_method, ks_solver, bndpar, nelec, nupdown);
50+
auto atoms_info = unitcell::read_pseudo(GlobalV::ofs_running,
51+
ucell,
52+
this->inp_->pseudo_dir,
53+
global_out_dir,
54+
this->inp_->out_element_info,
55+
this->inp_->dft_functional,
56+
this->inp_->lspinorb,
57+
this->inp_->pseudo_rcut,
58+
this->inp_->soc_lambda,
59+
this->inp_->nspin,
60+
npol,
61+
this->inp_->basis_type,
62+
this->inp_->esolver_type,
63+
this->inp_->init_wfc,
64+
this->inp_->nbands,
65+
two_fermi,
66+
this->inp_->nelec_delta,
67+
this->inp_->smearing_method,
68+
this->inp_->ks_solver,
69+
this->inp_->bndpar,
70+
this->inp_->nelec,
71+
this->inp_->nupdown);
6872
elecstate::ParamUpdater::update_from_atoms_info(atoms_info);
6973

7074
//! 2) setup pw_rho, pw_rhod, pw_big, sf, and read_pseudopotentials
@@ -92,9 +96,8 @@ void ESolver_FP::before_all_runners(BaseCell& basecell, const Input_para& inp)
9296
const bool use_ibz = !inp.berry_phase && ModuleSymmetry::Symmetry::symm_flag != -1;
9397
const bool gamma_only_local = PARAM.globalv.gamma_only_local;
9498
const double kspacing[3] = {this->inp_->kspacing[0], this->inp_->kspacing[1], this->inp_->kspacing[2]};
95-
const std::string kmesh_type = this->inp_->kmesh_type;
9699
const double koffset[3] = {this->inp_->koffset[0], this->inp_->koffset[1], this->inp_->koffset[2]};
97-
this->kv.set(ucell, ucell.symm, inp.kpoint_file, inp.nspin, ucell.G, ucell.latvec, GlobalV::ofs_running, use_ibz, global_out_dir, gamma_only_local, kspacing, kmesh_type, koffset);
100+
this->kv.set(ucell, ucell.symm, inp.kpoint_file, inp.nspin, ucell.G, ucell.latvec, GlobalV::ofs_running, use_ibz, global_out_dir, gamma_only_local, kspacing, this->inp_->kmesh_type, koffset);
98101
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT K-POINTS");
99102

100103
//! 8) print information

source/source_esolver/esolver_gets.cpp

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,49 +36,32 @@ void ESolver_GetS::before_all_runners(BaseCell& basecell, const Input_para& inp)
3636
ModuleBase::timer::start("ESolver_GetS", "before_all_runners");
3737

3838
// 1.1) read pseudopotentials
39-
const std::string pseudo_dir = this->inp_->pseudo_dir;
4039
const std::string global_out_dir = PARAM.globalv.global_out_dir;
41-
const bool out_element_info = this->inp_->out_element_info;
42-
const std::string dft_functional = this->inp_->dft_functional;
43-
const bool lspinorb = this->inp_->lspinorb;
44-
const double pseudo_rcut = this->inp_->pseudo_rcut;
45-
const double soc_lambda = this->inp_->soc_lambda;
46-
const int nspin = this->inp_->nspin;
4740
const int npol = PARAM.globalv.npol;
48-
const std::string basis_type = this->inp_->basis_type;
49-
const std::string esolver_type = this->inp_->esolver_type;
50-
const std::string init_wfc = this->inp_->init_wfc;
51-
const int nbands = this->inp_->nbands;
5241
const bool two_fermi = PARAM.globalv.two_fermi;
53-
const double nelec_delta = this->inp_->nelec_delta;
54-
const std::string smearing_method = this->inp_->smearing_method;
55-
const std::string ks_solver = this->inp_->ks_solver;
56-
const int bndpar = this->inp_->bndpar;
57-
const double nelec = this->inp_->nelec;
58-
const double nupdown = this->inp_->nupdown;
5942
// nlocal is calculated inside read_pseudo() via CalAtomsInfo::cal_atoms_info()
6043
auto atoms_info = unitcell::read_pseudo(GlobalV::ofs_running,
6144
ucell,
62-
pseudo_dir,
45+
this->inp_->pseudo_dir,
6346
global_out_dir,
64-
out_element_info,
65-
dft_functional,
66-
lspinorb,
67-
pseudo_rcut,
68-
soc_lambda,
69-
nspin,
47+
this->inp_->out_element_info,
48+
this->inp_->dft_functional,
49+
this->inp_->lspinorb,
50+
this->inp_->pseudo_rcut,
51+
this->inp_->soc_lambda,
52+
this->inp_->nspin,
7053
npol,
71-
basis_type,
72-
esolver_type,
73-
init_wfc,
74-
nbands,
54+
this->inp_->basis_type,
55+
this->inp_->esolver_type,
56+
this->inp_->init_wfc,
57+
this->inp_->nbands,
7558
two_fermi,
76-
nelec_delta,
77-
smearing_method,
78-
ks_solver,
79-
bndpar,
80-
nelec,
81-
nupdown);
59+
this->inp_->nelec_delta,
60+
this->inp_->smearing_method,
61+
this->inp_->ks_solver,
62+
this->inp_->bndpar,
63+
this->inp_->nelec,
64+
this->inp_->nupdown);
8265
elecstate::ParamUpdater::update_from_atoms_info(atoms_info);
8366

8467
// 1.2) symmetrize things
@@ -100,7 +83,6 @@ void ESolver_GetS::before_all_runners(BaseCell& basecell, const Input_para& inp)
10083
const bool use_ibz = !inp.berry_phase && ModuleSymmetry::Symmetry::symm_flag != -1;
10184
const bool gamma_only_local = PARAM.globalv.gamma_only_local;
10285
const double kspacing[3] = {this->inp_->kspacing[0], this->inp_->kspacing[1], this->inp_->kspacing[2]};
103-
const std::string kmesh_type = this->inp_->kmesh_type;
10486
const double koffset[3] = {this->inp_->koffset[0], this->inp_->koffset[1], this->inp_->koffset[2]};
10587
this->kv.set(ucell,
10688
ucell.symm,
@@ -113,7 +95,7 @@ void ESolver_GetS::before_all_runners(BaseCell& basecell, const Input_para& inp)
11395
global_out_dir,
11496
gamma_only_local,
11597
kspacing,
116-
kmesh_type,
98+
this->inp_->kmesh_type,
11799
koffset);
118100
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT K-POINTS");
119101

source/source_esolver/esolver_ks_lcao.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,6 @@ class ESolver_KS_LCAO : public ESolver_KS
101101
bool have_force = false;
102102

103103
GintPrecisionController gint_precision_controller_;
104-
105-
106-
public:
107-
const Record_adj & get_RA() const { return RA; }
108-
const Grid_Driver & get_gd() const { return gd; }
109-
const Parallel_Orbitals & get_pv() const { return pv; }
110-
const std::unique_ptr<ModuleGint::GintInfo> & get_gint_info() const { return gint_info_; }
111-
const TwoCenterBundle & get_two_center_bundle() const { return two_center_bundle_; }
112-
const rdmft::RDMFT<TK, TR> & get_rdmft_solver() const { return rdmft_solver; }
113-
const LCAO_Orbitals & get_orb() const { return orb_; }
114-
const ModuleBase::matrix & get_scs() const { return scs; }
115-
const Setup_DeePKS<TK> & get_deepks() const { return deepks; }
116-
const Exx_NAO<TK> & get_exx_nao() const { return exx_nao; }
117104
};
118105
} // namespace ModuleESolver
119106
#endif

source/source_esolver/esolver_lr_lcao_tddft.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,8 @@ void ModuleESolver::ESolver_LR<T, TR>::initialize_from_unitcell_(UnitCell& ucell
368368
const bool use_ibz = false;
369369
const bool gamma_only_local = PARAM.globalv.gamma_only_local;
370370
const double kspacing[3] = {this->inp_->kspacing[0], this->inp_->kspacing[1], this->inp_->kspacing[2]};
371-
const std::string kmesh_type = this->inp_->kmesh_type;
372371
const double koffset[3] = {this->inp_->koffset[0], this->inp_->koffset[1], this->inp_->koffset[2]};
373-
this->kv.set(ucell, ucell.symm, this->inp_->kpoint_file, this->inp_->nspin, ucell.G, ucell.latvec, GlobalV::ofs_running, use_ibz, this->out_dir, gamma_only_local, kspacing, kmesh_type, koffset);
372+
this->kv.set(ucell, ucell.symm, this->inp_->kpoint_file, this->inp_->nspin, ucell.G, ucell.latvec, GlobalV::ofs_running, use_ibz, this->out_dir, gamma_only_local, kspacing, this->inp_->kmesh_type, koffset);
374373
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT K-POINTS");
375374
ModuleIO::print_parameters(ucell, this->kv, inp);
376375

0 commit comments

Comments
 (0)