Skip to content

Commit 3cbf187

Browse files
committed
Fix the bug caused by merging the latest ABAUCS, need to test other bugs such as wp22, cwp22 and the difference of energy
1 parent 7649263 commit 3cbf187

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

source/module_esolver/esolver_ks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell)
592592

593593
// 9.5) rdmft, add by jghan 2024-10-09
594594
bool one_step_exx = false;
595-
if( GlobalC::exx_info.info_global.cal_exx && this->conv_elec ) one_step_exx = true;
595+
if( GlobalC::exx_info.info_global.cal_exx && this->conv_esolver ) one_step_exx = true;
596596

597597
// 10) finish scf iterations
598598
this->iter_finish(iter);

source/module_rdmft/rdmft.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
108108
std::cout << "\n\n\n******\nXC-functional in rdmft: " << XC_func_rdmft << "\n******\n\n\n" << std::endl;
109109
std::cout << "\n******\nGlobalC::exx_info.info_global.cal_exx: " << GlobalC::exx_info.info_global.cal_exx << "\n******\n" << std::endl;
110110
std::cout << "\n******\nPARAM.inp.ab_initio_type: " << PARAM.inp.ab_initio_type << "\n******\n" << std::endl;
111-
std::cout << "\n******\nGlobalV::NBANDS: " << GlobalV::NBANDS << "\n******\n" << std::endl;
111+
// std::cout << "\n******\nGlobalV::NBANDS: " << GlobalV::NBANDS << "\n******\n" << std::endl;
112112
std::cout << "\n******\nPARAM.inp.nbands: " << PARAM.inp.nbands << "\n******\n" << std::endl;
113113
// XC_func_rdmft = "hf";
114114
// std::cout << "\n\n\n******\nXC-functional in rdmft: " << XC_func_rdmft << "\n******\n\n\n" << std::endl;
@@ -340,7 +340,7 @@ void RDMFT<TK, TR>::update_charge()
340340
else
341341
{
342342
// calculate DMK and DMR
343-
elecstate::DensityMatrix<TK, double> DM(kv, ParaV, nspin);
343+
elecstate::DensityMatrix<TK, double> DM(ParaV, nspin, kv->kvec_d, nk_total);
344344
elecstate::cal_dm_psi(ParaV, wg, wfc, DM);
345345
DM.init_DMR(&GlobalC::GridD, &GlobalC::ucell);
346346
DM.cal_DMR();
@@ -593,7 +593,7 @@ void RDMFT<TK, TR>::cal_V_XC()
593593

594594
DM_XC_pass = DM_XC;
595595

596-
elecstate::DensityMatrix<TK, double> DM_test(kv, ParaV, nspin);
596+
elecstate::DensityMatrix<TK, double> DM_test(ParaV, nspin, kv->kvec_d, nk_total);
597597
elecstate::cal_dm_psi(ParaV, wg, wfc, DM_test);
598598
DM_test.init_DMR(&GlobalC::GridD, &GlobalC::ucell);
599599
DM_test.cal_DMR();

source/module_rdmft/rdmft_tools.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ void Veff_rdmft<TK, TR>::contributeHR()
284284
}
285285
else if( potential_ == "local" )
286286
{
287+
double vlocal_of_0 = 0.0;
287288
ModuleBase::matrix v_matrix_local(1, charge_->nrxx);
288-
elecstate::PotLocal potL(vloc_, sf_, rho_basis_);
289+
elecstate::PotLocal potL(vloc_, sf_, rho_basis_, vlocal_of_0);
289290
potL.cal_fixed_v( &v_matrix_local(0, 0) );
290291

291292
// use pointer to attach v(r)
@@ -362,8 +363,9 @@ void Veff_rdmft<double, double>::contributeHR()
362363
}
363364
else if( potential_ == "local" )
364365
{
366+
double vlocal_of_0 = 0.0;
365367
ModuleBase::matrix v_matrix_local(1, charge_->nrxx);
366-
elecstate::PotLocal potL(vloc_, sf_, rho_basis_);
368+
elecstate::PotLocal potL(vloc_, sf_, rho_basis_, vlocal_of_0);
367369
potL.cal_fixed_v( &v_matrix_local(0, 0) );
368370

369371
// use pointer to attach v(r)

0 commit comments

Comments
 (0)