From f17161ee67ee750cbb6e18e5af9611ffccd75346 Mon Sep 17 00:00:00 2001 From: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:15:11 +0800 Subject: [PATCH 1/2] Include total energy check in get_energy function Signed-off-by: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> --- dpdata/abacus/md.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdata/abacus/md.py b/dpdata/abacus/md.py index ffdd361a4..8df156c94 100644 --- a/dpdata/abacus/md.py +++ b/dpdata/abacus/md.py @@ -135,7 +135,7 @@ def get_energy(outlines, ndump, dump_freq): energy = [] nenergy = 0 for line_idx, line in enumerate(outlines): - if "final etot is" in line: + if "final etot is" in line or "#TOTAL ENERGY#" in line: if nenergy % dump_freq == 0: energy.append(float(line.split()[-2])) nenergy += 1 From 6c19c19e37c76afd044c3deaaf3ab12efcccb61c Mon Sep 17 00:00:00 2001 From: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> Date: Fri, 13 Mar 2026 08:45:42 +0800 Subject: [PATCH 2/2] Update relax.py Signed-off-by: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> --- dpdata/abacus/relax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdata/abacus/relax.py b/dpdata/abacus/relax.py index 31048a78d..66604c89e 100644 --- a/dpdata/abacus/relax.py +++ b/dpdata/abacus/relax.py @@ -94,7 +94,7 @@ def get_coords_from_log(loglines, natoms): list(map(lambda x: float(x) * a0, loglines[i + k].split()[0:3])) ) - elif line[1:14] == "final etot is": + elif line[1:14] == "final etot is" or "#TOTAL ENERGY#" in line: # add the energy for previous structures whose SCF is not converged while len(energy) < len(coords) - 1: energy.append(np.nan)