|
27 | 27 | #include "module_base/scalapack_connector.h" |
28 | 28 |
|
29 | 29 | template <> |
30 | | -void ModuleIO::write_dos_lcao(const psi::Psi<double>* psi, |
| 30 | +void ModuleIO::write_dos_lcao(const UnitCell& ucell, |
| 31 | + const psi::Psi<double>* psi, |
31 | 32 | const Parallel_Orbitals& pv, |
32 | 33 | const ModuleBase::matrix& ekb, |
33 | 34 | const ModuleBase::matrix& wg, |
@@ -254,24 +255,24 @@ void ModuleIO::write_dos_lcao(const psi::Psi<double>* psi, |
254 | 255 | out << std::setw(20) << en << std::endl; |
255 | 256 | } |
256 | 257 | out << "</energy_values>" << std::endl; |
257 | | - for (int i = 0; i < GlobalC::ucell.nat; i++) |
| 258 | + for (int i = 0; i < ucell.nat; i++) |
258 | 259 | { |
259 | | - int a = GlobalC::ucell.iat2ia[i]; |
260 | | - int t = GlobalC::ucell.iat2it[i]; |
261 | | - Atom* atom1 = &GlobalC::ucell.atoms[t]; |
262 | | - const int s0 = GlobalC::ucell.itiaiw2iwt(t, a, 0); |
| 260 | + int a = ucell.iat2ia[i]; |
| 261 | + int t = ucell.iat2it[i]; |
| 262 | + Atom* atom1 = &ucell.atoms[t]; |
| 263 | + const int s0 = ucell.itiaiw2iwt(t, a, 0); |
263 | 264 | for (int j = 0; j < atom1->nw; ++j) |
264 | 265 | { |
265 | 266 | const int L1 = atom1->iw2l[j]; |
266 | 267 | const int N1 = atom1->iw2n[j]; |
267 | 268 | const int m1 = atom1->iw2m[j]; |
268 | | - const int w = GlobalC::ucell.itiaiw2iwt(t, a, j); |
| 269 | + const int w = ucell.itiaiw2iwt(t, a, j); |
269 | 270 |
|
270 | 271 | // out << "</energy_values>" <<std::endl; |
271 | 272 | out << "<orbital" << std::endl; |
272 | 273 | out << std::setw(6) << "index=\"" << std::setw(40) << w + 1 << "\"" << std::endl; |
273 | 274 | out << std::setw(5) << "atom_index=\"" << std::setw(40) << i + 1 << "\"" << std::endl; |
274 | | - out << std::setw(8) << "species=\"" << GlobalC::ucell.atoms[t].label << "\"" << std::endl; |
| 275 | + out << std::setw(8) << "species=\"" << ucell.atoms[t].label << "\"" << std::endl; |
275 | 276 | out << std::setw(2) << "l=\"" << std::setw(40) << L1 << "\"" << std::endl; |
276 | 277 | out << std::setw(2) << "m=\"" << std::setw(40) << m1 << "\"" << std::endl; |
277 | 278 | out << std::setw(2) << "z=\"" << std::setw(40) << N1 + 1 << "\"" << std::endl; |
@@ -309,7 +310,7 @@ void ModuleIO::write_dos_lcao(const psi::Psi<double>* psi, |
309 | 310 | out << "</pdos>" << std::endl; |
310 | 311 | out.close(); |
311 | 312 | } |
312 | | - ModuleIO::write_orb_info(&(GlobalC::ucell)); |
| 313 | + ModuleIO::write_orb_info(&(ucell)); |
313 | 314 | } |
314 | 315 | delete[] pdos; |
315 | 316 |
|
@@ -341,7 +342,8 @@ void ModuleIO::write_dos_lcao(const psi::Psi<double>* psi, |
341 | 342 | } |
342 | 343 |
|
343 | 344 | template <> |
344 | | -void ModuleIO::write_dos_lcao(const psi::Psi<std::complex<double>>* psi, |
| 345 | +void ModuleIO::write_dos_lcao(const UnitCell& ucell, |
| 346 | + const psi::Psi<std::complex<double>>* psi, |
345 | 347 | const Parallel_Orbitals& pv, |
346 | 348 | const ModuleBase::matrix& ekb, |
347 | 349 | const ModuleBase::matrix& wg, |
@@ -604,24 +606,24 @@ void ModuleIO::write_dos_lcao(const psi::Psi<std::complex<double>>* psi, |
604 | 606 | out << std::setw(20) << en << std::endl; |
605 | 607 | } |
606 | 608 | out << "</energy_values>" << std::endl; |
607 | | - for (int i = 0; i < GlobalC::ucell.nat; i++) |
| 609 | + for (int i = 0; i < ucell.nat; i++) |
608 | 610 | { |
609 | | - int a = GlobalC::ucell.iat2ia[i]; |
610 | | - int t = GlobalC::ucell.iat2it[i]; |
611 | | - Atom* atom1 = &GlobalC::ucell.atoms[t]; |
612 | | - const int s0 = GlobalC::ucell.itiaiw2iwt(t, a, 0); |
| 611 | + int a = ucell.iat2ia[i]; |
| 612 | + int t = ucell.iat2it[i]; |
| 613 | + Atom* atom1 = &ucell.atoms[t]; |
| 614 | + const int s0 = ucell.itiaiw2iwt(t, a, 0); |
613 | 615 | for (int j = 0; j < atom1->nw; ++j) |
614 | 616 | { |
615 | 617 | const int L1 = atom1->iw2l[j]; |
616 | 618 | const int N1 = atom1->iw2n[j]; |
617 | 619 | const int m1 = atom1->iw2m[j]; |
618 | | - const int w = GlobalC::ucell.itiaiw2iwt(t, a, j); |
| 620 | + const int w = ucell.itiaiw2iwt(t, a, j); |
619 | 621 |
|
620 | 622 | // out << "</energy_values>" <<std::endl; |
621 | 623 | out << "<orbital" << std::endl; |
622 | 624 | out << std::setw(6) << "index=\"" << std::setw(40) << w + 1 << "\"" << std::endl; |
623 | 625 | out << std::setw(5) << "atom_index=\"" << std::setw(40) << i + 1 << "\"" << std::endl; |
624 | | - out << std::setw(8) << "species=\"" << GlobalC::ucell.atoms[t].label << "\"" << std::endl; |
| 626 | + out << std::setw(8) << "species=\"" << ucell.atoms[t].label << "\"" << std::endl; |
625 | 627 | out << std::setw(2) << "l=\"" << std::setw(40) << L1 << "\"" << std::endl; |
626 | 628 | out << std::setw(2) << "m=\"" << std::setw(40) << m1 << "\"" << std::endl; |
627 | 629 | out << std::setw(2) << "z=\"" << std::setw(40) << N1 + 1 << "\"" << std::endl; |
@@ -658,7 +660,7 @@ void ModuleIO::write_dos_lcao(const psi::Psi<std::complex<double>>* psi, |
658 | 660 | out << "</pdos>" << std::endl; |
659 | 661 | out.close(); |
660 | 662 | } |
661 | | - ModuleIO::write_orb_info(&(GlobalC::ucell)); |
| 663 | + ModuleIO::write_orb_info(&(ucell)); |
662 | 664 | } |
663 | 665 | delete[] pdos; |
664 | 666 | } |
|
0 commit comments