Skip to content

Commit 3201feb

Browse files
committed
fix bug
1 parent 3d64e44 commit 3201feb

File tree

1 file changed

+4
-3
lines changed
  • source/module_hamilt_lcao/module_gint

1 file changed

+4
-3
lines changed

source/module_hamilt_lcao/module_gint/gint.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ void Gint::transfer_DM2DtoGrid(std::vector<hamilt::HContainer<double>*> DM2D) {
270270
pv->set_atomic_trace(iat2iwt, ucell->nat, mg);
271271
auto ijr_info = DM2D[0]->get_ijr_info();
272272
this-> DM2D_tmp = new hamilt::HContainer<double>(pv, nullptr, &ijr_info);
273+
this-> DM2D_tmp->set_zero();
273274
ModuleBase::Memory::record("Gint::DM2D_tmp", this->DM2D_tmp->get_memory_size());
274275
for (int is = 0; is < 4; is++){
275276
for (int iap = 0; iap < DM2D[0]->size_atom_pairs(); ++iap) {
@@ -278,8 +279,8 @@ void Gint::transfer_DM2DtoGrid(std::vector<hamilt::HContainer<double>*> DM2D) {
278279
int iat2 = ap.get_atom_j();
279280
for (int ir = 0; ir < ap.get_R_size(); ++ir) {
280281
const ModuleBase::Vector3<int> r_index = ap.get_R_index(ir);
281-
T* matrix_out = DM2D_tmp -> find_matrix(iat1, iat2, r_index)->get_pointer();
282-
T* matrix_in = ap.get_pointer(ir);
282+
double* matrix_out = DM2D_tmp -> find_matrix(iat1, iat2, r_index)->get_pointer();
283+
double* matrix_in = ap.get_pointer(ir);
283284
for (int irow = 0; irow < ap.get_row_size()/2; irow ++) {
284285
for (int icol = 0; icol < ap.get_col_size()/2; icol ++) {
285286
int index_i = irow* ap.get_col_size()/2 + icol;
@@ -291,7 +292,7 @@ void Gint::transfer_DM2DtoGrid(std::vector<hamilt::HContainer<double>*> DM2D) {
291292
}
292293
hamilt::transferParallels2Serials( *(this->DM2D_tmp), this->DMRGint[is]);
293294
}
294-
// delete iat2iwt;
295+
// delete iat2iwt [];
295296
// delete pv;
296297
// delete this-> DM2D_tmp;
297298
#else

0 commit comments

Comments
 (0)