From 6f763889ba8caf481d83909cc1ee363bf0db2521 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Sat, 26 Feb 2022 20:29:54 +0800 Subject: [PATCH 1/2] fix the vasp 6.3 outcar with ML forces --- dpdata/vasp/outcar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dpdata/vasp/outcar.py b/dpdata/vasp/outcar.py index 0e9e74d33..74cdaf71f 100644 --- a/dpdata/vasp/outcar.py +++ b/dpdata/vasp/outcar.py @@ -127,7 +127,9 @@ def analyze_block(lines, ntot, nelm) : virial[2][1] = tmp_v[4] virial[0][2] = tmp_v[5] virial[2][0] = tmp_v[5] - elif 'TOTAL-FORCE' in ii: + elif 'TOTAL-FORCE' in ii and (not "ML" in ii): + # use the lines with " POSITION TOTAL-FORCE (eV/Angst)" + # exclude the lines with " POSITION TOTAL-FORCE (eV/Angst) (ML)" for jj in range(idx+2, idx+2+ntot) : tmp_l = lines[jj] info = [float(ss) for ss in tmp_l.split()] From fa5d3cc603c0ceef97557ac30e749a11bbe73f14 Mon Sep 17 00:00:00 2001 From: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> Date: Sun, 27 Feb 2022 09:05:32 +0800 Subject: [PATCH 2/2] Update dpdata/vasp/outcar.py Co-authored-by: Jinzhe Zeng --- 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 74cdaf71f..21256735e 100644 --- a/dpdata/vasp/outcar.py +++ b/dpdata/vasp/outcar.py @@ -127,7 +127,7 @@ def analyze_block(lines, ntot, nelm) : virial[2][1] = tmp_v[4] virial[0][2] = tmp_v[5] virial[2][0] = tmp_v[5] - elif 'TOTAL-FORCE' in ii and (not "ML" in ii): + elif 'TOTAL-FORCE' in ii and ("ML" not in ii): # use the lines with " POSITION TOTAL-FORCE (eV/Angst)" # exclude the lines with " POSITION TOTAL-FORCE (eV/Angst) (ML)" for jj in range(idx+2, idx+2+ntot) :