@@ -64,11 +64,11 @@ void ESolver_DoubleXC<TK, TR>::before_all_runners(BaseCell& basecell, const Inpu
6464 int ncol = 0 ;
6565 if (PARAM .globalv .gamma_only_local )
6666 {
67- nsk = PARAM . inp . nspin ;
67+ nsk = this -> inp_ -> nspin ;
6868 ncol = this ->pv .ncol_bands ;
69- if (PARAM . inp . ks_solver == " genelpa" || PARAM . inp . ks_solver == " elpa" || PARAM . inp . ks_solver == " lapack"
70- || PARAM . inp . ks_solver == " pexsi" || PARAM . inp . ks_solver == " cusolver"
71- || PARAM . inp . ks_solver == " cusolvermp" )
69+ if (this -> inp_ -> ks_solver == " genelpa" || this -> inp_ -> ks_solver == " elpa" || this -> inp_ -> ks_solver == " lapack"
70+ || this -> inp_ -> ks_solver == " pexsi" || this -> inp_ -> ks_solver == " cusolver"
71+ || this -> inp_ -> ks_solver == " cusolvermp" )
7272 {
7373 ncol = this ->pv .ncol ;
7474 }
@@ -79,19 +79,19 @@ void ESolver_DoubleXC<TK, TR>::before_all_runners(BaseCell& basecell, const Inpu
7979#ifdef __MPI
8080 ncol = this ->pv .ncol_bands ;
8181#else
82- ncol = PARAM . inp . nbands ;
82+ ncol = this -> inp_ -> nbands ;
8383#endif
8484 }
8585 this ->psi_base = new psi::Psi<TK >(nsk, ncol, this ->pv .nrow , this ->kv .ngk , true );
8686 }
8787
8888 // 6) initialize the density matrix
89- this ->dmat_base .allocate_dm (&this ->kv , &this ->pv , PARAM . inp . nspin );
89+ this ->dmat_base .allocate_dm (&this ->kv , &this ->pv , this -> inp_ -> nspin );
9090
9191 // 10) inititlize the charge density
9292 this ->chr_base .set_rhopw (this ->pw_rhod ); // mohan add 20251130
9393 const bool kin_den = this ->chr_base .kin_density (); // mohan add 20251202
94- this ->chr_base .allocate (PARAM . inp . nspin , kin_den);
94+ this ->chr_base .allocate (this -> inp_ -> nspin , kin_den);
9595 this ->chr_base .init_rho (ucell, this ->Pgrid , this ->sf .strucFac , ucell.symm , &this ->kv );
9696 this ->chr_base .check_rho ();
9797
@@ -127,7 +127,7 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
127127 // ----------------------------------------------------------
128128 // ! calculate ewald energy
129129 // ----------------------------------------------------------
130- if (!PARAM . inp . test_skip_ewald )
130+ if (!this -> inp_ -> test_skip_ewald )
131131 {
132132 // this->pelec_base->f_en.ewald_energy = H_Ewald_pw::compute_ewald(ucell, this->pw_rhod, this->sf.strucFac);
133133 this ->pelec_base ->f_en .ewald_energy = this ->pelec ->f_en .ewald_energy ;
@@ -151,17 +151,18 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
151151 &this ->dftu ,
152152 this ->deepks ,
153153 istep,
154- this ->exx_nao );
154+ this ->exx_nao ,
155+ this ->exx_info_ );
155156 }
156157
157- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
158+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
158159 elecstate::init_scf (ucell,
159160 this ->Pgrid ,
160161 this ->sf .strucFac ,
161162 this ->locpp .numeric ,
162163 istep,
163164 PARAM .globalv .global_out_dir ,
164- PARAM . inp ,
165+ * this -> inp_ ,
165166 this ->pelec_base );
166167 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
167168
@@ -183,13 +184,13 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
183184 ModuleBase::TITLE (" ESolver_DoubleXC" , " iter_finish" );
184185 ModuleBase::timer::start (" ESolver_DoubleXC" , " iter_finish" );
185186
186- bool output_iter = PARAM . inp . deepks_out_labels > 0 && PARAM . inp . deepks_out_freq_elec
187- && (iter % PARAM . inp . deepks_out_freq_elec == 0 );
187+ bool output_iter = this -> inp_ -> deepks_out_labels > 0 && this -> inp_ -> deepks_out_freq_elec
188+ && (iter % this -> inp_ -> deepks_out_freq_elec == 0 );
188189
189190 if (output_iter)
190191 {
191192 // save output charge density (density after diagnonalization)
192- for (int is = 0 ; is < PARAM . inp . nspin ; is++)
193+ for (int is = 0 ; is < this -> inp_ -> nspin ; is++)
193194 {
194195 ModuleBase::GlobalFunc::DCOPY (this ->chr .rho [is], this ->chr_base .rho [is], this ->chr .rhopw ->nrxx );
195196 if (XC_Functional::get_ked_flag ())
@@ -220,7 +221,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
220221 // This will change the result of out_hsk
221222 // The original result of out_hsk is H of input density, but this change H to that of output density
222223 // When converged, these two should be close
223- if (PARAM . inp . deepks_v_delta > 0 && PARAM . inp . vl_in_h )
224+ if (this -> inp_ -> deepks_v_delta > 0 && this -> inp_ -> vl_in_h )
224225 {
225226 // update real space Hamiltonian
226227 this ->p_hamilt ->refresh ();
@@ -255,7 +256,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
255256
256257 // ---------- prepare for base ----------
257258 // set as base functional Temporarily
258- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
259+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
259260
260261 // update pot of pelec_base according to chr_base
261262 if (!conv_esolver)
@@ -281,14 +282,14 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
281282 // std::endl;
282283
283284#ifdef __MLALGO
284- const std::string file_ebase = deepks_interface.get_filename (" ebase" , PARAM . inp . deepks_out_labels , iter);
285+ const std::string file_ebase = deepks_interface.get_filename (" ebase" , this -> inp_ -> deepks_out_labels , iter);
285286 LCAO_deepks_io::save_npy_e (pelec_base->f_en .etot , file_ebase, GlobalV::MY_RANK );
286287#endif
287288
288289 // ---------- h_base ----------
289- if (PARAM . inp . deepks_v_delta > 0 )
290+ if (this -> inp_ -> deepks_v_delta > 0 )
290291 {
291- if (PARAM . inp . vl_in_h )
292+ if (this -> inp_ -> vl_in_h )
292293 {
293294 // update real space Hamiltonian
294295 this ->p_hamilt_base ->refresh ();
@@ -307,13 +308,13 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
307308 std::vector<TH > h_tot (nks);
308309 DeePKS_domain::get_h_tot<TK , TH , TR >(this ->pv , p_ham_deepks_base, h_tot, PARAM .globalv .nlocal , nks, ' H' );
309310
310- const std::string file_htot = deepks_interface.get_filename (" hbase" , PARAM . inp . deepks_out_labels , iter);
311+ const std::string file_htot = deepks_interface.get_filename (" hbase" , this -> inp_ -> deepks_out_labels , iter);
311312 LCAO_deepks_io::save_npy_h<TK , TH >(h_tot, file_htot, PARAM .globalv .nlocal , nks, GlobalV::MY_RANK );
312313#endif
313314 }
314315
315316 // ---------- o_base ----------
316- if (PARAM . inp . deepks_bandgap > 0 )
317+ if (this -> inp_ -> deepks_bandgap > 0 )
317318 {
318319 // obase isn't implemented yet
319320 // don't need to solve p_hamilt_base
@@ -324,17 +325,17 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
324325 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
325326 }
326327 // ---------- prepare for f_base ----------
327- else if (PARAM . inp . cal_force && conv_esolver)
328+ else if (this -> inp_ -> cal_force && conv_esolver)
328329 {
329330 // vnew must be updated for force_scc() even if not output_iter
330331 // set as base functional Temporarily
331- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
332+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
332333 this ->pelec_base ->cal_converged ();
333334 // restore to original xc
334335 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
335336 }
336337
337- if (PARAM . inp . cal_force )
338+ if (this -> inp_ -> cal_force )
338339 {
339340 if (!conv_esolver)
340341 {
@@ -344,7 +345,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
344345 else
345346 {
346347 // copy charge
347- for (int is = 0 ; is < PARAM . inp . nspin ; is++)
348+ for (int is = 0 ; is < this -> inp_ -> nspin ; is++)
348349 {
349350 ModuleBase::GlobalFunc::DCOPY (this ->chr .rho [is], this ->chr_base .rho [is], this ->chr .rhopw ->nrxx );
350351 if (XC_Functional::get_ked_flag ())
@@ -388,16 +389,16 @@ void ESolver_DoubleXC<TK, TR>::cal_force(BaseCell& basecell, ModuleBase::matrix&
388389 Force_Stress_LCAO<TK > fsl (this ->RA , ucell.nat );
389390
390391 // set as base functional Temporarily
391- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
392+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
392393
393394 this ->deepks .dpks_out_type = " base" ; // for deepks method
394395
395396 fsl.getForceStress (ucell,
396397 this ->get_vdw_result (),
397- PARAM . inp . cal_force ,
398- PARAM . inp . cal_stress ,
399- PARAM . inp . test_force ,
400- PARAM . inp . test_stress ,
398+ this -> inp_ -> cal_force ,
399+ this -> inp_ -> cal_stress ,
400+ this -> inp_ -> test_force ,
401+ this -> inp_ -> test_stress ,
401402 this ->gd ,
402403 this ->pv ,
403404 this ->pelec_base ,
@@ -415,7 +416,8 @@ void ESolver_DoubleXC<TK, TR>::cal_force(BaseCell& basecell, ModuleBase::matrix&
415416 this ->dftu ,
416417 this ->deepks ,
417418 this ->exx_nao ,
418- &ucell.symm );
419+ &ucell.symm ,
420+ this ->exx_info_ );
419421
420422 // restore to original xc
421423 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
0 commit comments