You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a bug in the "read_aims_output" function inside aimsio.py file.
When the mixer is restarted the energy and forces, which are not the final ones, are printed
This case is not consider in the function.
Please find below a possible solution. (The new lines are marked with "#" )
Yair
def read_aims_output(filename):
"""
Read the aims output file
Will return the total energy corrected, and the forces
Only suitable for single calculations (i.e. no relaxations etc)
May read more stuff with little modification, if desired
"""
import numpy as np
output = open(filename, 'r')
n_atoms = 0
ener = 0
forces = []
iflag = False #
while True:
line = output.readline()
if not line:
break
if "| Number of atoms :" in line:
inp = line.split()
n_atoms = int(inp[5])
if "Self-consistency cycle converged." in line: #
iflag = True #
if "| Total energy corrected :" in line:
if iflag: #
ener = float(line.split()[5])
if "Total atomic forces (unitary forces cleaned)" in line:
if iflag: #
for i in range(n_atoms):
inp = output.readline().split()
forces.append([float(inp[2]), float(inp[3]), float(inp[4])])
output.close()
return ener, np.array(forces)
The text was updated successfully, but these errors were encountered:
I found a bug in the "read_aims_output" function inside aimsio.py file.
When the mixer is restarted the energy and forces, which are not the final ones, are printed
This case is not consider in the function.
Please find below a possible solution. (The new lines are marked with "#" )
Yair
def read_aims_output(filename):
"""
Read the aims output file
Will return the total energy corrected, and the forces
Only suitable for single calculations (i.e. no relaxations etc)
May read more stuff with little modification, if desired
"""
import numpy as np
output = open(filename, 'r')
n_atoms = 0
ener = 0
forces = []
iflag = False #
while True:
line = output.readline()
if not line:
break
if "| Number of atoms :" in line:
inp = line.split()
n_atoms = int(inp[5])
if "Self-consistency cycle converged." in line: #
iflag = True #
if "| Total energy corrected :" in line:
if iflag: #
ener = float(line.split()[5])
if "Total atomic forces (unitary forces cleaned)" in line:
if iflag: #
for i in range(n_atoms):
inp = output.readline().split()
forces.append([float(inp[2]), float(inp[3]), float(inp[4])])
output.close()
return ener, np.array(forces)
The text was updated successfully, but these errors were encountered: