@@ -34,62 +34,22 @@ void Exx_LRI<Tdata>::init(const MPI_Comm &mpi_comm_in,
3434 ModuleBase::TITLE (" Exx_LRI" ," init" );
3535 ModuleBase::timer::tick (" Exx_LRI" , " init" );
3636
37- // if(GlobalC::exx_info.info_global.separate_loop)
38- // {
39- // Hexx_para.mixing_mode = Exx_Abfs::Parallel::Communicate::Hexx::Mixing_Mode::No;
40- // Hexx_para.mixing_beta = 0;
41- // }
42- // else
43- // {
44- // if("plain"==GlobalC::CHR.mixing_mode)
45- // Hexx_para.mixing_mode = Exx_Abfs::Parallel::Communicate::Hexx::Mixing_Mode::Plain;
46- // else if("pulay"==GlobalC::CHR.mixing_mode)
47- // Hexx_para.mixing_mode = Exx_Abfs::Parallel::Communicate::Hexx::Mixing_Mode::Pulay;
48- // else
49- // throw std::invalid_argument("exx mixing error. exx_separate_loop==false, mixing_mode!=plain or pulay");
50- // Hexx_para.mixing_beta = GlobalC::CHR.mixing_beta;
51- // }
52-
5337 this ->mpi_comm = mpi_comm_in;
5438 this ->p_kv = &kv_in;
5539 this ->orb_cutoff_ = orb.cutoffs ();
56- const double omega = ucell.omega ;
5740
5841 this ->lcaos = Exx_Abfs::Construct_Orbs::change_orbs ( orb, this ->info .kmesh_times );
5942
60- // #ifdef __MPI
61- // Exx_Abfs::Util::bcast( this->info.files_abfs, 0, this->mpi_comm );
62- // #endif
63-
6443 const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
6544 abfs_same_atom = Exx_Abfs::Construct_Orbs::abfs_same_atom (ucell, orb, this ->lcaos , this ->info .kmesh_times , this ->info .pca_threshold );
6645 if (this ->info .files_abfs .empty ())
6746 { this ->abfs = abfs_same_atom;}
6847 else
6948 { this ->abfs = Exx_Abfs::IO::construct_abfs ( abfs_same_atom, orb, this ->info .files_abfs , this ->info .kmesh_times ); }
70- Exx_Abfs::Construct_Orbs::print_orbs_size (ucell,this ->abfs , GlobalV::ofs_running);
71-
72- auto get_ccp_parameter = [this ,&omega]() -> std::map<std::string,double >
73- {
74- switch (this ->info .ccp_type )
75- {
76- case Conv_Coulomb_Pot_K::Ccp_Type::Ccp:
77- return {};
78- case Conv_Coulomb_Pot_K::Ccp_Type::Hf:
79- {
80- // 4/3 * pi * Rcut^3 = V_{supercell} = V_{unitcell} * Nk
81- const int nspin0 = (PARAM.inp .nspin ==2 ) ? 2 : 1 ;
82- const double hf_Rcut = std::pow (0.75 * this ->p_kv ->get_nkstot_full ()/nspin0 * omega / (ModuleBase::PI), 1.0 /3.0 );
83- return {{" hf_Rcut" , hf_Rcut}};
84- }
85- case Conv_Coulomb_Pot_K::Ccp_Type::Erfc:
86- return {{" hse_omega" , this ->info .hse_omega }};
87- default :
88- throw std::domain_error (std::string (__FILE__)+" line " +std::to_string (__LINE__)); break ;
89- }
90- };
91- this ->abfs_ccp = Conv_Coulomb_Pot_K::cal_orbs_ccp (this ->abfs , this ->info .ccp_type , get_ccp_parameter (), this ->info .ccp_rmesh_times );
49+ Exx_Abfs::Construct_Orbs::print_orbs_size (ucell, this ->abfs , GlobalV::ofs_running);
9250
51+ const std::map<std::string,double > ccp_parameter = RI_Util::get_ccp_parameter (this ->info , ucell.omega , this ->p_kv ->get_nkstot_full ());
52+ this ->abfs_ccp = Conv_Coulomb_Pot_K::cal_orbs_ccp (this ->abfs , this ->info .ccp_type , ccp_parameter, this ->info .ccp_rmesh_times );
9353
9454 for ( size_t T=0 ; T!=this ->abfs .size (); ++T )
9555 { GlobalC::exx_info.info_ri .abfs_Lmax = std::max ( GlobalC::exx_info.info_ri .abfs_Lmax , static_cast <int >(this ->abfs [T].size ())-1 ); }
0 commit comments