Skip to content

Commit 29c639e

Browse files
committed
delete info_ewald
1 parent 0496d42 commit 29c639e

File tree

10 files changed

+21
-34
lines changed

10 files changed

+21
-34
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ ESolver_KS_LCAO<TK, TR>::ESolver_KS_LCAO()
8181
// because some members like two_level_step are used outside if(cal_exx)
8282
if (GlobalC::exx_info.info_ri.real_number)
8383
{
84-
this->exd = std::make_shared<Exx_LRI_Interface<TK, double>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
84+
this->exd = std::make_shared<Exx_LRI_Interface<TK, double>>(GlobalC::exx_info.info_ri);
8585
}
8686
else
8787
{
88-
this->exc = std::make_shared<Exx_LRI_Interface<TK, std::complex<double>>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
88+
this->exc = std::make_shared<Exx_LRI_Interface<TK, std::complex<double>>>(GlobalC::exx_info.info_ri);
8989
}
9090
#endif
9191
}

source/module_esolver/lcao_after_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep, const
226226
//------------------------------------------------------------------
227227
if (PARAM.inp.rpa)
228228
{
229-
RPA_LRI<TK, double> rpa_lri_double(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
229+
RPA_LRI<TK, double> rpa_lri_double(GlobalC::exx_info.info_ri);
230230
rpa_lri_double.cal_postSCF_exx(*dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(this->pelec)->get_DM(),
231231
MPI_COMM_WORLD,
232232
ucell,

source/module_hamilt_general/module_xc/exx_info.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ struct Exx_Info
1010
struct Exx_Info_Global
1111
{
1212
bool cal_exx = false;
13-
bool use_ewald = false;
1413

1514
Conv_Coulomb_Pot_K::Ccp_Type ccp_type;
1615
double hybrid_alpha = 0.25;
@@ -37,17 +36,6 @@ struct Exx_Info
3736
};
3837
Exx_Info_Lip info_lip;
3938

40-
struct Exx_Info_Ewald
41-
{
42-
Singular_Value::Fq_type fq_type;
43-
const bool& use_ewald;
44-
45-
Exx_Info_Ewald(const Exx_Info::Exx_Info_Global& info_global) : use_ewald(info_global.use_ewald)
46-
{
47-
}
48-
};
49-
Exx_Info_Ewald info_ewald;
50-
5139
struct Exx_Info_RI
5240
{
5341
const Conv_Coulomb_Pot_K::Ccp_Type& ccp_type;
@@ -57,6 +45,8 @@ struct Exx_Info
5745

5846
bool real_number = false;
5947
int Rcut_type = 1;
48+
Singular_Value::Fq_type fq_type;
49+
const bool& use_ewald;
6050

6151
double pca_threshold = 0;
6252
std::vector<std::string> files_abfs;
@@ -83,7 +73,7 @@ struct Exx_Info
8373
};
8474
Exx_Info_RI info_ri;
8575

86-
Exx_Info() : info_lip(this->info_global), info_ewald(this->info_global), info_ri(this->info_global)
76+
Exx_Info() : info_lip(this->info_global), info_ri(this->info_global)
8777
{
8878
}
8979
};

source/module_io/input_conv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void Input_Conv::Convert()
333333
if (PARAM.inp.exx_use_ewald)
334334
{
335335
GlobalC::exx_info.info_global.use_ewald = true;
336-
GlobalC::exx_info.info_ewald.fq_type = Singular_Value::Fq_type(PARAM.inp.exx_fq_type);
336+
GlobalC::exx_info.info_ri.fq_type = Singular_Value::Fq_type(PARAM.inp.exx_fq_type);
337337
GlobalC::exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Ccp;
338338
}
339339
else
@@ -384,7 +384,7 @@ void Input_Conv::Convert()
384384
if (PARAM.inp.exx_use_ewald)
385385
{
386386
GlobalC::exx_info.info_global.use_ewald = true;
387-
GlobalC::exx_info.info_ewald.fq_type = Singular_Value::Fq_type(PARAM.inp.exx_fq_type);
387+
GlobalC::exx_info.info_ri.fq_type = Singular_Value::Fq_type(PARAM.inp.exx_fq_type);
388388
GlobalC::exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Ccp;
389389
}
390390
else

source/module_lr/esolver_lrtd_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
281281
// set ccp_type according to the xc_kernel
282282
if (xc_kernel == "hf") { exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Hf; }
283283
else if (xc_kernel == "hse") { exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Erfc; }
284-
this->exx_lri = std::make_shared<Exx_LRI<T>>(exx_info.info_ri, exx_info.info_ewald);
284+
this->exx_lri = std::make_shared<Exx_LRI<T>>(exx_info.info_ri);
285285
this->exx_lri->init(MPI_COMM_WORLD, ucell,this->kv, ks_sol.orb_);
286286
this->exx_lri->cal_exx_ions(ucell, input.out_ri_cv);
287287
}
@@ -459,7 +459,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(const Input_para& inp, UnitCell& ucell) : inpu
459459
// set ccp_type according to the xc_kernel
460460
if (xc_kernel == "hf") { exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Hf; }
461461
else if (xc_kernel == "hse") { exx_info.info_global.ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Erfc; }
462-
this->exx_lri = std::make_shared<Exx_LRI<T>>(exx_info.info_ri, exx_info.info_ewald);
462+
this->exx_lri = std::make_shared<Exx_LRI<T>>(exx_info.info_ri);
463463
this->exx_lri->init(MPI_COMM_WORLD, ucell,this->kv, orb);
464464
this->exx_lri->cal_exx_ions(ucell, input.out_ri_cv);
465465
}

