1313namespace LR
1414{
1515 // constructor for exchange-correlation kernel
16- PotHxcLR::PotHxcLR (const std::string& xc_kernel_in , const ModulePW::PW_Basis* rho_basis_in , const UnitCell* ucell_in ,
16+ PotHxcLR::PotHxcLR (const std::string& xc_kernel , const ModulePW::PW_Basis* rho_basis , const UnitCell* ucell ,
1717 const Charge* chg_gs/* ground state*/ , const Parallel_Grid& pgrid,
18- const SpinType& st_in , const std::vector<std::string>& lr_init_xc_kernel)
19- :xc_kernel(xc_kernel_in ), tpiba_(ucell_in ->tpiba), spin_type_(st_in ),
20- xc_kernel_components_ (*rho_basis_in )
18+ const SpinType& st , const std::vector<std::string>& lr_init_xc_kernel)
19+ :xc_kernel_(xc_kernel ), tpiba_(ucell ->tpiba), spin_type_(st ),
20+ xc_kernel_components_ (*rho_basis )
2121 {
22- this ->rho_basis_ = rho_basis_in ;
22+ this ->rho_basis_ = rho_basis ;
2323 this ->nrxx = chg_gs->nrxx ;
2424 this ->nspin = (PARAM.inp .nspin == 1 || (PARAM.inp .nspin == 4 && !PARAM.globalv .domag && !PARAM.globalv .domag_z )) ? 1 : 2 ;
2525
2626 this ->pot_hartree = LR_Util::make_unique<elecstate::PotHartree>(this ->rho_basis_ );
2727
2828 const std::set<std::string> local_xc = { " lda" , " pwlda" , " pbe" , " hse" };
29- if (local_xc.find (this ->xc_kernel ) != local_xc.end ())
29+ if (local_xc.find (this ->xc_kernel_ ) != local_xc.end ())
3030 {
31- XC_Functional::set_xc_type (this ->xc_kernel ); // for hse, (1-alpha) and omega are set here
31+ XC_Functional::set_xc_type (this ->xc_kernel_ ); // for hse, (1-alpha) and omega are set here
3232 this ->xc_type_ = XCType (XC_Functional::get_func_type ());
3333 this ->set_integral_func (this ->spin_type_ , this ->xc_type_ );
3434
3535 if (lr_init_xc_kernel[0 ] == " file" )
3636 {
3737 const std::set<std::string> lda_xc = { " lda" , " pwlda" };
38- assert (lda_xc.count (this ->xc_kernel ));
38+ assert (lda_xc.count (this ->xc_kernel_ ));
3939 const int spinsize = (1 == nspin) ? 1 : 3 ;
4040 std::vector<double > v2rho2 (spinsize * nrxx);
4141 // read fxc adn add to xc_kernel_components
@@ -46,7 +46,7 @@ namespace LR
4646 int prenspin = 1 ;
4747 std::vector<double > v2rho2_tmp (nrxx);
4848 ModuleIO::read_vdata_palgrid (pgrid, GlobalV::MY_RANK, GlobalV::ofs_running, lr_init_xc_kernel[is + 1 ],
49- v2rho2_tmp.data (), ucell_in ->nat );
49+ v2rho2_tmp.data (), ucell ->nat );
5050 for (int ir = 0 ;ir < nrxx;++ir) { v2rho2[ir * spinsize + is] = v2rho2_tmp[ir]; }
5151 }
5252 this ->xc_kernel_components_ .set_kernel (" v2rho2" , std::move (v2rho2));
@@ -65,12 +65,12 @@ namespace LR
6565 {
6666 const std::string file = lr_init_xc_kernel[lr_init_xc_kernel.size () > nspin ? 1 + is : 1 ];
6767 ModuleIO::read_vdata_palgrid (pgrid, GlobalV::MY_RANK, GlobalV::ofs_running, file,
68- rho_for_fxc[is], ucell_in ->nat );
68+ rho_for_fxc[is], ucell ->nat );
6969 }
70- this ->xc_kernel_components_ .f_xc_libxc (nspin, ucell_in ->omega , ucell_in ->tpiba , rho_for_fxc, chg_gs->rho_core );
70+ this ->xc_kernel_components_ .f_xc_libxc (nspin, ucell ->omega , ucell ->tpiba , rho_for_fxc, chg_gs->rho_core );
7171 LR_Util::delete_p2 (rho_for_fxc, nspin);
7272 }
73- else { this ->xc_kernel_components_ .f_xc_libxc (nspin, ucell_in ->omega , ucell_in ->tpiba , chg_gs->rho , chg_gs->rho_core ); }
73+ else { this ->xc_kernel_components_ .f_xc_libxc (nspin, ucell ->omega , ucell ->tpiba , chg_gs->rho , chg_gs->rho_core ); }
7474#else
7575 ModuleBase::WARNING_QUIT (" KernelXC" , " to calculate xc-kernel in LR-TDDFT, compile with LIBXC" );
7676#endif
@@ -96,7 +96,7 @@ namespace LR
9696 break ;
9797 }
9898 // XC
99- if (xc_kernel == " rpa" || xc_kernel == " hf" ) { return ; } // no xc
99+ if (this -> xc_kernel_ == " rpa" || this -> xc_kernel_ == " hf" ) { return ; } // no xc
100100#ifdef USE_LIBXC
101101 this ->kernel_to_potential_ [spin_type_](rho[0 ], v_eff, ispin_op);
102102#else
0 commit comments