@@ -110,8 +110,8 @@ double Charge_Mixing::get_dkin(Charge* chr, const double nelec)
110110
111111double Charge_Mixing::inner_product_recip_rho (std::complex <double >* rho1, std::complex <double >* rho2)
112112{
113- ModuleBase::TITLE (" Charge_Mixing" , " inner_product_recip_rho " );
114- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_rho " );
113+ ModuleBase::TITLE (" Charge_Mixing" , " recip_rho " );
114+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_rho " );
115115
116116 std::complex <double >** rhog1 = new std::complex <double >*[PARAM.inp .nspin ];
117117 std::complex <double >** rhog2 = new std::complex <double >*[PARAM.inp .nspin ];
@@ -134,10 +134,11 @@ double Charge_Mixing::inner_product_recip_rho(std::complex<double>* rho1, std::c
134134#endif
135135 for (int ig = 0 ; ig < this ->rhopw ->npw ; ++ig)
136136 {
137- if (this ->rhopw ->gg [ig] < 1e-8 ) {
138- continue ;
139- }
140- sum += (conj (rhog1[0 ][ig]) * rhog2[0 ][ig]).real () / this ->rhopw ->gg [ig];
137+ if (this ->rhopw ->gg [ig] < 1e-8 )
138+ {
139+ continue ;
140+ }
141+ sum += (conj (rhog1[0 ][ig]) * rhog2[0 ][ig]).real () / this ->rhopw ->gg [ig];
141142 }
142143 sum *= fac;
143144 return sum;
@@ -207,9 +208,10 @@ double Charge_Mixing::inner_product_recip_rho(std::complex<double>* rho1, std::c
207208#endif
208209 for (int ig = 0 ; ig < this ->rhopw ->npw ; ig++)
209210 {
210- if (ig == this ->rhopw ->ig_gge0 ) {
211- continue ;
212- }
211+ if (ig == this ->rhopw ->ig_gge0 )
212+ {
213+ continue ;
214+ }
213215 sum += (conj (rhog1[0 ][ig]) * rhog2[0 ][ig]).real () / this ->rhopw ->gg [ig];
214216 }
215217 sum *= fac;
@@ -243,20 +245,21 @@ double Charge_Mixing::inner_product_recip_rho(std::complex<double>* rho1, std::c
243245#ifdef __MPI
244246 Parallel_Reduce::reduce_pool (sum);
245247#endif
246- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_rho" );
247248
248249 sum *= *this ->omega * 0.5 ;
249250
250251 delete[] rhog1;
251252 delete[] rhog2;
253+
254+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_rho" );
252255 return sum;
253256}
254257
255258// a simple inner product, now is not used anywhere. For test only.
256259double Charge_Mixing::inner_product_recip_simple (std::complex <double >* rho1, std::complex <double >* rho2)
257260{
258- ModuleBase::TITLE (" Charge_Mixing" , " inner_product_recip_simple " );
259- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_simple " );
261+ ModuleBase::TITLE (" Charge_Mixing" , " recip_simple " );
262+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_simple " );
260263
261264 double rnorm = 0.0 ;
262265 // consider a resize for mixing_angle
@@ -274,16 +277,16 @@ double Charge_Mixing::inner_product_recip_simple(std::complex<double>* rho1, std
274277 Parallel_Reduce::reduce_pool (rnorm);
275278#endif
276279
277- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_simple " );
280+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_simple " );
278281
279282 return rnorm;
280283}
281284
282285// a Hartree-like inner product
283286double Charge_Mixing::inner_product_recip_hartree (std::complex <double >* rhog1, std::complex <double >* rhog2)
284287{
285- ModuleBase::TITLE (" Charge_Mixing" , " inner_product_recip_hartree " );
286- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_hartree " );
288+ ModuleBase::TITLE (" Charge_Mixing" , " recip_hartree " );
289+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_hartree " );
287290
288291 static const double fac = ModuleBase::e2 * ModuleBase::FOUR_PI / ((*this ->tpiba ) * (*this ->tpiba ));
289292 static const double fac2 = ModuleBase::e2 * ModuleBase::FOUR_PI / (ModuleBase::TWO_PI * ModuleBase::TWO_PI);
@@ -444,10 +447,10 @@ double Charge_Mixing::inner_product_recip_hartree(std::complex<double>* rhog1, s
444447 Parallel_Reduce::reduce_pool (sum);
445448#endif
446449
447- ModuleBase::timer::tick (" Charge_Mixing" , " inner_product_recip_hartree" );
448-
449450 sum *= *this ->omega * 0.5 ;
450451
452+ ModuleBase::timer::tick (" Charge_Mixing" , " recip_hartree" );
453+
451454 return sum;
452455}
453456
@@ -456,8 +459,10 @@ double Charge_Mixing::inner_product_real(double* rho1, double* rho2)
456459 double rnorm = 0.0 ;
457460 // consider a resize for mixing_angle
458461 int resize_tmp = 1 ;
459- if (PARAM.inp .nspin == 4 && this ->mixing_angle > 0 ) { resize_tmp = 2 ;
460- }
462+ if (PARAM.inp .nspin == 4 && this ->mixing_angle > 0 )
463+ {
464+ resize_tmp = 2 ;
465+ }
461466
462467#ifdef _OPENMP
463468#pragma omp parallel for reduction(+ : rnorm)
@@ -470,4 +475,4 @@ double Charge_Mixing::inner_product_real(double* rho1, double* rho2)
470475 Parallel_Reduce::reduce_pool (rnorm);
471476#endif
472477 return rnorm;
473- }
478+ }
0 commit comments