From 823fa60680d676d06e3fe9802b762ec467dc9c78 Mon Sep 17 00:00:00 2001 From: AnguseZhang <529133328@qq.com> Date: Sat, 8 May 2021 00:21:28 +0800 Subject: [PATCH 1/2] Fix TITEL bugs when reading VASP6's OUTCAR --- dpdata/vasp/outcar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dpdata/vasp/outcar.py b/dpdata/vasp/outcar.py index 0475354e6..b382a99e0 100644 --- a/dpdata/vasp/outcar.py +++ b/dpdata/vasp/outcar.py @@ -5,7 +5,7 @@ def system_info (lines, type_idx_zero = False) : atom_numbs = None nelm = None for ii in lines: - if 'TITEL =' in ii : + if 'TITEL' in ii : # get atom names from POTCAR info, tested only for PAW_PBE ... _ii=ii.split()[3] if '_' in _ii: @@ -13,9 +13,9 @@ def system_info (lines, type_idx_zero = False) : atom_names.append(_ii.split('_')[0]) else: atom_names.append(_ii) - elif 'NELM' in ii : + elif 'NELM' in ii and nelm == None: + # will read only first nelm nelm = int(ii.split()[2][:-1]) - break; elif 'ions per type' in ii : atom_numbs_ = [int(s) for s in ii.split()[4:]] if atom_numbs is None : From 3a91d7a7aa5f8c83f688ce2b1676912aa7eb0b8d Mon Sep 17 00:00:00 2001 From: AnguseZhang <529133328@qq.com> Date: Sat, 8 May 2021 01:35:30 +0800 Subject: [PATCH 2/2] Fix nelm reading. --- dpdata/vasp/outcar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdata/vasp/outcar.py b/dpdata/vasp/outcar.py index b382a99e0..a99332603 100644 --- a/dpdata/vasp/outcar.py +++ b/dpdata/vasp/outcar.py @@ -15,7 +15,7 @@ def system_info (lines, type_idx_zero = False) : atom_names.append(_ii) elif 'NELM' in ii and nelm == None: # will read only first nelm - nelm = int(ii.split()[2][:-1]) + nelm = int(ii.split()[2].rstrip(";")) elif 'ions per type' in ii : atom_numbs_ = [int(s) for s in ii.split()[4:]] if atom_numbs is None :