Skip to content

Commit 133629f

Browse files
committed
remove some redundant lines
1 parent a41c74d commit 133629f

File tree

7 files changed

+29
-34
lines changed

7 files changed

+29
-34
lines changed

source/module_hamilt_lcao/module_gint/gint.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,23 @@ class Gint {
145145
void cal_meshball_vlocal(
146146
const int na_grid,
147147
const int LD_pool,
148-
const int* const block_iw,
149-
const int* const block_size,
150-
const int* const block_index,
151-
const int grid_index,
152-
const bool* const* const cal_flag,
153-
const double* const* const psir_ylm,
154-
const double* const* const psir_vlbr3,
155-
hamilt::HContainer<double>* hR);
156-
157-
158-
//! in gint_fvl.cpp
159-
//! calculate vl contributuion to force & stress via grid integrals
148+
const int* const
149+
block_size, // block_size[na_grid], number of columns of a band
150+
const int* const block_index, // block_index[na_grid+1], count total
151+
// number of atomis orbitals
152+
const int grid_index, // index of grid group, for tracing iat
153+
const bool* const* const
154+
cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid
155+
// distance is larger than cutoff
156+
const double* const* const psir_ylm, // psir_ylm[bxyz][LD_pool]
157+
const double* const* const psir_vlbr3, // psir_vlbr3[bxyz][LD_pool]
158+
hamilt::HContainer<double>* hR); // HContainer for storing the <phi_0 |
159+
// V | phi_R> matrix element.
160+
161+
//------------------------------------------------------
162+
// in gint_fvl.cpp
163+
//------------------------------------------------------
164+
// calculate vl contributuion to force & stress via grid integrals
160165
void gint_kernel_force(const int na_grid,
161166
const int grid_index,
162167
const double delta_r,

source/module_hamilt_lcao/module_gint/gint_vl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
void Gint::cal_meshball_vlocal(
2323
const int na_grid, // how many atoms on this (i,j,k) grid
2424
const int LD_pool,
25-
const int*const block_iw, // block_iw[na_grid], index of wave functions for each block
2625
const int*const block_size, // block_size[na_grid], number of columns of a band
2726
const int*const block_index, // block_index[na_grid+1], count total number of atomis orbitals
2827
const int grid_index, // index of grid group, for tracing global atom index

source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void Gint::gint_kernel_vlocal(Gint_inout* inout) {
7272
//integrate (psi_mu*v(r)*dv) * psi_nu on grid
7373
//and accumulates to the corresponding element in Hamiltonian
7474
this->cal_meshball_vlocal(
75-
na_grid, LD_pool, block_iw.data(), block_size.data(), block_index.data(), grid_index,
75+
na_grid, LD_pool, block_size.data(), block_index.data(), grid_index,
7676
cal_flag.get_ptr_2D(),psir_ylm.get_ptr_2D(), psir_vlbr3.get_ptr_2D(),
7777
&hRGint_thread);
7878
}
@@ -158,13 +158,13 @@ void Gint::gint_kernel_dvlocal(Gint_inout* inout) {
158158
//integrate (psi_mu*v(r)*dv) * psi_nu on grid
159159
//and accumulates to the corresponding element in Hamiltonian
160160
this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(),
161-
block_iw.data(), grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
161+
grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
162162
dpsir_ylm_x.get_ptr_2D(), &pvdpRx_thread);
163163
this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(),
164-
block_iw.data(), grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
164+
grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
165165
dpsir_ylm_y.get_ptr_2D(), &pvdpRy_thread);
166166
this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(),
167-
block_iw.data(), grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
167+
grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(),
168168
dpsir_ylm_z.get_ptr_2D(), &pvdpRz_thread);
169169
}
170170
#pragma omp critical(gint_k)
@@ -281,18 +281,18 @@ void Gint::gint_kernel_vlocal_meta(Gint_inout* inout) {
281281
//integrate (psi_mu*v(r)*dv) * psi_nu on grid
282282
//and accumulates to the corresponding element in Hamiltonian
283283
this->cal_meshball_vlocal(
284-
na_grid, LD_pool, block_iw.data(), block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
284+
na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
285285
psir_ylm.get_ptr_2D(), psir_vlbr3.get_ptr_2D(), &hRGint_thread);
286286
//integrate (d/dx_i psi_mu*vk(r)*dv) * (d/dx_i psi_nu) on grid (x_i=x,y,z)
287287
//and accumulates to the corresponding element in Hamiltonian
288288
this->cal_meshball_vlocal(
289-
na_grid, LD_pool, block_iw.data(), block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
289+
na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
290290
dpsir_ylm_x.get_ptr_2D(), dpsix_vlbr3.get_ptr_2D(), &hRGint_thread);
291291
this->cal_meshball_vlocal(
292-
na_grid, LD_pool, block_iw.data(), block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
292+
na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
293293
dpsir_ylm_y.get_ptr_2D(), dpsiy_vlbr3.get_ptr_2D(), &hRGint_thread);
294294
this->cal_meshball_vlocal(
295-
na_grid, LD_pool, block_iw.data(), block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
295+
na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(),
296296
dpsir_ylm_z.get_ptr_2D(), dpsiz_vlbr3.get_ptr_2D(), &hRGint_thread);
297297
}
298298

