@@ -222,18 +222,22 @@ void transfer_dm_2d_to_gint(
222222 int mg = dm[0 ]->get_paraV ()->get_global_row_size ()/2 ;
223223 int ng = dm[0 ]->get_paraV ()->get_global_col_size ()/2 ;
224224 int nb = dm[0 ]->get_paraV ()->get_block_size ()/2 ;
225+ const UnitCell* ucell = gint_info.get_ucell ();
226+ auto ijr_info = dm[0 ]->get_ijr_info ();
225227#ifdef __MPI
226228 int blacs_ctxt = dm[0 ]->get_paraV ()->blacs_ctxt ;
227- const UnitCell* ucell = gint_info.get_ucell ();
228229 std::vector<int > iat2iwt (ucell->nat );
229230 for (int iat = 0 ; iat < ucell->nat ; iat++) {
230231 iat2iwt[iat] = ucell->get_iat2iwt ()[iat]/2 ;
231232 }
232233 Parallel_Orbitals *pv = new Parallel_Orbitals ();
233234 pv->set (mg, ng, nb, blacs_ctxt);
234235 pv->set_atomic_trace (iat2iwt.data (), ucell->nat , mg);
235- auto ijr_info = dm[0 ]->get_ijr_info ();
236236 HContainer<T>* dm2d_tmp = new hamilt::HContainer<T>(pv, nullptr , &ijr_info);
237+ #else
238+ dm2d_tmp = new hamilt::HContainer<double >(ucell->nat );
239+ dm2d_tmp -> insert_ijrs (gint_info.get_ijr_info (), *ucell);
240+ dm2d_tmp -> allocate (nullptr , true );
237241#endif
238242 for (int is = 0 ; is < 4 ; is++){
239243 for (int iap = 0 ; iap < dm[0 ]->size_atom_pairs (); ++iap) {
0 commit comments