Skip to content

Commit

Permalink
fix deepmodeling#359: read atom names from POTCAR if not present in O…
Browse files Browse the repository at this point in the history
…UTCAR
  • Loading branch information
Holger Badorreck committed Mar 30, 2023
1 parent c02097b commit c396348
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dpdata/vasp/outcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ def system_info(lines, type_idx_zero=False):
atom_names.append(_ii.split("_")[0])
else:
atom_names.append(_ii)
elif 'POTCAR' in ii:
# get atom names from POTCAR info, tested only for PAW_PBE ...
_ii=ii.split()[2]
if '_' in _ii:
# for case like : POTCAR: PAW_PBE Ti_sv 26Sep2005
atom_names.append(_ii.split('_')[0])
else:
atom_names.append(_ii)
# a stricker check for "NELM"; compatible with distingct formats in different versions(6 and older, newers_expect-to-work) of vasp
elif nelm is None:
m = re.search(r"NELM\s*=\s*(\d+)", ii)
Expand Down

0 comments on commit c396348

Please sign in to comment.