Skip to content

Commit a6631a6

Browse files
Update elecstate_pw.h (#5651)
* Update elecstate_pw.h * [pre-commit.ci lite] apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 8ef9cba commit a6631a6

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

source/module_elecstate/elecstate_pw.h

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ElecStatePW : public ElecState
1717
{
1818
private:
1919
using Real = typename GetTypeReal<T>::type;
20+
2021
public:
2122
ElecStatePW(ModulePW::PW_Basis_K* wfc_basis_in,
2223
Charge* chg_in,
@@ -26,46 +27,59 @@ class ElecStatePW : public ElecState
2627
ModulePW::PW_Basis* rhodpw_in,
2728
ModulePW::PW_Basis* rhopw_in,
2829
ModulePW::PW_Basis_Big* bigpw_in);
29-
// void init(Charge* chg_in):charge(chg_in){} override;
3030

3131
~ElecStatePW();
32-
// interface for HSolver to calculate rho from Psi
32+
33+
//! interface for HSolver to calculate rho from Psi
3334
virtual void psiToRho(const psi::Psi<T, Device>& psi);
34-
// return current electronic density rho, as a input for constructing Hamiltonian
35-
// const double* getRho(int spin) const override;
36-
virtual void cal_tau(const psi::Psi<T, Device>& psi);
3735

38-
// update charge density for next scf step
39-
// void getNewRho() override;
36+
virtual void cal_tau(const psi::Psi<T, Device>& psi);
4037

4138
Real* becsum = nullptr;
42-
// init rho_data and kin_r_data
39+
40+
//! init rho_data and kin_r_data
4341
void init_rho_data();
44-
Real ** rho = nullptr, ** kin_r = nullptr; //[Device] [spin][nrxx] rho and kin_r
42+
Real** rho = nullptr;
43+
Real** kin_r = nullptr; //[Device] [spin][nrxx] rho and kin_r
4544

4645
protected:
46+
4747
ModulePW::PW_Basis* rhopw_smooth = nullptr;
48+
4849
ModulePW::PW_Basis_K* basis = nullptr;
50+
4951
UnitCell* ucell = nullptr;
52+
5053
const pseudopot_cell_vnl* ppcell = nullptr;
5154

52-
// calculate electronic charge density on grid points or density matrix in real space
53-
// the consequence charge density rho saved into rho_out, preparing for charge mixing.
55+
//! calculate electronic charge density on grid points or density matrix in real space
56+
//! the consequence charge density rho saved into rho_out, preparing for charge mixing.
5457
void updateRhoK(const psi::Psi<T, Device>& psi); // override;
55-
// sum over all pools for rho and ebands
58+
59+
//! sum over all pools for rho and ebands
5660
void parallelK();
57-
// calcualte rho for each k
61+
62+
//! calcualte rho for each k
5863
void rhoBandK(const psi::Psi<T, Device>& psi);
59-
// add to the charge density in reciprocal space the part which is due to the US augmentation.
64+
65+
//! add to the charge density in reciprocal space the part which is due to the US augmentation.
6066
void add_usrho(const psi::Psi<T, Device>& psi);
61-
// \sum_lm Q_lm(r) \sum_i <psi_i|beta_l><beta_m|psi_i> w_i
67+
68+
//! Non-local pseudopotentials
69+
//! \sum_lm Q_lm(r) \sum_i <psi_i|beta_l><beta_m|psi_i> w_i
6270
void addusdens_g(const Real* becsum, T* rhog);
6371

6472
Device * ctx = {};
73+
6574
bool init_rho = false;
75+
6676
mutable T* vkb = nullptr;
67-
Real * rho_data = nullptr, * kin_r_data = nullptr;
68-
T * wfcr = nullptr, * wfcr_another_spin = nullptr;
77+
78+
Real* rho_data = nullptr;
79+
Real* kin_r_data = nullptr;
80+
T* wfcr = nullptr;
81+
T* wfcr_another_spin = nullptr;
82+
6983
private:
7084
using meta_op = hamilt::meta_pw_op<Real, Device>;
7185
using elecstate_pw_op = elecstate::elecstate_pw_op<Real, Device>;
@@ -85,4 +99,4 @@ class ElecStatePW : public ElecState
8599

86100
} // namespace elecstate
87101

88-
#endif
102+
#endif

0 commit comments

Comments
 (0)