@@ -158,7 +158,7 @@ void Charge::init_rho()
158158 std::cout << " START CHARGE : " << GlobalV::init_chg << std::endl;
159159 if (GlobalV::init_chg == " atomic" ) // mohan add 2007-10-17
160160 {
161- this ->atomic_rho (GlobalV::NSPIN, rho, GlobalC::rhopw);
161+ this ->atomic_rho (GlobalV::NSPIN, GlobalC::ucell. omega , rho, GlobalC::rhopw);
162162 }
163163 else if (GlobalV::init_chg == " file" )
164164 {
@@ -338,7 +338,7 @@ void Charge::renormalize_rho(void)
338338// rho_at (read from pseudopotential files)
339339// allocate work space (psic must already be allocated)
340340// -------------------------------------------------------
341- void Charge::atomic_rho (const int spin_number_need, double ** rho_in, ModulePW::PW_Basis* rho_basis)const // Peize Lin refactor 2021.04.08
341+ void Charge::atomic_rho (const int spin_number_need, const double & omega, double ** rho_in, ModulePW::PW_Basis* rho_basis)const // Peize Lin refactor 2021.04.08
342342{
343343 ModuleBase::TITLE (" Charge" ," atomic_rho" );
344344 ModuleBase::timer::tick (" Charge" ," atomic_rho" );
@@ -467,7 +467,7 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in, ModulePW::P
467467#pragma omp for
468468#endif
469469 for (int igg=0 ; igg< rho_basis->ngg ; igg++)
470- rho_lgl[igg] /= GlobalC::ucell. omega ;
470+ rho_lgl[igg] /= omega;
471471#ifdef _OPENMP
472472}
473473#endif
@@ -635,7 +635,7 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in, ModulePW::P
635635
636636 for (int ir=0 ; ir<rho_basis->nrxx ; ++ir)
637637 ne[is] += rho_in[is][ir];
638- ne[is] *= GlobalC::ucell. omega /(double )rho_basis->nxyz ;
638+ ne[is] *= omega/(double )rho_basis->nxyz ;
639639 Parallel_Reduce::reduce_double_pool ( ne[is] );
640640
641641 // we check that everything is correct
@@ -656,9 +656,9 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in, ModulePW::P
656656 Parallel_Reduce::reduce_double_pool ( sumrea );
657657
658658 // mohan fix bug 2011-04-03
659- neg = neg / (double )rho_basis->nxyz * GlobalC::ucell. omega ;
660- ima = ima / (double )rho_basis->nxyz * GlobalC::ucell. omega ;
661- sumrea = sumrea / (double )rho_basis->nxyz * GlobalC::ucell. omega ;
659+ neg = neg / (double )rho_basis->nxyz * omega;
660+ ima = ima / (double )rho_basis->nxyz * omega;
661+ sumrea = sumrea / (double )rho_basis->nxyz * omega;
662662
663663 if ( ((neg<-1.0e-4 ) && (is==0 ||GlobalV::NSPIN==2 )) || ima>1.0e-4 )
664664 {
0 commit comments