@@ -40,12 +40,12 @@ void berryphase::get_occupation_bands()
4040}
4141
4242#ifdef __LCAO
43- void berryphase::lcao_init (const K_Vectors& kv, const Grid_Technique& grid_tech, const LCAO_Orbitals& orb)
43+ void berryphase::lcao_init (const UnitCell& ucell, const K_Vectors& kv, const Grid_Technique& grid_tech, const LCAO_Orbitals& orb)
4444{
4545 ModuleBase::TITLE (" berryphase" , " lcao_init" );
46- lcao_method.init (grid_tech, kv.get_nkstot (), orb);
47- lcao_method.cal_R_number ();
48- lcao_method.cal_orb_overlap ();
46+ lcao_method.init (ucell, grid_tech, kv.get_nkstot (), orb);
47+ lcao_method.cal_R_number (ucell );
48+ lcao_method.cal_orb_overlap (ucell );
4949 return ;
5050}
5151#endif
@@ -232,7 +232,8 @@ void berryphase::set_kpoints(const K_Vectors& kv, const int direction)
232232}
233233
234234#include " ../module_base/complexmatrix.h"
235- double berryphase::stringPhase (int index_str,
235+ double berryphase::stringPhase (const UnitCell& ucell,
236+ int index_str,
236237 int nbands,
237238 const int npwx,
238239 const psi::Psi<std::complex <double >>* psi_in,
@@ -347,7 +348,7 @@ double berryphase::stringPhase(int index_str,
347348 if (PARAM.inp .nspin != 4 )
348349 {
349350 // std::complex<double> my_det = lcao_method.det_berryphase(ik_1,ik_2,dk,nbands);
350- zeta = zeta * lcao_method.det_berryphase (ik_1, ik_2, dk, nbands, *(this ->paraV ), psi_in, kv);
351+ zeta = zeta * lcao_method.det_berryphase (ucell, ik_1, ik_2, dk, nbands, *(this ->paraV ), psi_in, kv);
351352 // test by jingan
352353 // GlobalV::ofs_running << "methon 1: det = " << my_det << std::endl;
353354 // test by jingan
@@ -392,7 +393,8 @@ double berryphase::stringPhase(int index_str,
392393 return log (zeta).imag ();
393394}
394395
395- void berryphase::Berry_Phase (int nbands,
396+ void berryphase::Berry_Phase (const UnitCell& ucell,
397+ int nbands,
396398 double & pdl_elec_tot,
397399 int & mod_elec_tot,
398400 const int npwx,
@@ -421,7 +423,7 @@ void berryphase::Berry_Phase(int nbands,
421423
422424 for (int istring = 0 ; istring < total_string; istring++)
423425 {
424- phik[istring] = stringPhase (istring, nbands, npwx, psi_in, rhopw, wfcpw, kv);
426+ phik[istring] = stringPhase (ucell, istring, nbands, npwx, psi_in, rhopw, wfcpw, kv);
425427 // transfer phase to complex number
426428 cphik[istring] = std::complex <double >(cos (phik[istring]), sin (phik[istring]));
427429 cave = cave + std::complex <double >(wistring[istring], 0.0 ) * cphik[istring];
@@ -595,7 +597,7 @@ void berryphase::Macroscopic_polarization(const UnitCell& ucell,
595597 set_kpoints (kv, direction);
596598 double pdl_elec_tot = 0.0 ;
597599 int mod_elec_tot = 0 ;
598- Berry_Phase (occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
600+ Berry_Phase (ucell, occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
599601
600602 const double rmod = ucell.a1 .norm () * ucell.lat0 ;
601603 const double unit1 = rmod;
@@ -641,7 +643,7 @@ void berryphase::Macroscopic_polarization(const UnitCell& ucell,
641643 set_kpoints (kv, direction);
642644 double pdl_elec_tot = 0.0 ;
643645 int mod_elec_tot = 0 ;
644- Berry_Phase (occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
646+ Berry_Phase (ucell, occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
645647
646648 const double rmod = ucell.a2 .norm () * ucell.lat0 ;
647649 const double unit1 = rmod;
@@ -687,7 +689,7 @@ void berryphase::Macroscopic_polarization(const UnitCell& ucell,
687689 set_kpoints (kv, direction);
688690 double pdl_elec_tot = 0.0 ;
689691 int mod_elec_tot = 0 ;
690- Berry_Phase (occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
692+ Berry_Phase (ucell, occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv);
691693
692694 const double rmod = ucell.a3 .norm () * ucell.lat0 ;
693695 const double unit1 = rmod;
0 commit comments