1111#include " ../module_base/global_variable.h"
1212#include " grid_technique.h"
1313#include " LCAO_matrix.h"
14+ #include " ../src_pw/charge.h"
1415#include < omp.h>
1516
1617// =========================================================
@@ -30,7 +31,7 @@ class Gint_Gamma
3031 void cal_vlocal ( const double *const vlocal, LCAO_Matrix &lm);
3132
3233 // (2) calculate charge density
33- double cal_rho (double *** DM_in);
34+ void cal_rho (double *** DM_in, Charge* chr );
3435
3536 // (3) calcualte the forces related to grid
3637 void cal_force (double *** DM_in, const double *const vlocal,
@@ -42,36 +43,13 @@ class Gint_Gamma
4243
4344 // (5) calculate the Mulliken charge
4445 void cal_mulliken (double ** mulliken);
45-
46- void prepare (
47- const ModuleBase::Matrix3 &latvec_in,
48- const double & lat0_in);
4946
5047private:
5148
52- double vfactor;
53- ModuleBase::Matrix3 latvec0;
54- double lat0;
5549 double *** DM; // pointer to LOC.DM
56- double * transformer;
57- double psiv1;
58- double psiv2;
59- double * ylm1;
60- double * ylm2;
6150
6251 int grid_index; // may delete?
6352 int max_size;
64-
65- // these parameters are for interpolation.
66- // we store these parameters at first to speed
67- // up the calculation.
68- double *x0;
69- double *x1;
70- double *x2;
71- double *x3;
72- double * x12;
73- double * x03;
74- int *iq;
7553
7654 // /===============================
7755 // / Use MPI_Alltoallv to convert a grid distributed matrix
@@ -90,32 +68,17 @@ class Gint_Gamma
9068 int *receiver_size_process;
9169 int *receiver_displacement_process;
9270 double * receiver_buffer;
93-
94- void save_atoms_on_grid (const Grid_Technique& gt);
9571
9672 // for calculation of < phi_i | Vlocal | phi_j >
9773 // Input: vlocal[ir]
9874 // Output: GridVlocal.ptr_2D[iw1_lo][iw2_lo]
9975 Gint_Tools::Array_Pool<double > gamma_vlocal (const double *const vlocal) const ;
100-
101- // for calculation of charege
102- // Input: DM[is][iw1_lo][iw2_lo]
103- // Output: rho.ptr_2D[is][ir]
104- Gint_Tools::Array_Pool<double > gamma_charge (const double *const *const *const DM) const ;
105-
10676 // for calculation of Mulliken charge.
10777 void gamma_mulliken (double ** mulliken);
10878
10979 // for calculation of envelope functions.
11080 void gamma_envelope (const double * wfc, double * rho);// mohan add 2011-07-01
11181
112-
113- // for calculatin of < dphi_i | Vlocal | phi_j > for foce calculation
114- // on regular FFT real space grid.
115- void gamma_force (const double *const *const *const DM, const double *const vlocal,
116- ModuleBase::matrix& force, ModuleBase::matrix& stress,
117- const bool is_force, const bool is_stress);
118-
11982 void cal_meshball_vlocal (
12083 const int na_grid, // how many atoms on this (i,j,k) grid
12184 const int LD_pool,
@@ -139,7 +102,7 @@ class Gint_Gamma
139102 const double *const *const psir_ylm, // psir_ylm[GlobalC::pw.bxyz][LD_pool]
140103 const int *const vindex, // vindex[GlobalC::pw.bxyz]
141104 const double *const *const *const DM, // DM[GlobalV::NSPIN][lgd_now][lgd_now]
142- Gint_Tools::Array_Pool< double > &rho ) const ; // rho[GlobalV::NSPIN][GlobalC::pw.nrxx]
105+ Charge* chr ) const ; // rho[GlobalV::NSPIN][GlobalC::pw.nrxx]
143106
144107 void cal_meshball_force (
145108 const int grid_index,
0 commit comments