1313// a forward declaration of UnitCell
1414class UnitCell ;
1515
16- // ==========================================================
1716// Electron Charge Density
18- // ==========================================================
1917class Charge
2018{
2119
2220 public:
21+
2322 Charge ();
2423 ~Charge ();
2524
@@ -43,8 +42,8 @@ class Charge
4342
4443 double **kin_r = nullptr ; // kinetic energy density in real space, for meta-GGA
4544 double **kin_r_save = nullptr ; // kinetic energy density in real space, for meta-GGA
46- // wenfei 2021-07-28
4745 const Parallel_Grid* pgrid = nullptr ;
46+
4847 private:
4948
5049 // temporary
@@ -56,6 +55,7 @@ class Charge
5655 double *_space_kin_r_save = nullptr ;
5756
5857 public:
58+
5959 double **nhat = nullptr ; // compensation charge for PAW
6060 double **nhat_save = nullptr ; // compensation charge for PAW
6161 // wenfei 2023-09-05
@@ -77,7 +77,7 @@ class Charge
7777 * @param klist [in] k points list if needed
7878 * @param wfcpw [in] PW basis for wave function if needed
7979 */
80- void init_rho (elecstate::efermi & eferm_iout,
80+ void init_rho (elecstate::Efermi & eferm_iout,
8181 const UnitCell& ucell,
8282 const Parallel_Grid& pgrid,
8383 const ModuleBase::ComplexMatrix& strucFac,
@@ -96,6 +96,7 @@ class Charge
9696 void set_rho_core (const UnitCell& ucell,
9797 const ModuleBase::ComplexMatrix& structure_factor,
9898 const bool * numeric);
99+
99100 void set_rho_core_paw ();
100101
101102 void renormalize_rho ();
@@ -119,14 +120,13 @@ class Charge
119120
120121 double cal_rho2ne (const double *rho_in) const ;
121122
122- void check_rho (); // to check whether the charge density is normal
123+ void check_rho (); // to check whether the charge density is normal
123124
124- void init_final_scf (); // LiuXh add 20180619
125+ void init_final_scf (); // LiuXh add 20180619
125126
126127 public:
127128 /* *
128129 * @brief init some arrays for mpi_inter_pools, rho_mpi
129- *
130130 */
131131 void init_chgmpi ();
132132
@@ -136,14 +136,14 @@ class Charge
136136 */
137137 void rho_mpi ();
138138
139- /* *
140- * @brief Reduce among different pools
139+ /* *
140+ * @brief Reduce among different pools
141141 * If NPROC_IN_POOLs are all the same, use GlobalV::KP_WORLD
142142 * else, gather rho in a POOL, and then reduce among different POOLs
143- *
144- * @param array_rho f(rho): an array [nrxx]
145- */
146- void reduce_diff_pools (double * array_rho) const ;
143+ *
144+ * @param array_rho f(rho): an array [nrxx]
145+ */
146+ void reduce_diff_pools (double * array_rho) const ;
147147
148148 void set_omega (double * omega_in){this ->omega_ = omega_in;};
149149
@@ -154,6 +154,7 @@ class Charge
154154 int nspin=0 ; // number of spins
155155 ModulePW::PW_Basis* rhopw = nullptr ;// When double_grid is used, rhopw = rhodpw (dense grid)
156156 bool cal_elf = false ; // whether to calculate electron localization function (ELF)
157+
157158 private:
158159
159160 void destroy (); // free arrays liuyu 2023-03-12
@@ -163,8 +164,8 @@ class Charge
163164 bool allocate_rho;
164165
165166 bool allocate_rho_final_scf; // LiuXh add 20180606
167+
166168#ifdef __MPI
167- private:
168169 int *rec = nullptr ; // The number of elements each process should receive into the receive buffer.
169170 int *dis = nullptr ; // The displacement (relative to recvbuf) for each process in the receive buffer.
170171#endif
0 commit comments