Skip to content

Commit db47c6e

Browse files
committed
rename: lr_init_xc_kernel
1 parent d676e9c commit db47c6e

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3917,7 +3917,7 @@ These parameters are used to solve the excited states using. e.g. LR-TDDFT.
39173917
Currently supported: `RPA`, `LDA`, `PBE`, `HSE`, `HF`.
39183918
- **Default**: LDA
39193919

3920-
### init_xc_kernel
3920+
### lr_init_xc_kernel
39213921

39223922
- **Type**: String
39233923
- **Description**: The method to initalize the xc kernel.

source/module_io/read_input_item_tddft.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,17 @@ void ReadInput::item_lr_tddft()
310310
this->add_item(item);
311311
}
312312
{
313-
Input_Item item("init_xc_kernel");
313+
Input_Item item("lr_init_xc_kernel");
314314
item.annotation = "The method to initalize the xc kernel";
315315
item.read_value = [](const Input_Item& item, Parameter& para) {
316316
size_t count = item.get_size();
317-
auto& ifxc = para.input.init_xc_kernel;
317+
auto& ifxc = para.input.lr_init_xc_kernel;
318318
for (int i = 0; i < count; i++) { ifxc.push_back(item.str_values[i]); }
319319
};
320320
item.reset_value = [](const Input_Item& item, Parameter& para) {
321-
if (para.input.init_xc_kernel.empty()) { para.input.init_xc_kernel.push_back("from_chg_groundstate"); }
321+
if (para.input.lr_init_xc_kernel.empty()) { para.input.lr_init_xc_kernel.push_back("from_chg_groundstate"); }
322322
};
323-
sync_stringvec(input.init_xc_kernel, para.input.init_xc_kernel.size(), "from_chg_groundstate");
323+
sync_stringvec(input.lr_init_xc_kernel, para.input.lr_init_xc_kernel.size(), "from_chg_groundstate");
324324
this->add_item(item);
325325
}
326326
{

source/module_io/test/read_input_ptest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ TEST_F(InputParaTest, ParaRead)
417417
EXPECT_EQ(param.inp.nocc, param.inp.nbands);
418418
EXPECT_EQ(param.inp.nvirt, 1);
419419
EXPECT_EQ(param.inp.xc_kernel, "LDA");
420-
EXPECT_EQ(param.inp.init_xc_kernel[0], "from_chg_groundstate");
420+
EXPECT_EQ(param.inp.lr_init_xc_kernel[0], "from_chg_groundstate");
421421
EXPECT_EQ(param.inp.lr_solver, "dav");
422422
EXPECT_DOUBLE_EQ(param.inp.lr_thr, 1e-2);
423423
EXPECT_FALSE(param.inp.lr_unrestricted);

source/module_lr/esolver_lrtd_lcao.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ void LR::ESolver_LR<T, TR>::init_pot(const Charge& chg_gs)
603603
{
604604
using ST = PotHxcLR::SpinType;
605605
case 1:
606-
this->pot[0] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, ST::S1, input.init_xc_kernel);
606+
this->pot[0] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, ST::S1, input.lr_init_xc_kernel);
607607
break;
608608
case 2:
609-
this->pot[0] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, openshell ? ST::S2_updown : ST::S2_singlet, input.init_xc_kernel);
610-
this->pot[1] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, openshell ? ST::S2_updown : ST::S2_triplet, input.init_xc_kernel);
609+
this->pot[0] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, openshell ? ST::S2_updown : ST::S2_singlet, input.lr_init_xc_kernel);
610+
this->pot[1] = std::make_shared<PotHxcLR>(xc_kernel, this->pw_rho, &ucell, &chg_gs, GlobalC::Pgrid, openshell ? ST::S2_updown : ST::S2_triplet, input.lr_init_xc_kernel);
611611
break;
612612
default:
613613
throw std::invalid_argument("ESolver_LR: nspin must be 1 or 2");