source/module_hamilt_lcao/module_gint/grid_meshcell.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class Grid_MeshCell: public Grid_MeshK
1818
int nbzp_start,nbzp;
1919
// save the position of each meshcell.
2020
std::vector<std::vector<double>> meshcell_pos;
21+
22+
private:
23+
// latvec0 and GT are not used in current code.
24+
// these two variables may be removed in the future.
2125
ModuleBase::Matrix3 meshcell_latvec0;
2226
ModuleBase::Matrix3 meshcell_GT;
2327

source/module_hamilt_lcao/module_gint/gtask_force.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ void alloc_mult_force(const hamilt::HContainer<double>* dm,
106106
const int ry1 = gridt.ucell_index2y[uc1];
107107
const int rz1 = gridt.ucell_index2z[uc1];
108108
const int it1 = ucell.iat2it[iat1];
109-
const int lo1
110-
= gridt.trace_lo[ucell.itiaiw2iwt(it1, ucell.iat2ia[iat1], 0)];
111109
const int nw1 = ucell.atoms[it1].nw;
112110

113111
for (int atom2 = 0; atom2 < gridt.how_many_atoms[grid_index];atom2++)
@@ -124,9 +122,6 @@ void alloc_mult_force(const hamilt::HContainer<double>* dm,
124122
continue;
125123
}
126124
const int it2 = ucell.iat2it[iat2];
127-
const int lo2 = gridt.trace_lo[ucell.itiaiw2iwt(it2,
128-
ucell.iat2ia[iat2],
129-
0)];
130125
const int nw2 = ucell.atoms[it2].nw;
131126

132127
const int mat_A_idx = (pre_atoms + atom2) * nwmax * gridt.bxyz;

source/module_hamilt_lcao/module_gint/gtask_rho.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ void alloc_mult_dot_rho(const hamilt::HContainer<double>* dm,
8989
const int ry1 = gridt.ucell_index2y[uc1];
9090
const int rz1 = gridt.ucell_index2z[uc1];
9191
const int it1 = ucell.iat2it[iat1];
92-
const int lo1
93-
= gridt.trace_lo[ucell.itiaiw2iwt(it1, ucell.iat2ia[iat1], 0)];
9492
const int nw1 = ucell.atoms[it1].nw;
9593

9694
for (int atom2 = atom1; atom2 < gridt.how_many_atoms[grid_index];
@@ -108,9 +106,6 @@ void alloc_mult_dot_rho(const hamilt::HContainer<double>* dm,
108106
continue;
109107
}
110108
const int it2 = ucell.iat2it[iat2];
111-
const int lo2 = gridt.trace_lo[ucell.itiaiw2iwt(it2,
112-
ucell.iat2ia[iat2],
113-
0)];
114109
const int nw2 = ucell.atoms[it2].nw;
115110

116111
const int mat_A_idx = bcell_start_psir + atom2 * nwmax;

source/module_hamilt_lcao/module_gint/mult_psi_dmr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ void mult_psi_DMR(
3232
{
3333
const int bcell1 = gt.bcell_start[grid_index] + ia1;
3434
const int iat1 = gt.which_atom[bcell1];
35-
const int T1 = ucell.iat2it[iat1];
36-
const int I1 = ucell.iat2ia[iat1];
3735

3836
//! get cell R1, this step is redundant in gamma_only case.
3937
const int id1 = gt.which_unitcell[bcell1];
@@ -74,7 +72,6 @@ void mult_psi_DMR(
7472
for (int ia2 = start; ia2 < na_grid; ia2++)
7573
{
7674
const int bcell2 = gt.bcell_start[grid_index] + ia2;
77-
const int T2 = ucell.iat2it[gt.which_atom[bcell2]];
7875
const int iat2 = gt.which_atom[bcell2];
7976
const int id2 = gt.which_unitcell[bcell2];
8077

0 commit comments

Comments
 (0)