Skip to content

Commit 4ffe19a

Browse files
committed
fix bugs
1 parent 9a4a462 commit 4ffe19a

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ void ESolver_KS_PW<T, Device>::before_all_runners(UnitCell& ucell, const Input_p
9191
ESolver_KS<T, Device>::before_all_runners(ucell, inp);
9292

9393
//! setup and allocation for pelec, charge density, potentials, etc.
94-
// elecstate::setup_estate_pw<T, Device>(ucell, this->kv, this->sf, this->pelec, this->chr,
95-
// this->locpp, this->ppcell, this->vsep_cell, this->pw_wfc, this->pw_rho,
96-
// this->pw_rhod, this->pw_big, this->solvent, inp);
94+
elecstate::setup_estate_pw<T, Device>(ucell, this->kv, this->sf, this->pelec, this->chr,
95+
this->locpp, this->ppcell, this->vsep_cell, this->pw_wfc, this->pw_rho,
96+
this->pw_rhod, this->pw_big, this->solvent, inp);
9797

98+
/*
9899
//! Initialize ElecState, set pelec pointer
99100
if (this->pelec == nullptr)
100101
{
@@ -143,6 +144,7 @@ void ESolver_KS_PW<T, Device>::before_all_runners(UnitCell& ucell, const Input_p
143144
this->ppcell.init(ucell, &this->sf, this->pw_wfc);
144145
this->ppcell.init_vnl(ucell, this->pw_rhod);
145146
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "NON-LOCAL POTENTIAL");
147+
*/
146148

147149

148150

@@ -161,6 +163,7 @@ void ESolver_KS_PW<T, Device>::before_all_runners(UnitCell& ucell, const Input_p
161163

162164
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT BASIS");
163165

166+
/*
164167
//! Setup occupations
165168
if (inp.ocp)
166169
{
@@ -171,8 +174,7 @@ void ESolver_KS_PW<T, Device>::before_all_runners(UnitCell& ucell, const Input_p
171174
this->pelec->wg,
172175
this->pelec->skip_weights);
173176
}
174-
175-
177+
*/
176178

177179
//! Initialize exx pw
178180
if (inp.calculation == "scf" || inp.calculation == "relax" || inp.calculation == "cell-relax"

source/source_estate/setup_estate_pw.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ template <typename T, typename Device>
77
void elecstate::setup_estate_pw(UnitCell& ucell, // unitcell
88
K_Vectors &kv, // kpoints
99
Structure_Factor &sf, // structure factors
10-
elecstate::ElecState *pelec, // pointer of electrons
10+
elecstate::ElecState* &pelec, // pointer of electrons
1111
Charge &chr, // charge density
1212
pseudopot_cell_vl &locpp, // local pseudopotentials
1313
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
14-
VSep* vsep_cell, // U-1/2 method
15-
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
16-
ModulePW::PW_Basis *pw_rho, // pw for rho
17-
ModulePW::PW_Basis *pw_rhod, // pw for rhod
14+
VSep* &vsep_cell, // U-1/2 method
15+
ModulePW::PW_Basis_K* pw_wfc, // pw for wfc
16+
ModulePW::PW_Basis* pw_rho, // pw for rho
17+
ModulePW::PW_Basis* pw_rhod, // pw for rhod
1818
ModulePW::PW_Basis_Big* pw_big, // pw for big grid
1919
surchem &solvent, // solvent
2020
const Input_para& inp) // input parameters
@@ -69,7 +69,6 @@ void elecstate::setup_estate_pw(UnitCell& ucell, // unitcell
6969
ppcell.init_vnl(ucell, pw_rhod);
7070
ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "NON-LOCAL POTENTIAL");
7171

72-
/*
7372
//! Setup occupations
7473
if (inp.ocp)
7574
{
@@ -80,7 +79,6 @@ void elecstate::setup_estate_pw(UnitCell& ucell, // unitcell
8079
pelec->wg,
8180
pelec->skip_weights);
8281
}
83-
*/
8482

8583
return;
8684
}
@@ -117,11 +115,11 @@ template void elecstate::setup_estate_pw<std::complex<float>, base_device::DEVIC
117115
UnitCell& ucell, // unitcell
118116
K_Vectors &kv, // kpoints
119117
Structure_Factor &sf, // structure factors
120-
elecstate::ElecState *pelec, // pointer of electrons
118+
elecstate::ElecState* &pelec, // pointer of electrons
121119
Charge &chr, // charge density
122120
pseudopot_cell_vl &locpp, // local pseudopotentials
123121
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
124-
VSep* vsep_cell, // U-1/2 method
122+
VSep* &vsep_cell, // U-1/2 method
125123
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
126124
ModulePW::PW_Basis *pw_rho, // pw for rho
127125
ModulePW::PW_Basis *pw_rhod, // pw for rhod
@@ -133,11 +131,11 @@ template void elecstate::setup_estate_pw<std::complex<double>, base_device::DEVI
133131
UnitCell& ucell, // unitcell
134132
K_Vectors &kv, // kpoints
135133
Structure_Factor &sf, // structure factors
136-
elecstate::ElecState *pelec, // pointer of electrons
134+
elecstate::ElecState* &pelec, // pointer of electrons
137135
Charge &chr, // charge density
138136
pseudopot_cell_vl &locpp, // local pseudopotentials
139137
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
140-
VSep* vsep_cell, // U-1/2 method
138+
VSep* &vsep_cell, // U-1/2 method
141139
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
142140
ModulePW::PW_Basis *pw_rho, // pw for rho
143141
ModulePW::PW_Basis *pw_rhod, // pw for rhod
@@ -159,11 +157,11 @@ template void elecstate::setup_estate_pw<std::complex<float>, base_device::DEVIC
159157
UnitCell& ucell, // unitcell
160158
K_Vectors &kv, // kpoints
161159
Structure_Factor &sf, // structure factors
162-
elecstate::ElecState *pelec, // pointer of electrons
160+
elecstate::ElecState* &pelec, // pointer of electrons
163161
Charge &chr, // charge density
164162
pseudopot_cell_vl &locpp, // local pseudopotentials
165163
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
166-
VSep* vsep_cell, // U-1/2 method
164+
VSep* &vsep_cell, // U-1/2 method
167165
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
168166
ModulePW::PW_Basis *pw_rho, // pw for rho
169167
ModulePW::PW_Basis *pw_rhod, // pw for rhod
@@ -175,11 +173,11 @@ template void elecstate::setup_estate_pw<std::complex<double>, base_device::DEVI
175173
UnitCell& ucell, // unitcell
176174
K_Vectors &kv, // kpoints
177175
Structure_Factor &sf, // structure factors
178-
elecstate::ElecState *pelec, // pointer of electrons
176+
elecstate::ElecState* &pelec, // pointer of electrons
179177
Charge &chr, // charge density
180178
pseudopot_cell_vl &locpp, // local pseudopotentials
181179
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
182-
VSep* vsep_cell, // U-1/2 method
180+
VSep* &vsep_cell, // U-1/2 method
183181
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
184182
ModulePW::PW_Basis *pw_rho, // pw for rho
185183
ModulePW::PW_Basis *pw_rhod, // pw for rhod

source/source_estate/setup_estate_pw.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ template <typename T, typename Device>
1616
void setup_estate_pw(UnitCell& ucell, // unitcell
1717
K_Vectors &kv, // kpoints
1818
Structure_Factor &sf, // structure factors
19-
elecstate::ElecState *pelec, // pointer of electrons
19+
elecstate::ElecState* &pelec, // pointer of electrons
2020
Charge &chr, // charge density
2121
pseudopot_cell_vl &locpp, // local pseudopotentials
2222
pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
23-
VSep* vsep_cell, // U-1/2 method
24-
ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
25-
ModulePW::PW_Basis *pw_rho, // pw for rho
26-
ModulePW::PW_Basis *pw_rhod, // pw for rhod
23+
VSep* &vsep_cell, // U-1/2 method
24+
ModulePW::PW_Basis_K* pw_wfc, // pw for wfc
25+
ModulePW::PW_Basis* pw_rho, // pw for rho
26+
ModulePW::PW_Basis* pw_rhod, // pw for rhod
2727
ModulePW::PW_Basis_Big* pw_big, // pw for big grid
2828
surchem &solvent, // solvent
2929
const Input_para& inp); // input parameters

0 commit comments

Comments
 (0)