From 78c79c887ded40cf493a9748287f7435ccefb390 Mon Sep 17 00:00:00 2001 From: donerancl Date: Wed, 31 Jan 2024 17:00:44 -0500 Subject: [PATCH] update --- arkane/ess/gaussian.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/arkane/ess/gaussian.py b/arkane/ess/gaussian.py index 2e84d6f231..a3005061f2 100644 --- a/arkane/ess/gaussian.py +++ b/arkane/ess/gaussian.py @@ -35,7 +35,7 @@ import logging import math import os.path - +import re import numpy as np import rmgpy.constants as constants @@ -309,9 +309,8 @@ def load_energy(self, zpe_scale_factor=1.): with open(self.path, 'r') as f: line = f.readline() while line != '': - if 'SCF Done:' in line: - e_elect = float(line.split()[4]) * constants.E_h * constants.Na + e_elect = float(re.findall(r"SCF Done: E\(.+\) \=\s+[^\s]+",line)[0].split()[-1])* constants.E_h * constants.Na elect_energy_source = 'SCF' elif ' E2(' in line and ' E(' in line: e_elect = float(line.split()[-1].replace('D', 'E')) * constants.E_h * constants.Na @@ -351,6 +350,7 @@ def load_energy(self, zpe_scale_factor=1.): # G4MP2 calculation without opt and freq calculation # Keyword in Gaussian G4MP2(SP), No zero-point or thermal energies are included. e_elect = float(line.split()[2]) * constants.E_h * constants.Na + # Read the ZPE from the "E(ZPE)=" line, as this is the scaled version. # Gaussian defines the following as @@ -376,6 +376,21 @@ def load_energy(self, zpe_scale_factor=1.): elect_energy_source = 'HF' except ValueError: pass +<<<<<<< HEAD +======= +<<<<<<< HEAD + elif 'Energy=' in line: + # for xtb + e_elect = float(line.split()[1]) * constants.E_h * constants.Na +======= +<<<<<<< HEAD +======= + elif 'Energy=' in line: + # for xtb + e_elect = float(line.split()[1]) * constants.E_h * constants.Na +>>>>>>> 9de7bbb55 (squashed) +>>>>>>> e28081cdf (try to squash) +>>>>>>> 40ec25438 (squash) # Read the next line in the file line = f.readline()