source/module_rdmft/rdmft.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in,
164164

165165
if (GlobalC::exx_info.info_ri.real_number)
166166
{
167-
Vxc_fromRI_d = new Exx_LRI<double>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
167+
Vxc_fromRI_d = new Exx_LRI<double>(GlobalC::exx_info.info_ri);
168168
Vxc_fromRI_d->init(MPI_COMM_WORLD, ucell_in,*kv, *orb);
169169
}
170170
else
171171
{
172-
Vxc_fromRI_c = new Exx_LRI<std::complex<double>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
172+
Vxc_fromRI_c = new Exx_LRI<std::complex<double>>(GlobalC::exx_info.info_ri);
173173
Vxc_fromRI_c->init(MPI_COMM_WORLD, ucell_in,*kv, *orb);
174174
}
175175
}

source/module_ri/Exx_LRI.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Exx_LRI
4949
using TatomR = std::array<double,Ndim>; // tmp
5050

5151
public:
52-
Exx_LRI(const Exx_Info::Exx_Info_RI& info_in, const Exx_Info::Exx_Info_Ewald& info_ewald_in) :info(info_in), info_ewald(info_ewald_in), evq(info, info_ewald) {}
52+
Exx_LRI(const Exx_Info::Exx_Info_RI& info_in) :info(info_in), evq(info) {}
5353
Exx_LRI operator=(const Exx_LRI&) = delete;
5454
Exx_LRI operator=(Exx_LRI&&);
5555

@@ -79,7 +79,6 @@ class Exx_LRI
7979

8080
private:
8181
const Exx_Info::Exx_Info_RI& info;
82-
const Exx_Info::Exx_Info_Ewald& info_ewald;
8382
MPI_Comm mpi_comm;
8483
const K_Vectors* p_kv = nullptr;
8584
ORB_gaunt_table MGT;

source/module_ri/Exx_LRI.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void Exx_LRI<Tdata>::cal_exx_ions(const UnitCell& ucell, const bool write_cv)
103103
{{"writable_Vws", true}});
104104

