Skip to content

Commit 24a450b

Browse files
mohanchenFisherd99
authored andcommitted
Update elecstate.cpp (deepmodeling#5579)
1 parent fcbc019 commit 24a450b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

source/module_elecstate/elecstate.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ namespace elecstate
1212

1313
const double* ElecState::getRho(int spin) const
1414
{
15-
// hamilt::MatrixBlock<double> temp{&(this->charge->rho[spin][0]), 1, this->charge->nrxx}; //
16-
// this->chr->get_nspin(), this->chr->get_nrxx()};
1715
return &(this->charge->rho[spin][0]);
1816
}
1917

2018
void ElecState::fixed_weights(const std::vector<double>& ocp_kb, const int& nbands, const double& nelec)
2119
{
22-
2320
assert(nbands > 0);
2421
assert(nelec > 0.0);
2522

@@ -56,6 +53,7 @@ void ElecState::fixed_weights(const std::vector<double>& ocp_kb, const int& nban
5653
return;
5754
}
5855

56+
5957
void ElecState::init_nelec_spin()
6058
{
6159
this->nelec_spin.resize(PARAM.inp.nspin);
@@ -66,6 +64,7 @@ void ElecState::init_nelec_spin()
6664
}
6765
}
6866

67+
6968
void ElecState::calculate_weights()
7069
{
7170
ModuleBase::TITLE("ElecState", "calculate_weights");
@@ -74,8 +73,8 @@ void ElecState::calculate_weights()
7473
return;
7574
}
7675

77-
int nbands = this->ekb.nc;
78-
int nks = this->ekb.nr;
76+
const int nbands = this->ekb.nc;
77+
const int nks = this->ekb.nr;
7978

8079
if (!Occupy::use_gaussian_broadening && !Occupy::fixed_occupations)
8180
{
@@ -176,6 +175,7 @@ void ElecState::calculate_weights()
176175
return;
177176
}
178177

178+
179179
void ElecState::calEBand()
180180
{
181181
ModuleBase::TITLE("ElecState", "calEBand");
@@ -205,10 +205,13 @@ void ElecState::calEBand()
205205
return;
206206
}
207207

208-
void ElecState::init_scf(const int istep, const ModuleBase::ComplexMatrix& strucfac, ModuleSymmetry::Symmetry& symm, const void* wfcpw)
208+
209+
void ElecState::init_scf(const int istep,
210+
const ModuleBase::ComplexMatrix& strucfac,
211+
ModuleSymmetry::Symmetry& symm,
212+
const void* wfcpw)
209213
{
210-
//---------Charge part-----------------
211-
// core correction potential.
214+
//! core correction potential.
212215
if (!PARAM.inp.use_paw)
213216
{
214217
this->charge->set_rho_core(strucfac);
@@ -218,23 +221,22 @@ void ElecState::init_scf(const int istep, const ModuleBase::ComplexMatrix& struc
218221
this->charge->set_rho_core_paw();
219222
}
220223

221-
//--------------------------------------------------------------------
222-
// (2) other effective potentials need charge density,
224+
//! other effective potentials need charge density,
223225
// choose charge density from ionic step 0.
224-
//--------------------------------------------------------------------
225226
if (istep == 0)
226227
{
227228
this->charge->init_rho(this->eferm, strucfac, symm, (const void*)this->klist, wfcpw);
228229
this->charge->check_rho(); // check the rho
229230
}
230231

231-
// renormalize the charge density
232+
//! renormalize the charge density
232233
this->charge->renormalize_rho();
233234

234-
//---------Potential part--------------
235+
//! initialize the potential
235236
this->pot->init_pot(istep, this->charge);
236237
}
237238

239+
238240
void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
239241
const K_Vectors* klist_in,
240242
int nk_in,
@@ -252,6 +254,4 @@ void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
252254
this->wg.create(nk_in, PARAM.inp.nbands);
253255
}
254256

255-
256-
257257
} // namespace elecstate

0 commit comments

Comments
 (0)