@@ -262,81 +262,44 @@ void ESolver_FP::after_scf(const int istep)
262262 PARAM.inp .out_elf [1 ]);
263263 }
264264 }
265-
266- // #ifdef __RAPIDJSON
267- // // add Json of efermi energy converge
268- // Json::add_output_efermi_converge(this->pelec->eferm.ef * ModuleBase::Ry_to_eV, this->conv_esolver);
269- // // add nkstot,nkstot_ibz to output json
270- // int Jnkstot = this->pelec->klist->get_nkstot();
271- // Json::add_nkstot(Jnkstot);
272- // #endif //__RAPIDJSON
273265}
274266
275- void ESolver_FP::init_after_vc (const Input_para& inp, UnitCell& cell )
267+ void ESolver_FP::before_scf (const int istep )
276268{
277- ModuleBase::TITLE (" ESolver_FP" , " init_after_vc " );
269+ ModuleBase::TITLE (" ESolver_FP" , " before_scf " );
278270
279- if (inp.mdp .md_prec_level == 2 )
280- {
281- if (inp.nx * inp.ny * inp.nz == 0 )
282- {
283- this ->pw_rho ->initgrids (cell.lat0 , cell.latvec , 4.0 * inp.ecutwfc );
284- }
285- else
286- {
287- this ->pw_rho ->initgrids (cell.lat0 , cell.latvec , inp.nx , inp.ny , inp.nz );
288- }
289-
290- this ->pw_rho ->initparameters (false , 4.0 * inp.ecutwfc );
291- this ->pw_rho ->setuptransform ();
292- this ->pw_rho ->collect_local_pw ();
293- this ->pw_rho ->collect_uniqgg ();
294-
295- if ( PARAM.globalv .double_grid )
296- {
297- ModulePW::PW_Basis_Sup* pw_rhod_sup = static_cast <ModulePW::PW_Basis_Sup*>(pw_rhod);
298- if (inp.ndx * inp.ndy * inp.ndz == 0 )
299- {
300- this ->pw_rhod ->initgrids (cell.lat0 , cell.latvec , inp.ecutrho );
301- }
302- else
303- {
304- this ->pw_rhod ->initgrids (cell.lat0 , cell.latvec , inp.ndx , inp.ndy , inp.ndz );
305- }
306- this ->pw_rhod ->initparameters (false , inp.ecutrho );
307- pw_rhod_sup->setuptransform (this ->pw_rho );
308- this ->pw_rhod ->collect_local_pw ();
309- this ->pw_rhod ->collect_uniqgg ();
310- }
311- }
312- else
271+ if (GlobalC::ucell.cell_parameter_updated )
313272 {
314273 // only G-vector and K-vector are changed due to the change of lattice
315274 // vector FFT grids do not change!!
316- pw_rho->initgrids (cell .lat0 , cell .latvec , pw_rho->nx , pw_rho->ny , pw_rho->nz );
275+ pw_rho->initgrids (GlobalC::ucell .lat0 , GlobalC::ucell .latvec , pw_rho->nx , pw_rho->ny , pw_rho->nz );
317276 pw_rho->collect_local_pw ();
318277 pw_rho->collect_uniqgg ();
319278
320- if ( PARAM.globalv .double_grid )
279+ if (PARAM.globalv .double_grid )
321280 {
322- this ->pw_rhod ->initgrids (cell .lat0 , cell .latvec , pw_rhod->nx , pw_rhod->ny , pw_rhod->nz );
281+ this ->pw_rhod ->initgrids (GlobalC::ucell .lat0 , GlobalC::ucell .latvec , pw_rhod->nx , pw_rhod->ny , pw_rhod->nz );
323282 this ->pw_rhod ->collect_local_pw ();
324283 this ->pw_rhod ->collect_uniqgg ();
325284 }
326285
327286 GlobalC::ppcell.init_vloc (GlobalC::ppcell.vloc , pw_rhod);
328287 ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " LOCAL POTENTIAL" );
329- }
330- this ->pelec ->omega = GlobalC::ucell.omega ;
331288
332- if (ModuleSymmetry::Symmetry::symm_flag == 1 )
333- {
334- cell.symm .analy_sys (cell.lat , cell.st , cell.atoms , GlobalV::ofs_running);
335- ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " SYMMETRY" );
336- }
289+ this ->pelec ->omega = GlobalC::ucell.omega ;
290+
291+ if (ModuleSymmetry::Symmetry::symm_flag == 1 )
292+ {
293+ GlobalC::ucell.symm .analy_sys (GlobalC::ucell.lat ,
294+ GlobalC::ucell.st ,
295+ GlobalC::ucell.atoms ,
296+ GlobalV::ofs_running);
297+ ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " SYMMETRY" );
298+ }
337299
338- kv.set_after_vc (PARAM.inp .nspin , cell.G , cell.latvec );
339- ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " INIT K-POINTS" );
300+ kv.set_after_vc (PARAM.inp .nspin , GlobalC::ucell.G , GlobalC::ucell.latvec );
301+ ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " INIT K-POINTS" );
302+ }
340303
341304 return ;
342305}
0 commit comments