Skip to content

Commit d38a8df

Browse files
kirk0830QianruipkuhongriTianqi
authored
Fix issue #2721 (#2739)
* Fix issue #2721: a correction on atom sequence check Fix issue #2721 * Update read_atoms.cpp * Update klist.cpp * Revert "Update klist.cpp" This reverts commit 0699982. --------- Co-authored-by: Qianrui <[email protected]> Co-authored-by: Zhao Tianqi <[email protected]>
1 parent 594bccb commit d38a8df

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

source/module_cell/read_atoms.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,16 +415,9 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
415415
// start magnetization
416416
//=======================================
417417
ModuleBase::GlobalFunc::READ_VALUE(ifpos, atoms[it].label);
418-
bool found = false;
419-
for(int it2=0; it2<ntype; it2++)
420-
{
421-
if( this->atoms[it].label == this->atom_label[it] )
422-
{
423-
found = true;
424-
}
425-
}
426-
if(!found)
418+
if(this->atoms[it].label != this->atom_label[it])
427419
{
420+
ofs_warning << " Label orders in ATOMIC_POSITIONS and ATOMIC_SPECIES sections do not match!" << std::endl;
428421
ofs_warning << " Label read from ATOMIC_POSITIONS is " << this->atoms[it].label << std::endl;
429422
ofs_warning << " Label from ATOMIC_SPECIES is " << this->atom_label[it] << std::endl;
430423
return 0;

0 commit comments

Comments
 (0)