Skip to content

Commit a499a42

Browse files
authored
Merge pull request #151 from AnguseZhang/fixvasp6
Fix TITEL bugs when reading VASP6's OUTCAR
2 parents 0ef2e4b + 3a91d7a commit a499a42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpdata/vasp/outcar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ def system_info (lines, type_idx_zero = False) :
55
atom_numbs = None
66
nelm = None
77
for ii in lines:
8-
if 'TITEL =' in ii :
8+
if 'TITEL' in ii :
99
# get atom names from POTCAR info, tested only for PAW_PBE ...
1010
_ii=ii.split()[3]
1111
if '_' in _ii:
1212
# for case like : TITEL = PAW_PBE Sn_d 06Sep2000
1313
atom_names.append(_ii.split('_')[0])
1414
else:
1515
atom_names.append(_ii)
16-
elif 'NELM' in ii :
17-
nelm = int(ii.split()[2][:-1])
18-
break;
16+
elif 'NELM' in ii and nelm == None:
17+
# will read only first nelm
18+
nelm = int(ii.split()[2].rstrip(";"))
1919
elif 'ions per type' in ii :
2020
atom_numbs_ = [int(s) for s in ii.split()[4:]]
2121
if atom_numbs is None :

0 commit comments

Comments
 (0)