@@ -34,62 +34,22 @@ void Exx_LRI<Tdata>::init(const MPI_Comm &mpi_comm_in,
34
34
ModuleBase::TITLE (" Exx_LRI" ," init" );
35
35
ModuleBase::timer::tick (" Exx_LRI" , " init" );
36
36
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
-
53
37
this ->mpi_comm = mpi_comm_in;
54
38
this ->p_kv = &kv_in;
55
39
this ->orb_cutoff_ = orb.cutoffs ();
56
- const double omega = ucell.omega ;
57
40
58
41
this ->lcaos = Exx_Abfs::Construct_Orbs::change_orbs ( orb, this ->info .kmesh_times );
59
42
60
- // #ifdef __MPI
61
- // Exx_Abfs::Util::bcast( this->info.files_abfs, 0, this->mpi_comm );
62
- // #endif
63
-
64
43
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
65
44
abfs_same_atom = Exx_Abfs::Construct_Orbs::abfs_same_atom (ucell, orb, this ->lcaos , this ->info .kmesh_times , this ->info .pca_threshold );
66
45
if (this ->info .files_abfs .empty ())
67
46
{ this ->abfs = abfs_same_atom;}
68
47
else
69
48
{ 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);
92
50
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 );
93
53
94
54
for ( size_t T=0 ; T!=this ->abfs .size (); ++T )
95
55
{ 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