@@ -253,7 +253,7 @@ void DFTU::init(
253253 }
254254 }
255255
256- if (GlobalV::CALCULATION==" nscf" )
256+ if (GlobalV::CALCULATION==" nscf" || GlobalC::pot. start_pot == " file " )
257257 {
258258 std::stringstream sst;
259259 sst << GlobalV::global_out_dir << " onsite.dm" ;
@@ -987,7 +987,7 @@ void DFTU::cal_energy_correction(const int istep)
987987{
988988 ModuleBase::TITLE (" DFTU" , " cal_energy_correction" );
989989 ModuleBase::timer::tick (" DFTU" , " cal_energy_correction" );
990- if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 )
990+ if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 && GlobalC::pot. start_pot != " file " )
991991 {
992992 ModuleBase::timer::tick (" DFTU" , " cal_energy_correction" );
993993 return ;
@@ -1152,7 +1152,7 @@ void DFTU::cal_eff_pot_mat_complex(const int ik, const int istep, std::complex<d
11521152{
11531153 ModuleBase::TITLE (" DFTU" , " cal_eff_pot_mat" );
11541154 ModuleBase::timer::tick (" DFTU" , " cal_eff_pot_mat" );
1155- if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 )
1155+ if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 && GlobalC::pot. start_pot != " file " )
11561156 {
11571157 ModuleBase::timer::tick (" DFTU" , " cal_eff_pot_mat" );
11581158 return ;
@@ -1239,7 +1239,7 @@ void DFTU::cal_eff_pot_mat_real(const int ik, const int istep, double* eff_pot)
12391239{
12401240 ModuleBase::TITLE (" DFTU" , " cal_eff_pot_mat" );
12411241 ModuleBase::timer::tick (" DFTU" , " cal_eff_pot_mat" );
1242- if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 )
1242+ if ((GlobalV::CALCULATION==" scf" || GlobalV::CALCULATION==" relax" || GlobalV::CALCULATION==" cell-relax" ) && (!omc) && istep==0 && this ->iter_dftu ==1 && GlobalC::pot. start_pot != " file " )
12431243 {
12441244 ModuleBase::timer::tick (" DFTU" , " cal_eff_pot_mat" );
12451245 return ;
@@ -1325,6 +1325,13 @@ void DFTU::cal_eff_pot_mat_real(const int ik, const int istep, double* eff_pot)
13251325void DFTU::output ()
13261326{
13271327 ModuleBase::TITLE (" DFTU" , " output" );
1328+
1329+ if (GlobalC::CHR.out_charge )
1330+ {
1331+ std::stringstream sst;
1332+ sst << GlobalV::global_out_dir << " onsite.dm" ;
1333+ this ->write_occup_m ( sst.str () );
1334+ }
13281335
13291336 GlobalV::ofs_running << " //=========================L(S)DA+U===========================//" << std::endl;
13301337
0 commit comments