Skip to content

Commit 52f4412

Browse files
committed
after merging to abacus-v3.8.0, the program ran successfully for the first time, but the call of V_exx was not correct.
1 parent 5669f69 commit 52f4412

File tree

6 files changed

+15
-666
lines changed

6 files changed

+15
-666
lines changed

source/module_esolver/esolver_ks.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell)
627627
// if ( PARAM.inp.ab_initio_type == "rdmft" )
628628
if ( 1 ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
629629
{
630-
if ( (!GlobalC::exx_info.info_global.cal_exx && iter == 1) || one_step_exx )
630+
// if ( (!GlobalC::exx_info.info_global.cal_exx && iter == 1) || one_step_exx )
631+
if ( 1 )
631632
{
632633
ModuleBase::matrix occ_number_ks(this->pelec->wg);
633634
for(int ik=0; ik < occ_number_ks.nr; ++ik)
@@ -638,6 +639,13 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell)
638639

639640
std::cout << "\n\n\n******\nget the initial values of wfc and occ_numbers successfully\n******\n\n\n" << std::endl;
640641

642+
//initialize the gradients of Etotal on wg and wfc, and set all elements to 0.
643+
ModuleBase::matrix E_gradient_occNum(this->pelec->wg.nr, this->pelec->wg.nc, true);
644+
psi::Psi<T> E_gradient_wfc(this->psi->get_nk(), this->psi->get_nbands(), this->psi->get_nbasis());
645+
E_gradient_wfc.zero_out();
646+
647+
double Etotal_RDMFT = this->Run_rdmft(E_gradient_occNum, E_gradient_wfc);
648+
641649
// break;
642650
}
643651
}

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(const Input_para& inp, UnitCell
261261
}
262262

263263

264-
std::cout << "\n\n\n******\n" << 1.0 << "\n******\n\n\n" << std::endl;
265-
266264
// add by jghan for rdmft calculation
267265
// if( PARAM.inp.ab_initio_type == "rdmft" )
268266
if( 1 )
@@ -276,8 +274,6 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(const Input_para& inp, UnitCell
276274
// rdmft_solver.update_ion(ucell, LM, *(this->pw_rho), GlobalC::ppcell.vloc, this->sf.strucFac, this->LOC);
277275
}
278276

279-
std::cout << "\n\n\n******\n" << 1.1 << "\n******\n\n\n" << std::endl;
280-
281277
// 15) if kpar is not divisible by nks, print a warning
282278
if (GlobalV::KPAR_LCAO > 1)
283279
{

0 commit comments

Comments
 (0)