From 8198370a5fb4bebb9ded161ee2e4a99dac8e604b Mon Sep 17 00:00:00 2001 From: maki49 <1579492865@qq.com> Date: Tue, 4 May 2021 00:17:59 +0800 Subject: [PATCH 1/2] read atom type from .orb file --- ABACUS.develop/source/src_lcao/ORB_read.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ABACUS.develop/source/src_lcao/ORB_read.cpp b/ABACUS.develop/source/src_lcao/ORB_read.cpp index 653eb01540..41f3f3ba80 100644 --- a/ABACUS.develop/source/src_lcao/ORB_read.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_read.cpp @@ -822,11 +822,19 @@ void LCAO_Orbitals::read_orb_file( { TITLE("LCAO_Orbitals","read_orb_file"); char word[80]; + string orb_label; if (MY_RANK == 0) { while (ifs.good()) { ifs >> word; + if (std::strcmp(word, "Element") == 0) + { + ifs >> orb_label; + int pos = this->orbital_file[it].find_last_of('/'); + assert(orb_label == this->orbital_file[it].substr(pos + 1, orb_label.length())); + continue; + } if (std::strcmp(word, "Lmax") == 0) { ifs >> lmax; @@ -1021,7 +1029,7 @@ void LCAO_Orbitals::read_orb_file( ofs_running << setw(12) << unit << endl; ao[it].phiLN[count].set_orbital_info( - ucell.atoms[it].label, + orb_label, it, //type L, //angular momentum L N, // number of orbitals of this L @@ -1046,7 +1054,7 @@ void LCAO_Orbitals::read_orb_file( } ao[it].set_orbital_info( it, // type - ucell.atoms[it].label, // label + orb_label, // label lmax, nchi, total_nchi); //copy twice ! From a2a4e9ca5d9176a793189526ee3b8dbdd8a76e4b Mon Sep 17 00:00:00 2001 From: maki49 <1579492865@qq.com> Date: Tue, 4 May 2021 18:05:17 +0800 Subject: [PATCH 2/2] read label without check --- ABACUS.develop/source/src_lcao/ORB_read.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ABACUS.develop/source/src_lcao/ORB_read.cpp b/ABACUS.develop/source/src_lcao/ORB_read.cpp index 41f3f3ba80..96cb364b63 100644 --- a/ABACUS.develop/source/src_lcao/ORB_read.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_read.cpp @@ -831,8 +831,6 @@ void LCAO_Orbitals::read_orb_file( if (std::strcmp(word, "Element") == 0) { ifs >> orb_label; - int pos = this->orbital_file[it].find_last_of('/'); - assert(orb_label == this->orbital_file[it].substr(pos + 1, orb_label.length())); continue; } if (std::strcmp(word, "Lmax") == 0)