Skip to content

Commit 0a768b4

Browse files
committed
change ucell in module_io/get_wf_lcao.cpp
1 parent d6be570 commit 0a768b4

File tree

7 files changed

+29
-21
lines changed

7 files changed

+29
-21
lines changed

source/module_esolver/lcao_others.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
326326
IState_Envelope IEP(this->pelec);
327327
if (PARAM.globalv.gamma_only_local)
328328
{
329-
IEP.begin(this->psi,
329+
IEP.begin(ucell,
330+
this->psi,
330331
this->pw_rhod,
331332
this->pw_wfc,
332333
this->pw_big,
@@ -346,7 +347,8 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
346347
}
347348
else
348349
{
349-
IEP.begin(this->psi,
350+
IEP.begin(ucell,
351+
this->psi,
350352
this->pw_rhod,
351353
this->pw_wfc,
352354
this->pw_big,

source/module_hamilt_lcao/module_gint/gint_gamma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Gint_Gamma : public Gint
3636

3737
//! in gint_gamma_env.cpp
3838
//! calcualte the electronic wave functions via grid integral
39-
void cal_env(const double* wfc, double* rho,UnitCell &ucell);
39+
void cal_env(const double* wfc, double* rho,const UnitCell &ucell);
4040

4141
//! transfer this->hRGint to Veff::hR
4242
void transfer_pvpR(hamilt::HContainer<double>* hR,const UnitCell* ucell);

source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "module_basis/module_ao/ORB_read.h"
77
#include "module_hamilt_pw/hamilt_pwdft/global.h"
88

9-
void Gint_Gamma::cal_env(const double* wfc, double* rho, UnitCell& ucell)
9+
void Gint_Gamma::cal_env(const double* wfc, double* rho,const UnitCell& ucell)
1010
{
1111
ModuleBase::TITLE("Grid_Integral", "cal_env");
1212

source/module_hamilt_lcao/module_gint/gint_k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Gint_k : public Gint {
6565
double* rho,
6666
const std::vector<ModuleBase::Vector3<double>>& kvec_c,
6767
const std::vector<ModuleBase::Vector3<double>>& kvec_d,
68-
UnitCell& ucell);
68+
const UnitCell& ucell);
6969

7070
//------------------------------------------------------
7171
// in gint_k_sparse1.cpp

source/module_hamilt_lcao/module_gint/gint_k_env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void Gint_k::cal_env_k(int ik,
1313
double* rho,
1414
const std::vector<ModuleBase::Vector3<double>>& kvec_c,
1515
const std::vector<ModuleBase::Vector3<double>>& kvec_d,
16-
UnitCell& ucell)
16+
const UnitCell& ucell)
1717
{
1818
ModuleBase::TITLE("Gint_k", "cal_env_k");
1919
ModuleBase::timer::tick("Gint_k", "cal_env_k");

source/module_io/get_wf_lcao.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ IState_Envelope::~IState_Envelope()
1919
}
2020

2121
// For gamma_only
22-
void IState_Envelope::begin(const psi::Psi<double>* psid,
22+
void IState_Envelope::begin(const UnitCell& ucell,
23+
const psi::Psi<double>* psid,
2324
const ModulePW::PW_Basis* pw_rhod,
2425
const ModulePW::PW_Basis_K* pw_wfc,
2526
const ModulePW::PW_Basis_Big* pw_big,
@@ -113,7 +114,7 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
113114
}
114115
#endif
115116

116-
gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], GlobalC::ucell);
117+
gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], ucell);
117118

118119
pes_->charge->save_rho_before_sum_band();
119120

@@ -128,7 +129,7 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
128129
0,
129130
ss.str(),
130131
ef_tmp,
131-
&(GlobalC::ucell));
132+
&(ucell));
132133
}
133134
}
134135
}
@@ -176,7 +177,7 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
176177
}
177178
#endif
178179

179-
gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], GlobalC::ucell);
180+
gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], ucell);
180181

181182
pes_->charge->save_rho_before_sum_band();
182183

@@ -210,7 +211,7 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
210211
0,
211212
ss_real.str(),
212213
ef_tmp,
213-
&(GlobalC::ucell));
214+
&(ucell));
214215

