@@ -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 ;
@@ -155,14 +155,14 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
155155 this ->exx_info_ );
156156 }
157157
158- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
158+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
159159 elecstate::init_scf (ucell,
160160 this ->Pgrid ,
161161 this ->sf .strucFac ,
162162 this ->locpp .numeric ,
163163 istep,
164164 PARAM .globalv .global_out_dir ,
165- PARAM . inp ,
165+ * this -> inp_ ,
166166 this ->pelec_base );
167167 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
168168
@@ -184,13 +184,13 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
184184 ModuleBase::TITLE (" ESolver_DoubleXC" , " iter_finish" );
185185 ModuleBase::timer::start (" ESolver_DoubleXC" , " iter_finish" );
186186
187- bool output_iter = PARAM . inp . deepks_out_labels > 0 && PARAM . inp . deepks_out_freq_elec
188- && (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 );
189189
190190 if (output_iter)
191191 {
192192 // save output charge density (density after diagnonalization)
193- for (int is = 0 ; is < PARAM . inp . nspin ; is++)
193+ for (int is = 0 ; is < this -> inp_ -> nspin ; is++)
194194 {
195195 ModuleBase::GlobalFunc::DCOPY (this ->chr .rho [is], this ->chr_base .rho [is], this ->chr .rhopw ->nrxx );
196196 if (XC_Functional::get_ked_flag ())
@@ -221,7 +221,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
221221 // This will change the result of out_hsk
222222 // The original result of out_hsk is H of input density, but this change H to that of output density
223223 // When converged, these two should be close
224- 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 )
225225 {
226226 // update real space Hamiltonian
227227 this ->p_hamilt ->refresh ();
@@ -256,7 +256,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
256256
257257 // ---------- prepare for base ----------
258258 // set as base functional Temporarily
259- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
259+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
260260
261261 // update pot of pelec_base according to chr_base
262262 if (!conv_esolver)
@@ -282,14 +282,14 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
282282 // std::endl;
283283
284284#ifdef __MLALGO
285- 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);
286286 LCAO_deepks_io::save_npy_e (pelec_base->f_en .etot , file_ebase, GlobalV::MY_RANK );
287287#endif
288288
289289 // ---------- h_base ----------
290- if (PARAM . inp . deepks_v_delta > 0 )
290+ if (this -> inp_ -> deepks_v_delta > 0 )
291291 {
292- if (PARAM . inp . vl_in_h )
292+ if (this -> inp_ -> vl_in_h )
293293 {
294294 // update real space Hamiltonian
295295 this ->p_hamilt_base ->refresh ();
@@ -308,13 +308,13 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
308308 std::vector<TH > h_tot (nks);
309309 DeePKS_domain::get_h_tot<TK , TH , TR >(this ->pv , p_ham_deepks_base, h_tot, PARAM .globalv .nlocal , nks, ' H' );
310310
311- 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);
312312 LCAO_deepks_io::save_npy_h<TK , TH >(h_tot, file_htot, PARAM .globalv .nlocal , nks, GlobalV::MY_RANK );
313313#endif
314314 }
315315
316316 // ---------- o_base ----------
317- if (PARAM . inp . deepks_bandgap > 0 )
317+ if (this -> inp_ -> deepks_bandgap > 0 )
318318 {
319319 // obase isn't implemented yet
320320 // don't need to solve p_hamilt_base
@@ -325,17 +325,17 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
325325 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
326326 }
327327 // ---------- prepare for f_base ----------
328- else if (PARAM . inp . cal_force && conv_esolver)
328+ else if (this -> inp_ -> cal_force && conv_esolver)
329329 {
330330 // vnew must be updated for force_scc() even if not output_iter
331331 // set as base functional Temporarily
332- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
332+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
333333 this ->pelec_base ->cal_converged ();
334334 // restore to original xc
335335 XC_Functional::set_xc_type (ucell.atoms [0 ].ncpp .xc_func );
336336 }
337337
338- if (PARAM . inp . cal_force )
338+ if (this -> inp_ -> cal_force )
339339 {
340340 if (!conv_esolver)
341341 {
@@ -345,7 +345,7 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
345345 else
346346 {
347347 // copy charge
348- for (int is = 0 ; is < PARAM . inp . nspin ; is++)
348+ for (int is = 0 ; is < this -> inp_ -> nspin ; is++)
349349 {
350350 ModuleBase::GlobalFunc::DCOPY (this ->chr .rho [is], this ->chr_base .rho [is], this ->chr .rhopw ->nrxx );
351351 if (XC_Functional::get_ked_flag ())
@@ -389,16 +389,16 @@ void ESolver_DoubleXC<TK, TR>::cal_force(BaseCell& basecell, ModuleBase::matrix&
389389 Force_Stress_LCAO<TK > fsl (this ->RA , ucell.nat );
390390
391391 // set as base functional Temporarily
392- XC_Functional::set_xc_type (PARAM . inp . deepks_out_base );
392+ XC_Functional::set_xc_type (this -> inp_ -> deepks_out_base );
393393
394394 this ->deepks .dpks_out_type = " base" ; // for deepks method
395395
396396 fsl.getForceStress (ucell,
397397 this ->get_vdw_result (),
398- PARAM . inp . cal_force ,
399- PARAM . inp . cal_stress ,
400- PARAM . inp . test_force ,
401- PARAM . inp . test_stress ,
398+ this -> inp_ -> cal_force ,
399+ this -> inp_ -> cal_stress ,
400+ this -> inp_ -> test_force ,
401+ this -> inp_ -> test_stress ,
402402 this ->gd ,
403403 this ->pv ,
404404 this ->pelec_base ,
0 commit comments