105105
this->cv.Vws = LRI_CV_Tools::get_CVws(ucell, Vs);
106-
if (this->info_ewald.use_ewald) {
106+
if (this->info.use_ewald) {
107107
std::map<TA, std::map<TAC, RI::Tensor<Tdata>>> Vs_sr;
108108
if (this->info.hybrid_beta) {
109109
Vs_sr = this->sr_cv.cal_Vs(ucell, list_As_Vs.first,
@@ -116,7 +116,7 @@ void Exx_LRI<Tdata>::cal_exx_ions(const UnitCell& ucell, const bool write_cv)
116116
}
117117
this->evq.init_ions(ucell, period_Vs);
118118

119-
double chi = this->evq.get_singular_chi(ucell, this->info_ewald.fq_type, 2.0);
119+
double chi = this->evq.get_singular_chi(ucell, this->info.fq_type, 2.0);
120120
std::map<TA, std::map<TAC, RI::Tensor<Tdata>>> Vs_full
121121
= this->evq.cal_Vs(ucell, chi, Vs);
122122
Vs_full = LRI_CV_Tools::mul2(
@@ -137,7 +137,7 @@ void Exx_LRI<Tdata>::cal_exx_ions(const UnitCell& ucell, const bool write_cv)
137137
{{"writable_dVws", true}});
138138
this->cv.dVws = LRI_CV_Tools::get_dCVws(ucell, dVs);
139139

140-
if (this->info_ewald.use_ewald) {
140+
if (this->info.use_ewald) {
141141
std::map<TA, std::map<TAC, std::array<RI::Tensor<Tdata>, Ndim>>>
142142
dVs_sr;
143143
if (this->info.hybrid_beta) {

source/module_ri/RPA_LRI.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ template <typename T, typename Tdata> class RPA_LRI
3333
using TatomR = std::array<double, Ndim>; // tmp
3434

3535
public:
36-
RPA_LRI(const Exx_Info::Exx_Info_RI &info_in, const Exx_Info::Exx_Info_Ewald &info_ewald_in)
37-
:info(info_in), info_ewald(info_ewald_in){};
36+
RPA_LRI(const Exx_Info::Exx_Info_RI &info_in)
37+
:info(info_in){};
3838
~RPA_LRI(){};
3939
void init(const MPI_Comm &mpi_comm_in, const K_Vectors &kv_in, const std::vector<double>& orb_cutoff);
4040
void cal_rpa_cv(const UnitCell &ucell);
@@ -63,7 +63,6 @@ template <typename T, typename Tdata> class RPA_LRI
6363

6464
private:
6565
const Exx_Info::Exx_Info_RI &info;
66-
const Exx_Info::Exx_Info_Ewald &info_ewald;
6766
const K_Vectors *p_kv=nullptr;
6867
MPI_Comm mpi_comm;
6968
std::vector<double> orb_cutoff_;
@@ -80,7 +79,7 @@ template <typename T, typename Tdata> class RPA_LRI
8079

8180
// Tdata post_process_Erpa( const Tdata &Erpa_in ) const;
8281
};
83-
Exx_LRI<double> exx_lri_rpa(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
82+
Exx_LRI<double> exx_lri_rpa(GlobalC::exx_info.info_ri);
8483
#include "RPA_LRI.hpp"
8584

8685
#endif

source/module_ri/ewald_Vq.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class Ewald_Vq
4444
using TAK = std::pair<TA, TK>;
4545

4646
public:
47-
Ewald_Vq(const Exx_Info::Exx_Info_RI& info_in, const Exx_Info::Exx_Info_Ewald& info_ewald_in)
48-
: info(info_in), info_ewald(info_ewald_in)
47+
Ewald_Vq(const Exx_Info::Exx_Info_RI& info_in)
48+
: info(info_in)
4949
{
5050
}
5151

@@ -81,7 +81,6 @@ class Ewald_Vq
8181

8282
private:
8383
const Exx_Info::Exx_Info_RI& info;
84-
const Exx_Info::Exx_Info_Ewald& info_ewald;
8584
LRI_CV<Tdata> cv;
8685
Gaussian_Abfs gaussian_abfs;
8786
const K_Vectors* p_kv;

0 commit comments

Comments
 (0)