source/module_lr/potentials/pot_hxc_lrtd.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace LR
1515
// constructor for exchange-correlation kernel
1616
PotHxcLR::PotHxcLR(const std::string& xc_kernel_in, const ModulePW::PW_Basis* rho_basis_in, const UnitCell* ucell_in,
1717
const Charge* chg_gs/*ground state*/, const Parallel_Grid& pgrid,
18-
const SpinType& st_in, const std::vector<std::string>& init_xc_kernel)
18+
const SpinType& st_in, const std::vector<std::string>& lr_init_xc_kernel)
1919
:xc_kernel(xc_kernel_in), tpiba_(ucell_in->tpiba), spin_type_(st_in),
2020
xc_kernel_components_(*rho_basis_in)
2121
{
@@ -32,20 +32,20 @@ namespace LR
3232
this->xc_type_ = XCType(XC_Functional::get_func_type());
3333
this->set_integral_func(this->spin_type_, this->xc_type_);
3434

35-
if (init_xc_kernel[0] == "file")
35+
if (lr_init_xc_kernel[0] == "file")
3636
{
3737
std::set<std::string> lda_xc = { "lda", "pwlda" };
3838
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
42-
assert(init_xc_kernel.size() >= spinsize + 1);
42+
assert(lr_init_xc_kernel.size() >= spinsize + 1);
4343
for (int is = 0;is < spinsize;++is)
4444
{
4545
double ef = 0.0;
4646
int prenspin = 1;
4747
std::vector<double> v2rho2_tmp(nrxx);
48-
ModuleIO::read_vdata_palgrid(pgrid, GlobalV::MY_RANK, GlobalV::ofs_running, init_xc_kernel[is + 1],
48+
ModuleIO::read_vdata_palgrid(pgrid, GlobalV::MY_RANK, GlobalV::ofs_running, lr_init_xc_kernel[is + 1],
4949
v2rho2_tmp.data(), ucell_in->nat);
5050
for (int ir = 0;ir < nrxx;++ir) { v2rho2[ir * spinsize + is] = v2rho2_tmp[ir]; }
5151
}
@@ -54,16 +54,16 @@ namespace LR
5454
}
5555

5656
#ifdef USE_LIBXC
57-
if (init_xc_kernel[0] == "from_chg_file")
57+
if (lr_init_xc_kernel[0] == "from_chg_file")
5858
{
59-
assert(init_xc_kernel.size() >= 2);
59+
assert(lr_init_xc_kernel.size() >= 2);
6060
double** rho_for_fxc;
6161
LR_Util::new_p2(rho_for_fxc, nspin, nrxx);
6262
double ef = 0.0;
6363
int prenspin = 1;
6464
for (int is = 0;is < nspin;++is)
6565
{
66-
const std::string file = init_xc_kernel[init_xc_kernel.size() > nspin ? 1 + is : 1];
66+
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,
6868
rho_for_fxc[is], ucell_in->nat);
6969
}

source/module_lr/potentials/pot_hxc_lrtd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace LR
2020
/// constructor for exchange-correlation kernel
2121
PotHxcLR(const std::string& xc_kernel_in, const ModulePW::PW_Basis* rho_basis_in,
2222
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>& init_xc_kernel = { "from_chg_groundstate" });
23+
const SpinType& st_in = 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 });

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ struct Input_para
296296

297297
// ============== #Parameters (10.lr-tddft) ===========================
298298
int lr_nstates = 1; ///< the number of 2-particle states to be solved
299-
std::vector<std::string> init_xc_kernel = {}; ///< The method to initalize the xc kernel
299+
std::vector<std::string> lr_init_xc_kernel = {}; ///< The method to initalize the xc kernel
300300
int nocc = -1; ///< the number of occupied orbitals to form the 2-particle basis
301301
int nvirt = 1; ///< the number of virtual orbitals to form the 2-particle basis (nocc + nvirt <= nbands)
302302
std::string xc_kernel = "LDA"; ///< exchange correlation (XC) kernel for LR-TDDFT

0 commit comments

Comments
 (0)