diff --git a/source/source_estate/elecstate_lcao.cpp b/source/source_estate/elecstate_lcao.cpp index 0a02774687..7eaef537b0 100644 --- a/source/source_estate/elecstate_lcao.cpp +++ b/source/source_estate/elecstate_lcao.cpp @@ -35,7 +35,7 @@ void ElecStateLCAO>::psiToRho(const psi::Psigint_k->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint + this->gint_k->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer dm2d to DM_grid in gint Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin); this->gint_k->cal_gint(&inout); #else @@ -72,7 +72,7 @@ void ElecStateLCAO::psiToRho(const psi::Psi& psi) ModuleBase::GlobalFunc::NOTE("Calculate the charge on real space grid!"); #ifdef __OLD_GINT - this->gint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint + this->gint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer dm2d to DM_grid in gint Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin); this->gint_gamma->cal_gint(&inout); #else @@ -140,7 +140,7 @@ void ElecStateLCAO::dmToRho(std::vector pexsi_DM, std::vectorgint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint + this->gint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer dm2d to DM_grid in gint Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin); this->gint_gamma->cal_gint(&inout); #else diff --git a/source/source_lcao/module_gint/gint.h b/source/source_lcao/module_gint/gint.h index 9810b913f2..3c447b7e4f 100644 --- a/source/source_lcao/module_gint/gint.h +++ b/source/source_lcao/module_gint/gint.h @@ -26,7 +26,7 @@ class Gint { hamilt::HContainer* get_hRGint() const { return hRGint; } - std::vector*> get_DMRGint() const { return DMRGint; } + std::vector*> get_DMRGint() const { return dmr_gint; } int get_ncxyz() const { return ncxyz; } @@ -58,14 +58,14 @@ class Gint { void initialize_pvpR(const UnitCell& unitcell, const Grid_Driver* gd, const int& nspin); /** - * @brief resize DMRGint to nspin and reallocate the memory + * @brief resize dmr_gint to nspin and reallocate the memory */ void reset_DMRGint(const int& nspin); /** * @brief transfer DMR (2D para) to DMR (Grid para) in elecstate_lcao.cpp */ - void transfer_DM2DtoGrid(std::vector*> DM2D); + void transfer_DM2DtoGrid(std::vector*> dm2d); const Grid_Technique* gridt = nullptr; const UnitCell* ucell; @@ -256,13 +256,13 @@ class Gint { hamilt::HContainer* hRGint = nullptr; //! size of vec is 4, only used when nspin = 4 - std::vector*> hRGint_tmp; + std::vector*> hr_gint_tmp; //! stores Hamiltonian in sparse format hamilt::HContainer>* hRGintCd = nullptr; //! stores DMR in sparse format - std::vector*> DMRGint; + std::vector*> dmr_gint; //! tmp tools used in transfer_DM2DtoGrid hamilt::HContainer* dm2d_tmp = nullptr; diff --git a/source/source_lcao/module_gint/gint_force_cpu_interface.cpp b/source/source_lcao/module_gint/gint_force_cpu_interface.cpp index e3b6a30077..f4f346783d 100644 --- a/source/source_lcao/module_gint/gint_force_cpu_interface.cpp +++ b/source/source_lcao/module_gint/gint_force_cpu_interface.cpp @@ -82,7 +82,7 @@ void Gint::gint_kernel_force(Gint_inout* inout) { cal_flag.get_ptr_2D(), psir_vlbr3.get_ptr_2D(), psir_vlbr3_DM.get_ptr_2D(), - this->DMRGint[inout->ispin], + this->dmr_gint[inout->ispin], false); if(inout->isforce) @@ -230,19 +230,19 @@ void Gint::gint_kernel_force_meta(Gint_inout* inout) { //calculating g_mu(r) = sum_nu rho_mu,nu f_nu(r) Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - psir_vlbr3.get_ptr_2D(), psir_vlbr3_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); + psir_vlbr3.get_ptr_2D(), psir_vlbr3_DM.get_ptr_2D(), this->dmr_gint[inout->ispin], false); Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_x_vlbr3.get_ptr_2D(), dpsirx_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); + dpsir_x_vlbr3.get_ptr_2D(), dpsirx_v_DM.get_ptr_2D(), this->dmr_gint[inout->ispin], false); Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_y_vlbr3.get_ptr_2D(), dpsiry_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); + dpsir_y_vlbr3.get_ptr_2D(), dpsiry_v_DM.get_ptr_2D(), this->dmr_gint[inout->ispin], false); Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_z_vlbr3.get_ptr_2D(), dpsirz_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); + dpsir_z_vlbr3.get_ptr_2D(), dpsirz_v_DM.get_ptr_2D(), this->dmr_gint[inout->ispin], false); if(inout->isforce) { diff --git a/source/source_lcao/module_gint/gint_gpu_interface.cpp b/source/source_lcao/module_gint/gint_gpu_interface.cpp index f033722ecf..8e8e362f23 100644 --- a/source/source_lcao/module_gint/gint_gpu_interface.cpp +++ b/source/source_lcao/module_gint/gint_gpu_interface.cpp @@ -18,7 +18,7 @@ void Gint::gpu_vlocal_interface(Gint_inout* inout) { ylmcoef[i] = ModuleBase::Ylm::ylmcoef[i]; } - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; + hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hr_gint_tmp[inout->ispin]; GintKernel::gint_vl_gpu(hRGint_kernel, inout->vl, ylmcoef, @@ -45,7 +45,7 @@ void Gint::gpu_rho_interface(Gint_inout* inout) { int nrxx = this->gridt->ncx * this->gridt->ncy * this->nplane; for (int is = 0; is < PARAM.inp.nspin; ++is) { ModuleBase::GlobalFunc::ZEROS(inout->rho[is], nrxx); - GintKernel::gint_rho_gpu(this->DMRGint[is], + GintKernel::gint_rho_gpu(this->dmr_gint[is], ylmcoef, dr, this->gridt->rcuts.data(), @@ -76,7 +76,7 @@ void Gint::gpu_force_interface(Gint_inout* inout) { if (isforce || isstress) { std::vector force(nat * 3, 0.0); std::vector stress(6, 0.0); - GintKernel::gint_fvl_gpu(this->DMRGint[inout->ispin], + GintKernel::gint_fvl_gpu(this->dmr_gint[inout->ispin], inout->vl, force.data(), stress.data(), diff --git a/source/source_lcao/module_gint/gint_k_pvpr.cpp b/source/source_lcao/module_gint/gint_k_pvpr.cpp index e59ed4443d..8f98e1dcaf 100644 --- a/source/source_lcao/module_gint/gint_k_pvpr.cpp +++ b/source/source_lcao/module_gint/gint_k_pvpr.cpp @@ -89,8 +89,8 @@ void Gint_k::transfer_pvpR(hamilt::HContainer>* hR, { hamilt::AtomPair>* upper_ap = ap; hamilt::AtomPair>* lower_ap = this->hRGintCd->find_pair(iat2, iat1); - const hamilt::AtomPair* ap_nspin_0 = this->hRGint_tmp[0]->find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_3 = this->hRGint_tmp[3]->find_pair(iat1, iat2); + const hamilt::AtomPair* ap_nspin_0 = this->hr_gint_tmp[0]->find_pair(iat1, iat2); + const hamilt::AtomPair* ap_nspin_3 = this->hr_gint_tmp[3]->find_pair(iat1, iat2); for (int ir = 0; ir < upper_ap->get_R_size(); ir++) { const auto R_index = upper_ap->get_R_index(ir); @@ -110,8 +110,8 @@ void Gint_k::transfer_pvpR(hamilt::HContainer>* hR, if (PARAM.globalv.domag) { - const hamilt::AtomPair* ap_nspin_1 = this->hRGint_tmp[1]->find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_2 = this->hRGint_tmp[2]->find_pair(iat1, iat2); + const hamilt::AtomPair* ap_nspin_1 = this->hr_gint_tmp[1]->find_pair(iat1, iat2); + const hamilt::AtomPair* ap_nspin_2 = this->hr_gint_tmp[2]->find_pair(iat1, iat2); const auto mat_nspin_1 = ap_nspin_1->find_matrix(R_index); const auto mat_nspin_2 = ap_nspin_2->find_matrix(R_index); for (int irow = 0; irow < mat_nspin_1->get_row_size(); ++irow) diff --git a/source/source_lcao/module_gint/gint_old.cpp b/source/source_lcao/module_gint/gint_old.cpp index da19046563..73b666581c 100644 --- a/source/source_lcao/module_gint/gint_old.cpp +++ b/source/source_lcao/module_gint/gint_old.cpp @@ -24,13 +24,13 @@ Gint::~Gint() { delete this->hRGint; delete this->hRGintCd; - // in gamma_only case, DMRGint.size()=0, - // in multi-k case, DMRGint.size()=nspin - for (int is = 0; is < this->DMRGint.size(); is++) { - delete this->DMRGint[is]; + // in gamma_only case, dmr_gint.size()=0, + // in multi-k case, dmr_gint.size()=nspin + for (int is = 0; is < this->dmr_gint.size(); is++) { + delete this->dmr_gint[is]; } - for(int is = 0; is < this->hRGint_tmp.size(); is++) { - delete this->hRGint_tmp[is]; + for(int is = 0; is < this->hr_gint_tmp .size(); is++) { + delete this->hr_gint_tmp [is]; } #ifdef __MPI delete this->dm2d_tmp; @@ -141,13 +141,12 @@ void Gint::prep_grid(const Grid_Technique& gt, void Gint::initialize_pvpR(const UnitCell& ucell_in, const Grid_Driver* gd, const int& nspin) { ModuleBase::TITLE("Gint", "initialize_pvpR"); - int npol = 1; - // there is the only resize code of DMRGint - if (this->DMRGint.size() == 0) { - this->DMRGint.resize(nspin); + // there is the only resize code of dmr_gint + if (this->dmr_gint.size() == 0) { + this->dmr_gint.resize(nspin); } - hRGint_tmp.resize(nspin); + hr_gint_tmp.resize(nspin); if (nspin != 4) { if (this->hRGint != nullptr) { delete this->hRGint; @@ -161,14 +160,14 @@ void Gint::initialize_pvpR(const UnitCell& ucell_in, const Grid_Driver* gd, cons this->hRGintCd = new hamilt::HContainer>(ucell_in.nat); for (int is = 0; is < nspin; is++) { - if (this->DMRGint[is] != nullptr) { - delete this->DMRGint[is]; + if (this->dmr_gint[is] != nullptr) { + delete this->dmr_gint[is]; } - if (this->hRGint_tmp[is] != nullptr) { - delete this->hRGint_tmp[is]; + if (this->hr_gint_tmp[is] != nullptr) { + delete this->hr_gint_tmp[is]; } - this->DMRGint[is] = new hamilt::HContainer(ucell_in.nat); - this->hRGint_tmp[is] = new hamilt::HContainer(ucell_in.nat); + this->dmr_gint[is] = new hamilt::HContainer(ucell_in.nat); + this->hr_gint_tmp[is] = new hamilt::HContainer(ucell_in.nat); } #ifdef __MPI if (this->dm2d_tmp != nullptr) { @@ -176,7 +175,6 @@ void Gint::initialize_pvpR(const UnitCell& ucell_in, const Grid_Driver* gd, cons } #endif } - if (PARAM.globalv.gamma_only_local && nspin != 4) { this->hRGint->fix_gamma(); } @@ -185,30 +183,30 @@ void Gint::initialize_pvpR(const UnitCell& ucell_in, const Grid_Driver* gd, cons this->hRGint->allocate(nullptr, true); ModuleBase::Memory::record("Gint::hRGint", this->hRGint->get_memory_size()); - // initialize DMRGint with hRGint when NSPIN != 4 - for (int is = 0; is < this->DMRGint.size(); is++) { - if (this->DMRGint[is] != nullptr) { - delete this->DMRGint[is]; + // initialize dmr_gint with hRGint when NSPIN != 4 + for (int is = 0; is < this->dmr_gint.size(); is++) { + if (this->dmr_gint[is] != nullptr) { + delete this->dmr_gint[is]; } - this->DMRGint[is] = new hamilt::HContainer(*this->hRGint); + this->dmr_gint[is] = new hamilt::HContainer(*this->hRGint); } - ModuleBase::Memory::record("Gint::DMRGint", - this->DMRGint[0]->get_memory_size() - * this->DMRGint.size()); + ModuleBase::Memory::record("Gint::dmr_gint", + this->dmr_gint[0]->get_memory_size() + * this->dmr_gint.size()); } else { this->hRGintCd->insert_ijrs(this->gridt->get_ijr_info(), ucell_in, npol); this->hRGintCd->allocate(nullptr, true); for(int is = 0; is < nspin; is++) { - this->hRGint_tmp[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); - this->DMRGint[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); - this->hRGint_tmp[is]->allocate(nullptr, true); - this->DMRGint[is]->allocate(nullptr, true); + this->hr_gint_tmp[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); + this->dmr_gint[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); + this->hr_gint_tmp[is]->allocate(nullptr, true); + this->dmr_gint[is]->allocate(nullptr, true); } - ModuleBase::Memory::record("Gint::hRGint_tmp", - this->hRGint_tmp[0]->get_memory_size()*nspin); - ModuleBase::Memory::record("Gint::DMRGint", - this->DMRGint[0]->get_memory_size() - * this->DMRGint.size()*nspin); + ModuleBase::Memory::record("Gint::hr_gint_tmp", + this->hr_gint_tmp[0]->get_memory_size()*nspin); + ModuleBase::Memory::record("Gint::dmr_gint", + this->dmr_gint[0]->get_memory_size() + * this->dmr_gint.size()*nspin); } } @@ -216,13 +214,13 @@ void Gint::reset_DMRGint(const int& nspin) { if (this->hRGint) { - for (auto& d : this->DMRGint) { delete d; } - this->DMRGint.resize(nspin); - this->DMRGint.shrink_to_fit(); - for (auto& d : this->DMRGint) { d = new hamilt::HContainer(*this->hRGint); } + for (auto& d : this->dmr_gint) { delete d; } + this->dmr_gint.resize(nspin); + this->dmr_gint.shrink_to_fit(); + for (auto& d : this->dmr_gint) { d = new hamilt::HContainer(*this->hRGint); } if (nspin == 4) { - for (auto& d : this->DMRGint) { d->allocate(nullptr, false); } + for (auto& d : this->dmr_gint) { d->allocate(nullptr, false); } #ifdef __MPI delete this->dm2d_tmp; #endif @@ -230,36 +228,35 @@ void Gint::reset_DMRGint(const int& nspin) } } -void Gint::transfer_DM2DtoGrid(std::vector*> DM2D) { +void Gint::transfer_DM2DtoGrid(std::vector*> dm2d) { ModuleBase::TITLE("Gint", "transfer_DMR"); - - // To check whether input parameter DM2D has been initialized + // To check whether input parameter dm2d has been initialized #ifdef __DEBUG - assert(!DM2D.empty() - && "Input parameter DM2D has not been initialized while calling " + assert(!dm2d.empty() + && "Input parameter dm2d has not been initialized while calling " "function transfer_DM2DtoGrid!"); #endif - ModuleBase::timer::tick("Gint", "transfer_DMR"); if (PARAM.inp.nspin != 4) { - for (int is = 0; is < this->DMRGint.size(); is++) { + for (int is = 0; is < this->dmr_gint.size(); is++) { #ifdef __MPI - hamilt::transferParallels2Serials(*DM2D[is], DMRGint[is]); + hamilt::transferParallels2Serials(*dm2d[is], dmr_gint[is]); #else - this->DMRGint[is]->set_zero(); - this->DMRGint[is]->add(*DM2D[is]); + this->dmr_gint[is]->set_zero(); + this->dmr_gint[is]->add(*dm2d[is]); #endif } } else // NSPIN=4 case { -#ifdef __MPI // is=0:↑↑, 1:↑↓, 2:↓↑, 3:↓↓ const int row_set[4] = {0, 0, 1, 1}; const int col_set[4] = {0, 1, 0, 1}; - int mg = DM2D[0]->get_paraV()->get_global_row_size()/2; - int ng = DM2D[0]->get_paraV()->get_global_col_size()/2; - int nb = DM2D[0]->get_paraV()->get_block_size()/2; - int blacs_ctxt = DM2D[0]->get_paraV()->blacs_ctxt; + int mg = dm2d[0]->get_paraV()->get_global_row_size()/2; + int ng = dm2d[0]->get_paraV()->get_global_col_size()/2; + int nb = dm2d[0]->get_paraV()->get_block_size()/2; + auto ijr_info = dm2d[0]->get_ijr_info(); +#ifdef __MPI + int blacs_ctxt = dm2d[0]->get_paraV()->blacs_ctxt; std::vector iat2iwt(ucell->nat); for (int iat = 0; iat < ucell->nat; iat++) { iat2iwt[iat] = ucell->get_iat2iwt()[iat]/2; @@ -267,12 +264,19 @@ void Gint::transfer_DM2DtoGrid(std::vector*> DM2D) { Parallel_Orbitals pv{}; pv.set(mg, ng, nb, blacs_ctxt); pv.set_atomic_trace(iat2iwt.data(), ucell->nat, mg); - auto ijr_info = DM2D[0]->get_ijr_info(); this-> dm2d_tmp = new hamilt::HContainer(&pv, nullptr, &ijr_info); +#else + if (this->dm2d_tmp != nullptr) { + delete this->dm2d_tmp; + } + this-> dm2d_tmp = new hamilt::HContainer(*this->hRGint); + this-> dm2d_tmp -> insert_ijrs(this->gridt->get_ijr_info(), *(this->ucell)); + this-> dm2d_tmp -> allocate(nullptr, true); +#endif ModuleBase::Memory::record("Gint::dm2d_tmp", this->dm2d_tmp->get_memory_size()); for (int is = 0; is < 4; is++){ - for (int iap = 0; iap < DM2D[0]->size_atom_pairs(); ++iap) { - auto& ap = DM2D[0]->get_atom_pair(iap); + for (int iap = 0; iap < dm2d[0]->size_atom_pairs(); ++iap) { + auto& ap = dm2d[0]->get_atom_pair(iap); int iat1 = ap.get_atom_i(); int iat2 = ap.get_atom_j(); for (int ir = 0; ir < ap.get_R_size(); ++ir) { @@ -288,13 +292,15 @@ void Gint::transfer_DM2DtoGrid(std::vector*> DM2D) { } } } - hamilt::transferParallels2Serials( *(this->dm2d_tmp), this->DMRGint[is]); - } - delete this->dm2d_tmp; - this->dm2d_tmp = nullptr; +#ifdef __MPI + hamilt::transferParallels2Serials( *(this->dm2d_tmp), this->dmr_gint[is]); #else - //this->DMRGint_full = DM2D[0]; + this->dmr_gint[is]->set_zero(); + this->dmr_gint[is]->add(*(this->dm2d_tmp)); #endif + }//is=4 + delete this->dm2d_tmp; + this->dm2d_tmp = nullptr; } ModuleBase::timer::tick("Gint", "transfer_DMR"); } \ No newline at end of file diff --git a/source/source_lcao/module_gint/gint_rho_cpu_interface.cpp b/source/source_lcao/module_gint/gint_rho_cpu_interface.cpp index 073a1821b0..2f41152fc3 100644 --- a/source/source_lcao/module_gint/gint_rho_cpu_interface.cpp +++ b/source/source_lcao/module_gint/gint_rho_cpu_interface.cpp @@ -76,7 +76,7 @@ void Gint::gint_kernel_rho(Gint_inout* inout) { cal_flag.get_ptr_2D(), psir_ylm_1.get_ptr_2D(), psir_DM.get_ptr_2D(), - this->DMRGint[is], + this->dmr_gint[is], inout->if_symm); // do sum_mu g_mu(r)psi_mu(r) to get electron density on grid @@ -156,7 +156,7 @@ void Gint::gint_kernel_tau(Gint_inout* inout) { cal_flag.get_ptr_2D(), dpsir_ylm_x.get_ptr_2D(), dpsix_DM.get_ptr_2D(), - this->DMRGint[is], + this->dmr_gint[is], true); Gint_Tools::mult_psi_DMR( *this->gridt, this->bxyz, @@ -166,7 +166,7 @@ void Gint::gint_kernel_tau(Gint_inout* inout) { cal_flag.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsiy_DM.get_ptr_2D(), - this->DMRGint[is], + this->dmr_gint[is], true); Gint_Tools::mult_psi_DMR( *this->gridt, this->bxyz, @@ -176,7 +176,7 @@ void Gint::gint_kernel_tau(Gint_inout* inout) { cal_flag.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D(), dpsiz_DM.get_ptr_2D(), - this->DMRGint[is], + this->dmr_gint[is], true); //do sum_i,mu g_i,mu(r) * d/dx_i psi_mu(r) to get kinetic energy density on grid diff --git a/source/source_lcao/module_gint/gint_vl_cpu_interface.cpp b/source/source_lcao/module_gint/gint_vl_cpu_interface.cpp index 4f65c1147a..f913fab83e 100644 --- a/source/source_lcao/module_gint/gint_vl_cpu_interface.cpp +++ b/source/source_lcao/module_gint/gint_vl_cpu_interface.cpp @@ -12,7 +12,7 @@ void Gint::gint_kernel_vlocal(Gint_inout* inout) { const int ncyz = this->ny * this->nplane; const double dv = ucell.omega / this->ncxyz; const double delta_r = this->gridt->dr_uniform; - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; + hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hr_gint_tmp[inout->ispin]; hRGint_kernel->set_zero(); #pragma omp parallel @@ -166,7 +166,7 @@ void Gint::gint_kernel_vlocal_meta(Gint_inout* inout) { const int ncyz = this->ny * this->nplane; const double dv = ucell.omega / this->ncxyz; const double delta_r = this->gridt->dr_uniform; - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; + hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hr_gint_tmp[inout->ispin]; hRGint_kernel->set_zero(); const int nnrg = hRGint_kernel->get_nnr(); diff --git a/source/source_lcao/module_gint/grid_technique.cpp b/source/source_lcao/module_gint/grid_technique.cpp index 9241c81d0a..de52f4d5f9 100644 --- a/source/source_lcao/module_gint/grid_technique.cpp +++ b/source/source_lcao/module_gint/grid_technique.cpp @@ -556,7 +556,7 @@ void Grid_Technique::init_ijr_and_nnrg(const UnitCell& ucell, const Grid_Driver& { ModuleBase::TITLE("Grid_Technique", "init_ijr_and_nnrg"); - hamilt::HContainer hRGint_tmp(ucell.nat); + hamilt::HContainer hr_gint_tmp(ucell.nat); // prepare the row_index and col_index for construct AtomPairs, they are // same, name as orb_index std::vector orb_index(ucell.nat + 1); @@ -614,15 +614,15 @@ void Grid_Technique::init_ijr_and_nnrg(const UnitCell& ucell, const Grid_Driver& orb_index.data(), orb_index.data(), ucell.nat); - hRGint_tmp.insert_pair(tmp_atom_pair); + hr_gint_tmp.insert_pair(tmp_atom_pair); } } } } } } - this->ijr_info = hRGint_tmp.get_ijr_info(); - this->nnrg = hRGint_tmp.get_nnr(); + this->ijr_info = hr_gint_tmp.get_ijr_info(); + this->nnrg = hr_gint_tmp.get_nnr(); return; } diff --git a/source/source_lcao/module_gint/temp_gint/gint_common.cpp b/source/source_lcao/module_gint/temp_gint/gint_common.cpp index 675b50c7cd..69957f0b38 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_common.cpp +++ b/source/source_lcao/module_gint/temp_gint/gint_common.cpp @@ -47,73 +47,6 @@ void compose_hr_gint(HContainer& hr_gint) ModuleBase::timer::tick("Gint", "compose_hr_gint"); } -void compose_hr_gint(const std::vector>& hr_gint_part, - HContainer>& hr_gint_full) -{ - ModuleBase::TITLE("Gint", "compose_hr_gint"); - ModuleBase::timer::tick("Gint", "compose_hr_gint"); - for (int iap = 0; iap < hr_gint_full.size_atom_pairs(); iap++) - { - auto* ap = &(hr_gint_full.get_atom_pair(iap)); - const int iat1 = ap->get_atom_i(); - const int iat2 = ap->get_atom_j(); - if (iat1 <= iat2) - { - hamilt::AtomPair>* upper_ap = ap; - hamilt::AtomPair>* lower_ap = hr_gint_full.find_pair(iat2, iat1); - const hamilt::AtomPair* ap_nspin_0 = hr_gint_part[0].find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_3 = hr_gint_part[3].find_pair(iat1, iat2); - for (int ir = 0; ir < upper_ap->get_R_size(); ir++) - { - const auto R_index = upper_ap->get_R_index(ir); - auto upper_mat = upper_ap->find_matrix(R_index); - auto mat_nspin_0 = ap_nspin_0->find_matrix(R_index); - auto mat_nspin_3 = ap_nspin_3->find_matrix(R_index); - - // The row size and the col size of upper_matrix is double that of matrix_nspin_0 - for (int irow = 0; irow < mat_nspin_0->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_0->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol) = mat_nspin_0->get_value(irow, icol) + mat_nspin_3->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol+1) = mat_nspin_0->get_value(irow, icol) - mat_nspin_3->get_value(irow, icol); - } - } - - if (PARAM.globalv.domag) - { - const hamilt::AtomPair* ap_nspin_1 = hr_gint_part[1].find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_2 = hr_gint_part[2].find_pair(iat1, iat2); - const auto mat_nspin_1 = ap_nspin_1->find_matrix(R_index); - const auto mat_nspin_2 = ap_nspin_2->find_matrix(R_index); - for (int irow = 0; irow < mat_nspin_1->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_1->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol+1) = mat_nspin_1->get_value(irow, icol) + std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol) = mat_nspin_1->get_value(irow, icol) - std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - } - } - } - - // fill the lower triangle matrix - if (iat1 < iat2) - { - auto lower_mat = lower_ap->find_matrix(-R_index); - for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) - { - for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) - { - lower_mat->get_value(icol, irow) = conj(upper_mat->get_value(irow, icol)); - } - } - } - } - } - } - ModuleBase::timer::tick("Gint", "compose_hr_gint"); -} - template void transfer_hr_gint_to_hR(const HContainer& hr_gint, HContainer& hR) { @@ -136,6 +69,130 @@ void transfer_hr_gint_to_hR(const HContainer& hr_gint, HContainer& hR) ModuleBase::timer::tick("Gint", "transfer_hr_gint_to_hR"); } + +void merge_hr_part_to_hR(const std::vector>& hr_gint_tmp , + hamilt::HContainer>* hR, + const GintInfo& gint_info){ + ModuleBase::TITLE("Gint_k", "transfer_pvpR"); + ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); + + const UnitCell* ucell_in = gint_info.get_ucell(); + int mg = hR->get_paraV()->get_global_row_size()/2; + int ng = hR->get_paraV()->get_global_col_size()/2; + int nb = hR->get_paraV()->get_block_size()/2; + hamilt::HContainer>* hR_tmp; + + +#ifdef __MPI + int blacs_ctxt = hR->get_paraV()->blacs_ctxt; + std::vector iat2iwt(ucell_in->nat); + for (int iat = 0; iat < ucell_in->nat; iat++) { + iat2iwt[iat] = ucell_in->get_iat2iwt()[iat]/2; + } + Parallel_Orbitals *pv = new Parallel_Orbitals(); + pv->set(mg, ng, nb, blacs_ctxt); + pv->set_atomic_trace(iat2iwt.data(), ucell_in->nat, mg); + auto ijr_info = hR->get_ijr_info(); + hR_tmp = new hamilt::HContainer>(pv, nullptr, &ijr_info); +#endif + + //select hr_gint_tmp + std::vector first = {0, 1, 1, 0}; + std::vector second= {3, 2, 2, 3}; + //select position in the big matrix + std::vector row_set = {0, 0, 1, 1}; + std::vector col_set = {0, 1, 0, 1}; + //construct complex matrix + std::vector clx_i = {1, 0, 0, -1}; + std::vector clx_j = {0, 1, -1, 0}; + for (int is = 0; is < 4; is++){ + if(!PARAM.globalv.domag && (is==1 || is==2)) continue; + hR_tmp->set_zero(); + hamilt::HContainer>* hRGint_tmpCd = new hamilt::HContainer>(ucell_in->nat); + hRGint_tmpCd->insert_ijrs( &(gint_info.get_ijr_info()), *(ucell_in)); + hRGint_tmpCd->allocate(nullptr, true); + hRGint_tmpCd->set_zero(); + for (int iap = 0; iap < hRGint_tmpCd->size_atom_pairs(); iap++) + { + auto* ap = &hRGint_tmpCd->get_atom_pair(iap); + const int iat1 = ap->get_atom_i(); + const int iat2 = ap->get_atom_j(); + if (iat1 <= iat2) + { + hamilt::AtomPair>* upper_ap = ap; + hamilt::AtomPair>* lower_ap = hRGint_tmpCd->find_pair(iat2, iat1); + const hamilt::AtomPair* ap_nspin1 = hr_gint_tmp [first[is]].find_pair(iat1, iat2); + const hamilt::AtomPair* ap_nspin2 = hr_gint_tmp [second[is]].find_pair(iat1, iat2); + for (int ir = 0; ir < upper_ap->get_R_size(); ir++) + { + const auto R_index = upper_ap->get_R_index(ir); + auto upper_mat = upper_ap->find_matrix(R_index); + auto mat_nspin1 = ap_nspin1->find_matrix(R_index); + auto mat_nspin2 = ap_nspin2->find_matrix(R_index); + // The row size and the col size of upper_matrix is double that of matrix_nspin_0 + for (int irow = 0; irow < mat_nspin1->get_row_size(); ++irow) + { + for (int icol = 0; icol < mat_nspin1->get_col_size(); ++icol) + { + upper_mat->get_value(irow, icol) = mat_nspin1->get_value(irow, icol) + + std::complex(clx_i[is], clx_j[is]) * mat_nspin2->get_value(irow, icol); + } + } + //fill the lower triangle matrix + //When is=0 or 3, the real part does not need conjugation; + //when is=1 or 2, the small matrix is not Hermitian, so conjugation is not needed + if (iat1 < iat2) + { + auto lower_mat = lower_ap->find_matrix(-R_index); + for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) + { + for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) + { + lower_mat->get_value(icol, irow) = upper_mat->get_value(irow, icol); + } + } + } + + } + } + } + // transfer hRGint_tmpCd to parallel hR_tmp +#ifdef __MPI + hamilt::transferSerials2Parallels( *hRGint_tmpCd, hR_tmp); +#else + hR_tmp = hRGint_tmpCd; +#endif + // merge hR_tmp to hR + for (int iap = 0; iap < hR->size_atom_pairs(); iap++) + { + auto* ap = &hR->get_atom_pair(iap); + const int iat1 = ap->get_atom_i(); + const int iat2 = ap->get_atom_j(); + auto* ap_nspin = hR_tmp ->find_pair(iat1, iat2); + for (int ir = 0; ir < ap->get_R_size(); ir++) + { + const auto R_index = ap->get_R_index(ir); + auto upper_mat = ap->find_matrix(R_index); + auto mat_nspin = ap_nspin->find_matrix(R_index); + // The row size and the col size of upper_matrix is double that of matrix_nspin_0 + for (int irow = 0; irow < mat_nspin->get_row_size(); ++irow) + { + for (int icol = 0; icol < mat_nspin->get_col_size(); ++icol) + { + upper_mat->get_value(2*irow+row_set[is], 2*icol+col_set[is]) = + mat_nspin->get_value(irow, icol); + } + } + } + } + delete hRGint_tmpCd; + } + ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); + return; +} + + + // gint_info should not have been a parameter, but it was added to initialize dm_gint_full // In the future, we might try to remove the gint_info parameter template @@ -162,15 +219,17 @@ void transfer_dm_2d_to_gint( } } else // NSPIN=4 case { -#ifdef __MPI + // is=0:↑↑, 1:↑↓, 2:↓↑, 3:↓↓ const int row_set[4] = {0, 0, 1, 1}; const int col_set[4] = {0, 1, 0, 1}; int mg = dm[0]->get_paraV()->get_global_row_size()/2; int ng = dm[0]->get_paraV()->get_global_col_size()/2; int nb = dm[0]->get_paraV()->get_block_size()/2; - int blacs_ctxt = dm[0]->get_paraV()->blacs_ctxt; const UnitCell* ucell = gint_info.get_ucell(); + auto ijr_info = dm[0]->get_ijr_info(); +#ifdef __MPI + int blacs_ctxt = dm[0]->get_paraV()->blacs_ctxt; std::vector iat2iwt(ucell->nat); for (int iat = 0; iat < ucell->nat; iat++) { iat2iwt[iat] = ucell->get_iat2iwt()[iat]/2; @@ -178,8 +237,12 @@ void transfer_dm_2d_to_gint( Parallel_Orbitals pv{}; pv.set(mg, ng, nb, blacs_ctxt); pv.set_atomic_trace(iat2iwt.data(), ucell->nat, mg); - auto ijr_info = dm[0]->get_ijr_info(); HContainer dm2d_tmp(&pv, nullptr, &ijr_info); +#else + auto* dm2d_tmp = new hamilt::HContainer(ucell->nat); + dm2d_tmp -> insert_ijrs(&ijr_info, *ucell); + dm2d_tmp -> allocate(nullptr, true); +#endif for (int is = 0; is < 4; is++){ for (int iap = 0; iap < dm[0]->size_atom_pairs(); ++iap) { auto& ap = dm[0]->get_atom_pair(iap); @@ -187,7 +250,11 @@ void transfer_dm_2d_to_gint( int iat2 = ap.get_atom_j(); for (int ir = 0; ir < ap.get_R_size(); ++ir) { const ModuleBase::Vector3 r_index = ap.get_R_index(ir); +#ifdef __MPI T* matrix_out = dm2d_tmp.find_matrix(iat1, iat2, r_index)->get_pointer(); +#else + T* matrix_out = dm2d_tmp->find_matrix(iat1, iat2, r_index)->get_pointer(); +#endif T* matrix_in = ap.get_pointer(ir); for (int irow = 0; irow < ap.get_row_size()/2; irow ++) { for (int icol = 0; icol < ap.get_col_size()/2; icol ++) { @@ -198,11 +265,13 @@ void transfer_dm_2d_to_gint( } } } +#ifdef __MPI hamilt::transferParallels2Serials(dm2d_tmp, &dm_gint[is]); - } #else - //HContainer& dm_full = *(dm[0]); + dm_gint[is].set_zero(); + dm_gint[is].add(*dm2d_tmp); #endif + }//is=4 } ModuleBase::timer::tick("Gint", "transfer_dm_2d_to_gint"); } diff --git a/source/source_lcao/module_gint/temp_gint/gint_common.h b/source/source_lcao/module_gint/temp_gint/gint_common.h index 17a324df2b..0e04a7cffc 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_common.h +++ b/source/source_lcao/module_gint/temp_gint/gint_common.h @@ -6,12 +6,14 @@ namespace ModuleGint { // fill the lower triangle matrix with the upper triangle matrix void compose_hr_gint(HContainer& hr_gint); - // for nspin=4 case - void compose_hr_gint(const std::vector>& hr_gint_part, - HContainer>& hr_gint_full); + template void transfer_hr_gint_to_hR(const HContainer& hr_gint, HContainer& hR); + // for nspin=4 case + void merge_hr_part_to_hR(const std::vector>& hr_gint_tmp , + hamilt::HContainer>* hR, + const GintInfo& gint_info); template void transfer_dm_2d_to_gint( diff --git a/source/source_lcao/module_gint/temp_gint/gint_info.h b/source/source_lcao/module_gint/temp_gint/gint_info.h index 356a62127e..0f311c1bcc 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_info.h +++ b/source/source_lcao/module_gint/temp_gint/gint_info.h @@ -39,6 +39,7 @@ class GintInfo int get_lgd() const { return lgd_; } int get_nat() const { return ucell_->nat; } // return the number of atoms in the unitcell const UnitCell* get_ucell() const { return ucell_; } + const std::vector& get_ijr_info() const {return ijr_info_;} int get_local_mgrid_num() const { return localcell_info_->get_mgrids_num(); } double get_mgrid_volume() const { return meshgrid_info_->get_volume(); } diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp index d5880600b0..5b4c45e5db 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp @@ -14,8 +14,7 @@ void Gint_vl_metagga_nspin4::cal_gint() ModuleBase::timer::tick("Gint", "cal_gint_vl"); init_hr_gint_(); cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); + merge_hr_part_to_hR(hr_gint_part_, hR_, *gint_info_); ModuleBase::timer::tick("Gint", "cal_gint_vl"); } @@ -26,8 +25,6 @@ void Gint_vl_metagga_nspin4::init_hr_gint_() { hr_gint_part_[i] = gint_info_->get_hr(); } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); } void Gint_vl_metagga_nspin4::cal_hr_gint_() diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h index 12722fef21..138cb1a277 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h @@ -37,7 +37,6 @@ class Gint_vl_metagga_nspin4 : public Gint const int nspin_ = 4; std::vector> hr_gint_part_; - HContainer> hr_gint_full_; }; } \ No newline at end of file diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp index 9adc4cb137..ec8b940710 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp @@ -13,8 +13,7 @@ void Gint_vl_metagga_nspin4_gpu::cal_gint() ModuleBase::timer::tick("Gint", "cal_gint_vl"); init_hr_gint_(); cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); + merge_hr_part_to_hR(hr_gint_part_, hR_, *gint_info_); ModuleBase::timer::tick("Gint", "cal_gint_vl"); } @@ -25,8 +24,6 @@ void Gint_vl_metagga_nspin4_gpu::init_hr_gint_() { hr_gint_part_[i] = gint_info_->get_hr(); } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); } void Gint_vl_metagga_nspin4_gpu::transfer_cpu_to_gpu_() diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h index fd967a63ec..c5f6f7c729 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h @@ -42,7 +42,6 @@ class Gint_vl_metagga_nspin4_gpu : public Gint const int nspin_ = 4; std::vector> hr_gint_part_; - HContainer> hr_gint_full_; std::vector> vr_eff_d_; std::vector> vofk_d_; diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp index 56aca5edeb..14350eb218 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp @@ -13,8 +13,7 @@ void Gint_vl_nspin4::cal_gint() ModuleBase::timer::tick("Gint", "cal_gint_vl"); init_hr_gint_(); cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); + merge_hr_part_to_hR(hr_gint_part_, hR_, *gint_info_); ModuleBase::timer::tick("Gint", "cal_gint_vl"); } @@ -25,8 +24,6 @@ void Gint_vl_nspin4::init_hr_gint_() { hr_gint_part_[i] = gint_info_->get_hr(); } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); } void Gint_vl_nspin4::cal_hr_gint_() diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.h b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.h index eed9827242..97aa47ca58 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.h +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4.h @@ -39,7 +39,6 @@ class Gint_vl_nspin4 : public Gint const int nspin_ = 4; std::vector> hr_gint_part_; - HContainer> hr_gint_full_; }; } // namespace ModuleGint \ No newline at end of file diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp index c070258db5..4f9b86c0b4 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp @@ -13,8 +13,7 @@ void Gint_vl_nspin4_gpu::cal_gint() ModuleBase::timer::tick("Gint", "cal_gint_vl"); init_hr_gint_(); cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); + merge_hr_part_to_hR(hr_gint_part_, hR_, *gint_info_); ModuleBase::timer::tick("Gint", "cal_gint_vl"); } @@ -25,8 +24,6 @@ void Gint_vl_nspin4_gpu::init_hr_gint_() { hr_gint_part_[i] = gint_info_->get_hr(); } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); } void Gint_vl_nspin4_gpu::transfer_cpu_to_gpu_() diff --git a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h index 81215b33ac..6d17a9a1bb 100644 --- a/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h +++ b/source/source_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h @@ -44,7 +44,6 @@ class Gint_vl_nspin4_gpu : public Gint const int nspin_ = 4; std::vector> hr_gint_part_; - HContainer> hr_gint_full_; std::vector> vr_eff_d_; std::vector> hr_gint_part_d_; diff --git a/source/source_lcao/module_lr/utils/gint_move.hpp b/source/source_lcao/module_lr/utils/gint_move.hpp index 6b4a8c82e6..b7c01118ef 100644 --- a/source/source_lcao/module_lr/utils/gint_move.hpp +++ b/source/source_lcao/module_lr/utils/gint_move.hpp @@ -47,19 +47,19 @@ Gint& Gint::operator=(Gint&& rhs) rhs.hRGint = nullptr; this->hRGintCd = rhs.hRGintCd; rhs.hRGintCd = nullptr; - for (int i = 0; i < this->DMRGint.size(); i++) + for (int i = 0; i < this->dmr_gint.size(); i++) { - delete this->DMRGint[i]; + delete this->dmr_gint[i]; } - for (int i = 0; i < this->hRGint_tmp.size(); i++) + for (int i = 0; i < this->hr_gint_tmp .size(); i++) { - delete this->hRGint_tmp[i]; + delete this->hr_gint_tmp [i]; } this->pvdpRx_reduced = std::move(rhs.pvdpRx_reduced); this->pvdpRy_reduced = std::move(rhs.pvdpRy_reduced); this->pvdpRz_reduced = std::move(rhs.pvdpRz_reduced); - this->DMRGint = std::move(rhs.DMRGint); - this->hRGint_tmp = std::move(rhs.hRGint_tmp); + this->dmr_gint = std::move(rhs.dmr_gint); + this->hr_gint_tmp = std::move(rhs.hr_gint_tmp ); this->dm2d_tmp = rhs.dm2d_tmp; rhs.dm2d_tmp = nullptr;