55#include " module_base/timer.h"
66#include " module_base/tool_title.h"
77#include < algorithm>
8-
9- // temporary
10- #include " module_hamilt_pw/hamilt_pwdft/global.h"
118namespace hsolver
129{
1310 void HSolverPW_SDFT::solve (hamilt::Hamilt<double >* pHamilt,
@@ -58,13 +55,6 @@ namespace hsolver
5855 stoiter.orthog (ik,psi,stowf);
5956 stoiter.checkemm (ik,istep, iter, stowf); // check and reset emax & emin
6057 }
61- // DiagoCG would keep 9*nbasis memory in cache during loop-k
62- // it should be deleted before calculating charge
63- if (this ->method == " cg" )
64- {
65- delete pdiagh;
66- pdiagh = nullptr ;
67- }
6858
6959 this ->endDiagh ();
7060
@@ -96,7 +86,7 @@ namespace hsolver
9686 {
9787 for (int is=0 ; is < GlobalV::NSPIN; is++)
9888 {
99- ModuleBase::GlobalFunc::ZEROS (pes->charge ->rho [is], GlobalC::rhopw ->nrxx );
89+ ModuleBase::GlobalFunc::ZEROS (pes->charge ->rho [is], pes-> charge ->nrxx );
10090 }
10191 }
10292 // calculate stochastic rho
@@ -108,25 +98,7 @@ namespace hsolver
10898 // mohan add 2009-01-23
10999 // en.calculate_harris();
110100
111- if (GlobalV::MY_STOGROUP==0 )
112- {
113- Symmetry_rho srho;
114- for (int is=0 ; is < GlobalV::NSPIN; is++)
115- {
116- srho.begin (is, *(pes->charge ), GlobalC::rhopw, GlobalC::Pgrid, GlobalC::symm);
117- }
118- }
119- else
120- {
121- #ifdef __MPI
122- if (ModuleSymmetry::Symmetry::symm_flag == 1 ) MPI_Barrier (MPI_COMM_WORLD);
123- #endif
124- }
125-
126- if (GlobalV::MY_STOGROUP == 0 )
127- {
128- GlobalC::en.deband = GlobalC::en.delta_e (pes);
129- }
101+ // will do rho symmetry and energy calculation in esolver
130102 ModuleBase::timer::tick (this ->classname , " solve" );
131103 return ;
132104 }
0 commit comments