Skip to content

Commit 1b7aae8

Browse files
committed
change ucell in module_io/to_wannier90_lcao_in_pw.cpp
1 parent 6c346f3 commit 1b7aae8

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,8 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12321232
PARAM.inp.nnkpfile,
12331233
PARAM.inp.wannier_spin);
12341234

1235-
myWannier.calculate(this->pelec->ekb,
1235+
myWannier.calculate(ucell,
1236+
this->pelec->ekb,
12361237
this->pw_wfc,
12371238
this->pw_big,
12381239
this->sf,

source/module_io/to_wannier90_lcao_in_pw.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ toWannier90_LCAO_IN_PW::~toWannier90_LCAO_IN_PW()
3030
}
3131

3232
void toWannier90_LCAO_IN_PW::calculate(
33+
UnitCell& ucell,
3334
const ModuleBase::matrix& ekb,
3435
const ModulePW::PW_Basis_K* wfcpw,
3536
const ModulePW::PW_Basis_Big* bigpw,
@@ -45,9 +46,9 @@ void toWannier90_LCAO_IN_PW::calculate(
4546
ModulePW::PW_Basis_K* wfcpw_ptr = const_cast<ModulePW::PW_Basis_K*>(wfcpw);
4647
this->psi_init_ = new psi_initializer_nao<std::complex<double>, base_device::DEVICE_CPU>();
4748
#ifdef __MPI
48-
this->psi_init_->initialize(sf_ptr, wfcpw_ptr, &(GlobalC::ucell), &(GlobalC::Pkpoints), 1, nullptr, GlobalV::MY_RANK);
49+
this->psi_init_->initialize(sf_ptr, wfcpw_ptr, &ucell, &(GlobalC::Pkpoints), 1, nullptr, GlobalV::MY_RANK);
4950
#else
50-
this->psi_init_->initialize(sf_ptr, wfcpw_ptr, &(GlobalC::ucell), 1, nullptr);
51+
this->psi_init_->initialize(sf_ptr, wfcpw_ptr, &(ucell), 1, nullptr);
5152
#endif
5253
this->psi_init_->tabulate();
5354
this->psi_init_->allocate(true);
@@ -69,7 +70,7 @@ void toWannier90_LCAO_IN_PW::calculate(
6970
}
7071
}
7172

72-
psi::Psi<std::complex<double>> *unk_inLcao = get_unk_from_lcao(*psi, wfcpw, sf, kv);
73+
psi::Psi<std::complex<double>> *unk_inLcao = get_unk_from_lcao(ucell,*psi, wfcpw, sf, kv);
7374

7475
if (out_wannier_eig)
7576
{
@@ -106,6 +107,7 @@ void toWannier90_LCAO_IN_PW::calculate(
106107
}
107108

108109
psi::Psi<std::complex<double>>* toWannier90_LCAO_IN_PW::get_unk_from_lcao(
110+
const UnitCell& ucell,
109111
const psi::Psi<std::complex<double>>& psi_in,
110112
const ModulePW::PW_Basis_K* wfcpw,
111113
const Structure_Factor& sf,
@@ -118,7 +120,7 @@ psi::Psi<std::complex<double>>* toWannier90_LCAO_IN_PW::get_unk_from_lcao(
118120
unk_inLcao->zero_out();
119121

120122
// Orbital projection to plane wave
121-
ModuleBase::realArray table_local(GlobalC::ucell.ntype, GlobalC::ucell.nmax_total, PARAM.globalv.nqx);
123+
ModuleBase::realArray table_local(ucell.ntype, ucell.nmax_total, PARAM.globalv.nqx);
122124

123125
for (int ik = 0; ik < num_kpts; ik++)
124126
{

source/module_io/to_wannier90_lcao_in_pw.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ class toWannier90_LCAO_IN_PW : public toWannier90_PW
4646
const std::string& wannier_spin);
4747
~toWannier90_LCAO_IN_PW();
4848

49-
void calculate(const ModuleBase::matrix& ekb,
49+
void calculate(UnitCell& ucell,
50+
const ModuleBase::matrix& ekb,
5051
const ModulePW::PW_Basis_K* wfcpw,
5152
const ModulePW::PW_Basis_Big* bigpw,
5253
const Structure_Factor& sf,
5354
const K_Vectors& kv,
5455
const psi::Psi<std::complex<double>>* psi,
5556
const Parallel_Orbitals* pv);
5657

57-
void calculate(const ModuleBase::matrix& ekb,
58+
void calculate(UnitCell& ucell,
59+
const ModuleBase::matrix& ekb,
5860
const ModulePW::PW_Basis_K* wfcpw,
5961
const ModulePW::PW_Basis_Big* bigpw,
6062
const Structure_Factor& sf,
@@ -76,7 +78,8 @@ class toWannier90_LCAO_IN_PW : public toWannier90_PW
7678
/// @param sf [in] computational methods instance, structure factor calculator
7779
/// @param kv [in] data carrier, storing kpoints information
7880
/// @return psi::Psi<std::complex<double>>*
79-
psi::Psi<std::complex<double>>* get_unk_from_lcao(const psi::Psi<std::complex<double>>& psi_in,
81+
psi::Psi<std::complex<double>>* get_unk_from_lcao(const UnitCell& ucell,
82+
const psi::Psi<std::complex<double>>& psi_in,
8083
const ModulePW::PW_Basis_K* wfcpw,
8184
const Structure_Factor& sf,
8285
const K_Vectors& kv);

0 commit comments

Comments
 (0)