215216
// Output imaginary part
216217
std::stringstream ss_imag;
@@ -222,7 +223,7 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
222223
0,
223224
ss_imag.str(),
224225
ef_tmp,
225-
&(GlobalC::ucell));
226+
&(ucell));
226227
}
227228
}
228229
}
@@ -253,7 +254,8 @@ void IState_Envelope::begin(const psi::Psi<double>* psid,
253254
}
254255

255256
// For multi-k
256-
void IState_Envelope::begin(const psi::Psi<std::complex<double>>* psi,
257+
void IState_Envelope::begin(const UnitCell& ucell,
258+
const psi::Psi<std::complex<double>>* psi,
257259
const ModulePW::PW_Basis* pw_rhod,
258260
const ModulePW::PW_Basis_K* pw_wfc,
259261
const ModulePW::PW_Basis_Big* pw_big,
@@ -348,7 +350,7 @@ void IState_Envelope::begin(const psi::Psi<std::complex<double>>* psi,
348350
}
349351
#endif
350352
// deal with NSPIN=4
351-
gk.cal_env_k(ik, wfc_k_grid[ik][ib], pes_->charge->rho[ispin], kv.kvec_c, kv.kvec_d, GlobalC::ucell);
353+
gk.cal_env_k(ik, wfc_k_grid[ik][ib], pes_->charge->rho[ispin], kv.kvec_c, kv.kvec_d, ucell);
352354

353355
std::stringstream ss;
354356
ss << global_out_dir << "BAND" << ib + 1 << "_k_" << ik + 1 << "_s_" << ispin + 1 << "_ENV.cube";
@@ -361,7 +363,7 @@ void IState_Envelope::begin(const psi::Psi<std::complex<double>>* psi,
361363
0,
362364
ss.str(),
363365
ef_tmp,
364-
&(GlobalC::ucell),
366+
&(ucell),
365367
3,
366368
1);
367369

@@ -429,7 +431,7 @@ void IState_Envelope::begin(const psi::Psi<std::complex<double>>* psi,
429431
0,
430432
ss_real.str(),
431433
ef_tmp,
432-
&(GlobalC::ucell));
434+
&(ucell));
433435

434436
// Output imaginary part
435437
std::stringstream ss_imag;
@@ -442,7 +444,7 @@ void IState_Envelope::begin(const psi::Psi<std::complex<double>>* psi,
442444
0,
443445
ss_imag.str(),
444446
ef_tmp,
445-
&(GlobalC::ucell));
447+
&(ucell));
446448
}
447449
}
448450
}

source/module_io/get_wf_lcao.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class IState_Envelope
1717
~IState_Envelope();
1818

1919
/// For gamma_only
20-
void begin(const psi::Psi<double>* psid,
20+
void begin(const UnitCell& ucell,
21+
const psi::Psi<double>* psid,
2122
const ModulePW::PW_Basis* pw_rhod,
2223
const ModulePW::PW_Basis_K* pw_wfc,
2324
const ModulePW::PW_Basis_Big* pw_big,
@@ -36,7 +37,8 @@ class IState_Envelope
3637
const std::string& global_out_dir);
3738

3839
/// tmp, delete after Gint is refactored.
39-
void begin(const psi::Psi<double>* psid,
40+
void begin(const UnitCell& ucell,
41+
const psi::Psi<double>* psid,
4042
const ModulePW::PW_Basis* pw_rhod,
4143
const ModulePW::PW_Basis_K* pw_wfc,
4244
const ModulePW::PW_Basis_Big* pw_big,
@@ -58,7 +60,8 @@ class IState_Envelope
5860
};
5961

6062
/// For multi-k
61-
void begin(const psi::Psi<std::complex<double>>* psi,
63+
void begin(const UnitCell& ucell,
64+
const psi::Psi<std::complex<double>>* psi,
6265
const ModulePW::PW_Basis* pw_rhod,
6366
const ModulePW::PW_Basis_K* pw_wfc,
6467
const ModulePW::PW_Basis_Big* pw_big,
@@ -77,7 +80,8 @@ class IState_Envelope
7780
const std::string& global_out_dir);
7881

7982
/// tmp, delete after Gint is refactored.
80-
void begin(const psi::Psi<std::complex<double>>* psi,
83+
void begin(const UnitCell& ucell,
84+
const psi::Psi<std::complex<double>>* psi,
8185
const ModulePW::PW_Basis* pw_rhod,
8286
const ModulePW::PW_Basis_K* pw_wfc,
8387
const ModulePW::PW_Basis_Big* pw_big,

0 commit comments

Comments
 (0)