Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dpdata/cp2k/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,22 @@ def get_frames (fname) :
eV = 2.72113838565563E+01 # hatree to eV
angstrom = 5.29177208590000E-01 # Bohr to Angstrom
GPa = 160.21766208 # 1 eV/(Angstrom^3) = 160.21 GPa
fp = open(fname)
atom_symbol_list = []
cell = []
coord = []
force = []
stress = []
cell_count = 0
coord_count = 0

fp = open(fname)
Comment thread
robinzyb marked this conversation as resolved.
# check if output is converged, if not, return sys = 0
content = fp.read()
count = content.count('SCF run converged')
if count == 0:
return [], [], [], [], [], [], [], []

fp.seek(0)
for idx, ii in enumerate(fp) :
if ('CELL| Vector' in ii) and (cell_count < 3) :
cell.append(ii.split()[4:7])
Expand Down
Loading