11#include " source_lcao/LCAO_set_pot.h"
22#include " source_io/module_parameter/parameter.h"
33
4- namespace LCAO_domain
5- {
6-
7- void set_psi_occ_dm_chg (psi, kv, pv, inp, pelec, dmat, chr)
4+ template <typename TK>
5+ void LCAO_domain::set_psi_occ_dm_chg (
6+ const K_Vectors &kv, // k-points
7+ psi::Psi<TK>* psi, // coefficients of NAO basis
8+ const Parallel_Orbitals &pv, // parallel scheme of NAO basis
9+ elecstate::ElecState* pelec, // eigen values and weights
10+ LCAO_domain::Setup_DM<TK> &dmat, // density matrix
11+ Charge &chr, // charge density
12+ const Input_para &inp) // input parameters
813{
914 // ! 1) init electronic wave function psi
1015 Setup_Psi<TK>::allocate_psi (psi, kv, pv, inp);
@@ -16,54 +21,69 @@ void set_psi_occ_dm_chg(psi, kv, pv, inp, pelec, dmat, chr)
1621 pv, *psi, pelec->ekb , pelec->wg , kv.ik2iktot ,
1722 kv.get_nkstot (), inp.nspin ))
1823 {
19- ModuleBase::WARNING_QUIT (" ESolver_KS_LCAO " , " read electronic wave functions failed" );
24+ ModuleBase::WARNING_QUIT (" set_psi_occ_dm_chg " , " read electronic wave functions failed" );
2025 }
2126 }
2227
23- // 3) set occupations, tddft does not need to set occupations in the first scf
28+ // ! 3) set occupations, tddft does not need to set occupations in the first scf
2429 if (inp.ocp && inp.esolver_type != " tddft" )
2530 {
2631 elecstate::fixed_weights (inp.ocp_kb , inp.nbands , inp.nelec ,
27- pelec-> klist , pelec->wg , pelec->skip_weights );
32+ kv , pelec->wg , pelec->skip_weights );
2833 }
2934
30- // 4) init DMK, but DMR is constructed in before_scf()
35+ // ! 4) init DMK, but DMR is constructed in before_scf()
3136 dmat.allocate_dm (&kv, &pv, inp.nspin );
3237
33- // 5) init charge density
38+ // ! 5) init charge density
3439 chr.allocate (inp.nspin );
40+
41+ return ;
3542}
3643
3744
38- void set_pot (pelec, locpp, pw_rho, pw_rhod, sf, solvent, dftu, pv, kv, orb_, exx_nao, deepks)
45+
46+ void LCAO_domain::set_pot (
47+ const K_Vectors &kv,
48+ const Structure_Factor& sf,
49+ const ModulePW::PW_Basis &pw_rho,
50+ const ModulePW::PW_Basis &pw_rhod,
51+ elecstate::ElecState* pelec,
52+ const LCAO_Orbitals& orb,
53+ const Parallel_Orbitals &pv,
54+ pseudopot_cell_vl &locpp,
55+ Plus_U &dftu,
56+ surchem& solvent,
57+ Exx_NAO<T> &exx_nao,
58+ Setup_DeePKS<T> &deepks,
59+ const Input_para &inp)
3960{
40- // 1) init local pseudopotentials
61+ // ! 1) init local pseudopotentials
4162 locpp.init_vloc (ucell, pw_rho);
4263 ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " LOCAL POTENTIAL" );
4364
44- // 2) init potentials
65+ // ! 2) init potentials
4566 if (pelec->pot == nullptr )
4667 {
4768 // where is the pot deleted?
48- pelec->pot = new elecstate::Potential (pw_rhod, pw_rho,
69+ pelec->pot = new elecstate::Potential (& pw_rhod, & pw_rho,
4970 &ucell, &(locpp.vloc ), &(sf), &(solvent),
5071 &(pelec->f_en .etxc ), &(pelec->f_en .vtxc ));
5172 }
5273
53- // 3) initialize DFT+U
74+ // ! 3) initialize DFT+U
5475 if (inp.dft_plus_u )
5576 {
56- dftu.init (ucell, &pv, kv.get_nks (), &orb_ );
77+ dftu.init (ucell, &pv, kv.get_nks (), &orb );
5778 }
5879
59- // 4) init exact exchange calculations
60- exx_nao.before_runner (ucell, kv, orb_ , pv, inp);
80+ // ! 4) init exact exchange calculations
81+ exx_nao.before_runner (ucell, kv, orb , pv, inp);
6182
62- // 5) init deepks
63- deepks.before_runner (ucell, kv.get_nks (), orb_ , pv, inp);
83+ // ! 5) init deepks
84+ deepks.before_runner (ucell, kv.get_nks (), orb , pv, inp);
6485
6586 return ;
6687}
6788
6889
69- }
0 commit comments