Skip to content

Commit f6534ac

Browse files
committed
rename variables in PotHxcLR
1 parent c40f414 commit f6534ac

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

source/module_lr/potentials/pot_hxc_lrtd.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@
1313
namespace 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

source/module_lr/potentials/pot_hxc_lrtd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace LR
1818
enum SpinType { S1 = 0, S2_singlet = 1, S2_triplet = 2, S2_updown = 3 };
1919
enum XCType { None = 0, LDA = 1, GGA = 2, HYB_GGA = 4 };
2020
/// constructor for exchange-correlation kernel
21-
PotHxcLR(const std::string& xc_kernel_in, const ModulePW::PW_Basis* rho_basis_in,
22-
const UnitCell* ucell_in, const Charge* chg_gs/*ground state*/, const Parallel_Grid& pgrid,
23-
const SpinType& st_in = SpinType::S1, const std::vector<std::string>& lr_init_xc_kernel = { "from_chg_groundstate" });
21+
PotHxcLR(const std::string& xc_kernel, const ModulePW::PW_Basis* rho_basis,
22+
const UnitCell* ucell, const Charge* chg_gs/*ground state*/, const Parallel_Grid& pgrid,
23+
const SpinType& st = SpinType::S1, const std::vector<std::string>& lr_init_xc_kernel = { "from_chg_groundstate" });
2424
~PotHxcLR() {}
2525
void cal_v_eff(const Charge* chg/*excited state*/, const UnitCell* ucell, ModuleBase::matrix& v_eff) override {};
2626
void cal_v_eff(double** rho, const UnitCell* ucell, ModuleBase::matrix& v_eff, const std::vector<int>& ispin_op = { 0,0 });
@@ -33,7 +33,7 @@ namespace LR
3333
/// GGA: v2rho2, v2rhosigma, v2sigma2
3434
/// meta-GGA: v2rho2, v2rhosigma, v2sigma2, v2rholap, v2rhotau, v2sigmalap, v2sigmatau, v2laptau, v2lap2, v2tau2
3535
KernelXC xc_kernel_components_;
36-
const std::string xc_kernel;
36+
const std::string xc_kernel_;
3737
const double& tpiba_;
3838
const SpinType spin_type_ = SpinType::S1;
3939
XCType xc_type_ = XCType::None;

0 commit comments

Comments
 (0)